@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-45934.0 → 0.0.0-feat-dev-KB-46477.6

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 (207) hide show
  1. package/dist/cjs/{ConfigStorage-085c7117.js → ConfigStorage-8d4e9d53.js} +12 -11
  2. package/dist/cjs/{form-config-fetcher-cdd644a7.js → DataFetcher-99f0f6ed.js} +0 -251
  3. package/dist/cjs/{IExporterProvider-3c5e52f4.js → RmPrecisionCustomValueFormatter-4d60d44a.js} +33 -47
  4. package/dist/cjs/{SnkFormConfigManager-8986431f.js → SnkFormConfigManager-33995e92.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-4a95fe86.js} +6 -12
  6. package/dist/cjs/{auth-fetcher-eddaf17f.js → auth-fetcher-bb8e9ae4.js} +1 -1
  7. package/dist/cjs/{pesquisa-fetcher-7eddc221.js → dataunit-fetcher-b770fda0.js} +70 -179
  8. package/dist/cjs/form-config-fetcher-d73f4449.js +256 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/pesquisa-fetcher-98b68a28.js +166 -0
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +10 -8
  13. package/dist/cjs/snk-application.cjs.entry.js +49 -39
  14. package/dist/cjs/snk-attach.cjs.entry.js +20 -18
  15. package/dist/cjs/snk-crud.cjs.entry.js +44 -10
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +93 -211
  17. package/dist/cjs/snk-data-unit-746af433.js +649 -0
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +9 -3
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -7
  20. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -2
  21. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -2
  22. package/dist/cjs/snk-form-config.cjs.entry.js +2 -1
  23. package/dist/cjs/snk-form-view.cjs.entry.js +22 -0
  24. package/dist/cjs/snk-form.cjs.entry.js +28 -7
  25. package/dist/cjs/snk-grid.cjs.entry.js +143 -71
  26. package/dist/cjs/{snk-guides-viewer-c3dbb5eb.js → snk-guides-viewer-42b67a24.js} +20 -7
  27. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
  28. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -2
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +109 -140
  30. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -3
  31. package/dist/cjs/{taskbar-elements-d9392685.js → taskbar-elements-3ecd1278.js} +2 -2
  32. package/dist/collection/collection-manifest.json +1 -1
  33. package/dist/collection/components/snk-application/snk-application.js +37 -17
  34. package/dist/collection/components/snk-crud/snk-crud.js +109 -6
  35. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +65 -0
  36. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +41 -4
  37. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -48
  38. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +57 -52
  39. package/dist/collection/components/snk-data-unit/snk-data-unit.js +456 -177
  40. package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
  41. package/dist/collection/components/snk-form/snk-form.js +50 -4
  42. package/dist/collection/components/snk-grid/snk-grid.js +180 -9
  43. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +156 -101
  44. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  45. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
  46. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +31 -0
  47. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  48. package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
  49. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +1 -5
  50. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
  51. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +51 -1
  52. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
  53. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
  54. package/dist/collection/lib/message/SnkMessageBuilder.js +25 -32
  55. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
  56. package/dist/components/ConfigStorage.js +2 -1
  57. package/dist/components/DataFetcher.js +7023 -0
  58. package/dist/components/{IExporterProvider.js → RmPrecisionCustomValueFormatter.js} +34 -47
  59. package/dist/components/SnkMessageBuilder.js +6 -12
  60. package/dist/components/dataunit-fetcher.js +60 -170
  61. package/dist/components/form-config-fetcher.js +3 -7022
  62. package/dist/components/index2.js +33 -198
  63. package/dist/components/index3.js +199 -0
  64. package/dist/components/pesquisa-fetcher.js +164 -0
  65. package/dist/components/snk-actions-button2.js +14 -4
  66. package/dist/components/snk-application2.js +26 -17
  67. package/dist/components/snk-attach2.js +6 -4
  68. package/dist/components/snk-crud.js +48 -11
  69. package/dist/components/snk-data-exporter2.js +91 -209
  70. package/dist/components/snk-data-unit2.js +396 -216
  71. package/dist/components/snk-detail-view2.js +24 -9
  72. package/dist/components/snk-expression-item2.js +1 -1
  73. package/dist/components/snk-form-config2.js +1 -1
  74. package/dist/components/snk-form-view2.js +25 -1
  75. package/dist/components/snk-form.js +26 -5
  76. package/dist/components/snk-grid2.js +145 -71
  77. package/dist/components/snk-personalized-filter2.js +1 -1
  78. package/dist/components/snk-simple-crud2.js +96 -126
  79. package/dist/components/snk-taskbar2.js +5 -6
  80. package/dist/esm/{ConfigStorage-cc3f3dd3.js → ConfigStorage-6e241cd7.js} +2 -1
  81. package/dist/esm/{form-config-fetcher-13cd3285.js → DataFetcher-a650ae58.js} +1 -250
  82. package/dist/esm/{IExporterProvider-597c0494.js → RmPrecisionCustomValueFormatter-7a596db9.js} +32 -46
  83. package/dist/esm/{SnkFormConfigManager-7edda7eb.js → SnkFormConfigManager-7a4e678f.js} +2 -2
  84. package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-3a767111.js} +6 -12
  85. package/dist/esm/{auth-fetcher-11dd9cae.js → auth-fetcher-8ec448b0.js} +1 -1
  86. package/dist/esm/{pesquisa-fetcher-a3d5b866.js → dataunit-fetcher-b4d2bdc3.js} +59 -169
  87. package/dist/esm/form-config-fetcher-765b8498.js +253 -0
  88. package/dist/esm/loader.js +1 -1
  89. package/dist/esm/pesquisa-fetcher-69273870.js +164 -0
  90. package/dist/esm/sankhyablocks.js +1 -1
  91. package/dist/esm/snk-actions-button_4.entry.js +5 -3
  92. package/dist/esm/snk-application.entry.js +30 -20
  93. package/dist/esm/snk-attach.entry.js +6 -4
  94. package/dist/esm/snk-crud.entry.js +44 -10
  95. package/dist/esm/snk-data-exporter.entry.js +93 -211
  96. package/dist/esm/snk-data-unit-dd2d82c3.js +647 -0
  97. package/dist/esm/snk-data-unit.entry.js +9 -3
  98. package/dist/esm/snk-detail-view.entry.js +9 -7
  99. package/dist/esm/snk-filter-bar.entry.js +3 -2
  100. package/dist/esm/snk-filter-modal-item.entry.js +3 -2
  101. package/dist/esm/snk-form-config.entry.js +2 -1
  102. package/dist/esm/snk-form-view.entry.js +22 -0
  103. package/dist/esm/snk-form.entry.js +28 -7
  104. package/dist/esm/snk-grid.entry.js +141 -69
  105. package/dist/esm/{snk-guides-viewer-6c459e2d.js → snk-guides-viewer-dca40a89.js} +20 -7
  106. package/dist/esm/snk-guides-viewer.entry.js +9 -7
  107. package/dist/esm/snk-personalized-filter.entry.js +3 -2
  108. package/dist/esm/snk-simple-crud.entry.js +96 -127
  109. package/dist/esm/snk-taskbar.entry.js +2 -3
  110. package/dist/esm/{taskbar-elements-ad766858.js → taskbar-elements-2473c8ac.js} +2 -2
  111. package/dist/sankhyablocks/p-004c356e.js +26 -0
  112. package/dist/sankhyablocks/p-01e5d408.js +6 -0
  113. package/dist/sankhyablocks/{p-8a4c4b54.js → p-0624f62d.js} +6 -6
  114. package/dist/sankhyablocks/p-07d6401b.entry.js +1 -0
  115. package/dist/sankhyablocks/p-0b40d41c.js +1 -0
  116. package/dist/sankhyablocks/p-0bc5133a.entry.js +11 -0
  117. package/dist/sankhyablocks/{p-99b51d06.js → p-125bb902.js} +1 -1
  118. package/dist/sankhyablocks/p-24ed6ad6.entry.js +1 -0
  119. package/dist/sankhyablocks/p-265175c8.entry.js +1 -0
  120. package/dist/sankhyablocks/p-2a2eb0d2.entry.js +1 -0
  121. package/dist/sankhyablocks/p-4a6a1e98.js +60 -0
  122. package/dist/sankhyablocks/p-4ce73e88.js +1 -0
  123. package/dist/sankhyablocks/p-63fc5de8.js +1 -0
  124. package/dist/sankhyablocks/p-68c4033c.entry.js +1 -0
  125. package/dist/sankhyablocks/p-7c2e540d.entry.js +1 -0
  126. package/dist/sankhyablocks/p-85af23fe.entry.js +1 -0
  127. package/dist/sankhyablocks/p-8dcaf5c7.js +1 -0
  128. package/dist/sankhyablocks/p-927e7b7d.entry.js +1 -0
  129. package/dist/sankhyablocks/p-a1d3fb8d.entry.js +1 -0
  130. package/dist/sankhyablocks/p-a6249871.entry.js +1 -0
  131. package/dist/sankhyablocks/p-a724656f.entry.js +1 -0
  132. package/dist/sankhyablocks/p-ac77949b.entry.js +1 -0
  133. package/dist/sankhyablocks/p-af1f03d2.entry.js +1 -0
  134. package/dist/sankhyablocks/p-b10b9934.entry.js +1 -0
  135. package/dist/sankhyablocks/p-be75153c.js +1 -0
  136. package/dist/sankhyablocks/p-bf39bdb8.entry.js +1 -0
  137. package/dist/sankhyablocks/p-e6b839fd.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-d24c9dc6.js → p-efeca7ba.js} +1 -1
  139. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  140. package/dist/types/components/snk-application/snk-application.d.ts +6 -2
  141. package/dist/types/components/snk-crud/snk-crud.d.ts +14 -1
  142. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +11 -1
  143. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -0
  144. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +6 -23
  145. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +2 -4
  146. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +46 -9
  147. package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
  148. package/dist/types/components/snk-form/snk-form.d.ts +6 -0
  149. package/dist/types/components/snk-grid/snk-grid.d.ts +21 -3
  150. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +25 -17
  151. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  152. package/dist/types/components.d.ts +66 -18
  153. package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
  154. package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
  155. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
  156. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
  157. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
  158. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
  159. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
  160. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -1
  161. package/package.json +1 -1
  162. package/dist/cjs/RecordIDUtils-31a12a38.js +0 -43
  163. package/dist/cjs/snk-data-unit-f2036a46.js +0 -435
  164. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -90
  165. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -68
  166. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -56
  167. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
  168. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
  169. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
  170. package/dist/collection/lib/utils/SnkApplicationContext.js +0 -1
  171. package/dist/components/ISave.js +0 -42
  172. package/dist/esm/RecordIDUtils-7e1db1f0.js +0 -41
  173. package/dist/esm/snk-data-unit-82a5b426.js +0 -433
  174. package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
  175. package/dist/sankhyablocks/p-1d9d07b4.entry.js +0 -1
  176. package/dist/sankhyablocks/p-32556aa6.js +0 -1
  177. package/dist/sankhyablocks/p-33a6728e.js +0 -26
  178. package/dist/sankhyablocks/p-439d70ae.entry.js +0 -1
  179. package/dist/sankhyablocks/p-53f1cfad.js +0 -1
  180. package/dist/sankhyablocks/p-64914c34.entry.js +0 -1
  181. package/dist/sankhyablocks/p-7184bfd0.entry.js +0 -11
  182. package/dist/sankhyablocks/p-85722343.js +0 -1
  183. package/dist/sankhyablocks/p-99a21d7c.entry.js +0 -1
  184. package/dist/sankhyablocks/p-9ee96756.entry.js +0 -1
  185. package/dist/sankhyablocks/p-9f5d417b.js +0 -65
  186. package/dist/sankhyablocks/p-aba70b0b.entry.js +0 -1
  187. package/dist/sankhyablocks/p-b5ce5338.js +0 -1
  188. package/dist/sankhyablocks/p-bd1c9cb6.entry.js +0 -1
  189. package/dist/sankhyablocks/p-c25e9acf.entry.js +0 -1
  190. package/dist/sankhyablocks/p-c2f3ebf3.entry.js +0 -1
  191. package/dist/sankhyablocks/p-cfb98f51.entry.js +0 -1
  192. package/dist/sankhyablocks/p-d6a12e7a.entry.js +0 -1
  193. package/dist/sankhyablocks/p-e933b291.entry.js +0 -1
  194. package/dist/sankhyablocks/p-ea72d9ff.entry.js +0 -1
  195. package/dist/sankhyablocks/p-eb64464a.entry.js +0 -1
  196. package/dist/sankhyablocks/p-edd9dd1c.entry.js +0 -1
  197. package/dist/sankhyablocks/p-f1930aaa.js +0 -1
  198. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -13
  199. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -11
  200. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
  201. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
  202. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
  203. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
  204. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
  205. package/dist/types/lib/utils/SnkApplicationContext.d.ts +0 -1
  206. /package/dist/collection/{components/snk-data-exporter/interfaces/IExporterStrategy.js → lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js} +0 -0
  207. /package/dist/sankhyablocks/{p-61dd89eb.js → p-ae4fc9a9.js} +0 -0
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
3
+ const formConfigFetcher = require('./form-config-fetcher-d73f4449.js');
4
4
  const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
