@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-57523.0 → 0.0.0-bugfix-dev-59880.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-7df9d3bb.js → ConfigStorage-9a53a42c.js} +12 -11
- package/dist/cjs/{form-config-fetcher-3c4daeb5.js → DataFetcher-515bda03.js} +0 -251
- package/dist/cjs/{IExporterProvider-c307e2b1.js → IExporterProvider-e286ef6a.js} +55 -12
- package/dist/cjs/{SnkFormConfigManager-4259edbe.js → SnkFormConfigManager-7b222c78.js} +4 -4
- package/dist/cjs/{SnkMessageBuilder-66aa2557.js → SnkMessageBuilder-4a95fe86.js} +6 -12
- package/dist/cjs/{auth-fetcher-e6112be7.js → auth-fetcher-5acb0335.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-cbdaba63.js → dataunit-fetcher-7a08e4dd.js} +74 -175
- package/dist/cjs/form-config-fetcher-3f430aee.js +256 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-fetcher-916a935c.js +166 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +10 -8
- package/dist/cjs/snk-application.cjs.entry.js +49 -39
- package/dist/cjs/snk-attach.cjs.entry.js +19 -17
- package/dist/cjs/snk-crud.cjs.entry.js +95 -10
- package/dist/cjs/snk-data-exporter.cjs.entry.js +11 -9
- package/dist/cjs/snk-data-unit-3718477f.js +670 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +10 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +48 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +8 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +53 -7
- package/dist/cjs/snk-grid.cjs.entry.js +103 -11
- package/dist/cjs/{snk-guides-viewer-b0c44e0c.js → snk-guides-viewer-66dd6949.js} +36 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +153 -14
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +37 -17
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +230 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +135 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +112 -5
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +14 -8
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +5 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +499 -176
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +22 -1
- package/dist/collection/components/snk-form/snk-form.js +101 -4
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +2 -2
- package/dist/collection/components/snk-grid/snk-grid.js +219 -8
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +283 -9
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +6 -2
- package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +51 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +25 -32
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
- package/dist/components/ConfigStorage.js +2 -1
- package/dist/components/DataFetcher.js +7024 -0
- package/dist/components/IExporterProvider.js +54 -12
- package/dist/components/SnkFormConfigManager.js +2 -2
- package/dist/components/SnkMessageBuilder.js +6 -12
- package/dist/components/dataunit-fetcher.js +64 -166
- package/dist/components/form-config-fetcher.js +3 -7023
- package/dist/components/pesquisa-fetcher.js +164 -0
- package/dist/components/snk-actions-button2.js +4 -2
- package/dist/components/snk-application2.js +26 -17
- package/dist/components/snk-attach2.js +4 -2
- package/dist/components/snk-crud.js +101 -10
- package/dist/components/snk-data-exporter2.js +6 -4
- package/dist/components/snk-data-unit2.js +424 -177
- package/dist/components/snk-detail-view2.js +87 -9
- package/dist/components/snk-filter-bar2.js +6 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form-view2.js +72 -1
- package/dist/components/snk-form.js +52 -5
- package/dist/components/snk-grid2.js +109 -12
- package/dist/components/snk-simple-crud2.js +157 -11
- package/dist/esm/{ConfigStorage-928c3bf4.js → ConfigStorage-174101b9.js} +2 -1
- package/dist/esm/{form-config-fetcher-e3094014.js → DataFetcher-4b4b7beb.js} +1 -250
- package/dist/esm/{IExporterProvider-e2a1195d.js → IExporterProvider-cf5a56ee.js} +54 -12
- package/dist/esm/{SnkFormConfigManager-a87ade7a.js → SnkFormConfigManager-3bdb3e1f.js} +4 -4
- package/dist/esm/{SnkMessageBuilder-0a4becdd.js → SnkMessageBuilder-3a767111.js} +6 -12
- package/dist/esm/{auth-fetcher-e1cb288f.js → auth-fetcher-9f86c346.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-6d8e50bb.js → dataunit-fetcher-f3fa35b9.js} +63 -165
- package/dist/esm/form-config-fetcher-5d72aaf1.js +253 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-9cfab836.js +164 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -3
- package/dist/esm/snk-application.entry.js +30 -20
- package/dist/esm/snk-attach.entry.js +5 -3
- package/dist/esm/snk-crud.entry.js +95 -10
- package/dist/esm/snk-data-exporter.entry.js +8 -6
- package/dist/esm/snk-data-unit-8d6afa43.js +668 -0
- package/dist/esm/snk-data-unit.entry.js +10 -2
- package/dist/esm/snk-detail-view.entry.js +48 -7
- package/dist/esm/snk-filter-bar.entry.js +8 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -2
- package/dist/esm/snk-form-config.entry.js +2 -1
- package/dist/esm/snk-form-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +53 -7
- package/dist/esm/snk-grid.entry.js +104 -12
- package/dist/esm/{snk-guides-viewer-1fd41a25.js → snk-guides-viewer-11cf8dc7.js} +36 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -2
- package/dist/esm/snk-simple-crud.entry.js +153 -14
- package/dist/sankhyablocks/p-010d475f.js +1 -0
- package/dist/sankhyablocks/p-0a28cb19.entry.js +1 -0
- package/dist/sankhyablocks/p-188e1432.entry.js +1 -0
- package/dist/sankhyablocks/p-1c6debe6.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/p-2a84e45b.entry.js +1 -0
- package/dist/sankhyablocks/p-2cc2d8fd.entry.js +1 -0
- package/dist/sankhyablocks/p-3e4c2cfe.entry.js +11 -0
- package/dist/sankhyablocks/p-4a8a149d.entry.js +1 -0
- package/dist/sankhyablocks/p-4ce73e88.js +1 -0
- package/dist/sankhyablocks/p-50e72d6c.js +1 -0
- package/dist/sankhyablocks/{p-e27496ed.js → p-566f5f50.js} +6 -6
- package/dist/sankhyablocks/p-59dccb7a.entry.js +1 -0
- package/dist/sankhyablocks/p-5bd78e4c.entry.js +1 -0
- package/dist/sankhyablocks/p-6b2be902.js +6 -0
- package/dist/sankhyablocks/p-8171e586.entry.js +1 -0
- package/dist/sankhyablocks/p-a6dfa396.js +1 -0
- package/dist/sankhyablocks/p-a97060b0.js +1 -0
- package/dist/sankhyablocks/p-aa854fa8.entry.js +1 -0
- package/dist/sankhyablocks/p-b27114c4.js +1 -0
- package/dist/sankhyablocks/p-b643f746.entry.js +1 -0
- package/dist/sankhyablocks/p-b68918fc.entry.js +1 -0
- package/dist/sankhyablocks/p-da7c81d6.entry.js +1 -0
- package/dist/sankhyablocks/p-e0c27486.js +26 -0
- package/dist/sankhyablocks/p-e238279a.entry.js +1 -0
- package/dist/sankhyablocks/p-eae66367.js +1 -0
- package/dist/sankhyablocks/p-fde91811.js +60 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +6 -2
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +32 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +19 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +3 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +61 -2
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +14 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +42 -3
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +40 -2
- package/dist/types/components.d.ts +180 -4
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/snk-data-unit-abd2113f.js +0 -427
- package/dist/esm/snk-data-unit-29eba11a.js +0 -425
- package/dist/sankhyablocks/p-029bfc09.js +0 -1
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- package/dist/sankhyablocks/p-07825198.js +0 -1
- package/dist/sankhyablocks/p-0e8702f0.js +0 -1
- package/dist/sankhyablocks/p-13ea113d.entry.js +0 -1
- package/dist/sankhyablocks/p-314e2d1a.entry.js +0 -1
- package/dist/sankhyablocks/p-32556aa6.js +0 -1
- package/dist/sankhyablocks/p-3357af48.js +0 -1
- package/dist/sankhyablocks/p-3c2a1f4d.js +0 -65
- package/dist/sankhyablocks/p-3e7167dd.js +0 -1
- package/dist/sankhyablocks/p-536eeb16.js +0 -26
- package/dist/sankhyablocks/p-587f9dcf.entry.js +0 -1
- package/dist/sankhyablocks/p-61984566.entry.js +0 -1
- package/dist/sankhyablocks/p-61b6126e.entry.js +0 -1
- package/dist/sankhyablocks/p-65b6dba3.entry.js +0 -1
- package/dist/sankhyablocks/p-6a7bc5c8.entry.js +0 -1
- package/dist/sankhyablocks/p-6c9edfd8.entry.js +0 -1
- package/dist/sankhyablocks/p-89bde7d3.entry.js +0 -1
- package/dist/sankhyablocks/p-91dceecf.entry.js +0 -1
- package/dist/sankhyablocks/p-a40cbad8.entry.js +0 -1
- package/dist/sankhyablocks/p-b86ea293.entry.js +0 -1
- package/dist/sankhyablocks/p-d8ddb2a4.entry.js +0 -11
- package/dist/sankhyablocks/p-f92f1f5f.entry.js +0 -1
- package/dist/sankhyablocks/p-fa84e72f.entry.js +0 -1
|
@@ -7021,253 +7021,4 @@ class WaitingRequest {
|
|
|
7021
7021
|
}
|
|
7022
7022
|
}
|
|
7023
7023
|
|
|
7024
|
-
|
|
7025
|
-
constructor() {
|
|
7026
|
-
this.templateByQuery = new Map();
|
|
7027
|
-
this.buldTemplates();
|
|
7028
|
-
}
|
|
7029
|
-
buldTemplates() {
|
|
7030
|
-
this.templateByQuery.set("fetchResource", dist.gql `query($name: String!) {
|
|
7031
|
-
$queryAlias$: fetchResource(name: $name){
|
|
7032
|
-
resource
|
|
7033
|
-
}
|
|
7034
|
-
}`);
|
|
7035
|
-
this.templateByQuery.set("saveResource", dist.gql `mutation($resource: InputResource!) {
|
|
7036
|
-
$queryAlias$: saveResource(resource: $resource){
|
|
7037
|
-
name
|
|
7038
|
-
resource
|
|
7039
|
-
}
|
|
7040
|
-
}`);
|
|
7041
|
-
}
|
|
7042
|
-
loadResource(name) {
|
|
7043
|
-
if (ResourceFetcher._loadingResource.has(name)) {
|
|
7044
|
-
return ResourceFetcher._loadingResource.get(name);
|
|
7045
|
-
}
|
|
7046
|
-
const promiseLoadResource = new Promise((resolve, reject) => {
|
|
7047
|
-
DataFetcher.get()
|
|
7048
|
-
.callGraphQL({
|
|
7049
|
-
values: { name },
|
|
7050
|
-
query: this.templateByQuery.get("fetchResource"),
|
|
7051
|
-
})
|
|
7052
|
-
.then((result) => {
|
|
7053
|
-
resolve(result === null || result === void 0 ? void 0 : result.resource);
|
|
7054
|
-
ResourceFetcher._loadingResource.delete(name);
|
|
7055
|
-
})
|
|
7056
|
-
.catch((error) => {
|
|
7057
|
-
reject(error);
|
|
7058
|
-
ResourceFetcher._loadingResource.delete(name);
|
|
7059
|
-
});
|
|
7060
|
-
});
|
|
7061
|
-
ResourceFetcher._loadingResource.set(name, promiseLoadResource);
|
|
7062
|
-
return promiseLoadResource;
|
|
7063
|
-
}
|
|
7064
|
-
saveResource(resource, name) {
|
|
7065
|
-
return new Promise((resolve, reject) => {
|
|
7066
|
-
DataFetcher.get()
|
|
7067
|
-
.callGraphQL({
|
|
7068
|
-
values: {
|
|
7069
|
-
resource: {
|
|
7070
|
-
name: name,
|
|
7071
|
-
resource: JSON.stringify(resource)
|
|
7072
|
-
}
|
|
7073
|
-
},
|
|
7074
|
-
query: this.templateByQuery.get("saveResource")
|
|
7075
|
-
})
|
|
7076
|
-
.then((resp) => {
|
|
7077
|
-
resolve(resp);
|
|
7078
|
-
})
|
|
7079
|
-
.catch((error) => {
|
|
7080
|
-
reject(error);
|
|
7081
|
-
});
|
|
7082
|
-
});
|
|
7083
|
-
}
|
|
7084
|
-
}
|
|
7085
|
-
ResourceFetcher._loadingResource = new Map();
|
|
7086
|
-
|
|
7087
|
-
class FormConfigFetcher extends ResourceFetcher {
|
|
7088
|
-
constructor() {
|
|
7089
|
-
super();
|
|
7090
|
-
this.queryConfig = new Map();
|
|
7091
|
-
this.buildTemplatesConfig();
|
|
7092
|
-
}
|
|
7093
|
-
buildTemplatesConfig() {
|
|
7094
|
-
this.queryConfig.set("fetchUserAvailableConfigs", dist.gql `query($name: String!) {
|
|
7095
|
-
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
|
7096
|
-
name
|
|
7097
|
-
origin
|
|
7098
|
-
key
|
|
7099
|
-
}
|
|
7100
|
-
}`);
|
|
7101
|
-
this.queryConfig.set("fetchLegacyConfig", dist.gql `query($name: String!) {
|
|
7102
|
-
$queryAlias$: fetchLegacyConfig(name: $name){
|
|
7103
|
-
name
|
|
7104
|
-
resource
|
|
7105
|
-
}
|
|
7106
|
-
}`);
|
|
7107
|
-
this.queryConfig.set("fetchDefaultConfig", dist.gql `query($name: String!) {
|
|
7108
|
-
$queryAlias$: fetchDefaultConfig(name: $name){
|
|
7109
|
-
name
|
|
7110
|
-
resource
|
|
7111
|
-
}
|
|
7112
|
-
}`);
|
|
7113
|
-
}
|
|
7114
|
-
loadFormConfig(formName, resourceID) {
|
|
7115
|
-
return new Promise((accept, reject) => {
|
|
7116
|
-
Promise.all([
|
|
7117
|
-
this.loadResource(this.getPath(resourceID, formName)),
|
|
7118
|
-
this.loadResource(this.getPath(`FormCardState:${resourceID}`, formName, "form-card")),
|
|
7119
|
-
this.loadResource(this.getPath(resourceID, formName, "summary")),
|
|
7120
|
-
this.loadResource(this.getPath(resourceID, formName, "defaultValues"))
|
|
7121
|
-
])
|
|
7122
|
-
.then(([configAsString, formCardState, summary, defaultValues]) => {
|
|
7123
|
-
let config;
|
|
7124
|
-
if (configAsString != undefined) {
|
|
7125
|
-
config = Object.assign(Object.assign({}, JSON.parse(configAsString)), { emptyConfig: false });
|
|
7126
|
-
const { tabs, fields } = config;
|
|
7127
|
-
if (tabs) {
|
|
7128
|
-
const allTabs = new Map(tabs.map(t => [t.label, t]));
|
|
7129
|
-
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)); });
|
|
7130
|
-
}
|
|
7131
|
-
config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
7132
|
-
if ("readonly" in field) {
|
|
7133
|
-
const readOnly = field['readonly'] === true;
|
|
7134
|
-
delete field['readonly'];
|
|
7135
|
-
field.readOnly = readOnly;
|
|
7136
|
-
}
|
|
7137
|
-
return field;
|
|
7138
|
-
});
|
|
7139
|
-
}
|
|
7140
|
-
if (formCardState != undefined) {
|
|
7141
|
-
if (config == undefined) {
|
|
7142
|
-
config = { emptyConfig: true, fields: [] };
|
|
7143
|
-
}
|
|
7144
|
-
config.cardsState = new Map(JSON.parse(formCardState));
|
|
7145
|
-
}
|
|
7146
|
-
if (summary != undefined) {
|
|
7147
|
-
if (config == undefined) {
|
|
7148
|
-
config = { emptyConfig: true, fields: [] };
|
|
7149
|
-
}
|
|
7150
|
-
config.summary = new Map(Object.entries(JSON.parse(summary)));
|
|
7151
|
-
}
|
|
7152
|
-
if (defaultValues != undefined) {
|
|
7153
|
-
if (config == undefined) {
|
|
7154
|
-
config = { emptyConfig: true, fields: [] };
|
|
7155
|
-
}
|
|
7156
|
-
config.defaultVars = new Map(Object.entries(JSON.parse(defaultValues)));
|
|
7157
|
-
}
|
|
7158
|
-
accept(config);
|
|
7159
|
-
})
|
|
7160
|
-
.catch((error) => {
|
|
7161
|
-
reject(error);
|
|
7162
|
-
});
|
|
7163
|
-
});
|
|
7164
|
-
}
|
|
7165
|
-
getTabName(tab) {
|
|
7166
|
-
if (typeof tab === 'object') { // ITabConfig type
|
|
7167
|
-
return tab.label;
|
|
7168
|
-
}
|
|
7169
|
-
return tab; //string type
|
|
7170
|
-
}
|
|
7171
|
-
saveCardState(cardsState, formName, resourceID) {
|
|
7172
|
-
const completePath = this.getPath(`FormCardState:${resourceID}`, formName, "form-card");
|
|
7173
|
-
return new Promise((resolve, reject) => {
|
|
7174
|
-
this.saveResource(Array.from(cardsState.entries()), completePath)
|
|
7175
|
-
.then((resp) => {
|
|
7176
|
-
resolve(new Map(JSON.parse(resp.resource)));
|
|
7177
|
-
})
|
|
7178
|
-
.catch((error) => {
|
|
7179
|
-
reject(error);
|
|
7180
|
-
});
|
|
7181
|
-
});
|
|
7182
|
-
}
|
|
7183
|
-
saveConfig(config, formName, resourceID) {
|
|
7184
|
-
//Essas informações não devem ser salvas na configuração
|
|
7185
|
-
delete config.cardsState;
|
|
7186
|
-
delete config.defaultVars;
|
|
7187
|
-
delete config.summary;
|
|
7188
|
-
const completePath = this.getPath(resourceID, formName);
|
|
7189
|
-
return new Promise((resolve, reject) => {
|
|
7190
|
-
this.saveResource(config, completePath)
|
|
7191
|
-
.then((resp) => {
|
|
7192
|
-
resolve(JSON.parse(resp.resource));
|
|
7193
|
-
})
|
|
7194
|
-
.catch((error) => {
|
|
7195
|
-
reject(error);
|
|
7196
|
-
});
|
|
7197
|
-
});
|
|
7198
|
-
}
|
|
7199
|
-
fetchUserAvailableConfigs(formName, resourceID) {
|
|
7200
|
-
const name = this.getPath(resourceID, formName);
|
|
7201
|
-
return new Promise((resolve, reject) => {
|
|
7202
|
-
DataFetcher.get()
|
|
7203
|
-
.callGraphQL({
|
|
7204
|
-
values: { name },
|
|
7205
|
-
query: this.queryConfig.get("fetchUserAvailableConfigs"),
|
|
7206
|
-
})
|
|
7207
|
-
.then((result) => {
|
|
7208
|
-
resolve(result);
|
|
7209
|
-
})
|
|
7210
|
-
.catch((error) => {
|
|
7211
|
-
reject(error);
|
|
7212
|
-
});
|
|
7213
|
-
});
|
|
7214
|
-
}
|
|
7215
|
-
fetchLegacyConfig(formName, resourceID) {
|
|
7216
|
-
const name = this.getPath(resourceID, formName);
|
|
7217
|
-
return new Promise((resolve, reject) => {
|
|
7218
|
-
DataFetcher.get()
|
|
7219
|
-
.callGraphQL({
|
|
7220
|
-
values: { name },
|
|
7221
|
-
query: this.queryConfig.get("fetchLegacyConfig"),
|
|
7222
|
-
})
|
|
7223
|
-
.then((result) => {
|
|
7224
|
-
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
7225
|
-
})
|
|
7226
|
-
.catch((error) => {
|
|
7227
|
-
reject(error);
|
|
7228
|
-
});
|
|
7229
|
-
});
|
|
7230
|
-
}
|
|
7231
|
-
fetchDefaultConfig(formName, resourceID) {
|
|
7232
|
-
const name = this.getPath(resourceID, formName);
|
|
7233
|
-
return new Promise((resolve, reject) => {
|
|
7234
|
-
DataFetcher.get()
|
|
7235
|
-
.callGraphQL({
|
|
7236
|
-
values: { name },
|
|
7237
|
-
query: this.queryConfig.get("fetchDefaultConfig"),
|
|
7238
|
-
})
|
|
7239
|
-
.then((result) => {
|
|
7240
|
-
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
7241
|
-
})
|
|
7242
|
-
.catch((error) => {
|
|
7243
|
-
reject(error);
|
|
7244
|
-
});
|
|
7245
|
-
});
|
|
7246
|
-
}
|
|
7247
|
-
getPath(resourceID, name, authority = "form") {
|
|
7248
|
-
if (name) {
|
|
7249
|
-
return `cfg://${authority}/${resourceID}/${name}`;
|
|
7250
|
-
}
|
|
7251
|
-
return `cfg://${authority}/${resourceID}`;
|
|
7252
|
-
}
|
|
7253
|
-
async fetchLegacyConfigurableForm(configName) {
|
|
7254
|
-
const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
|
|
7255
|
-
const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
|
7256
|
-
if (ObjectUtils.isEmpty(response))
|
|
7257
|
-
return undefined;
|
|
7258
|
-
return this.buildLegacyConfigurableForm(response);
|
|
7259
|
-
}
|
|
7260
|
-
buildLegacyConfigurableForm(config) {
|
|
7261
|
-
var _a, _b, _c;
|
|
7262
|
-
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 : [];
|
|
7263
|
-
return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
|
|
7264
|
-
}
|
|
7265
|
-
}
|
|
7266
|
-
var UserConfigType;
|
|
7267
|
-
(function (UserConfigType) {
|
|
7268
|
-
UserConfigType["USER"] = "USER";
|
|
7269
|
-
UserConfigType["DEFAULT"] = "DEFAULT";
|
|
7270
|
-
UserConfigType["SHARED"] = "SHARED";
|
|
7271
|
-
})(UserConfigType || (UserConfigType = {}));
|
|
7272
|
-
|
|
7273
|
-
export { DataFetcher as D, FormConfigFetcher as F, ResourceFetcher as R, UrlUtils as U, UserConfigType as a, dist as d };
|
|
7024
|
+
export { DataFetcher as D, UrlUtils as U, dist as d };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { D as DataFetcher } from './
|
|
2
|
-
import
|
|
3
|
-
import { SortMode, ApplicationContext, UserInterface, DateUtils, DataType } from '@sankhyalabs/core';
|
|
1
|
+
import { D as DataFetcher } from './DataFetcher-4b4b7beb.js';
|
|
2
|
+
import './pesquisa-fetcher-9cfab836.js';
|
|
3
|
+
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
|
4
4
|
import './index-0ece87a6.js';
|
|
5
5
|
import './ISave-d8c8bc59.js';
|
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
7
7
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
8
|
+
import { P as PreloadManager } from './dataunit-fetcher-f3fa35b9.js';
|
|
8
9
|
import './filter-item-type.enum-d45e026f.js';
|
|
10
|
+
import './form-config-fetcher-5d72aaf1.js';
|
|
9
11
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
|
10
12
|
|
|
11
13
|
class CrudUtils {
|
|
@@ -129,6 +131,41 @@ class SnkMultiSelectionListDataSource {
|
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
class RmPrecisionCustomValueFormatter {
|
|
135
|
+
setGrid(grid) {
|
|
136
|
+
if (this._grid) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this._grid = grid;
|
|
140
|
+
this.refreshSelectedRows();
|
|
141
|
+
}
|
|
142
|
+
setDataState(dataState) {
|
|
143
|
+
if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this._dataState = dataState;
|
|
147
|
+
this.refreshSelectedRows();
|
|
148
|
+
}
|
|
149
|
+
format(currentValue, column, recordId) {
|
|
150
|
+
var _a;
|
|
151
|
+
if (!currentValue) {
|
|
152
|
+
return currentValue;
|
|
153
|
+
}
|
|
154
|
+
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
155
|
+
const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
|
|
156
|
+
if (rmPrecision || rmPrecision === 0) {
|
|
157
|
+
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return currentValue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
refreshSelectedRows() {
|
|
164
|
+
var _a;
|
|
165
|
+
(_a = this._grid) === null || _a === void 0 ? void 0 : _a.refreshSelectedRows();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
132
169
|
class CommonsExporter {
|
|
133
170
|
constructor(dataUnit, grid) {
|
|
134
171
|
this.dataUnit = dataUnit;
|
|
@@ -136,26 +173,31 @@ class CommonsExporter {
|
|
|
136
173
|
}
|
|
137
174
|
async getColumnsMetadata() {
|
|
138
175
|
var _a;
|
|
139
|
-
|
|
140
|
-
return this.buildColumnsMetadata(columnsState);
|
|
176
|
+
this.columnsState = await ((_a = this.grid) === null || _a === void 0 ? void 0 : _a.getColumnsState()) || [];
|
|
177
|
+
return await this.buildColumnsMetadata(this.columnsState);
|
|
178
|
+
}
|
|
179
|
+
getColumnsState() {
|
|
180
|
+
return this.columnsState;
|
|
141
181
|
}
|
|
142
|
-
buildColumnsMetadata(gridColumns) {
|
|
182
|
+
async buildColumnsMetadata(gridColumns) {
|
|
183
|
+
var _a, _b;
|
|
143
184
|
const columnsMetadata = [];
|
|
144
|
-
|
|
145
|
-
var _a, _b;
|
|
185
|
+
for (const column of gridColumns) {
|
|
146
186
|
/**
|
|
147
187
|
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
|
148
188
|
*/
|
|
149
189
|
if (column.hidden && column.name !== "RECDESP") {
|
|
150
|
-
|
|
190
|
+
continue;
|
|
151
191
|
}
|
|
152
192
|
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
|
193
|
+
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
|
153
194
|
const columnData = {
|
|
154
195
|
label: column.label,
|
|
155
196
|
id: column.name,
|
|
156
197
|
width: (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface$1.SEARCH ? 30 : column.width,
|
|
157
198
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
|
158
|
-
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
|
199
|
+
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
|
200
|
+
customFormatter
|
|
159
201
|
};
|
|
160
202
|
columnsMetadata.push(columnData);
|
|
161
203
|
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
|
@@ -171,9 +213,9 @@ class CommonsExporter {
|
|
|
171
213
|
};
|
|
172
214
|
columnsMetadata.push(descriptionColumn);
|
|
173
215
|
}
|
|
174
|
-
}
|
|
216
|
+
}
|
|
175
217
|
return columnsMetadata || [];
|
|
176
218
|
}
|
|
177
219
|
}
|
|
178
220
|
|
|
179
|
-
export { CommonsExporter as C, SnkMultiSelectionListDataSource as S, CrudUtils as a };
|
|
221
|
+
export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, CrudUtils as a };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-174101b9.js';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-5d72aaf1.js';
|
|
4
4
|
|
|
5
5
|
class SnkFormConfigManager {
|
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
|
@@ -72,11 +72,11 @@ class SnkFormConfigManager {
|
|
|
72
72
|
var _a;
|
|
73
73
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
|
75
|
-
return fields.map(({ label, name, readOnly }) => {
|
|
75
|
+
return fields.map(({ label, name, readOnly, visible }) => {
|
|
76
76
|
if (label == undefined) {
|
|
77
77
|
return dataUnit.getField(name);
|
|
78
78
|
}
|
|
79
|
-
return { name, label, readOnly };
|
|
79
|
+
return { name, label, readOnly, visible };
|
|
80
80
|
})
|
|
81
81
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
|
82
82
|
}
|
|
@@ -29,6 +29,7 @@ const snkDataUnitMessages = {
|
|
|
29
29
|
forbiddenRemove: "Não é possível remover. Verifique as permissões de acesso.",
|
|
30
30
|
removeAllConfirmation: "Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",
|
|
31
31
|
removeAllInfo: "Os {{size}} registros foram removidos com sucesso!",
|
|
32
|
+
fieldNameRequired: "É necessário informar o nome da coluna."
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const snkFilterBarMessages = {
|
|
@@ -552,7 +553,7 @@ class SnkMessageBuilder {
|
|
|
552
553
|
this.loadAppMessages().then((msgs) => {
|
|
553
554
|
this._appMessages = msgs;
|
|
554
555
|
}, error => {
|
|
555
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages
|
|
556
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
|
556
557
|
});
|
|
557
558
|
}
|
|
558
559
|
/**
|
|
@@ -644,17 +645,10 @@ class SnkMessageBuilder {
|
|
|
644
645
|
return message;
|
|
645
646
|
}
|
|
646
647
|
}
|
|
647
|
-
loadAppMessages() {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
.then(module => {
|
|
652
|
-
accept(module.default);
|
|
653
|
-
})
|
|
654
|
-
.catch(reason => {
|
|
655
|
-
reject(reason);
|
|
656
|
-
});
|
|
657
|
-
});
|
|
648
|
+
async loadAppMessages() {
|
|
649
|
+
const messagesUrl = await this._application.getApplicationPath();
|
|
650
|
+
const module = await import(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`);
|
|
651
|
+
return module.default;
|
|
658
652
|
}
|
|
659
653
|
}
|
|
660
654
|
var OperationMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-5d72aaf1.js';
|
|
3
3
|
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
|
5
5
|
getData(resourceID) {
|