@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-65214.0 → 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-e49214c6.js → ConfigStorage-0a690675.js} +0 -1
- package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-d6d5db6d.js} +7 -8
- package/dist/cjs/{SnkMessageBuilder-cceebbae.js → SnkMessageBuilder-96b0f549.js} +13 -9
- package/dist/cjs/{IExporterProvider-10b7fed5.js → SnkMultiSelectionListDataSource-f79d220c.js} +4 -94
- package/dist/cjs/{index-1dfc7a6e.js → index-0922807b.js} +0 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-d4873076.js → pesquisa-fetcher-cba1b3d0.js} +180 -87
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +3 -5
- package/dist/cjs/snk-application.cjs.entry.js +12 -35
- package/dist/cjs/snk-attach.cjs.entry.js +46 -71
- package/dist/cjs/snk-crud.cjs.entry.js +10 -101
- package/dist/cjs/snk-data-exporter.cjs.entry.js +85 -315
- 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 -50
- package/dist/cjs/snk-filter-bar.cjs.entry.js +12 -7
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +0 -67
- package/dist/cjs/snk-form.cjs.entry.js +7 -52
- package/dist/cjs/snk-grid.cjs.entry.js +110 -167
- package/dist/cjs/{snk-guides-viewer-aafc3073.js → snk-guides-viewer-bfcad2d6.js} +10 -43
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +40 -268
- 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 -305
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -136
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -161
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +7 -134
- 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 +0 -62
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +219 -540
- 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 +6 -7
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- 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 +20 -406
- 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/configs/ConfigStorage.js +0 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +3 -7
- 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 +1 -2
- package/dist/components/ConfigStorage.js +0 -1
- package/dist/components/SnkFormConfigManager.js +6 -7
- 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 -110
- package/dist/components/snk-data-exporter2.js +85 -309
- package/dist/components/snk-data-unit2.js +217 -487
- package/dist/components/snk-detail-view2.js +14 -96
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +11 -7
- package/dist/components/snk-form-config2.js +1 -1
- 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 +25 -263
- package/dist/components/snk-taskbar2.js +5 -6
- package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-8c2ddac8.js} +0 -1
- package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-c01b9d9d.js} +7 -8
- package/dist/esm/{SnkMessageBuilder-ae87b754.js → SnkMessageBuilder-72423074.js} +13 -9
- package/dist/esm/{IExporterProvider-d597f27d.js → SnkMultiSelectionListDataSource-a4805051.js} +5 -93
- package/dist/esm/{index-3aa4977a.js → index-0ece87a6.js} +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-3d2ec959.js → pesquisa-fetcher-34a8b8be.js} +181 -83
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +3 -5
- package/dist/esm/snk-application.entry.js +11 -34
- package/dist/esm/snk-attach.entry.js +41 -66
- package/dist/esm/snk-crud.entry.js +10 -101
- package/dist/esm/snk-data-exporter.entry.js +86 -316
- 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 -50
- package/dist/esm/snk-filter-bar.entry.js +12 -7
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +0 -67
- package/dist/esm/snk-form.entry.js +7 -52
- package/dist/esm/snk-grid.entry.js +108 -165
- package/dist/esm/{snk-guides-viewer-62124f3d.js → snk-guides-viewer-edeac29f.js} +10 -43
- package/dist/esm/snk-guides-viewer.entry.js +7 -9
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +28 -256
- 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-176c3491.entry.js +1 -0
- package/dist/sankhyablocks/p-37e5d563.js +65 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/{p-9dfda04a.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-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-3287a6cc.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-bd008859.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-f03e4199.entry.js +1 -0
- 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 -45
- 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 -24
- 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 +3 -67
- 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-form-config/SnkFormConfigManager.d.ts +2 -2
- 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 -62
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components.d.ts +4 -261
- 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-a1d0353f.js +0 -166
- package/dist/cjs/snk-data-unit-f0221097.js +0 -690
- 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-a87445a0.js +0 -164
- package/dist/esm/snk-data-unit-1ef94aef.js +0 -688
- package/dist/sankhyablocks/p-091ce761.js +0 -60
- package/dist/sankhyablocks/p-0c68f40f.entry.js +0 -1
- package/dist/sankhyablocks/p-162b9a59.entry.js +0 -11
- package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
- package/dist/sankhyablocks/p-25f1fc39.js +0 -6
- package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
- package/dist/sankhyablocks/p-30cf616e.js +0 -1
- package/dist/sankhyablocks/p-421bec84.entry.js +0 -1
- package/dist/sankhyablocks/p-42f7b05d.entry.js +0 -1
- package/dist/sankhyablocks/p-51999ab5.entry.js +0 -1
- package/dist/sankhyablocks/p-52a6a293.entry.js +0 -1
- package/dist/sankhyablocks/p-5f016aed.js +0 -1
- package/dist/sankhyablocks/p-62f34e6f.entry.js +0 -1
- package/dist/sankhyablocks/p-684a2590.entry.js +0 -1
- package/dist/sankhyablocks/p-70001ac1.js +0 -1
- package/dist/sankhyablocks/p-74c665d5.entry.js +0 -1
- package/dist/sankhyablocks/p-76a65660.js +0 -1
- package/dist/sankhyablocks/p-7c4aabe2.js +0 -1
- package/dist/sankhyablocks/p-8c1ff936.entry.js +0 -1
- package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-c273d6ee.js +0 -1
- package/dist/sankhyablocks/p-d65d98ed.entry.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- 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
|
@@ -2,111 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index
|
|
5
|
+
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
|
9
|
-
const taskbarElements = require('./taskbar-elements-
|
|
9
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
10
10
|
require('./DataFetcher-77729a93.js');
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
12
|
-
const
|
|
13
|
-
const index = require('./index-
|
|
11
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-cba1b3d0.js');
|
|
12
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-f79d220c.js');
|
|
13
|
+
const index$1 = require('./index-0922807b.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-d4873076.js');
|
|
18
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
18
|
const formConfigFetcher = require('./form-config-fetcher-feb08214.js');
|
|
20
19
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
23
|
-
|
|
24
|
-
const index$2 = require('./index-102ba62d.js');
|
|
20
|
+
const ConfigStorage = require('./ConfigStorage-0a690675.js');
|
|
21
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-d6d5db6d.js');
|
|
22
|
+
require('./index-102ba62d.js');
|
|
25
23
|
require('./PrintUtils-bcaeb82f.js');
|
|
26
|
-
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
27
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
28
|
-
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
29
25
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
26
|
+
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
30
27
|
|
|
31
28
|
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
|
32
29
|
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
|
33
30
|
|
|
34
|
-
class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
35
|
-
getSelectedNumber() {
|
|
36
|
-
return this.dataUnit.getSelectionInfo().length;
|
|
37
|
-
}
|
|
38
|
-
getTotalRecords() {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
|
41
|
-
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
|
42
|
-
}
|
|
43
|
-
getSelectedIDs() {
|
|
44
|
-
return RecordIDUtils.getSelectedIDs(this.dataUnit);
|
|
45
|
-
}
|
|
46
|
-
getRecordID() {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
49
|
-
}
|
|
50
|
-
async getRecords() {
|
|
51
|
-
if (this.dataUnit.records.length === 0) {
|
|
52
|
-
return Promise.resolve([]);
|
|
53
|
-
}
|
|
54
|
-
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
55
|
-
const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
|
|
56
|
-
return Promise.resolve(records == undefined ? [] : records);
|
|
57
|
-
}
|
|
58
|
-
getHiddenOptions() {
|
|
59
|
-
return [
|
|
60
|
-
index.DataExporterOption.EXPORT_BY_EMAIL,
|
|
61
|
-
index.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
62
|
-
index.DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
63
|
-
index.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
64
|
-
index.DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
formatValue(record, column) {
|
|
68
|
-
const { id, descriptionFrom } = column;
|
|
69
|
-
const value = record[descriptionFrom || id];
|
|
70
|
-
if (value == undefined) {
|
|
71
|
-
return "";
|
|
72
|
-
}
|
|
73
|
-
if (descriptionFrom != undefined) {
|
|
74
|
-
return value.label;
|
|
75
|
-
}
|
|
76
|
-
const fieldDescriptor = this.dataUnit.getField(id);
|
|
77
|
-
if (fieldDescriptor.userInterface === core.UserInterface.SEARCH) {
|
|
78
|
-
return value.value;
|
|
79
|
-
}
|
|
80
|
-
if (column.customFormatter) {
|
|
81
|
-
const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
|
|
82
|
-
const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
|
|
83
|
-
return formattedValue;
|
|
84
|
-
}
|
|
85
|
-
return this.dataUnit.getFormattedValue(id, value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
31
|
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
|
|
90
32
|
|
|
91
33
|
const SnkSimpleCrud = class {
|
|
92
34
|
constructor(hostRef) {
|
|
93
|
-
index
|
|
94
|
-
this.dataStateChange = index
|
|
95
|
-
this.dataUnitReady = index
|
|
96
|
-
this.actionClick = index
|
|
97
|
-
this.formItemsReady = index
|
|
98
|
-
this.configuratorSave = index
|
|
99
|
-
this.configuratorCancel = index
|
|
100
|
-
this._multiSelectionListDataSource = new
|
|
35
|
+
index.registerInstance(this, hostRef);
|
|
36
|
+
this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
|
|
37
|
+
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
|
38
|
+
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
39
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
40
|
+
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
|
41
|
+
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
|
42
|
+
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
|
101
43
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
|
102
44
|
this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
|
|
103
|
-
this._customEditors = new Map();
|
|
104
|
-
this._customRenders = new Map();
|
|
105
45
|
this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
|
|
106
|
-
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false,
|
|
107
|
-
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false,
|
|
108
|
-
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true,
|
|
109
|
-
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true,
|
|
46
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, taskbarElements.TaskbarElement.GRID_MODE),
|
|
47
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, taskbarElements.TaskbarElement.FORM_MODE),
|
|
48
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, taskbarElements.TaskbarElement.GRID_MODE),
|
|
49
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, taskbarElements.TaskbarElement.FORM_MODE),
|
|
110
50
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
111
51
|
});
|
|
112
52
|
this._showPopUpGridConfig = false;
|
|
@@ -117,15 +57,12 @@ const SnkSimpleCrud = class {
|
|
|
117
57
|
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
|
118
58
|
this.dataState = undefined;
|
|
119
59
|
this.dataUnit = undefined;
|
|
120
|
-
this.entityName = undefined;
|
|
121
60
|
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
|
122
61
|
this.gridConfig = undefined;
|
|
123
62
|
this.formConfig = undefined;
|
|
124
63
|
this._formFields = [];
|
|
125
|
-
this._fieldsProps = new Map();
|
|
126
64
|
this.multipleSelection = undefined;
|
|
127
65
|
this.useCancelConfirm = true;
|
|
128
|
-
this.pageSize = 150;
|
|
129
66
|
this.resourceID = undefined;
|
|
130
67
|
this.taskbarManager = undefined;
|
|
131
68
|
this.messagesBuilder = undefined;
|
|
@@ -136,34 +73,6 @@ const SnkSimpleCrud = class {
|
|
|
136
73
|
this.gridLegacyConfigName = undefined;
|
|
137
74
|
this.formLegacyConfigName = undefined;
|
|
138
75
|
this.ignoreReadOnlyFormFields = false;
|
|
139
|
-
this.autoFocus = true;
|
|
140
|
-
this.domainMessagesBuilder = undefined;
|
|
141
|
-
this.autoLoad = undefined;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Registra um editor customizado para campos da grade e formulário.
|
|
145
|
-
*/
|
|
146
|
-
async addCustomEditor(fieldName, customEditor) {
|
|
147
|
-
if (this._grid && this._form) {
|
|
148
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
149
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const newCustomEditors = new Map(this._customEditors);
|
|
153
|
-
newCustomEditors.set(fieldName, customEditor);
|
|
154
|
-
this._customEditors = newCustomEditors;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Registra um render customizado para colunas da grid.
|
|
158
|
-
*/
|
|
159
|
-
async addGridCustomRender(fieldName, customRender) {
|
|
160
|
-
if (this._grid) {
|
|
161
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const newCustomRenders = new Map(this._customRenders);
|
|
165
|
-
newCustomRenders.set(fieldName, customRender);
|
|
166
|
-
this._customRenders = newCustomRenders;
|
|
167
76
|
}
|
|
168
77
|
handleResourceIDChanged(newValue, oldValue) {
|
|
169
78
|
if (core.StringUtils.isEmpty(newValue)) {
|
|
@@ -175,30 +84,9 @@ const SnkSimpleCrud = class {
|
|
|
175
84
|
this.loadFormConfig(true);
|
|
176
85
|
this.loadGridConfig(true);
|
|
177
86
|
}
|
|
178
|
-
|
|
179
|
-
* Registra um formatador de valores para uma coluna da grid.
|
|
180
|
-
*/
|
|
181
|
-
async addCustomValueFormatter(columnName, customFormatter) {
|
|
182
|
-
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Remove o formatador de valores de uma coluna da grid.
|
|
186
|
-
*/
|
|
187
|
-
async removeCustomValueFormatter(columnName) {
|
|
188
|
-
this._grid.removeCustomValueFormatter(columnName);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
192
|
-
*/
|
|
193
|
-
async setFieldProp(fieldName, propName, value) {
|
|
194
|
-
const newCustomFieldProps = new Map(this._fieldsProps);
|
|
195
|
-
const currentProps = this._fieldsProps.get(fieldName);
|
|
196
|
-
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
197
|
-
this._fieldsProps = newCustomFieldProps;
|
|
198
|
-
}
|
|
199
|
-
getButtons(selected, extraButtons) {
|
|
87
|
+
getButtons(selected, changeModeBtn) {
|
|
200
88
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
201
|
-
.concat(
|
|
89
|
+
.concat(changeModeBtn));
|
|
202
90
|
}
|
|
203
91
|
addConfigButton(buttons) {
|
|
204
92
|
if (this.configName === undefined) {
|
|
@@ -238,19 +126,15 @@ const SnkSimpleCrud = class {
|
|
|
238
126
|
}
|
|
239
127
|
evt.stopPropagation();
|
|
240
128
|
}
|
|
241
|
-
async onChangeEntityName(newValue) {
|
|
242
|
-
if (this.dataUnit)
|
|
243
|
-
return;
|
|
244
|
-
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
245
|
-
this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
|
|
246
|
-
}
|
|
247
129
|
onModeChange() {
|
|
248
130
|
if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
249
131
|
this.initInMemoryDataUnit();
|
|
250
132
|
}
|
|
251
133
|
}
|
|
252
134
|
observeDataState(newValue, oldValue) {
|
|
253
|
-
|
|
135
|
+
if (core.ObjectUtils.objectToString(oldValue) != core.ObjectUtils.objectToString(newValue)) {
|
|
136
|
+
this.dataStateChange.emit(newValue);
|
|
137
|
+
}
|
|
254
138
|
}
|
|
255
139
|
async observeFormLegacy(newValue, oldValue) {
|
|
256
140
|
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
|
@@ -258,28 +142,6 @@ const SnkSimpleCrud = class {
|
|
|
258
142
|
async observeGridLegacy(newValue, oldValue) {
|
|
259
143
|
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
|
260
144
|
}
|
|
261
|
-
async handleDataStateChange(newValue, oldValue) {
|
|
262
|
-
if (core.ObjectUtils.objectToString(oldValue) != core.ObjectUtils.objectToString(newValue)) {
|
|
263
|
-
this.dataStateChange.emit(newValue);
|
|
264
|
-
}
|
|
265
|
-
await this.processRmPrecision();
|
|
266
|
-
}
|
|
267
|
-
async processRmPrecision() {
|
|
268
|
-
var _a, _b;
|
|
269
|
-
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
|
270
|
-
for (const field of fieldsWithRmPrecision || []) {
|
|
271
|
-
if (!field) {
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
|
|
275
|
-
if (!rmPrecision && rmPrecision !== 0) {
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
await this.setFieldProp(field, 'precision', rmPrecision);
|
|
279
|
-
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
|
280
|
-
}
|
|
281
|
-
this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
|
|
282
|
-
}
|
|
283
145
|
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
|
284
146
|
if (newValue == undefined || newValue == oldValue) {
|
|
285
147
|
return;
|
|
@@ -376,7 +238,6 @@ const SnkSimpleCrud = class {
|
|
|
376
238
|
}
|
|
377
239
|
async componentWillRender() {
|
|
378
240
|
this._resourceID = await this.application.getResourceID();
|
|
379
|
-
this.dataExporterProviderStore();
|
|
380
241
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
|
381
242
|
if (this.configName === undefined) {
|
|
382
243
|
return;
|
|
@@ -388,70 +249,32 @@ const SnkSimpleCrud = class {
|
|
|
388
249
|
this.loadGridConfig();
|
|
389
250
|
this.loadFormConfig();
|
|
390
251
|
}
|
|
391
|
-
componentDidRender() {
|
|
392
|
-
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
393
|
-
this.addGridCustomValueFormattters();
|
|
394
|
-
this.setFieldsProps();
|
|
395
|
-
this.setCustomRenders();
|
|
396
|
-
this.setCustomEditors();
|
|
397
|
-
}
|
|
398
252
|
componentWillLoad() {
|
|
399
253
|
this.processMetadata();
|
|
400
254
|
this.onModeChange();
|
|
401
255
|
this.configDatasource();
|
|
402
|
-
this._rmPrecisionCustomValueFormatter = new IExporterProvider.RmPrecisionCustomValueFormatter();
|
|
403
256
|
}
|
|
404
257
|
componentDidLoad() {
|
|
405
258
|
utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
|
406
259
|
}
|
|
407
|
-
setCustomRenders() {
|
|
408
|
-
if (!this._grid) {
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
for (const [fieldName, customRender] of this._customRenders) {
|
|
412
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
413
|
-
this._customRenders.delete(fieldName);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
setCustomEditors() {
|
|
417
|
-
if (!this._grid || !this._form) {
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
for (const [fieldName, customEditor] of this._customEditors) {
|
|
421
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
422
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
423
|
-
this._customEditors.delete(fieldName);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
260
|
configDatasource() {
|
|
427
261
|
this._multiSelectionListDataSource.setApplication(this.application);
|
|
428
262
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
|
429
263
|
}
|
|
430
|
-
setFieldsProps() {
|
|
431
|
-
if (!this._form) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
for (const [fieldName, props] of this._fieldsProps) {
|
|
435
|
-
for (const prop in props) {
|
|
436
|
-
this._form.setFieldProp(fieldName, prop, props[prop]);
|
|
437
|
-
}
|
|
438
|
-
this._fieldsProps.delete(fieldName);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
264
|
getTaskBarId() {
|
|
442
|
-
var _a, _b;
|
|
265
|
+
var _a, _b, _c;
|
|
443
266
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
|
444
267
|
return "snkSimpleCrudTaskbar.finish_edition";
|
|
445
268
|
}
|
|
446
269
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
|
447
270
|
!this.dataState.selectionInfo.isAllRecords() &&
|
|
448
|
-
this.dataState.selectionInfo.length > 0) {
|
|
271
|
+
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
449
272
|
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
|
450
273
|
}
|
|
451
274
|
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
|
452
275
|
}
|
|
453
276
|
initInMemoryDataUnit() {
|
|
454
|
-
this._inMemoryLoader = new
|
|
277
|
+
this._inMemoryLoader = new pesquisaFetcher.InMemoryLoader(this._metadata);
|
|
455
278
|
this.dataUnit = this._inMemoryLoader.dataUnit;
|
|
456
279
|
this.dataUnitReady.emit(this.dataUnit);
|
|
457
280
|
}
|
|
@@ -490,11 +313,12 @@ const SnkSimpleCrud = class {
|
|
|
490
313
|
var _a;
|
|
491
314
|
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
|
492
315
|
}
|
|
493
|
-
|
|
316
|
+
updateConfig() {
|
|
494
317
|
if (this._formConfigManager == undefined) {
|
|
495
318
|
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
496
319
|
}
|
|
497
320
|
this._formConfigManager.setConfig(this.formConfig);
|
|
321
|
+
return;
|
|
498
322
|
}
|
|
499
323
|
processMetadata() {
|
|
500
324
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
|
@@ -526,28 +350,11 @@ const SnkSimpleCrud = class {
|
|
|
526
350
|
};
|
|
527
351
|
}
|
|
528
352
|
}
|
|
529
|
-
addGridCustomValueFormattters() {
|
|
530
|
-
var _a, _b, _c;
|
|
531
|
-
const metadataFields = ((_a = this._metadata) === null || _a === void 0 ? void 0 : _a.fields) || ((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.fields);
|
|
532
|
-
if (!metadataFields) {
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
const fieldsWithRmPrecision = [];
|
|
536
|
-
metadataFields.forEach((field) => {
|
|
537
|
-
var _a;
|
|
538
|
-
if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
|
|
539
|
-
fieldsWithRmPrecision.push(field.name);
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
fieldsWithRmPrecision.forEach(field => {
|
|
543
|
-
this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
353
|
onDataStateChange(evt) {
|
|
547
354
|
this.dataState = Object.assign({}, evt.detail);
|
|
548
355
|
}
|
|
549
356
|
getTaskBarDisabledButtons() {
|
|
550
|
-
var _a, _b, _c, _d
|
|
357
|
+
var _a, _b, _c, _d;
|
|
551
358
|
const disabledButtons = [];
|
|
552
359
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
|
553
360
|
disabledButtons.push(taskbarElements.TaskbarElement.NEXT);
|
|
@@ -558,9 +365,6 @@ const SnkSimpleCrud = class {
|
|
|
558
365
|
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
|
559
366
|
disabledButtons.push(taskbarElements.TaskbarElement.FORM_MODE);
|
|
560
367
|
}
|
|
561
|
-
if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
|
|
562
|
-
disabledButtons.push(taskbarElements.TaskbarElement.CLONE);
|
|
563
|
-
}
|
|
564
368
|
return disabledButtons;
|
|
565
369
|
}
|
|
566
370
|
handleCancelEdit() {
|
|
@@ -653,8 +457,8 @@ const SnkSimpleCrud = class {
|
|
|
653
457
|
}
|
|
654
458
|
getTopTaskBarId() {
|
|
655
459
|
var _a;
|
|
656
|
-
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index.PresentationMode.PRIMARY}` :
|
|
657
|
-
`snkGridTopTaskbar.regular${index.PresentationMode.PRIMARY}`;
|
|
460
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${index$1.PresentationMode.PRIMARY}` :
|
|
461
|
+
`snkGridTopTaskbar.regular${index$1.PresentationMode.PRIMARY}`;
|
|
658
462
|
}
|
|
659
463
|
async keyDownListener(event) {
|
|
660
464
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
|
@@ -704,26 +508,12 @@ const SnkSimpleCrud = class {
|
|
|
704
508
|
.then(() => {
|
|
705
509
|
this.setGridConfig(config);
|
|
706
510
|
this.closeGridConfig();
|
|
707
|
-
this.dataExporterProviderStore();
|
|
708
511
|
});
|
|
709
512
|
evt.stopPropagation();
|
|
710
513
|
}
|
|
711
|
-
async dataExporterProviderStore() {
|
|
712
|
-
if (this.dataUnit == undefined) {
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
if (this._grid == undefined) {
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
|
719
|
-
index$2.store.set("exporterProviders", Object.assign(Object.assign({}, index$2.store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
|
720
|
-
}
|
|
721
|
-
getDataExporterStoreKey() {
|
|
722
|
-
return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
|
|
723
|
-
}
|
|
724
514
|
setGridConfig(config) {
|
|
725
515
|
this.gridConfig = config;
|
|
726
|
-
|
|
516
|
+
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
727
517
|
}
|
|
728
518
|
setFormConfig(config, forceUpdate) {
|
|
729
519
|
if (this.formConfig && !forceUpdate)
|
|
@@ -736,15 +526,6 @@ const SnkSimpleCrud = class {
|
|
|
736
526
|
closeFormConfig() {
|
|
737
527
|
this._showFormConfig = false;
|
|
738
528
|
}
|
|
739
|
-
getPageSize() {
|
|
740
|
-
if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
741
|
-
return 0;
|
|
742
|
-
}
|
|
743
|
-
if (this.pageSize == undefined) {
|
|
744
|
-
return 150;
|
|
745
|
-
}
|
|
746
|
-
return this.pageSize;
|
|
747
|
-
}
|
|
748
529
|
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
|
749
530
|
handleShowFormConfig() {
|
|
750
531
|
return this._showFormConfig && !this.formLegacyConfigName;
|
|
@@ -753,35 +534,26 @@ const SnkSimpleCrud = class {
|
|
|
753
534
|
return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
754
535
|
}
|
|
755
536
|
getFormConfig() {
|
|
756
|
-
var _a;
|
|
757
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
537
|
+
var _a, _b;
|
|
538
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
758
539
|
if (!this.configName && !configFromManager) {
|
|
759
540
|
return this.formConfig;
|
|
760
541
|
}
|
|
761
542
|
return configFromManager;
|
|
762
543
|
}
|
|
763
|
-
updateFormConfig() {
|
|
764
|
-
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
|
765
|
-
this.setFormConfig(newConfig, true);
|
|
766
|
-
if (this._formConfigManager == undefined) {
|
|
767
|
-
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
768
|
-
}
|
|
769
|
-
this._formConfigManager.setConfig(this.formConfig);
|
|
770
|
-
}
|
|
771
544
|
/* istanbul ignore next */
|
|
772
545
|
render() {
|
|
773
546
|
var _a;
|
|
774
547
|
if (this.dataUnit == undefined) {
|
|
775
548
|
return;
|
|
776
549
|
}
|
|
777
|
-
return (index
|
|
550
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
778
551
|
? undefined
|
|
779
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab
|
|
552
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
780
553
|
}
|
|
781
|
-
get _element() { return index
|
|
554
|
+
get _element() { return index.getElement(this); }
|
|
782
555
|
static get watchers() { return {
|
|
783
556
|
"resourceID": ["handleResourceIDChanged"],
|
|
784
|
-
"entityName": ["onChangeEntityName"],
|
|
785
557
|
"mode": ["onModeChange"],
|
|
786
558
|
"dataState": ["observeDataState"],
|
|
787
559
|
"formLegacyConfigName": ["observeFormLegacy"],
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
9
|
-
const index$1 = require('./index-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
|
9
|
+
const index$1 = require('./index-0922807b.js');
|
|
10
10
|
require('./index-102ba62d.js');
|
|
11
11
|
|
|
12
12
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
|
@@ -193,9 +193,8 @@ const SnkTaskbar = class {
|
|
|
193
193
|
className += "ez-padding-left--medium";
|
|
194
194
|
}
|
|
195
195
|
const taskbarElement = taskbarElements.TaskbarElement[def.toString()];
|
|
196
|
-
const dataExporterStoreKey = this._element.dataset.exporterStoreKey || this.configName;
|
|
197
196
|
if (taskbarElement) {
|
|
198
|
-
return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(),
|
|
197
|
+
return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
|
|
199
198
|
}
|
|
200
199
|
else {
|
|
201
200
|
return taskbarElements.buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
|
4
|
-
const index$2 = require('./index-
|
|
4
|
+
const index$2 = require('./index-0922807b.js');
|
|
5
5
|
const index$1 = require('./index-102ba62d.js');
|
|
6
6
|
|
|
7
7
|
exports.TaskbarElement = void 0;
|
|
@@ -50,7 +50,7 @@ const buildCustomButton = (def, className, dataElementId, action, isEnabled) =>
|
|
|
50
50
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions,
|
|
53
|
+
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
|
54
54
|
var _a;
|
|
55
55
|
const title = getTitle(element);
|
|
56
56
|
switch (element) {
|
|
@@ -93,7 +93,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
|
93
93
|
case exports.TaskbarElement.DIVIDER:
|
|
94
94
|
return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
|
95
95
|
case exports.TaskbarElement.DATA_EXPORTER:
|
|
96
|
-
const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[
|
|
96
|
+
const provider = (_a = index$1.store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
|
97
97
|
return index.h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
|
|
98
98
|
case exports.TaskbarElement.ATTACH:
|
|
99
99
|
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
3
|
"./components/snk-filter-bar/filter-item/snk-filter-item.js",
|
|
4
|
-
"./components/snk-data-unit/snk-data-unit.js",
|
|
5
4
|
"./components/snk-application/snk-application.js",
|
|
5
|
+
"./components/snk-data-unit/snk-data-unit.js",
|
|
6
6
|
"./components/snk-taskbar/snk-taskbar.js",
|
|
7
7
|
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
|
8
8
|
"./components/snk-print-selector/snk-print-selector.js",
|