5
5
  const core = require('@sankhyalabs/core');
6
+ const DataFetcher = require('./DataFetcher-99f0f6ed.js');
6
7
 
7
8
  class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
8
9
  constructor() {
@@ -194,7 +195,7 @@ class PersonalizedFilterFetcher {
194
195
  return uri;
195
196
  }
196
197
  buildTemplates() {
197
- this.templateByQuery.set("fetchFilterFields", formConfigFetcher.dist.gql `
198
+ this.templateByQuery.set("fetchFilterFields", DataFetcher.dist.gql `
198
199
  query($name: String!) {
199
200
  $queryAlias$: fetchFilterFields(name: $name){
200
201
  currentLink {
@@ -222,7 +223,7 @@ class PersonalizedFilterFetcher {
222
223
  }
223
224
  }
224
225
  `);
225
- this.templateByQuery.set("fetchFilterAssistent", formConfigFetcher.dist.gql `
226
+ this.templateByQuery.set("fetchFilterAssistent", DataFetcher.dist.gql `
226
227
  query($name: String!) {
227
228
  $queryAlias$: fetchFilterAssistent(name: $name) {
228
229
  id
@@ -233,21 +234,21 @@ class PersonalizedFilterFetcher {
233
234
  assistent
234
235
  }
235
236
  }`);
236
- this.templateByQuery.set("savePersonalizedFilter", formConfigFetcher.dist.gql `
237
+ this.templateByQuery.set("savePersonalizedFilter", DataFetcher.dist.gql `
237
238
  mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
238
239
  $queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
239
240
  id
240
241
  name
241
242
  }
242
243
  }`);
243
- this.templateByQuery.set("deletePersonalizedFilter", formConfigFetcher.dist.gql `
244
+ this.templateByQuery.set("deletePersonalizedFilter", DataFetcher.dist.gql `
244
245
  mutation($name: String!, $filterId: String!) {
245
246
  $queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
246
247
  id
247
248
  name
248
249
  }
249
250
  }`);
250
- this.templateByQuery.set("validateExpression", formConfigFetcher.dist.gql `
251
+ this.templateByQuery.set("validateExpression", DataFetcher.dist.gql `
251
252
  query($dataUnitName: String!, $expression: String!) {
252
253
  $queryAlias$: validateExpression(dataUnitName: $dataUnitName, expression: $expression) {
253
254
  valid
@@ -257,7 +258,7 @@ class PersonalizedFilterFetcher {
257
258
  }
258
259
  async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
259
260
  return new Promise((resolve, reject) => {
260
- formConfigFetcher.DataFetcher.get()
261
+ DataFetcher.DataFetcher.get()
261
262
  .callGraphQL({
262
263
  values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
263
264
  query: this.templateByQuery.get("fetchFilterAssistent"),
@@ -281,7 +282,7 @@ class PersonalizedFilterFetcher {
281
282
  let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
282
283
  personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
283
284
  return new Promise((resolve, reject) => {
284
- formConfigFetcher.DataFetcher.get()
285
+ DataFetcher.DataFetcher.get()
285
286
  .callGraphQL({
286
287
  values: { name: this.resolveURI(resourceID, configName), filterAssistent: personalizedFilterParsed },
287
288
  query: this.templateByQuery.get("savePersonalizedFilter"),
@@ -296,7 +297,7 @@ class PersonalizedFilterFetcher {
296
297
  }
297
298
  async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
298
299
  return new Promise((resolve, reject) => {
299
- formConfigFetcher.DataFetcher.get()
300
+ DataFetcher.DataFetcher.get()
300
301
  .callGraphQL({
301
302
  values: { name: this.resolveURI(resourceID, configName), filterId: personalizedFilter.id },
302
303
  query: this.templateByQuery.get("deletePersonalizedFilter"),
@@ -311,7 +312,7 @@ class PersonalizedFilterFetcher {
311
312
  }
312
313
  async validatePersonalizedFilter(dataUnitName, expression) {
313
314
  return new Promise((resolve, reject) => {
314
- formConfigFetcher.DataFetcher.get()
315
+ DataFetcher.DataFetcher.get()
315
316
  .callGraphQL({
316
317
  values: { dataUnitName: dataUnitName, expression: expression },
317
318
  query: this.templateByQuery.get("validateExpression"),
@@ -326,7 +327,7 @@ class PersonalizedFilterFetcher {
326
327
  }
327
328
  loadFields(uri) {
328
329
  return new Promise((resolve, reject) => {
329
- formConfigFetcher.DataFetcher.get()
330
+ DataFetcher.DataFetcher.get()
330
331
  .callGraphQL({
331
332
  values: { name: uri },
332
333
  query: this.templateByQuery.get("fetchFilterFields"),
@@ -7022,257 +7022,6 @@ class WaitingRequest {
7022
7022
  }
7023
7023
  }
7024
7024
 
7025
- class ResourceFetcher {
7026
- constructor() {
7027
- this.templateByQuery = new Map();
7028
- this.buldTemplates();
7029
- }
7030
- buldTemplates() {
7031
- this.templateByQuery.set("fetchResource", dist.gql `query($name: String!) {
7032
- $queryAlias$: fetchResource(name: $name){
7033
- resource
7034
- }
7035
- }`);
7036
- this.templateByQuery.set("saveResource", dist.gql `mutation($resource: InputResource!) {
7037
- $queryAlias$: saveResource(resource: $resource){
7038
- name
7039
- resource
7040
- }
7041
- }`);
7042
- }
7043
- loadResource(name) {
7044
- if (ResourceFetcher._loadingResource.has(name)) {
7045
- return ResourceFetcher._loadingResource.get(name);
7046
- }
7047
- const promiseLoadResource = new Promise((resolve, reject) => {
7048
- DataFetcher.get()
7049
- .callGraphQL({
7050
- values: { name },
7051
- query: this.templateByQuery.get("fetchResource"),
7052
- })
7053
- .then((result) => {
7054
- resolve(result === null || result === void 0 ? void 0 : result.resource);
7055
- ResourceFetcher._loadingResource.delete(name);
7056
- })
7057
- .catch((error) => {
7058
- reject(error);
7059
- ResourceFetcher._loadingResource.delete(name);
7060
- });
7061
- });
7062
- ResourceFetcher._loadingResource.set(name, promiseLoadResource);
7063
- return promiseLoadResource;
7064
- }
7065
- saveResource(resource, name) {
7066
- return new Promise((resolve, reject) => {
7067
- DataFetcher.get()
7068
- .callGraphQL({
7069
- values: {
7070
- resource: {
7071
- name: name,
7072
- resource: JSON.stringify(resource)
7073
- }
7074
- },
7075
- query: this.templateByQuery.get("saveResource")
7076
- })
7077
- .then((resp) => {
7078
- resolve(resp);
7079
- })
7080
- .catch((error) => {
7081
- reject(error);
7082
- });
7083
- });
7084
- }
7085
- }
7086
- ResourceFetcher._loadingResource = new Map();
7087
-
7088
- class FormConfigFetcher extends ResourceFetcher {
7089
- constructor() {
7090
- super();
7091
- this.queryConfig = new Map();
7092
- this.buildTemplatesConfig();
7093
- }
7094
- buildTemplatesConfig() {
7095
- this.queryConfig.set("fetchUserAvailableConfigs", dist.gql `query($name: String!) {
7096
- $queryAlias$: fetchUserAvailableConfigs(name: $name){
7097
- name
7098
- origin
7099
- key
7100
- }
7101
- }`);
7102
- this.queryConfig.set("fetchLegacyConfig", dist.gql `query($name: String!) {
7103
- $queryAlias$: fetchLegacyConfig(name: $name){
7104
- name
7105
- resource
7106
- }
7107
- }`);
7108
- this.queryConfig.set("fetchDefaultConfig", dist.gql `query($name: String!) {
7109
- $queryAlias$: fetchDefaultConfig(name: $name){
7110
- name
7111
- resource
7112
- }
7113
- }`);
7114
- }
7115
- loadFormConfig(formName, resourceID) {
7116
- return new Promise((accept, reject) => {
7117
- Promise.all([
7118
- this.loadResource(this.getPath(resourceID, formName)),
7119
- this.loadResource(this.getPath(`FormCardState:${resourceID}`, formName, "form-card")),
7120
- this.loadResource(this.getPath(resourceID, formName, "summary")),
7121
- this.loadResource(this.getPath(resourceID, formName, "defaultValues"))
7122
- ])
7123
- .then(([configAsString, formCardState, summary, defaultValues]) => {
7124
- let config;
7125
- if (configAsString != undefined) {
7126
- config = Object.assign(Object.assign({}, JSON.parse(configAsString)), { emptyConfig: false });
7127
- const { tabs, fields } = config;
7128
- if (tabs) {
7129
- const allTabs = new Map(tabs.map(t => [t.label, t]));
7130
- fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
7131
- }
7132
- config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
7133
- if ("readonly" in field) {
7134
- const readOnly = field['readonly'] === true;
7135
- delete field['readonly'];
7136
- field.readOnly = readOnly;
7137
- }
7138
- return field;
7139
- });
7140
- }
7141
- if (formCardState != undefined) {
7142
- if (config == undefined) {
7143
- config = { emptyConfig: true, fields: [] };
7144
- }
7145
- config.cardsState = new Map(JSON.parse(formCardState));
7146
- }
7147
- if (summary != undefined) {
7148
- if (config == undefined) {
7149
- config = { emptyConfig: true, fields: [] };
7150
- }
7151
- config.summary = new Map(Object.entries(JSON.parse(summary)));
7152
- }
7153
- if (defaultValues != undefined) {
7154
- if (config == undefined) {
7155
- config = { emptyConfig: true, fields: [] };
7156
- }
7157
- config.defaultVars = new Map(Object.entries(JSON.parse(defaultValues)));
7158
- }
7159
- accept(config);
7160
- })
7161
- .catch((error) => {
7162
- reject(error);
7163
- });
7164
- });
7165
- }
7166
- getTabName(tab) {
7167
- if (typeof tab === 'object') { // ITabConfig type
7168
- return tab.label;
7169
- }
7170
- return tab; //string type
7171
- }
7172
- saveCardState(cardsState, formName, resourceID) {
7173
- const completePath = this.getPath(`FormCardState:${resourceID}`, formName, "form-card");
7174
- return new Promise((resolve, reject) => {
7175
- this.saveResource(Array.from(cardsState.entries()), completePath)
7176
- .then((resp) => {
7177
- resolve(new Map(JSON.parse(resp.resource)));
7178
- })
7179
- .catch((error) => {
7180
- reject(error);
7181
- });
7182
- });
7183
- }
7184
- saveConfig(config, formName, resourceID) {
7185
- //Essas informações não devem ser salvas na configuração
7186
- delete config.cardsState;
7187
- delete config.defaultVars;
7188
- delete config.summary;
7189
- const completePath = this.getPath(resourceID, formName);
7190
- return new Promise((resolve, reject) => {
7191
- this.saveResource(config, completePath)
7192
- .then((resp) => {
7193
- resolve(JSON.parse(resp.resource));
7194
- })
7195
- .catch((error) => {
7196
- reject(error);
7197
- });
7198
- });
7199
- }
7200
- fetchUserAvailableConfigs(formName, resourceID) {
7201
- const name = this.getPath(resourceID, formName);
7202
- return new Promise((resolve, reject) => {
7203
- DataFetcher.get()
7204
- .callGraphQL({
7205
- values: { name },
7206
- query: this.queryConfig.get("fetchUserAvailableConfigs"),
7207
- })
7208
- .then((result) => {
7209
- resolve(result);
7210
- })
7211
- .catch((error) => {
7212
- reject(error);
7213
- });
7214
- });
7215
- }
7216
- fetchLegacyConfig(formName, resourceID) {
7217
- const name = this.getPath(resourceID, formName);
7218
- return new Promise((resolve, reject) => {
7219
- DataFetcher.get()
7220
- .callGraphQL({
7221
- values: { name },
7222
- query: this.queryConfig.get("fetchLegacyConfig"),
7223
- })
7224
- .then((result) => {
7225
- resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
7226
- })
7227
- .catch((error) => {
7228
- reject(error);
7229
- });
7230
- });
7231
- }
7232
- fetchDefaultConfig(formName, resourceID) {
7233
- const name = this.getPath(resourceID, formName);
7234
- return new Promise((resolve, reject) => {
7235
- DataFetcher.get()
7236
- .callGraphQL({
7237
- values: { name },
7238
- query: this.queryConfig.get("fetchDefaultConfig"),
7239
- })
7240
- .then((result) => {
7241
- resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
7242
- })
7243
- .catch((error) => {
7244
- reject(error);
7245
- });
7246
- });
7247
- }
7248
- getPath(resourceID, name, authority = "form") {
7249
- if (name) {
7250
- return `cfg://${authority}/${resourceID}/${name}`;
7251
- }
7252
- return `cfg://${authority}/${resourceID}`;
7253
- }
7254
- async fetchLegacyConfigurableForm(configName) {
7255
- const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
7256
- const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
7257
- if (core.ObjectUtils.isEmpty(response))
7258
- return undefined;
7259
- return this.buildLegacyConfigurableForm(response);
7260
- }
7261
- buildLegacyConfigurableForm(config) {
7262
- var _a, _b, _c;
7263
- const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
7264
- return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
7265
- }
7266
- }
7267
- exports.UserConfigType = void 0;
7268
- (function (UserConfigType) {
7269
- UserConfigType["USER"] = "USER";
7270
- UserConfigType["DEFAULT"] = "DEFAULT";
7271
- UserConfigType["SHARED"] = "SHARED";
7272
- })(exports.UserConfigType || (exports.UserConfigType = {}));
7273
-
7274
7025
  exports.DataFetcher = DataFetcher;
7275
- exports.FormConfigFetcher = FormConfigFetcher;
7276
- exports.ResourceFetcher = ResourceFetcher;
7277
7026
  exports.UrlUtils = UrlUtils;
7278
7027
  exports.dist = dist;
@@ -1,13 +1,15 @@
1
1
  'use strict';
2
2
 
3
- const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
4
- const pesquisaFetcher = require('./pesquisa-fetcher-7eddc221.js');
3
+ const DataFetcher = require('./DataFetcher-99f0f6ed.js');
4
+ require('./pesquisa-fetcher-98b68a28.js');
5
5
  const core = require('@sankhyalabs/core');
6
6
  require('./index-0922807b.js');
7
7
  require('./ISave-e91b70a7.js');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
9
- const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
9
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
10
+ const dataunitFetcher = require('./dataunit-fetcher-b770fda0.js');
10
11
  require('./filter-item-type.enum-a7ffdaa6.js');
12
+ require('./form-config-fetcher-d73f4449.js');
11
13
  const InMemoryFilterColumnDataSource = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
12
14
 
13
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -71,7 +73,7 @@ class CrudUtils {
71
73
  }
72
74
  };
73
75
  return new Promise((resolve) => {
74
- formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
76
+ DataFetcher.DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
75
77
  var _a;
76
78
  let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
77
79
  if (entities != undefined) {
@@ -115,7 +117,7 @@ class SnkMultiSelectionListDataSource {
115
117
  if (fieldName == undefined) {
116
118
  return Promise.resolve(undefined);
117
119
  }
118
- return Promise.resolve(await pesquisaFetcher.PreloadManager.getDistinct(this._dataUnit, fieldName));
120
+ return Promise.resolve(await dataunitFetcher.PreloadManager.getDistinct(this._dataUnit, fieldName));
119
121
  }
120
122
  fetchData(filterTerm, fieldName) {
121
123
  return new Promise(resolve => {
@@ -135,53 +137,37 @@ class SnkMultiSelectionListDataSource {
135
137
  }
136
138
  }
137
139
 
138
- class CommonsExporter {
139
- constructor(dataUnit, grid) {
140
- this.dataUnit = dataUnit;
141
- this.grid = grid;
140
+ class RmPrecisionCustomValueFormatter {
141
+ setGrid(grid) {
142
+ this._grid = grid;
142
143
  }
143
- async getColumnsMetadata() {
144
+ setDataState(dataState) {
145
+ if (core.ObjectUtils.objectToString(dataState) === core.ObjectUtils.objectToString(this._dataState)) {
146
+ return;
147
+ }
148
+ this._dataState = dataState;
149
+ this.refreshSelectedRows();
150
+ }
151
+ format(currentValue, column, recordId) {
144
152
  var _a;
145
- const columnsState = await ((_a = this.grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
146
- return this.buildColumnsMetadata(columnsState);
153
+ if (!currentValue) {
154
+ return currentValue;
155
+ }
156
+ const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
157
+ const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
158
+ if (rmPrecision) {
159
+ return core.NumberUtils.format(currentValue, rmPrecision, rmPrecision);
160
+ }
161
+ else {
162
+ return currentValue;
163
+ }
147
164
  }
148
- buildColumnsMetadata(gridColumns) {
149
- const columnsMetadata = [];
150
- gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
151
- var _a, _b;
152
- /**
153
- * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
154
- */
155
- if (column.hidden && column.name !== "RECDESP") {
156
- return;
157
- }
158
- const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
159
- const columnData = {
160
- label: column.label,
161
- id: column.name,
162
- width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UnitMetadata.UserInterface.SEARCH ? 30 : column.width,
163
- type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
164
- userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
165
- };
166
- columnsMetadata.push(columnData);
167
- if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
168
- const mergedFrom = fieldData.properties.mergedFrom;
169
- const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
170
- const descriptionColumn = {
171
- label: fieldData.properties.DESCRIPTIONENTITY,
172
- id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
173
- width: 200,
174
- type: core.DataType.TEXT,
175
- userInterface: UnitMetadata.UserInterface.LONGTEXT,
176
- descriptionFrom: fieldData.name
177
- };
178
- columnsMetadata.push(descriptionColumn);
179
- }
180
- });
181
- return columnsMetadata || [];
165
+ refreshSelectedRows() {
166
+ var _a;
167
+ (_a = this._grid) === null || _a === void 0 ? void 0 : _a.refreshSelectedRows();
182
168
  }
183
169
  }
184
170
 
185
- exports.CommonsExporter = CommonsExporter;
186
171
  exports.CrudUtils = CrudUtils;
172
+ exports.RmPrecisionCustomValueFormatter = RmPrecisionCustomValueFormatter;
187
173
  exports.SnkMultiSelectionListDataSource = SnkMultiSelectionListDataSource;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const ConfigStorage = require('./ConfigStorage-085c7117.js');
3
+ const ConfigStorage = require('./ConfigStorage-8d4e9d53.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
5
+ const formConfigFetcher = require('./form-config-fetcher-d73f4449.js');
6
6
 
7
7
  class SnkFormConfigManager {
8
8
  constructor(configName, resourceID, onConfigChange) {
@@ -51,6 +51,7 @@ const snkDataUnitMessages = {
51
51
  forbiddenRemove: "Não é possível remover. Verifique as permissões de acesso.",
52
52
  removeAllConfirmation: "Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",
53
53
  removeAllInfo: "Os {{size}} registros foram removidos com sucesso!",
54
+ fieldNameRequired: "É necessário informar o nome da coluna."
54
55
  };
55
56
 
56
57
  const snkFilterBarMessages = {
@@ -574,7 +575,7 @@ class SnkMessageBuilder {
574
575
  this.loadAppMessages().then((msgs) => {
575
576
  this._appMessages = msgs;
576
577
  }, error => {
577
- console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js', error);
578
+ console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
578
579
  });
579
580
  }
580
581
  /**
@@ -666,17 +667,10 @@ class SnkMessageBuilder {
666
667
  return message;
667
668
  }
668
669
  }
669
- loadAppMessages() {
670
- return new Promise(async (accept, reject) => {
671
- const messagesUrl = await this._application.getApplicationPath();
672
- Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`)); })
673
- .then(module => {
674
- accept(module.default);
675
- })
676
- .catch(reason => {
677
- reject(reason);
678
- });
679
- });
670
+ async loadAppMessages() {
671
+ const messagesUrl = await this._application.getApplicationPath();
672
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`)); });
673
+ return module.default;
680
674
  }
681
675
  }
682
676
  exports.OperationMap = void 0;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const core = require('@sankhyalabs/core');
4
- const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
4
+ const formConfigFetcher = require('./form-config-fetcher-d73f4449.js');
5
5
 
6
6
  class AuthFetcher extends formConfigFetcher.ResourceFetcher {
7
7
  getData(resourceID) {