@sankhyalabs/sankhyablocks 8.15.0-dev.1 → 8.15.0-dev.11
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-0d507a8f.js → ConfigStorage-302bbbd4.js} +25 -15
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-467907f6.js → SnkFormConfigManager-71c4768e.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bdaf9482.js → pesquisa-fetcher-7a08d110.js} +205 -12
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +21 -5
- package/dist/cjs/snk-application.cjs.entry.js +65 -6
- package/dist/cjs/snk-attach.cjs.entry.js +395 -57
- package/dist/cjs/snk-crud.cjs.entry.js +5 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +33 -5
- package/dist/cjs/snk-filter-item.cjs.entry.js +47 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -2
- package/dist/cjs/snk-filter-modal.cjs.entry.js +14 -0
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +41 -18
- package/dist/cjs/{snk-guides-viewer-9342bca1.js → snk-guides-viewer-546509df.js} +6 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -7
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-b8c428a9.js → taskbar-elements-01b85b99.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +68 -5
- package/dist/collection/components/snk-attach/snk-attach.js +194 -38
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +47 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +65 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +0 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +62 -3
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-grid/snk-grid.js +39 -16
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +24 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -1
- package/dist/collection/lib/@types/index.js +1 -0
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +16 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +28 -11
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +1 -1
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/components/ConfigStorage.js +25 -15
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +44 -13
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +62 -2
- package/dist/components/snk-attach2.js +400 -56
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-filter-bar2.js +34 -5
- package/dist/components/snk-filter-item2.js +47 -1
- package/dist/components/snk-filter-modal-item2.js +0 -1
- package/dist/components/snk-filter-modal.js +18 -2
- package/dist/components/snk-grid2.js +38 -15
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/taskbar-actions-button2.js +19 -2
- package/dist/esm/{ConfigStorage-379a9cba.js → ConfigStorage-4151acc8.js} +25 -15
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-587e9030.js → SnkFormConfigManager-5c7d3771.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-cc1650eb.js → pesquisa-fetcher-d6ff9386.js} +206 -14
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +21 -5
- package/dist/esm/snk-application.entry.js +65 -6
- package/dist/esm/snk-attach.entry.js +396 -58
- package/dist/esm/snk-crud.entry.js +5 -6
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-filter-bar.entry.js +33 -5
- package/dist/esm/snk-filter-item.entry.js +47 -1
- package/dist/esm/snk-filter-modal-item.entry.js +1 -2
- package/dist/esm/snk-filter-modal.entry.js +14 -0
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +41 -18
- package/dist/esm/{snk-guides-viewer-9ce9588c.js → snk-guides-viewer-4e56a2e0.js} +6 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +4 -5
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-26c981af.js → taskbar-elements-d4d0b424.js} +1 -1
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/{p-729f5f5b.entry.js → p-1d75d9f9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-32460e98.entry.js +11 -0
- package/dist/sankhyablocks/p-374d03f6.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-40915359.entry.js} +1 -1
- package/dist/sankhyablocks/p-42af1bbf.js +65 -0
- package/dist/sankhyablocks/{p-2028633c.js → p-573a07c5.js} +1 -1
- package/dist/sankhyablocks/{p-953346b9.entry.js → p-69efa80d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-71439fd9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aaa1438e.entry.js → p-761ed32f.entry.js} +1 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +1 -0
- package/dist/sankhyablocks/p-7f3c7b09.entry.js +1 -0
- package/dist/sankhyablocks/p-8c74258e.entry.js +1 -0
- package/dist/sankhyablocks/p-8f0488b8.entry.js +1 -0
- package/dist/sankhyablocks/p-9ebcfeb6.entry.js +1 -0
- package/dist/sankhyablocks/p-a9e5b094.entry.js +1 -0
- package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
- package/dist/sankhyablocks/p-b05ab13d.entry.js +1 -0
- package/dist/sankhyablocks/p-c2137023.entry.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/p-d82f6eda.entry.js +1 -0
- package/dist/sankhyablocks/p-dcb6aad1.entry.js +1 -0
- package/dist/sankhyablocks/p-e0fd9555.entry.js +1 -0
- package/dist/sankhyablocks/p-e8812d8a.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +5 -2
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +28 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +14 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +5 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +2 -0
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +70 -13
- package/dist/types/lib/@types/index.d.ts +2 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +3 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +8 -6
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/sankhyablocks/p-145c4434.js +0 -1
- package/dist/sankhyablocks/p-17dda7a2.entry.js +0 -1
- package/dist/sankhyablocks/p-19f51c6b.entry.js +0 -11
- package/dist/sankhyablocks/p-311c6173.entry.js +0 -1
- package/dist/sankhyablocks/p-4396d1a6.js +0 -56
- package/dist/sankhyablocks/p-44e894af.entry.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-4b0ea83f.entry.js +0 -1
- package/dist/sankhyablocks/p-5534e08c.js +0 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +0 -1
- package/dist/sankhyablocks/p-9c3229fc.entry.js +0 -1
- package/dist/sankhyablocks/p-a037f5b4.entry.js +0 -1
- package/dist/sankhyablocks/p-a702a1a2.js +0 -60
- package/dist/sankhyablocks/p-c259545b.entry.js +0 -1
- package/dist/sankhyablocks/p-d1677df0.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-dd6a8377.js +0 -1
- package/dist/sankhyablocks/p-e138e7d4.entry.js +0 -1
- package/dist/sankhyablocks/p-e1b29d4c.entry.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DataType, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
1
|
+
import { DataType, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation, ApplicationContext, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
2
|
import { d as dist, D as DataFetcher } from './DataFetcher.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -576,13 +576,21 @@ class DatasetStrategy {
|
|
576
576
|
getFieldsList(dataUnit) {
|
577
577
|
let fields = ["__record__id__", "__record__label__"];
|
578
578
|
dataUnit.metadata.fields.forEach((descriptor) => {
|
579
|
-
if (descriptor.standAlone)
|
579
|
+
if (descriptor.standAlone)
|
580
580
|
return;
|
581
|
-
}
|
582
581
|
fields = fields.concat(this.getFieldNames(descriptor));
|
583
582
|
});
|
584
583
|
return fields;
|
585
584
|
}
|
585
|
+
getStandAloneFieldsList(dataUnit) {
|
586
|
+
let fields = {};
|
587
|
+
dataUnit.metadata.fields.forEach((currentField) => {
|
588
|
+
if (!currentField.standAlone)
|
589
|
+
return;
|
590
|
+
fields = Object.assign(Object.assign({}, fields), { [currentField.name]: { fieldType: currentField.dataType, userType: currentField.userInterface } });
|
591
|
+
});
|
592
|
+
return fields;
|
593
|
+
}
|
586
594
|
getFieldNames(descriptor) {
|
587
595
|
const descriptionField = this.getSearchDescriptionField(descriptor);
|
588
596
|
if (descriptionField == undefined) {
|
@@ -605,23 +613,25 @@ class DatasetStrategy {
|
|
605
613
|
totalRecordsCount: loadingInfo.count,
|
606
614
|
pagerID: loadingInfo.pagerId,
|
607
615
|
standAlone: false,
|
608
|
-
standAloneFieldsMD: {
|
609
|
-
__record__id__: { "fieldType": "S", "userType": "P" },
|
610
|
-
__record__label__: { "fieldType": "S", "userType": "P" }
|
611
|
-
},
|
616
|
+
standAloneFieldsMD: Object.assign({ __record__id__: { "fieldType": "S", "userType": "P" }, __record__label__: { "fieldType": "S", "userType": "P" } }, this.getStandAloneFieldsList(dataUnit)),
|
612
617
|
tryJoinedFields: true,
|
613
618
|
parallelLoader: useParallelLoader,
|
614
|
-
crudListener:
|
615
|
-
txProperties: this.getTxProperties(
|
619
|
+
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
620
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting),
|
616
621
|
useDefaultRowsLimit: false
|
617
622
|
}
|
618
623
|
};
|
619
624
|
return JSON.stringify(requestBody);
|
620
625
|
}
|
621
|
-
|
626
|
+
getModuleName() {
|
627
|
+
const app = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
628
|
+
const moduleName = app.getModuleName();
|
629
|
+
return moduleName.replace("-bff", "");
|
630
|
+
}
|
631
|
+
getTxProperties(dataUnit, request, sorting) {
|
622
632
|
var _a, _b;
|
623
633
|
const txProperties = {
|
624
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
634
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
625
635
|
};
|
626
636
|
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
627
637
|
if (serverSideFilters.length !== 0) {
|
@@ -633,6 +643,13 @@ class DatasetStrategy {
|
|
633
643
|
if (request.parentRecordId != undefined) {
|
634
644
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
635
645
|
}
|
646
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
647
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
648
|
+
return txProperties;
|
649
|
+
}
|
650
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
651
|
+
txProperties[name] = value;
|
652
|
+
});
|
636
653
|
return txProperties;
|
637
654
|
}
|
638
655
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -962,6 +979,19 @@ class DataUnitFetcher {
|
|
962
979
|
});
|
963
980
|
});
|
964
981
|
}
|
982
|
+
addTransientProperties(dataUnit, updatingFields) {
|
983
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
984
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
985
|
+
return updatingFields;
|
986
|
+
}
|
987
|
+
if (updatingFields == undefined) {
|
988
|
+
updatingFields = {};
|
989
|
+
}
|
990
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
991
|
+
updatingFields[`transient.${name}`] = value;
|
992
|
+
});
|
993
|
+
return updatingFields;
|
994
|
+
}
|
965
995
|
saveData(dataUnit, duChanges) {
|
966
996
|
const updatedRecordsIds = [];
|
967
997
|
const addedRecordsIds = [];
|
@@ -970,7 +1000,7 @@ class DataUnitFetcher {
|
|
970
1000
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
971
1001
|
let parsedUpdatingFields;
|
972
1002
|
if (updatingFields) {
|
973
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
1003
|
+
parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
|
974
1004
|
const descriptor = dataUnitInstance.getField(fieldName);
|
975
1005
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
976
1006
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
@@ -1017,7 +1047,8 @@ class DataUnitFetcher {
|
|
1017
1047
|
}
|
1018
1048
|
responseRecord.fields.forEach(({ name, value }) => {
|
1019
1049
|
var _a;
|
1020
|
-
|
1050
|
+
const valueFromString = (_a = dataUnitInstance === null || dataUnitInstance === void 0 ? void 0 : dataUnitInstance.valueFromString) === null || _a === void 0 ? void 0 : _a.call(dataUnitInstance, name, value);
|
1051
|
+
duRecord[name] = (valueFromString !== undefined) ? valueFromString : value;
|
1021
1052
|
});
|
1022
1053
|
dataUnitRecords.push(duRecord);
|
1023
1054
|
});
|
@@ -2,6 +2,7 @@ var PresentationMode;
|
|
2
2
|
(function (PresentationMode) {
|
3
3
|
PresentationMode["PRIMARY"] = "primary";
|
4
4
|
PresentationMode["SECONDARY"] = "secondary";
|
5
|
+
PresentationMode["SINGLE_TASKBAR"] = "singleTaskbar";
|
5
6
|
})(PresentationMode || (PresentationMode = {}));
|
6
7
|
var DataExporterOption;
|
7
8
|
(function (DataExporterOption) {
|
@@ -163,6 +163,7 @@ var SaveErrorsEnum;
|
|
163
163
|
SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
|
164
164
|
SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
|
165
165
|
SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
166
|
+
SaveErrorsEnum["DESCRIPTION_CANNOT_BE_CHANGED"] = "DESCRIPTION_CANNOT_BE_CHANGED";
|
166
167
|
})(SaveErrorsEnum || (SaveErrorsEnum = {}));
|
167
168
|
|
168
169
|
const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
2
|
+
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
|
@@ -818,11 +818,53 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
818
818
|
return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
|
819
819
|
}
|
820
820
|
}
|
821
|
+
filterInvalidFields(resp, item, mdByName) {
|
822
|
+
let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
|
823
|
+
let accept = !StringUtils.isEmpty(item[field.fieldName]) &&
|
824
|
+
field.visible !== false &&
|
825
|
+
field.type !== 'B' &&
|
826
|
+
resp.pkField !== field.fieldName &&
|
827
|
+
resp.descriptionField !== field.fieldName &&
|
828
|
+
(field.isPrimaryKey || !field.isLinkField) &&
|
829
|
+
!(field.type === 'S' && field.presentationType === 'H');
|
830
|
+
if (accept) {
|
831
|
+
mdByName[field.fieldName] = field;
|
832
|
+
}
|
833
|
+
//Condição que trata o problema de trazer imagem no entityCard na pesquisa de registros
|
834
|
+
if (typeof item[field.fieldName] === 'string' && (item[field.fieldName].indexOf('<img') > -1 || item[field.fieldName].indexOf('<svg') > -1)) {
|
835
|
+
return false;
|
836
|
+
}
|
837
|
+
return accept;
|
838
|
+
});
|
839
|
+
return fieldsMetadata;
|
840
|
+
}
|
841
|
+
filterMathFields(matchFields, fields, qtyFields, mdByName) {
|
842
|
+
if (matchFields && Array.isArray(matchFields)) {
|
843
|
+
matchFields.forEach((matchField) => {
|
844
|
+
let fieldMD = ArrayUtils.removeReference(fields, mdByName[matchField]);
|
845
|
+
if (fieldMD) {
|
846
|
+
fields.unshift(fieldMD);
|
847
|
+
}
|
848
|
+
});
|
849
|
+
}
|
850
|
+
fields = fields.slice(0, qtyFields);
|
851
|
+
return fields;
|
852
|
+
}
|
853
|
+
builOptionItem(argument, item, fields, descriptionField, pkField) {
|
854
|
+
var _a;
|
855
|
+
let exibitionItem = {
|
856
|
+
value: StringUtils.highlightValue(argument, item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
|
857
|
+
label: descriptionField ? StringUtils.highlightValue(argument, item['__matchFields'], item[descriptionField], fields, true) : "",
|
858
|
+
details: SearchUtils.buildDetails(argument, fields, item)
|
859
|
+
};
|
860
|
+
return exibitionItem;
|
861
|
+
}
|
821
862
|
/**
|
822
863
|
* Obtém as opções em componentes de pesquisa
|
823
864
|
* Ex.: snk-config-options
|
824
865
|
*/
|
825
866
|
async executePreparedSearch(mode, argument, options) {
|
867
|
+
const mdByName = {};
|
826
868
|
const { entity, entityDescription, criteria, searchOptions } = options;
|
827
869
|
if (mode === "ADVANCED") {
|
828
870
|
return new Promise(accept => {
|
@@ -840,7 +882,25 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
840
882
|
});
|
841
883
|
}
|
842
884
|
else {
|
843
|
-
return
|
885
|
+
return new Promise((resolve, reject) => {
|
886
|
+
this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
|
887
|
+
.then(result => {
|
888
|
+
result = ObjectUtils.stringToObject(result.json.$);
|
889
|
+
let descriptionField = result.descriptionField;
|
890
|
+
let pkField = result.pkField;
|
891
|
+
const list = [];
|
892
|
+
result.data.forEach((item) => {
|
893
|
+
let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
|
894
|
+
let qtyFields = 6;
|
895
|
+
let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
|
896
|
+
list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
|
897
|
+
});
|
898
|
+
resolve(list);
|
899
|
+
})
|
900
|
+
.catch(error => {
|
901
|
+
reject(error);
|
902
|
+
});
|
903
|
+
});
|
844
904
|
}
|
845
905
|
}
|
846
906
|
/**
|