@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-38445.1 → 0.0.0-bugfix-dev-kb-67792.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-942ce74b.js → ConfigStorage-0a690675.js} +2 -2
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-d6d5db6d.js} +5 -8
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-96b0f549.js} +13 -9
- package/dist/cjs/{IExporterProvider-597949f9.js → SnkMultiSelectionListDataSource-f79d220c.js} +6 -96
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
- package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → pesquisa-fetcher-cba1b3d0.js} +181 -88
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -7
- package/dist/cjs/snk-application.cjs.entry.js +15 -38
- package/dist/cjs/snk-attach.cjs.entry.js +49 -74
- package/dist/cjs/snk-crud.cjs.entry.js +13 -99
- package/dist/cjs/snk-data-exporter.cjs.entry.js +88 -318
- package/dist/cjs/snk-data-unit-559ac55c.js +462 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -12
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -51
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -9
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
- package/dist/cjs/snk-form.cjs.entry.js +9 -54
- package/dist/cjs/snk-grid.cjs.entry.js +112 -169
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-bfcad2d6.js} +10 -38
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -11
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -267
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -4
- package/dist/cjs/{taskbar-elements-9ad1f9c0.js → taskbar-elements-3ecd1278.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +11 -35
- package/dist/collection/components/snk-attach/snk-attach.js +44 -67
- package/dist/collection/components/snk-crud/snk-crud.js +7 -249
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +0 -135
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -112
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -54
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +52 -59
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -64
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +214 -507
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +11 -23
- package/dist/collection/components/snk-form/snk-form.js +5 -102
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -6
- package/dist/collection/components/snk-grid/snk-grid.css +0 -2
- package/dist/collection/components/snk-grid/snk-grid.js +102 -241
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +18 -386
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -2
- package/dist/collection/lib/@types/index.js +0 -5
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +0 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +0 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +13 -11
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +4 -53
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +34 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +4 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +12 -5
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +0 -2
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +0 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/components/DataFetcher.js +8 -3
- package/dist/components/SnkFormConfigManager.js +3 -6
- package/dist/components/SnkMessageBuilder.js +13 -9
- package/dist/components/dataunit-fetcher.js +182 -84
- package/dist/components/{IExporterProvider.js → field-search.js} +6 -93
- package/dist/components/index2.js +33 -198
- package/dist/components/index3.js +199 -0
- package/dist/components/snk-actions-button2.js +11 -4
- package/dist/components/snk-application2.js +9 -31
- package/dist/components/snk-attach2.js +41 -65
- package/dist/components/snk-crud.js +11 -103
- package/dist/components/snk-data-exporter2.js +87 -311
- package/dist/components/snk-data-unit2.js +212 -470
- package/dist/components/snk-detail-view2.js +10 -87
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +11 -7
- package/dist/components/snk-form-view2.js +1 -72
- package/dist/components/snk-form.js +6 -53
- package/dist/components/snk-grid2.js +108 -170
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +23 -259
- package/dist/components/snk-taskbar2.js +5 -6
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-8c2ddac8.js} +2 -2
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-c01b9d9d.js} +5 -8
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-72423074.js} +13 -9
- package/dist/esm/{IExporterProvider-63a188b6.js → SnkMultiSelectionListDataSource-a4805051.js} +7 -95
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
- package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → pesquisa-fetcher-34a8b8be.js} +182 -84
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -7
- package/dist/esm/snk-application.entry.js +14 -37
- package/dist/esm/snk-attach.entry.js +44 -69
- package/dist/esm/snk-crud.entry.js +13 -99
- package/dist/esm/snk-data-exporter.entry.js +89 -319
- package/dist/esm/snk-data-unit-44215df7.js +460 -0
- package/dist/esm/snk-data-unit.entry.js +2 -12
- package/dist/esm/snk-detail-view.entry.js +10 -51
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +14 -9
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form-view.entry.js +0 -67
- package/dist/esm/snk-form.entry.js +9 -54
- package/dist/esm/snk-grid.entry.js +110 -167
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-edeac29f.js} +10 -38
- package/dist/esm/snk-guides-viewer.entry.js +9 -11
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +28 -255
- package/dist/esm/snk-taskbar.entry.js +3 -4
- package/dist/esm/{taskbar-elements-d59867f1.js → taskbar-elements-2473c8ac.js} +3 -3
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-176c3491.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
- package/dist/sankhyablocks/p-37e5d563.js +65 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-41c2c191.entry.js} +1 -1
- package/dist/sankhyablocks/p-46e55a95.entry.js +1 -0
- package/dist/sankhyablocks/p-4e728357.entry.js +1 -0
- package/dist/sankhyablocks/p-5571bdfe.js +1 -0
- package/dist/sankhyablocks/p-5630574e.js +1 -0
- package/dist/sankhyablocks/p-594bc21d.js +1 -0
- package/dist/sankhyablocks/p-5f8c0426.entry.js +1 -0
- package/dist/sankhyablocks/p-80c64add.entry.js +1 -0
- package/dist/sankhyablocks/p-86af4cc2.js +1 -0
- package/dist/sankhyablocks/p-8b690717.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-96621231.js} +1 -1
- package/dist/sankhyablocks/p-a1832166.entry.js +1 -0
- package/dist/sankhyablocks/p-a809d944.entry.js +1 -0
- package/dist/sankhyablocks/p-a97226f6.entry.js +1 -0
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/{p-7e7a7473.js → p-ae4fc9a9.js} +1 -1
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-c2ae0fab.entry.js} +1 -1
- package/dist/sankhyablocks/p-c5a9a5d9.entry.js +1 -0
- package/dist/sankhyablocks/p-c5aa7d70.entry.js +11 -0
- package/dist/sankhyablocks/p-cb0147ab.entry.js +1 -0
- package/dist/sankhyablocks/p-f0145e3b.js +1 -0
- package/dist/sankhyablocks/{p-14a08904.entry.js → p-f03e4199.entry.js} +1 -1
- package/dist/sankhyablocks/p-f607db63.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +3 -7
- package/dist/types/components/snk-attach/snk-attach.d.ts +9 -11
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -36
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -23
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +3 -28
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -19
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +4 -24
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +1 -4
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +0 -21
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +2 -61
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -4
- package/dist/types/components/snk-form/snk-form.d.ts +0 -14
- package/dist/types/components/snk-grid/snk-grid.d.ts +6 -46
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -58
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +4 -220
- package/dist/types/lib/@types/index.d.ts +0 -5
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +0 -1
- 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/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -2
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/RecordIDUtils-3735135c.js +0 -43
- package/dist/cjs/pesquisa-fetcher-680e198f.js +0 -166
- package/dist/cjs/snk-data-unit-685272e7.js +0 -679
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +0 -1
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +0 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +0 -97
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +0 -74
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +0 -1
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +0 -58
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +0 -55
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +0 -88
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +0 -20
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +0 -38
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +0 -24
- package/dist/collection/components/snk-data-unit/test/resources/parentMetadataMock.js +0 -18
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +0 -35
- package/dist/collection/lib/dataUnit/ValueFormatter.js +0 -4
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +0 -1
- 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/components/ISave.js +0 -47
- package/dist/components/pesquisa-fetcher.js +0 -164
- package/dist/esm/RecordIDUtils-87d02110.js +0 -41
- package/dist/esm/pesquisa-fetcher-03c8f919.js +0 -164
- package/dist/esm/snk-data-unit-63f83504.js +0 -677
- package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
- package/dist/sankhyablocks/p-19c18d06.entry.js +0 -1
- package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-30cf616e.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-82a0bfb0.entry.js +0 -11
- package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-af8efd95.js +0 -6
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
- package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +0 -4
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +0 -14
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +0 -12
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +0 -5
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +0 -17
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +0 -77
- package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.d.ts +0 -3
- package/dist/types/components/snk-data-unit/test/resources/parentMetadataMock.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/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +0 -3
- 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
|
@@ -1,11 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DataType, ApplicationContext, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
|
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';
|
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
6
|
-
import SortingUtils from '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
7
6
|
import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
|
8
7
|
|
|
8
|
+
class PesquisaFetcher {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._defaultPageSize = 100;
|
|
11
|
+
this._templateByQuery = new Map();
|
|
12
|
+
this._searchListenersByDataUnit = new Map();
|
|
13
|
+
this.buldTemplates();
|
|
14
|
+
}
|
|
15
|
+
buldTemplates() {
|
|
16
|
+
this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
17
|
+
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
18
|
+
value
|
|
19
|
+
label
|
|
20
|
+
}
|
|
21
|
+
}`);
|
|
22
|
+
}
|
|
23
|
+
loadSearchOptions(entityName, argument, criteria, options) {
|
|
24
|
+
var _a;
|
|
25
|
+
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
|
|
26
|
+
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
|
27
|
+
criteria === null || criteria === void 0 ? void 0 : criteria.params.forEach(param => {
|
|
28
|
+
if (param.dataType === DataType.OBJECT) {
|
|
29
|
+
param.value = JSON.stringify(param.value);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, options);
|
|
33
|
+
const values = {
|
|
34
|
+
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
35
|
+
entityName,
|
|
36
|
+
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
|
37
|
+
options: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || options,
|
|
38
|
+
};
|
|
39
|
+
if (values.options) {
|
|
40
|
+
(_a = values.options) === null || _a === void 0 ? true : delete _a.dataUnitId;
|
|
41
|
+
}
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
DataFetcher.get()
|
|
44
|
+
.callGraphQL({
|
|
45
|
+
values,
|
|
46
|
+
query: this._templateByQuery.get("search"),
|
|
47
|
+
})
|
|
48
|
+
.then((result) => {
|
|
49
|
+
resolve(result);
|
|
50
|
+
})
|
|
51
|
+
.catch((error) => {
|
|
52
|
+
reject(error);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
|
+
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
59
|
+
const values = {
|
|
60
|
+
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
61
|
+
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
|
62
|
+
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || searchOptions,
|
|
63
|
+
};
|
|
64
|
+
const serviceName = "PesquisaSP.getSuggestion";
|
|
65
|
+
const externalCriteria = {
|
|
66
|
+
query: {
|
|
67
|
+
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
71
|
+
externalCriteria.params = {
|
|
72
|
+
param: values.criteria.params.map(param => {
|
|
73
|
+
let value = param.value;
|
|
74
|
+
if (typeof value === "string") {
|
|
75
|
+
const match = /CTX\{([^}]+)\}/.exec(value);
|
|
76
|
+
if (match) {
|
|
77
|
+
value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
let type = param.dataType;
|
|
81
|
+
if (type === DataType.OBJECT) {
|
|
82
|
+
value = value.value;
|
|
83
|
+
type = "S";
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
type = convertParamType(param.dataType);
|
|
87
|
+
}
|
|
88
|
+
return { $: value, type };
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const options = searchOptions != undefined
|
|
93
|
+
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
|
94
|
+
const reqBody = {
|
|
95
|
+
"serviceName": serviceName,
|
|
96
|
+
"requestBody": {
|
|
97
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_d = values.searchOptions) === null || _d === void 0 ? void 0 : _d.rootEntity }, { options }),
|
|
98
|
+
"clientEventList": {
|
|
99
|
+
"clientEvent": []
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
DataFetcher.get()
|
|
105
|
+
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
|
106
|
+
.then(result => resolve(result))
|
|
107
|
+
.catch(error => reject(error));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
addSearchListener(entityName, dataUnitID, listener) {
|
|
111
|
+
var _a;
|
|
112
|
+
const dataUnitSearchListeners = this._searchListenersByDataUnit.get(dataUnitID) || [];
|
|
113
|
+
const entityListener = dataUnitSearchListeners.find(currentListener => currentListener.entity === entityName);
|
|
114
|
+
if (!entityListener) {
|
|
115
|
+
this._searchListenersByDataUnit.set(dataUnitID, [...dataUnitSearchListeners, { entity: entityName, listener }]);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
for (const type of Object.keys(listener)) {
|
|
119
|
+
if (type in entityListener.listener) {
|
|
120
|
+
const listenerFunctionIsEquals = ((_a = entityListener.listener[type]) === null || _a === void 0 ? void 0 : _a.toString()) === listener[type].toString();
|
|
121
|
+
if (listenerFunctionIsEquals)
|
|
122
|
+
continue;
|
|
123
|
+
entityListener.listener[type] = listener[type];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return () => {
|
|
128
|
+
const newListeners = dataUnitSearchListeners.filter(currentListener => currentListener.entity !== entityName);
|
|
129
|
+
if (!newListeners.length) {
|
|
130
|
+
this._searchListenersByDataUnit.delete(dataUnitID);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this._searchListenersByDataUnit.set(dataUnitID, newListeners);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
applySearchListener(listenerType, entityName, argument, criteria, searchOptions) {
|
|
137
|
+
var _a;
|
|
138
|
+
const dataUnitId = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.dataUnitId;
|
|
139
|
+
if (!dataUnitId)
|
|
140
|
+
return;
|
|
141
|
+
const entityListener = (_a = this._searchListenersByDataUnit.get(dataUnitId)) === null || _a === void 0 ? void 0 : _a.find(({ entity }) => entity === entityName);
|
|
142
|
+
if (!entityListener)
|
|
143
|
+
return;
|
|
144
|
+
const { listener } = entityListener;
|
|
145
|
+
if (!(listenerType in listener))
|
|
146
|
+
return;
|
|
147
|
+
return listener[listenerType]({ argument, criteria, searchOptions });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function convertParamType(dataType) {
|
|
151
|
+
//Alerta: Cuidado pra não contaminar o DataType com a implementação
|
|
152
|
+
//atual da pesquisa... em geral, somente inteiros,
|
|
153
|
+
//data (com ou sem hora) e string são realmente relevantes
|
|
154
|
+
switch (dataType) {
|
|
155
|
+
case DataType.NUMBER:
|
|
156
|
+
return "I";
|
|
157
|
+
case DataType.DATE:
|
|
158
|
+
return "D";
|
|
159
|
+
default:
|
|
160
|
+
return "S";
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
var SearchListenerType;
|
|
164
|
+
(function (SearchListenerType) {
|
|
165
|
+
SearchListenerType["beforeSearch"] = "beforeSearch";
|
|
166
|
+
})(SearchListenerType || (SearchListenerType = {}));
|
|
167
|
+
|
|
9
168
|
class ArrayRepository {
|
|
10
169
|
constructor(equalsFunction) {
|
|
11
170
|
this._list = [];
|
|
@@ -85,9 +244,6 @@ class ArrayRepository {
|
|
|
85
244
|
async count() {
|
|
86
245
|
return Promise.resolve(this._list.length);
|
|
87
246
|
}
|
|
88
|
-
getFromCache() {
|
|
89
|
-
return ObjectUtils.copy(this._list);
|
|
90
|
-
}
|
|
91
247
|
}
|
|
92
248
|
|
|
93
249
|
class PreloadManager {
|
|
@@ -109,7 +265,17 @@ class PreloadManager {
|
|
|
109
265
|
}
|
|
110
266
|
}
|
|
111
267
|
static getSortingFunction(dataUnit, sorting) {
|
|
112
|
-
|
|
268
|
+
if (sorting == undefined || sorting.length == 0) {
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
return (recordA, recordB) => {
|
|
272
|
+
for (const sort of sorting) {
|
|
273
|
+
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
|
274
|
+
if (result != 0) {
|
|
275
|
+
return result;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
113
279
|
}
|
|
114
280
|
static async getDistinct(dataUnit, fieldName) {
|
|
115
281
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
|
@@ -146,11 +312,7 @@ class PreloadManager {
|
|
|
146
312
|
static async loadData(dataUnit, request, loadFromServer) {
|
|
147
313
|
try {
|
|
148
314
|
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
|
149
|
-
|
|
150
|
-
"EZ_GRID_LOADING_SOURCE",
|
|
151
|
-
DataUnit.CHANGING_PAGE_LOADING_SOURCE,
|
|
152
|
-
DataUnit.ALL_RECORDS_SELECTION_SOURCE
|
|
153
|
-
].includes(request.source);
|
|
315
|
+
let useCache = request.source === "EZ_GRID_LOADING_SOURCE" || request.source === DataUnit.CHANGING_PAGE_LOADING_SOURCE;
|
|
154
316
|
if (useCache) {
|
|
155
317
|
const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
|
|
156
318
|
if (!isCacheEmpty) {
|
|
@@ -217,9 +379,6 @@ class PreloadManager {
|
|
|
217
379
|
.catch(reason => reject(reason));
|
|
218
380
|
});
|
|
219
381
|
}
|
|
220
|
-
static getCachedRecords(dataUnit) {
|
|
221
|
-
return PreloadManager.getRepository(dataUnit).getFromCache();
|
|
222
|
-
}
|
|
223
382
|
}
|
|
224
383
|
PreloadManager._repositories = new Map();
|
|
225
384
|
PreloadManager._loadingStatus = new Map();
|
|
@@ -261,7 +420,7 @@ function buildPaginationInfo(records, offset = 0, limit = 0) {
|
|
|
261
420
|
}
|
|
262
421
|
|
|
263
422
|
class InMemoryLoader {
|
|
264
|
-
constructor(metadata, records
|
|
423
|
+
constructor(metadata, records) {
|
|
265
424
|
this.metadata = metadata;
|
|
266
425
|
this.records = records;
|
|
267
426
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
|
@@ -270,11 +429,7 @@ class InMemoryLoader {
|
|
|
270
429
|
this._dataUnit.dataLoader = (dataUnit, request) => this.inMemoryLoader(dataUnit, request, this.getRecordsToLoad());
|
|
271
430
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
|
272
431
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
|
273
|
-
this.dataUnit.loadMetadata().then(() =>
|
|
274
|
-
if ((config === null || config === void 0 ? void 0 : config.autoLoad) !== false) {
|
|
275
|
-
this.dataUnit.loadData();
|
|
276
|
-
}
|
|
277
|
-
});
|
|
432
|
+
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
|
278
433
|
}
|
|
279
434
|
getRecordsToLoad() {
|
|
280
435
|
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
|
@@ -326,7 +481,7 @@ class InMemoryLoader {
|
|
|
326
481
|
this._initialRecords = newRecords;
|
|
327
482
|
if (this._dataUnit) {
|
|
328
483
|
//Isso força o refresh internamente no datunit
|
|
329
|
-
this._dataUnit.
|
|
484
|
+
this._dataUnit.gotoPage(0);
|
|
330
485
|
}
|
|
331
486
|
}
|
|
332
487
|
get metadata() {
|
|
@@ -378,17 +533,11 @@ class InMemoryLoader {
|
|
|
378
533
|
}
|
|
379
534
|
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
|
|
380
535
|
|
|
381
|
-
function getRecordValue(record, fieldName) {
|
|
382
|
-
var _a, _b;
|
|
383
|
-
return ((_a = record[fieldName]) === null || _a === void 0 ? void 0 : _a.value) !== undefined ? (_b = record[fieldName]) === null || _b === void 0 ? void 0 : _b.value : record[fieldName];
|
|
384
|
-
}
|
|
385
|
-
|
|
386
536
|
class DatasetStrategy {
|
|
387
537
|
canSlice() {
|
|
388
538
|
return false;
|
|
389
539
|
}
|
|
390
540
|
processSortingSide(request, dataUnit, serverSideFilters) {
|
|
391
|
-
var _a;
|
|
392
541
|
const localSorting = [];
|
|
393
542
|
const serverSorting = [];
|
|
394
543
|
if (request.sort != undefined) {
|
|
@@ -397,7 +546,9 @@ class DatasetStrategy {
|
|
|
397
546
|
}
|
|
398
547
|
for (const sort of request.sort) {
|
|
399
548
|
const descriptor = dataUnit.getField(sort.field);
|
|
400
|
-
const local =
|
|
549
|
+
const local = descriptor != undefined
|
|
550
|
+
&& descriptor.properties != undefined
|
|
551
|
+
&& descriptor.properties.calculated === "true";
|
|
401
552
|
if (local) {
|
|
402
553
|
localSorting.push(sort);
|
|
403
554
|
}
|
|
@@ -437,53 +588,6 @@ class DatasetStrategy {
|
|
|
437
588
|
return Promise.reject(error);
|
|
438
589
|
}
|
|
439
590
|
}
|
|
440
|
-
async loadRowMetadata(snkDataUnit, fieldName, metadataName, updatedFields = {}) {
|
|
441
|
-
try {
|
|
442
|
-
const serviceName = "DatasetSP.loadRowMetadata";
|
|
443
|
-
const parsedRequestBody = await this.buildRequestBodyLoadRowMetadata({ snkDataUnit, fieldName, metadataName, serviceName, updatedFields });
|
|
444
|
-
const response = await DataFetcher.get().callServiceBroker(serviceName, parsedRequestBody);
|
|
445
|
-
return response;
|
|
446
|
-
}
|
|
447
|
-
catch (error) {
|
|
448
|
-
console.error(error);
|
|
449
|
-
return Promise.reject(error);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
async buildRequestBodyLoadRowMetadata({ snkDataUnit, serviceName, fieldName, metadataName, updatedFields, }) {
|
|
453
|
-
const dataUnit = snkDataUnit.dataUnit;
|
|
454
|
-
const entityName = DataUnitFetcher.parseDataUnitName(dataUnit.name).entityName;
|
|
455
|
-
const recordIdInfo = await snkDataUnit.getSelectedRecordsIDsInfo();
|
|
456
|
-
const pk = recordIdInfo.reduce((accumulator, currentValue) => {
|
|
457
|
-
accumulator[currentValue.name] = currentValue.value;
|
|
458
|
-
return accumulator;
|
|
459
|
-
}, {});
|
|
460
|
-
const record = dataUnit.getSelectedRecord();
|
|
461
|
-
const fields = dataUnit.metadata.fields.filter(({ standAlone, name }) => !standAlone && !name.includes(".")).map(({ name }) => name);
|
|
462
|
-
const values = fields.reduce((accumulator, currentValue, currentIndex) => {
|
|
463
|
-
const recordValue = getRecordValue(record, currentValue);
|
|
464
|
-
const updatedFieldValue = getRecordValue(updatedFields, currentValue);
|
|
465
|
-
accumulator[currentIndex] = updatedFieldValue !== undefined ? updatedFieldValue : recordValue;
|
|
466
|
-
return accumulator;
|
|
467
|
-
}, {});
|
|
468
|
-
const requestBody = {
|
|
469
|
-
serviceName,
|
|
470
|
-
requestBody: {
|
|
471
|
-
dataSetID: dataUnit.dataUnitId,
|
|
472
|
-
entityName,
|
|
473
|
-
standAlone: false,
|
|
474
|
-
metadataName,
|
|
475
|
-
fieldName,
|
|
476
|
-
fields,
|
|
477
|
-
record: {
|
|
478
|
-
pk,
|
|
479
|
-
oldPk: pk,
|
|
480
|
-
values,
|
|
481
|
-
},
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
const parsedRequestBody = JSON.stringify(requestBody);
|
|
485
|
-
return parsedRequestBody;
|
|
486
|
-
}
|
|
487
591
|
getFieldsList(dataUnit) {
|
|
488
592
|
let fields = ["__record__id__", "__record__label__"];
|
|
489
593
|
dataUnit.metadata.fields.forEach((descriptor) => {
|
|
@@ -563,11 +667,9 @@ class DatasetStrategy {
|
|
|
563
667
|
}
|
|
564
668
|
processRecords(dataUnit, fields, responseRecords) {
|
|
565
669
|
return responseRecords.map((dataFrame) => {
|
|
566
|
-
const lastElement = dataFrame[dataFrame.length - 1];
|
|
567
670
|
const duRecord = {
|
|
568
671
|
__record__id__: dataFrame[0],
|
|
569
|
-
__record__label__: dataFrame[1]
|
|
570
|
-
__record__metadata__: lastElement['_rmd'],
|
|
672
|
+
__record__label__: dataFrame[1]
|
|
571
673
|
};
|
|
572
674
|
dataUnit.metadata.fields.forEach(fieldDescriptor => {
|
|
573
675
|
duRecord[fieldDescriptor.name] = this.buildFieldValue(fieldDescriptor, fields, dataFrame);
|
|
@@ -630,9 +732,6 @@ class DataUnitDataLoader {
|
|
|
630
732
|
});
|
|
631
733
|
});
|
|
632
734
|
}
|
|
633
|
-
static getCachedRecords(dataUnit) {
|
|
634
|
-
return PreloadManager.getCachedRecords(dataUnit);
|
|
635
|
-
}
|
|
636
735
|
static async loadFromServer(dataUnit, request, loadingInfo) {
|
|
637
736
|
try {
|
|
638
737
|
//Registramos a request com as informações de carga para determinarmos a última.
|
|
@@ -833,7 +932,6 @@ class DataUnitFetcher {
|
|
|
833
932
|
dataUnit.saveLoader = (_dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
834
933
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
835
934
|
dataUnit.recordLoader = (dataUnit, recordIds) => this.loadRecord(dataUnit, recordIds);
|
|
836
|
-
dataUnit.allRecordsLoader = (dataUnit) => DataUnitDataLoader.getCachedRecords(dataUnit);
|
|
837
935
|
return dataUnit;
|
|
838
936
|
}
|
|
839
937
|
loadMetadata(dataUnit) {
|
|
@@ -1052,4 +1150,4 @@ class DataUnitFetcher {
|
|
|
1052
1150
|
}
|
|
1053
1151
|
}
|
|
1054
1152
|
|
|
1055
|
-
export { DataUnitFetcher as D, InMemoryLoader as I,
|
|
1153
|
+
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a, applyFilter as b, applySorting as c, buildPaginationInfo as d };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { D as DataFetcher } from './DataFetcher.js';
|
|
2
|
-
import './
|
|
3
|
-
import { SortMode, ApplicationContext, UserInterface, DateUtils
|
|
4
|
-
import './
|
|
2
|
+
import { a as PreloadManager } from './dataunit-fetcher.js';
|
|
3
|
+
import { SortMode, ApplicationContext, UserInterface, DateUtils } from '@sankhyalabs/core';
|
|
4
|
+
import './index2.js';
|
|
5
|
+
import './snk-actions-button2.js';
|
|
5
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
6
|
-
import
|
|
7
|
-
import { P as PreloadManager } from './dataunit-fetcher.js';
|
|
7
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
8
8
|
import './filter-item-type.enum.js';
|
|
9
9
|
import './form-config-fetcher.js';
|
|
10
10
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
|
@@ -208,91 +208,4 @@ const openFieldSearch = async (moreOptions, field) => {
|
|
|
208
208
|
await moreOptions.showActions();
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
setGrid(grid) {
|
|
213
|
-
if (this._grid) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
this._grid = grid;
|
|
217
|
-
this.refreshSelectedRows();
|
|
218
|
-
}
|
|
219
|
-
setDataState(dataState) {
|
|
220
|
-
if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
this._dataState = dataState;
|
|
224
|
-
this.refreshSelectedRows();
|
|
225
|
-
}
|
|
226
|
-
format(currentValue, column, recordId) {
|
|
227
|
-
var _a;
|
|
228
|
-
if (!currentValue) {
|
|
229
|
-
return currentValue;
|
|
230
|
-
}
|
|
231
|
-
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
|
232
|
-
const rmPrecision = rowMetadata === null || rowMetadata === void 0 ? void 0 : rowMetadata.getProp('rm_precision', column.name);
|
|
233
|
-
if (rmPrecision || rmPrecision === 0) {
|
|
234
|
-
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
return currentValue;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
refreshSelectedRows() {
|
|
241
|
-
var _a;
|
|
242
|
-
(_a = this._grid) === null || _a === void 0 ? void 0 : _a.refreshSelectedRows();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
class CommonsExporter {
|
|
247
|
-
constructor(dataUnit, grid) {
|
|
248
|
-
this.dataUnit = dataUnit;
|
|
249
|
-
this.grid = grid;
|
|
250
|
-
}
|
|
251
|
-
async getColumnsMetadata() {
|
|
252
|
-
var _a;
|
|
253
|
-
this.columnsState = await ((_a = this.grid) === null || _a === void 0 ? void 0 : _a.getColumnsState()) || [];
|
|
254
|
-
return await this.buildColumnsMetadata(this.columnsState);
|
|
255
|
-
}
|
|
256
|
-
getColumnsState() {
|
|
257
|
-
return this.columnsState;
|
|
258
|
-
}
|
|
259
|
-
async buildColumnsMetadata(gridColumns) {
|
|
260
|
-
var _a, _b;
|
|
261
|
-
const columnsMetadata = [];
|
|
262
|
-
for (const column of gridColumns) {
|
|
263
|
-
/**
|
|
264
|
-
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
|
265
|
-
*/
|
|
266
|
-
if (column.hidden && column.name !== "RECDESP") {
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
|
270
|
-
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
|
271
|
-
const columnData = {
|
|
272
|
-
label: column.label,
|
|
273
|
-
id: column.name,
|
|
274
|
-
width: column.width,
|
|
275
|
-
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
|
276
|
-
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
|
277
|
-
customFormatter
|
|
278
|
-
};
|
|
279
|
-
columnsMetadata.push(columnData);
|
|
280
|
-
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
|
281
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
|
282
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
|
283
|
-
const descriptionColumn = {
|
|
284
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
|
285
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
|
286
|
-
width: column.width,
|
|
287
|
-
type: DataType.TEXT,
|
|
288
|
-
userInterface: UserInterface$1.LONGTEXT,
|
|
289
|
-
descriptionFrom: fieldData.name
|
|
290
|
-
};
|
|
291
|
-
columnsMetadata.push(descriptionColumn);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return columnsMetadata || [];
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export { CommonsExporter as C, RmPrecisionCustomValueFormatter as R, SnkMultiSelectionListDataSource as S, TaskbarProcessor as T, CrudUtils as a, buildFieldSearch as b, openFieldSearch as o };
|
|
211
|
+
export { CrudUtils as C, SnkMultiSelectionListDataSource as S, TaskbarProcessor as T, buildFieldSearch as b, openFieldSearch as o };
|