@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-46477.4 → 0.0.0-feat-dev-KB-45934.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
- package/dist/cjs/{RmPrecisionCustomValueFormatter-41463024.js → IExporterProvider-3c5e52f4.js} +47 -29
- package/dist/cjs/RecordIDUtils-31a12a38.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-33995e92.js → SnkFormConfigManager-8986431f.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-4a95fe86.js → SnkMessageBuilder-66aa2557.js} +12 -6
- package/dist/cjs/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
- package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-b770fda0.js → pesquisa-fetcher-7eddc221.js} +179 -70
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +8 -10
- package/dist/cjs/snk-application.cjs.entry.js +39 -49
- package/dist/cjs/snk-attach.cjs.entry.js +18 -20
- package/dist/cjs/snk-crud.cjs.entry.js +10 -44
- package/dist/cjs/snk-data-exporter.cjs.entry.js +211 -93
- package/dist/cjs/snk-data-unit-f2036a46.js +435 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -9
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +2 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
- package/dist/cjs/snk-form-view.cjs.entry.js +0 -18
- package/dist/cjs/snk-form.cjs.entry.js +7 -28
- package/dist/cjs/snk-grid.cjs.entry.js +71 -144
- package/dist/cjs/{snk-guides-viewer-42b67a24.js → snk-guides-viewer-c3dbb5eb.js} +7 -20
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +140 -108
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -2
- package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +17 -37
- package/dist/collection/components/snk-crud/snk-crud.js +6 -109
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -58
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +4 -41
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +56 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -57
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +177 -468
- package/dist/collection/components/snk-form/snk-form.js +4 -50
- package/dist/collection/components/snk-grid/snk-grid.js +9 -181
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +101 -155
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +5 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +1 -51
- package/dist/collection/lib/message/SnkMessageBuilder.js +32 -25
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +0 -1
- package/dist/collection/lib/utils/SnkApplicationContext.js +1 -0
- package/dist/components/ConfigStorage.js +1 -2
- package/dist/components/{RmPrecisionCustomValueFormatter.js → IExporterProvider.js} +47 -30
- package/dist/components/ISave.js +42 -0
- package/dist/components/SnkMessageBuilder.js +12 -6
- package/dist/components/dataunit-fetcher.js +170 -60
- package/dist/components/form-config-fetcher.js +7022 -3
- package/dist/components/index2.js +198 -33
- package/dist/components/snk-actions-button2.js +4 -14
- package/dist/components/snk-application2.js +17 -26
- package/dist/components/snk-attach2.js +4 -6
- package/dist/components/snk-crud.js +11 -48
- package/dist/components/snk-data-exporter2.js +209 -91
- package/dist/components/snk-data-unit2.js +216 -408
- package/dist/components/snk-detail-view2.js +9 -24
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form-view2.js +1 -21
- package/dist/components/snk-form.js +5 -26
- package/dist/components/snk-grid2.js +71 -146
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +126 -95
- package/dist/components/snk-taskbar2.js +6 -5
- package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
- package/dist/esm/{RmPrecisionCustomValueFormatter-96238a6f.js → IExporterProvider-597c0494.js} +46 -28
- package/dist/esm/RecordIDUtils-7e1db1f0.js +41 -0
- package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-3a767111.js → SnkMessageBuilder-0a4becdd.js} +12 -6
- package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
- package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-b4d2bdc3.js → pesquisa-fetcher-a3d5b866.js} +169 -59
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +3 -5
- package/dist/esm/snk-application.entry.js +20 -30
- package/dist/esm/snk-attach.entry.js +4 -6
- package/dist/esm/snk-crud.entry.js +10 -44
- package/dist/esm/snk-data-exporter.entry.js +211 -93
- package/dist/esm/snk-data-unit-82a5b426.js +433 -0
- package/dist/esm/snk-data-unit.entry.js +3 -9
- package/dist/esm/snk-detail-view.entry.js +7 -9
- package/dist/esm/snk-filter-bar.entry.js +2 -3
- package/dist/esm/snk-filter-modal-item.entry.js +2 -3
- package/dist/esm/snk-form-config.entry.js +1 -2
- package/dist/esm/snk-form-view.entry.js +0 -18
- package/dist/esm/snk-form.entry.js +7 -28
- package/dist/esm/snk-grid.entry.js +69 -142
- package/dist/esm/{snk-guides-viewer-dca40a89.js → snk-guides-viewer-6c459e2d.js} +7 -20
- package/dist/esm/snk-guides-viewer.entry.js +7 -9
- package/dist/esm/snk-personalized-filter.entry.js +2 -3
- package/dist/esm/snk-simple-crud.entry.js +127 -95
- package/dist/esm/snk-taskbar.entry.js +3 -2
- package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
- package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-33a6728e.js +26 -0
- package/dist/sankhyablocks/p-439d70ae.entry.js +1 -0
- package/dist/sankhyablocks/p-53f1cfad.js +1 -0
- package/dist/sankhyablocks/p-64914c34.entry.js +1 -0
- package/dist/sankhyablocks/p-7184bfd0.entry.js +11 -0
- package/dist/sankhyablocks/p-85722343.js +1 -0
- package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
- package/dist/sankhyablocks/p-99a21d7c.entry.js +1 -0
- package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
- package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
- package/dist/sankhyablocks/p-9f5d417b.js +65 -0
- package/dist/sankhyablocks/p-aba70b0b.entry.js +1 -0
- package/dist/sankhyablocks/p-b5ce5338.js +1 -0
- package/dist/sankhyablocks/p-bd1c9cb6.entry.js +1 -0
- package/dist/sankhyablocks/p-c25e9acf.entry.js +1 -0
- package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
- package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
- package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
- package/dist/sankhyablocks/p-d6a12e7a.entry.js +1 -0
- package/dist/sankhyablocks/p-e933b291.entry.js +1 -0
- package/dist/sankhyablocks/p-ea72d9ff.entry.js +1 -0
- package/dist/sankhyablocks/p-eb64464a.entry.js +1 -0
- package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
- package/dist/sankhyablocks/p-f1930aaa.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +2 -6
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -14
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +1 -10
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -6
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +23 -6
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -2
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +9 -45
- package/dist/types/components/snk-form/snk-form.d.ts +0 -6
- package/dist/types/components/snk-grid/snk-grid.d.ts +3 -21
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +17 -24
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +18 -66
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
- package/dist/types/lib/utils/SnkApplicationContext.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
- package/dist/cjs/pesquisa-fetcher-98b68a28.js +0 -166
- package/dist/cjs/snk-data-unit-061e38b8.js +0 -661
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -27
- package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +0 -22
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/DataFetcher.js +0 -7023
- package/dist/components/index3.js +0 -199
- package/dist/components/pesquisa-fetcher.js +0 -164
- package/dist/esm/form-config-fetcher-765b8498.js +0 -253
- package/dist/esm/pesquisa-fetcher-69273870.js +0 -164
- package/dist/esm/snk-data-unit-20717a6b.js +0 -659
- package/dist/sankhyablocks/p-004c356e.js +0 -26
- package/dist/sankhyablocks/p-01e5d408.js +0 -6
- package/dist/sankhyablocks/p-07d6401b.entry.js +0 -1
- package/dist/sankhyablocks/p-0bc5133a.entry.js +0 -11
- package/dist/sankhyablocks/p-12b2589b.js +0 -1
- package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
- package/dist/sankhyablocks/p-2a2eb0d2.entry.js +0 -1
- package/dist/sankhyablocks/p-3e490c3c.js +0 -1
- package/dist/sankhyablocks/p-40a47bdf.entry.js +0 -1
- package/dist/sankhyablocks/p-4a6a1e98.js +0 -60
- package/dist/sankhyablocks/p-4ce73e88.js +0 -1
- package/dist/sankhyablocks/p-63fc5de8.js +0 -1
- package/dist/sankhyablocks/p-6ce71d63.entry.js +0 -1
- package/dist/sankhyablocks/p-6f44c136.entry.js +0 -1
- package/dist/sankhyablocks/p-7c2e540d.entry.js +0 -1
- package/dist/sankhyablocks/p-85af23fe.entry.js +0 -1
- package/dist/sankhyablocks/p-90ffb264.entry.js +0 -1
- package/dist/sankhyablocks/p-a724656f.entry.js +0 -1
- package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
- package/dist/sankhyablocks/p-af1f03d2.entry.js +0 -1
- package/dist/sankhyablocks/p-b10b9934.entry.js +0 -1
- package/dist/sankhyablocks/p-b9f00bc4.entry.js +0 -1
- package/dist/sankhyablocks/p-be75153c.js +0 -1
- package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
- package/dist/sankhyablocks/p-e6b839fd.entry.js +0 -1
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +0 -11
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +0 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +0 -10
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +0 -20
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
- /package/dist/collection/{lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js → components/snk-data-exporter/interfaces/IExporterStrategy.js} +0 -0
- /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-cdd644a7.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');
|
|
7
6
|
|
|
8
7
|
class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
|
9
8
|
constructor() {
|
|
@@ -195,7 +194,7 @@ class PersonalizedFilterFetcher {
|
|
|
195
194
|
return uri;
|
|
196
195
|
}
|
|
197
196
|
buildTemplates() {
|
|
198
|
-
this.templateByQuery.set("fetchFilterFields",
|
|
197
|
+
this.templateByQuery.set("fetchFilterFields", formConfigFetcher.dist.gql `
|
|
199
198
|
query($name: String!) {
|
|
200
199
|
$queryAlias$: fetchFilterFields(name: $name){
|
|
201
200
|
currentLink {
|
|
@@ -223,7 +222,7 @@ class PersonalizedFilterFetcher {
|
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
`);
|
|
226
|
-
this.templateByQuery.set("fetchFilterAssistent",
|
|
225
|
+
this.templateByQuery.set("fetchFilterAssistent", formConfigFetcher.dist.gql `
|
|
227
226
|
query($name: String!) {
|
|
228
227
|
$queryAlias$: fetchFilterAssistent(name: $name) {
|
|
229
228
|
id
|
|
@@ -234,21 +233,21 @@ class PersonalizedFilterFetcher {
|
|
|
234
233
|
assistent
|
|
235
234
|
}
|
|
236
235
|
}`);
|
|
237
|
-
this.templateByQuery.set("savePersonalizedFilter",
|
|
236
|
+
this.templateByQuery.set("savePersonalizedFilter", formConfigFetcher.dist.gql `
|
|
238
237
|
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
|
239
238
|
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
|
240
239
|
id
|
|
241
240
|
name
|
|
242
241
|
}
|
|
243
242
|
}`);
|
|
244
|
-
this.templateByQuery.set("deletePersonalizedFilter",
|
|
243
|
+
this.templateByQuery.set("deletePersonalizedFilter", formConfigFetcher.dist.gql `
|
|
245
244
|
mutation($name: String!, $filterId: String!) {
|
|
246
245
|
$queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
|
|
247
246
|
id
|
|
248
247
|
name
|
|
249
248
|
}
|
|
250
249
|
}`);
|
|
251
|
-
this.templateByQuery.set("validateExpression",
|
|
250
|
+
this.templateByQuery.set("validateExpression", formConfigFetcher.dist.gql `
|
|
252
251
|
query($dataUnitName: String!, $expression: String!) {
|
|
253
252
|
$queryAlias$: validateExpression(dataUnitName: $dataUnitName, expression: $expression) {
|
|
254
253
|
valid
|
|
@@ -258,7 +257,7 @@ class PersonalizedFilterFetcher {
|
|
|
258
257
|
}
|
|
259
258
|
async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
|
|
260
259
|
return new Promise((resolve, reject) => {
|
|
261
|
-
|
|
260
|
+
formConfigFetcher.DataFetcher.get()
|
|
262
261
|
.callGraphQL({
|
|
263
262
|
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
|
|
264
263
|
query: this.templateByQuery.get("fetchFilterAssistent"),
|
|
@@ -282,7 +281,7 @@ class PersonalizedFilterFetcher {
|
|
|
282
281
|
let personalizedFilterParsed = JSON.parse(JSON.stringify(personalizedFilter));
|
|
283
282
|
personalizedFilterParsed.assistent = JSON.stringify(personalizedFilterParsed.assistent);
|
|
284
283
|
return new Promise((resolve, reject) => {
|
|
285
|
-
|
|
284
|
+
formConfigFetcher.DataFetcher.get()
|
|
286
285
|
.callGraphQL({
|
|
287
286
|
values: { name: this.resolveURI(resourceID, configName), filterAssistent: personalizedFilterParsed },
|
|
288
287
|
query: this.templateByQuery.get("savePersonalizedFilter"),
|
|
@@ -297,7 +296,7 @@ class PersonalizedFilterFetcher {
|
|
|
297
296
|
}
|
|
298
297
|
async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
|
299
298
|
return new Promise((resolve, reject) => {
|
|
300
|
-
|
|
299
|
+
formConfigFetcher.DataFetcher.get()
|
|
301
300
|
.callGraphQL({
|
|
302
301
|
values: { name: this.resolveURI(resourceID, configName), filterId: personalizedFilter.id },
|
|
303
302
|
query: this.templateByQuery.get("deletePersonalizedFilter"),
|
|
@@ -312,7 +311,7 @@ class PersonalizedFilterFetcher {
|
|
|
312
311
|
}
|
|
313
312
|
async validatePersonalizedFilter(dataUnitName, expression) {
|
|
314
313
|
return new Promise((resolve, reject) => {
|
|
315
|
-
|
|
314
|
+
formConfigFetcher.DataFetcher.get()
|
|
316
315
|
.callGraphQL({
|
|
317
316
|
values: { dataUnitName: dataUnitName, expression: expression },
|
|
318
317
|
query: this.templateByQuery.get("validateExpression"),
|
|
@@ -327,7 +326,7 @@ class PersonalizedFilterFetcher {
|
|
|
327
326
|
}
|
|
328
327
|
loadFields(uri) {
|
|
329
328
|
return new Promise((resolve, reject) => {
|
|
330
|
-
|
|
329
|
+
formConfigFetcher.DataFetcher.get()
|
|
331
330
|
.callGraphQL({
|
|
332
331
|
values: { name: uri },
|
|
333
332
|
query: this.templateByQuery.get("fetchFilterFields"),
|
package/dist/cjs/{RmPrecisionCustomValueFormatter-41463024.js → IExporterProvider-3c5e52f4.js}
RENAMED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
require('./pesquisa-fetcher-
|
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
|
|
4
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-7eddc221.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
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-b770fda0.js');
|
|
9
|
+
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
11
10
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
12
|
-
require('./form-config-fetcher-d73f4449.js');
|
|
13
11
|
const InMemoryFilterColumnDataSource = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
14
12
|
|
|
15
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -73,7 +71,7 @@ class CrudUtils {
|
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
73
|
return new Promise((resolve) => {
|
|
76
|
-
|
|
74
|
+
formConfigFetcher.DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
|
77
75
|
var _a;
|
|
78
76
|
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
|
79
77
|
if (entities != undefined) {
|
|
@@ -117,7 +115,7 @@ class SnkMultiSelectionListDataSource {
|
|
|
117
115
|
if (fieldName == undefined) {
|
|
118
116
|
return Promise.resolve(undefined);
|
|
119
117
|
}
|
|
120
|
-
return Promise.resolve(await
|
|
118
|
+
return Promise.resolve(await pesquisaFetcher.PreloadManager.getDistinct(this._dataUnit, fieldName));
|
|
121
119
|
}
|
|
122
120
|
fetchData(filterTerm, fieldName) {
|
|
123
121
|
return new Promise(resolve => {
|
|
@@ -137,33 +135,53 @@ class SnkMultiSelectionListDataSource {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
|
|
140
|
-
class
|
|
141
|
-
|
|
142
|
-
this.
|
|
138
|
+
class CommonsExporter {
|
|
139
|
+
constructor(dataUnit, grid) {
|
|
140
|
+
this.dataUnit = dataUnit;
|
|
141
|
+
this.grid = grid;
|
|
143
142
|
}
|
|
144
|
-
|
|
145
|
-
this._dataState = dataState;
|
|
146
|
-
}
|
|
147
|
-
format(currentValue, column, recordId) {
|
|
143
|
+
async getColumnsMetadata() {
|
|
148
144
|
var _a;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
153
|
-
const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
|
|
154
|
-
if (rmPrecision) {
|
|
155
|
-
return core.NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
return currentValue;
|
|
159
|
-
}
|
|
145
|
+
const columnsState = await ((_a = this.grid) === null || _a === void 0 ? void 0 : _a.getColumnsState());
|
|
146
|
+
return this.buildColumnsMetadata(columnsState);
|
|
160
147
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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 || [];
|
|
164
182
|
}
|
|
165
183
|
}
|
|
166
184
|
|
|
185
|
+
exports.CommonsExporter = CommonsExporter;
|
|
167
186
|
exports.CrudUtils = CrudUtils;
|
|
168
|
-
exports.RmPrecisionCustomValueFormatter = RmPrecisionCustomValueFormatter;
|
|
169
187
|
exports.SnkMultiSelectionListDataSource = SnkMultiSelectionListDataSource;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@sankhyalabs/core');
|
|
4
|
+
|
|
5
|
+
const getSelectedIDs = async (dataUnit) => {
|
|
6
|
+
const selectionInfo = dataUnit.getAsyncSelectionInfo();
|
|
7
|
+
if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
const selectedRecordsIDsInfo = [];
|
|
11
|
+
const selectedRecords = await (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.recordIds);
|
|
12
|
+
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
|
13
|
+
selectedRecords.forEach(recordId => {
|
|
14
|
+
if (!dataUnit.isNewRecord(recordId)) {
|
|
15
|
+
/*
|
|
16
|
+
Esse if foi necessário para tratar corretamente o ID
|
|
17
|
+
do record quando está sendo utilizado no modo standAlone
|
|
18
|
+
isso não faz a exportação da grid funcionar no modo standAlone
|
|
19
|
+
mas deixa de causar erro nas oprações de CRUD.
|
|
20
|
+
*/
|
|
21
|
+
if (!core.JSUtils.isBase64(recordId)) {
|
|
22
|
+
selectedRecordsIDsInfo.push({
|
|
23
|
+
name: "__record__id__",
|
|
24
|
+
type: core.DataType.TEXT,
|
|
25
|
+
value: recordId
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const revertBase64ToObject = JSON.parse(window.atob(recordId));
|
|
30
|
+
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
|
31
|
+
const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
|
|
32
|
+
if (metadataField == undefined) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return selectedRecordsIDsInfo;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.getSelectedIDs = getSelectedIDs;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
3
|
+
const ConfigStorage = require('./ConfigStorage-085c7117.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
5
|
+
const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
|
|
6
6
|
|
|
7
7
|
class SnkFormConfigManager {
|
|
8
8
|
constructor(configName, resourceID, onConfigChange) {
|
|
@@ -51,7 +51,6 @@ 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."
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
const snkFilterBarMessages = {
|
|
@@ -575,7 +574,7 @@ class SnkMessageBuilder {
|
|
|
575
574
|
this.loadAppMessages().then((msgs) => {
|
|
576
575
|
this._appMessages = msgs;
|
|
577
576
|
}, error => {
|
|
578
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
|
577
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js', error);
|
|
579
578
|
});
|
|
580
579
|
}
|
|
581
580
|
/**
|
|
@@ -667,10 +666,17 @@ class SnkMessageBuilder {
|
|
|
667
666
|
return message;
|
|
668
667
|
}
|
|
669
668
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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
|
+
});
|
|
674
680
|
}
|
|
675
681
|
}
|
|
676
682
|
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-
|
|
4
|
+
const formConfigFetcher = require('./form-config-fetcher-cdd644a7.js');
|
|
5
5
|
|
|
6
6
|
class AuthFetcher extends formConfigFetcher.ResourceFetcher {
|
|
7
7
|
getData(resourceID) {
|
|
@@ -7022,6 +7022,257 @@ 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
|
+
|
|
7025
7274
|
exports.DataFetcher = DataFetcher;
|
|
7275
|
+
exports.FormConfigFetcher = FormConfigFetcher;
|
|
7276
|
+
exports.ResourceFetcher = ResourceFetcher;
|
|
7026
7277
|
exports.UrlUtils = UrlUtils;
|
|
7027
7278
|
exports.dist = dist;
|