@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-50737.1 → 0.0.0-bugfix-dev-KB-53946.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 (186) hide show
  1. package/dist/cjs/{ConfigStorage-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-1438f8f2.js → IExporterProvider-f50b6846.js} +52 -5
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-33995e92.js → SnkFormConfigManager-8986431f.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
  6. package/dist/cjs/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
  7. package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{pesquisa-fetcher-94f6b316.js → pesquisa-fetcher-90b801fb.js} +79 -55
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button_4.cjs.entry.js +9 -9
  12. package/dist/cjs/snk-application.cjs.entry.js +24 -24
  13. package/dist/cjs/snk-attach.cjs.entry.js +73 -52
  14. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-data-exporter.cjs.entry.js +199 -81
  16. package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-abd2113f.js} +3 -38
  17. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -2
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +7 -3
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
  21. package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
  22. package/dist/cjs/snk-form.cjs.entry.js +3 -4
  23. package/dist/cjs/snk-grid.cjs.entry.js +66 -102
  24. package/dist/cjs/{snk-guides-viewer-25721856.js → snk-guides-viewer-e4c8ee66.js} +4 -5
  25. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
  27. package/dist/cjs/snk-simple-crud.cjs.entry.js +144 -36
  28. package/dist/cjs/snk-taskbar.cjs.entry.js +27 -4
  29. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
  30. package/dist/collection/components/snk-attach/snk-attach.js +39 -24
  31. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
  32. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
  33. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
  34. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
  35. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
  36. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  37. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
  38. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  39. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +37 -47
  40. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  41. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  42. package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
  43. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +5 -0
  44. package/dist/collection/components/snk-grid/snk-grid.js +3 -94
  45. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -2
  46. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +126 -14
  47. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  48. package/dist/collection/components/snk-taskbar/snk-taskbar.js +30 -3
  49. package/dist/collection/lib/dataUnit/InMemoryLoader.js +10 -41
  50. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
  51. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  52. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  53. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +10 -2
  54. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  55. package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
  56. package/dist/components/ConfigStorage.js +1 -2
  57. package/dist/components/{field-search.js → IExporterProvider.js} +52 -7
  58. package/dist/components/ISave.js +42 -0
  59. package/dist/components/SnkMessageBuilder.js +4 -0
  60. package/dist/components/dataunit-fetcher.js +61 -44
  61. package/dist/components/form-config-fetcher.js +7022 -3
  62. package/dist/components/index2.js +198 -33
  63. package/dist/components/snk-actions-button2.js +3 -12
  64. package/dist/components/snk-application2.js +1 -1
  65. package/dist/components/snk-attach2.js +64 -44
  66. package/dist/components/snk-crud.js +3 -4
  67. package/dist/components/snk-data-exporter2.js +194 -81
  68. package/dist/components/snk-data-unit2.js +41 -39
  69. package/dist/components/snk-detail-view2.js +4 -5
  70. package/dist/components/snk-expression-item2.js +1 -1
  71. package/dist/components/snk-filter-bar2.js +5 -0
  72. package/dist/components/snk-form-config2.js +1 -1
  73. package/dist/components/snk-grid2.js +63 -100
  74. package/dist/components/snk-personalized-filter2.js +1 -1
  75. package/dist/components/snk-simple-crud2.js +133 -23
  76. package/dist/components/snk-taskbar2.js +33 -8
  77. package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
  78. package/dist/esm/{SnkMultiSelectionListDataSource-aad5d4ff.js → IExporterProvider-9e6e0071.js} +52 -6
  79. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  80. package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
  81. package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
  82. package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
  83. package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
  84. package/dist/esm/loader.js +1 -1
  85. package/dist/esm/{pesquisa-fetcher-f05a12ca.js → pesquisa-fetcher-d785663b.js} +61 -44
  86. package/dist/esm/sankhyablocks.js +1 -1
  87. package/dist/esm/snk-actions-button_4.entry.js +4 -4
  88. package/dist/esm/snk-application.entry.js +6 -6
  89. package/dist/esm/snk-attach.entry.js +65 -44
  90. package/dist/esm/snk-crud.entry.js +5 -5
  91. package/dist/esm/snk-data-exporter.entry.js +199 -81
  92. package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-29eba11a.js} +4 -39
  93. package/dist/esm/snk-data-unit.entry.js +3 -2
  94. package/dist/esm/snk-detail-view.entry.js +8 -8
  95. package/dist/esm/snk-filter-bar.entry.js +7 -3
  96. package/dist/esm/snk-filter-modal-item.entry.js +2 -3
  97. package/dist/esm/snk-form-config.entry.js +1 -2
  98. package/dist/esm/snk-form.entry.js +3 -4
  99. package/dist/esm/snk-grid.entry.js +64 -100
  100. package/dist/esm/{snk-guides-viewer-b94752f2.js → snk-guides-viewer-8fc16590.js} +4 -5
  101. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  102. package/dist/esm/snk-personalized-filter.entry.js +2 -3
  103. package/dist/esm/snk-simple-crud.entry.js +132 -24
  104. package/dist/esm/snk-taskbar.entry.js +27 -4
  105. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
  106. package/dist/sankhyablocks/p-07825198.js +1 -0
  107. package/dist/sankhyablocks/p-0ba97458.js +65 -0
  108. package/dist/sankhyablocks/p-1650f66b.entry.js +1 -0
  109. package/dist/sankhyablocks/p-1d1aa052.js +1 -0
  110. package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
  111. package/dist/sankhyablocks/p-250149af.entry.js +1 -0
  112. package/dist/sankhyablocks/p-2cfa05b0.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-400097f2.entry.js → p-2daa70f9.entry.js} +3 -3
  114. package/dist/sankhyablocks/p-32556aa6.js +1 -0
  115. package/dist/sankhyablocks/p-33a6728e.js +26 -0
  116. package/dist/sankhyablocks/p-5b6c4f46.entry.js +1 -0
  117. package/dist/sankhyablocks/p-5d9456dc.js +1 -0
  118. package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
  119. package/dist/sankhyablocks/p-9863d682.js +1 -0
  120. package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
  121. package/dist/sankhyablocks/p-9c283890.entry.js +1 -0
  122. package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
  123. package/dist/sankhyablocks/p-a4c94582.entry.js +1 -0
  124. package/dist/sankhyablocks/p-c2e3a71c.entry.js +1 -0
  125. package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
  126. package/dist/sankhyablocks/p-ce37e3d3.entry.js +1 -0
  127. package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
  129. package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
  130. package/dist/sankhyablocks/p-f51af6dd.entry.js +1 -0
  131. package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
  132. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  133. package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
  134. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
  135. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
  136. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
  137. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
  138. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -4
  139. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  140. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  141. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  142. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
  143. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  144. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  145. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  146. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -3
  147. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +17 -2
  148. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  149. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -0
  150. package/dist/types/components.d.ts +17 -0
  151. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
  152. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
  153. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  154. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  155. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  156. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
  157. package/package.json +1 -1
  158. package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
  159. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  160. package/dist/components/DataFetcher.js +0 -7023
  161. package/dist/components/index3.js +0 -199
  162. package/dist/esm/form-config-fetcher-765b8498.js +0 -253
  163. package/dist/sankhyablocks/p-004c356e.js +0 -26
  164. package/dist/sankhyablocks/p-0bba5c9f.entry.js +0 -1
  165. package/dist/sankhyablocks/p-1048bd26.entry.js +0 -1
  166. package/dist/sankhyablocks/p-20b46647.entry.js +0 -1
  167. package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
  168. package/dist/sankhyablocks/p-2936303b.js +0 -1
  169. package/dist/sankhyablocks/p-6c9adfca.js +0 -1
  170. package/dist/sankhyablocks/p-85af23fe.entry.js +0 -1
  171. package/dist/sankhyablocks/p-85ba3d6b.entry.js +0 -1
  172. package/dist/sankhyablocks/p-88b29791.js +0 -1
  173. package/dist/sankhyablocks/p-9a5d1b39.js +0 -1
  174. package/dist/sankhyablocks/p-9e8618ec.entry.js +0 -1
  175. package/dist/sankhyablocks/p-a043314f.entry.js +0 -1
  176. package/dist/sankhyablocks/p-a1642e7c.entry.js +0 -1
  177. package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
  178. package/dist/sankhyablocks/p-b47c2963.entry.js +0 -1
  179. package/dist/sankhyablocks/p-be75153c.js +0 -1
  180. package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
  181. package/dist/sankhyablocks/p-d304659d.entry.js +0 -1
  182. package/dist/sankhyablocks/p-d5cb4b5a.entry.js +0 -1
  183. package/dist/sankhyablocks/p-d78d4062.js +0 -65
  184. package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
  185. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
  186. /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
@@ -5,17 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
9
- const DataFetcher = require('./DataFetcher-99f0f6ed.js');
10
- const authFetcher = require('./auth-fetcher-bb8e9ae4.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
12
- const SnkMessageBuilder = require('./SnkMessageBuilder-141aa18d.js');
13
- require('./form-config-fetcher-d73f4449.js');
8
+ const ConfigStorage = require('./ConfigStorage-085c7117.js');
9
+ const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
10
+ const authFetcher = require('./auth-fetcher-eddaf17f.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-90b801fb.js');
12
+ const SnkMessageBuilder = require('./SnkMessageBuilder-66aa2557.js');
14
13
  require('./filter-item-type.enum-a7ffdaa6.js');
15
14
  require('./PrintUtils-bcaeb82f.js');
16
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
16
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
17
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
18
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
19
19
  require('./ResourceIDUtils-5ff86aa7.js');
20
20
 
21
21
  class AppletCaller {
@@ -48,7 +48,7 @@ class ParametersFetcher {
48
48
  this.buldTemplates();
49
49
  }
50
50
  buldTemplates() {
51
- this.templateByQuery.set("fetchParam", DataFetcher.dist.gql `query($name: String!) {
51
+ this.templateByQuery.set("fetchParam", formConfigFetcher.dist.gql `query($name: String!) {
52
52
  $queryAlias$: fetchResource(name: $name){
53
53
  name
54
54
  resource
@@ -60,7 +60,7 @@ class ParametersFetcher {
60
60
  return Promise.resolve(this._embeddedParams.get(name));
61
61
  }
62
62
  const completPath = `param://application?params=${name}`;
63
- return DataFetcher.DataFetcher.get().callGraphQL({
63
+ return formConfigFetcher.DataFetcher.get().callGraphQL({
64
64
  values: { name: completPath },
65
65
  query: this.templateByQuery.get("fetchParam"),
66
66
  });
@@ -119,7 +119,7 @@ class TotalsFetcher {
119
119
  this.buildTemplates();
120
120
  }
121
121
  buildTemplates() {
122
- this.templateByQuery.set("fetchTotals", DataFetcher.dist.gql `query($filters: [InputFilter!] $name: String!) {
122
+ this.templateByQuery.set("fetchTotals", formConfigFetcher.dist.gql `query($filters: [InputFilter!] $name: String!) {
123
123
  $queryAlias$: fetchTotals(name: $name, filters: $filters ){
124
124
  name
125
125
  value
@@ -152,7 +152,7 @@ class TotalsFetcher {
152
152
  }
153
153
  getTotals(name, resourceID, filters = []) {
154
154
  return new Promise((accept, reject) => {
155
- DataFetcher.DataFetcher
155
+ formConfigFetcher.DataFetcher
156
156
  .get()
157
157
  .callGraphQL({
158
158
  query: this.templateByQuery.get("fetchTotals"),
@@ -394,7 +394,7 @@ const SnkApplication = class {
394
394
  * @param options - Parâmetros de URL
395
395
  */
396
396
  async callServiceBroker(serviceName, payload, options) {
397
- return DataFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
397
+ return formConfigFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
398
398
  }
399
399
  async initOnboarding(onboardingKey) {
400
400
  if (this.hasToShowNewVersionPopup()) {
@@ -550,7 +550,7 @@ const SnkApplication = class {
550
550
  }
551
551
  };
552
552
  return new Promise((resolve, reject) => {
553
- DataFetcher.DataFetcher.get()
553
+ formConfigFetcher.DataFetcher.get()
554
554
  .callServiceBroker("SystemUtilsSP.getConf", JSON.stringify(payload))
555
555
  .then(result => { var _a; return resolve((_a = result.config) === null || _a === void 0 ? void 0 : _a.data); })
556
556
  .catch(error => reject(error));
@@ -571,7 +571,7 @@ const SnkApplication = class {
571
571
  }
572
572
  };
573
573
  return new Promise((resolve, reject) => {
574
- DataFetcher.DataFetcher.get()
574
+ formConfigFetcher.DataFetcher.get()
575
575
  .callServiceBroker("SystemUtilsSP.saveConf", JSON.stringify(payload))
576
576
  .then(result => resolve(result))
577
577
  .catch(error => reject(error));
@@ -676,7 +676,7 @@ const SnkApplication = class {
676
676
  */
677
677
  async addClientEvent(eventID, handler) {
678
678
  return new Promise((resolve) => {
679
- DataFetcher.DataFetcher.addClientEvent(eventID, handler);
679
+ formConfigFetcher.DataFetcher.addClientEvent(eventID, handler);
680
680
  resolve();
681
681
  });
682
682
  }
@@ -687,7 +687,7 @@ const SnkApplication = class {
687
687
  */
688
688
  async removeClientEvent(eventID) {
689
689
  return new Promise((resolve) => {
690
- DataFetcher.DataFetcher.removeClientEvent(eventID);
690
+ formConfigFetcher.DataFetcher.removeClientEvent(eventID);
691
691
  resolve();
692
692
  });
693
693
  }
@@ -698,7 +698,7 @@ const SnkApplication = class {
698
698
  */
699
699
  async hasClientEvent(eventID) {
700
700
  return new Promise((resolve) => {
701
- resolve(DataFetcher.DataFetcher.hasClientEvent(eventID));
701
+ resolve(formConfigFetcher.DataFetcher.hasClientEvent(eventID));
702
702
  });
703
703
  }
704
704
  get applicationResourceID() {
@@ -776,7 +776,7 @@ const SnkApplication = class {
776
776
  }
777
777
  get urlParams() {
778
778
  if (!this._urlParams) {
779
- this._urlParams = DataFetcher.UrlUtils.getQueryParams(location.search);
779
+ this._urlParams = formConfigFetcher.UrlUtils.getQueryParams(location.search);
780
780
  }
781
781
  return this._urlParams;
782
782
  }
@@ -1010,7 +1010,7 @@ const SnkApplication = class {
1010
1010
  * @returns DataFetcher do application
1011
1011
  */
1012
1012
  getDataFetcher() {
1013
- return Promise.resolve(DataFetcher.DataFetcher.get());
1013
+ return Promise.resolve(formConfigFetcher.DataFetcher.get());
1014
1014
  }
1015
1015
  /**
1016
1016
  * Retorna uma promise que sera resolvida quando o snk-application estiver carregado e registrado no ApplicationContext
@@ -1052,7 +1052,7 @@ const SnkApplication = class {
1052
1052
  if (this._currentPkParameter === pkHash)
1053
1053
  return;
1054
1054
  const resourceIDfromUrl = this.getResourceIdFromToken();
1055
- const pkObject = DataFetcher.UrlUtils.getPkObjectFromUrlToken(top.window.location.hash);
1055
+ const pkObject = formConfigFetcher.UrlUtils.getPkObjectFromUrlToken(top.window.location.hash);
1056
1056
  if (pkObject == undefined || resourceIDfromUrl !== this.applicationResourceID)
1057
1057
  return;
1058
1058
  const pkParam = { pk: pkObject };
@@ -1066,9 +1066,9 @@ const SnkApplication = class {
1066
1066
  }
1067
1067
  getResourceIdFromToken() {
1068
1068
  if ((top.window.location.pathname).indexOf("tabContent.jsp") > -1) {
1069
- return DataFetcher.UrlUtils.getResourceIdFromUrlToken(window.location['generateHash'](window.location.hash));
1069
+ return formConfigFetcher.UrlUtils.getResourceIdFromUrlToken(window.location['generateHash'](window.location.hash));
1070
1070
  }
1071
- return DataFetcher.UrlUtils.getResourceIdFromUrlToken(top.window.location.hash);
1071
+ return formConfigFetcher.UrlUtils.getResourceIdFromUrlToken(top.window.location.hash);
1072
1072
  }
1073
1073
  defaultLoadByPK(pkObject, pkHash) {
1074
1074
  if (!(pkObject === null || pkObject === void 0 ? void 0 : pkObject.pk))
@@ -1202,7 +1202,7 @@ const SnkApplication = class {
1202
1202
  core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
1203
1203
  this._errorHandler = new SnkErrorHandler(this);
1204
1204
  this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
1205
- core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${DataFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
1205
+ core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${formConfigFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
1206
1206
  core.ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
1207
1207
  return this.executeSearch(searchArgument, fieldName, dataUnit);
1208
1208
  });
@@ -1219,10 +1219,10 @@ const SnkApplication = class {
1219
1219
  }
1220
1220
  connectedCallback() {
1221
1221
  core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
1222
- DataFetcher.DataFetcher.addRequestListener(this._requestListener);
1222
+ formConfigFetcher.DataFetcher.addRequestListener(this._requestListener);
1223
1223
  }
1224
1224
  disconnectedCallback() {
1225
- DataFetcher.DataFetcher.removeRequestListener(this._requestListener);
1225
+ formConfigFetcher.DataFetcher.removeRequestListener(this._requestListener);
1226
1226
  this.removeShortcuts();
1227
1227
  }
1228
1228
  async componentDidLoad() {
@@ -4,19 +4,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const DataFetcher = require('./DataFetcher-99f0f6ed.js');
8
- const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
7
+ const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
8
+ const pesquisaFetcher = require('./pesquisa-fetcher-90b801fb.js');
9
9
  require('./index-0922807b.js');
10
10
  const ISave = require('./ISave-e91b70a7.js');
11
11
  require('./filter-item-type.enum-a7ffdaa6.js');
12
- require('./form-config-fetcher-d73f4449.js');
13
12
  const constants = require('./constants-35ddd366.js');
14
- const authFetcher = require('./auth-fetcher-bb8e9ae4.js');
15
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
13
+ const authFetcher = require('./auth-fetcher-eddaf17f.js');
14
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
16
15
  require('./PrintUtils-bcaeb82f.js');
17
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
18
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
19
18
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
19
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
20
20
  require('./ResourceIDUtils-5ff86aa7.js');
21
21
  require('./index-102ba62d.js');
22
22
 
@@ -49,7 +49,7 @@ class AttachFetcher {
49
49
  }
50
50
  };
51
51
  return new Promise((resolve, reject) => {
52
- DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
52
+ formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
53
53
  .then(result => {
54
54
  var _a;
55
55
  return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
@@ -68,7 +68,7 @@ class AttachFetcher {
68
68
  descricao: record.DESCRICAO,
69
69
  }
70
70
  };
71
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
71
+ const result = await formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
72
72
  return Promise.resolve(result);
73
73
  }
74
74
  async getDownloadKey(record) {
@@ -80,7 +80,7 @@ class AttachFetcher {
80
80
  tipoconteudo: record.TIPOCONTEUDO
81
81
  }
82
82
  };
83
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
83
+ const result = await formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
84
84
  return Promise.resolve({
85
85
  chave: {
86
86
  valor: (_b = (_a = result === null || result === void 0 ? void 0 : result.responseBody) === null || _a === void 0 ? void 0 : _a.chave) === null || _b === void 0 ? void 0 : _b.valor
@@ -97,7 +97,7 @@ class AttachFetcher {
97
97
  tipoConteudo: record.TIPOCONTEUDO
98
98
  }
99
99
  };
100
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
100
+ const result = await formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
101
101
  if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
102
102
  return Promise.resolve({
103
103
  chave: {
@@ -154,7 +154,7 @@ class AnexoSistemaFetcher {
154
154
  }
155
155
  }
156
156
  };
157
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
157
+ const result = await formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
158
158
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
159
159
  }
160
160
  catch (error) {
@@ -194,7 +194,7 @@ class AnexoSistemaFetcher {
194
194
  }
195
195
  }
196
196
  };
197
- const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
197
+ const result = await formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
198
198
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
199
199
  }
200
200
  catch (error) {
@@ -217,7 +217,7 @@ class AnexoSistemaFetcher {
217
217
  }
218
218
  };
219
219
  return new Promise((resolve, reject) => {
220
- DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
220
+ formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
221
221
  .then(result => resolve(result))
222
222
  .catch(error => reject(error));
223
223
  });
@@ -238,7 +238,7 @@ class AnexoSistemaFetcher {
238
238
  }
239
239
  };
240
240
  return new Promise((resolve, reject) => {
241
- DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
241
+ formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
242
242
  .then(result => resolve(result))
243
243
  .catch(error => reject(error));
244
244
  });
@@ -393,7 +393,7 @@ const attachFetcherMetadataBuilder = {
393
393
  label: "Attach List",
394
394
  fields: [
395
395
  { name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: core.DataType.TEXT },
396
- { name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: core.DataType.TEXT },
396
+ { name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: core.DataType.TEXT, readOnly: false },
397
397
  { name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: core.DataType.TEXT },
398
398
  { name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: core.DataType.TEXT },
399
399
  { name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: core.DataType.TEXT },
@@ -419,6 +419,7 @@ const SERVICE_LOAD = "Attach.load";
419
419
  class AttachFetcherDataUnitFactory {
420
420
  constructor(getMessage) {
421
421
  this.getMessage = getMessage;
422
+ this._records = [];
422
423
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
423
424
  }
424
425
  initLoaders(dataUnit, fetcher, onSuccess) {
@@ -438,25 +439,30 @@ class AttachFetcherDataUnitFactory {
438
439
  metadataLoader(_) {
439
440
  return Promise.resolve(attachFetcherMetadataBuilder);
440
441
  }
441
- async dataLoader(_, request) {
442
+ async dataLoader(dataUnit, request) {
442
443
  if (!request.source) {
443
- return Promise.resolve({ records: [] });
444
+ return Promise.resolve({ records: this._records });
444
445
  }
445
- const criteria = {
446
- criteria: {
447
- codata: request.source,
448
- tipoAnexo: "N"
449
- }
450
- };
451
- const applicationDataFetcher = await this._application.getDataFetcher();
452
- const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
453
- const records = [];
454
- anexo.forEach((param) => {
455
- records.push(Object.assign({ __record__id__: core.StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
456
- name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
457
- }] }, param));
458
- });
459
- return Promise.resolve({ records });
446
+ if (!Number.isNaN(Number(request.source))) {
447
+ const criteria = {
448
+ criteria: {
449
+ codata: request.source,
450
+ tipoAnexo: "N"
451
+ }
452
+ };
453
+ const applicationDataFetcher = await this._application.getDataFetcher();
454
+ const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
455
+ const records = [];
456
+ anexo.forEach((param) => {
457
+ records.push(Object.assign({ __record__id__: core.StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
458
+ name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
459
+ }] }, param));
460
+ });
461
+ this._records = records;
462
+ }
463
+ let records = pesquisaFetcher.applyFilter(this._records, dataUnit, request.filters);
464
+ records = pesquisaFetcher.applySorting(records, dataUnit, request.sort);
465
+ return Promise.resolve({ records, paginationInfo: pesquisaFetcher.buildPaginationInfo(records, request.offset, request.limit) });
460
466
  }
461
467
  saveLoader(changes, fetcher) {
462
468
  return new Promise((resolve) => {
@@ -635,7 +641,7 @@ const SnkAttach = class {
635
641
  this.back.emit();
636
642
  });
637
643
  };
638
- this.fetcherType = "AnexoSistema";
644
+ this.fetcherType = undefined;
639
645
  this.fetcher = undefined;
640
646
  this.dataUnit = undefined;
641
647
  this.dataUnitBuilder = undefined;
@@ -647,8 +653,8 @@ const SnkAttach = class {
647
653
  this.crudConfig = undefined;
648
654
  }
649
655
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
650
- var _a, _b, _c, _d;
651
- if (this._currentDataUnit == null) {
656
+ var _a, _b, _c, _d, _e, _f;
657
+ if (!this._currentDataUnit) {
652
658
  this.loadAttachmentDataUnit();
653
659
  }
654
660
  if (oldRegisterKey !== newRegisterKey) {
@@ -663,11 +669,7 @@ const SnkAttach = class {
663
669
  if (hasMoreOneItem)
664
670
  return;
665
671
  }
666
- return this._currentDataUnit
667
- .loadMetadata()
668
- .then(() => {
669
- this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
670
- });
672
+ return (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
671
673
  }
672
674
  }
673
675
  /**
@@ -733,7 +735,7 @@ const SnkAttach = class {
733
735
  if (!this._currentDataUnit.metadata) {
734
736
  this._currentDataUnit
735
737
  .loadMetadata()
736
- .then(() => this.crudConfig = anexoSistemaCrudConfig);
738
+ .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
737
739
  }
738
740
  this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
739
741
  this._currentDataUnit.addFilterProvider({
@@ -745,25 +747,29 @@ const SnkAttach = class {
745
747
  this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
746
748
  }
747
749
  loadAttach() {
748
- var _a;
750
+ var _a, _b, _c;
749
751
  this._currentFetcher = new AttachFetcher();
750
- this._currentDataUnit = new core.DataUnit();
752
+ this._currentDataUnit = new core.DataUnit(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
751
753
  this._currentDataUnit.addInterceptor({
752
- interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
754
+ interceptAction: (action) => {
755
+ var _a;
756
+ if (action.type === core.Action.METADATA_LOADED) {
757
+ this.crudConfig = Object.assign({}, attachCrudConfig);
758
+ (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
759
+ }
760
+ return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
761
+ }
753
762
  });
754
763
  this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
755
764
  (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
756
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
757
765
  this.returnToGridMode();
766
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
758
767
  });
759
768
  if (!this._currentDataUnit.metadata) {
760
- this._currentDataUnit
761
- .loadMetadata()
762
- .then(() => {
763
- this.crudConfig = attachCrudConfig;
764
- this._currentDataUnit
765
- .loadData(undefined, undefined, true, this.registerKey)
766
- .then(this.disableEditFieldsNotInForm.bind(this));
769
+ (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
770
+ var _a, _b;
771
+ this.crudConfig = Object.assign({}, attachCrudConfig);
772
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
767
773
  });
768
774
  }
769
775
  }
@@ -781,15 +787,30 @@ const SnkAttach = class {
781
787
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
782
788
  }
783
789
  componentWillRender() {
790
+ if (!this.fetcherType) {
791
+ this.fetcherType = "AnexoSistema";
792
+ }
784
793
  if (this._currentDataUnit == null) {
785
794
  this.loadAttachmentDataUnit();
786
795
  }
787
796
  }
797
+ async handleOnDataStateChange({ detail }) {
798
+ if (this.fetcherType !== 'Attach')
799
+ return;
800
+ if (!detail.insertionMode) {
801
+ this._currentDataUnit.disableField('DESCRICAO');
802
+ }
803
+ else {
804
+ this._currentDataUnit.enableField('DESCRICAO');
805
+ }
806
+ await this._currentDataUnit.loadMetadata();
807
+ }
808
+ ;
788
809
  render() {
789
810
  var _a, _b;
790
811
  if (!this._currentDataUnit)
791
812
  return null;
792
- return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
813
+ return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
793
814
  }
794
815
  static get watchers() { return {
795
816
  "registerKey": ["registerKeyWatcher"]
@@ -4,20 +4,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-3ecd1278.js');
8
- require('./DataFetcher-99f0f6ed.js');
9
- require('./pesquisa-fetcher-94f6b316.js');
7
+ const taskbarElements = require('./taskbar-elements-d9392685.js');
8
+ require('./form-config-fetcher-cdd644a7.js');
9
+ require('./pesquisa-fetcher-90b801fb.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
15
- require('./form-config-fetcher-d73f4449.js');
16
15
  const constants = require('./constants-35ddd366.js');
17
- const authFetcher = require('./auth-fetcher-bb8e9ae4.js');
16
+ const authFetcher = require('./auth-fetcher-eddaf17f.js');
18
17
  require('./index-102ba62d.js');
19
18
  require('./PrintUtils-bcaeb82f.js');
20
19
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
20
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
21
21
  require('./ResourceIDUtils-5ff86aa7.js');
22
22
 
23
23
  const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";