@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
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { StringUtils, ApplicationContext, ObjectUtils, DataType, UserInterface, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
|
5
5
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
6
6
|
import './DataFetcher.js';
|
|
7
|
-
import './
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { I as InMemoryLoader } from './dataunit-fetcher.js';
|
|
8
|
+
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch, C as CrudUtils } from './field-search.js';
|
|
9
|
+
import { P as PresentationMode } from './index2.js';
|
|
10
|
+
import { d as defineCustomElement$d } from './snk-actions-button2.js';
|
|
10
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
12
|
-
import { I as InMemoryLoader } from './dataunit-fetcher.js';
|
|
13
13
|
import './filter-item-type.enum.js';
|
|
14
14
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
|
15
15
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
16
16
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
|
|
17
|
-
import { g as getSelectedIDs, d as defineCustomElement$9 } from './snk-data-unit2.js';
|
|
18
|
-
import { s as store } from './index2.js';
|
|
19
|
-
import { d as defineCustomElement$d } from './snk-actions-button2.js';
|
|
20
17
|
import { d as defineCustomElement$c } from './snk-config-options2.js';
|
|
21
18
|
import { d as defineCustomElement$b } from './snk-configurator2.js';
|
|
22
19
|
import { d as defineCustomElement$a } from './snk-data-exporter2.js';
|
|
20
|
+
import { d as defineCustomElement$9 } from './snk-data-unit2.js';
|
|
23
21
|
import { d as defineCustomElement$8 } from './snk-exporter-email-sender2.js';
|
|
24
22
|
import { d as defineCustomElement$7 } from './snk-field-config2.js';
|
|
25
23
|
import { d as defineCustomElement$6 } from './snk-form-config2.js';
|
|
@@ -31,61 +29,6 @@ import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
|
|
31
29
|
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
|
32
30
|
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
|
33
31
|
|
|
34
|
-
class ClientSideExporterProvider extends 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 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
|
-
DataExporterOption.EXPORT_BY_EMAIL,
|
|
61
|
-
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
62
|
-
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
63
|
-
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
64
|
-
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 === 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
32
|
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
33
|
|
|
91
34
|
const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -101,13 +44,11 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
101
44
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
|
102
45
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
|
103
46
|
this._formConfigFetcher = new FormConfigFetcher();
|
|
104
|
-
this._customEditors = new Map();
|
|
105
|
-
this._customRenders = new Map();
|
|
106
47
|
this._taskbarProcessor = new TaskbarProcessor({
|
|
107
|
-
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false,
|
|
108
|
-
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false,
|
|
109
|
-
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true,
|
|
110
|
-
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true,
|
|
48
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, TaskbarElement.GRID_MODE),
|
|
49
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, TaskbarElement.FORM_MODE),
|
|
50
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, TaskbarElement.GRID_MODE),
|
|
51
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, TaskbarElement.FORM_MODE),
|
|
111
52
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
112
53
|
});
|
|
113
54
|
this._showPopUpGridConfig = false;
|
|
@@ -118,15 +59,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
118
59
|
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
119
60
|
this.dataState = undefined;
|
|
120
61
|
this.dataUnit = undefined;
|
|
121
|
-
this.entityName = undefined;
|
|
122
62
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
|
123
63
|
this.gridConfig = undefined;
|
|
124
64
|
this.formConfig = undefined;
|
|
125
65
|
this._formFields = [];
|
|
126
|
-
this._fieldsProps = new Map();
|
|
127
66
|
this.multipleSelection = undefined;
|
|
128
67
|
this.useCancelConfirm = true;
|
|
129
|
-
this.pageSize = 150;
|
|
130
68
|
this.resourceID = undefined;
|
|
131
69
|
this.taskbarManager = undefined;
|
|
132
70
|
this.messagesBuilder = undefined;
|
|
@@ -137,34 +75,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
137
75
|
this.gridLegacyConfigName = undefined;
|
|
138
76
|
this.formLegacyConfigName = undefined;
|
|
139
77
|
this.ignoreReadOnlyFormFields = false;
|
|
140
|
-
this.autoFocus = true;
|
|
141
|
-
this.domainMessagesBuilder = undefined;
|
|
142
|
-
this.autoLoad = undefined;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Registra um editor customizado para campos da grade e formulário.
|
|
146
|
-
*/
|
|
147
|
-
async addCustomEditor(fieldName, customEditor) {
|
|
148
|
-
if (this._grid && this._form) {
|
|
149
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
150
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const newCustomEditors = new Map(this._customEditors);
|
|
154
|
-
newCustomEditors.set(fieldName, customEditor);
|
|
155
|
-
this._customEditors = newCustomEditors;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Registra um render customizado para colunas da grid.
|
|
159
|
-
*/
|
|
160
|
-
async addGridCustomRender(fieldName, customRender) {
|
|
161
|
-
if (this._grid) {
|
|
162
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const newCustomRenders = new Map(this._customRenders);
|
|
166
|
-
newCustomRenders.set(fieldName, customRender);
|
|
167
|
-
this._customRenders = newCustomRenders;
|
|
168
78
|
}
|
|
169
79
|
handleResourceIDChanged(newValue, oldValue) {
|
|
170
80
|
if (StringUtils.isEmpty(newValue)) {
|
|
@@ -176,30 +86,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
176
86
|
this.loadFormConfig(true);
|
|
177
87
|
this.loadGridConfig(true);
|
|
178
88
|
}
|
|
179
|
-
|
|
180
|
-
* Registra um formatador de valores para uma coluna da grid.
|
|
181
|
-
*/
|
|
182
|
-
async addCustomValueFormatter(columnName, customFormatter) {
|
|
183
|
-
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Remove o formatador de valores de uma coluna da grid.
|
|
187
|
-
*/
|
|
188
|
-
async removeCustomValueFormatter(columnName) {
|
|
189
|
-
this._grid.removeCustomValueFormatter(columnName);
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
193
|
-
*/
|
|
194
|
-
async setFieldProp(fieldName, propName, value) {
|
|
195
|
-
const newCustomFieldProps = new Map(this._fieldsProps);
|
|
196
|
-
const currentProps = this._fieldsProps.get(fieldName);
|
|
197
|
-
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
198
|
-
this._fieldsProps = newCustomFieldProps;
|
|
199
|
-
}
|
|
200
|
-
getButtons(selected, extraButtons) {
|
|
89
|
+
getButtons(selected, changeModeBtn) {
|
|
201
90
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
202
|
-
.concat(
|
|
91
|
+
.concat(changeModeBtn));
|
|
203
92
|
}
|
|
204
93
|
addConfigButton(buttons) {
|
|
205
94
|
if (this.configName === undefined) {
|
|
@@ -239,19 +128,15 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
239
128
|
}
|
|
240
129
|
evt.stopPropagation();
|
|
241
130
|
}
|
|
242
|
-
async onChangeEntityName(newValue) {
|
|
243
|
-
if (this.dataUnit)
|
|
244
|
-
return;
|
|
245
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
246
|
-
this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
|
|
247
|
-
}
|
|
248
131
|
onModeChange() {
|
|
249
132
|
if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
250
133
|
this.initInMemoryDataUnit();
|
|
251
134
|
}
|
|
252
135
|
}
|
|
253
136
|
observeDataState(newValue, oldValue) {
|
|
254
|
-
|
|
137
|
+
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
|
138
|
+
this.dataStateChange.emit(newValue);
|
|
139
|
+
}
|
|
255
140
|
}
|
|
256
141
|
async observeFormLegacy(newValue, oldValue) {
|
|
257
142
|
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
|
@@ -259,28 +144,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
259
144
|
async observeGridLegacy(newValue, oldValue) {
|
|
260
145
|
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
|
261
146
|
}
|
|
262
|
-
async handleDataStateChange(newValue, oldValue) {
|
|
263
|
-
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
|
264
|
-
this.dataStateChange.emit(newValue);
|
|
265
|
-
}
|
|
266
|
-
await this.processRmPrecision();
|
|
267
|
-
}
|
|
268
|
-
async processRmPrecision() {
|
|
269
|
-
var _a, _b;
|
|
270
|
-
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
|
271
|
-
for (const field of fieldsWithRmPrecision || []) {
|
|
272
|
-
if (!field) {
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
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);
|
|
276
|
-
if (!rmPrecision && rmPrecision !== 0) {
|
|
277
|
-
continue;
|
|
278
|
-
}
|
|
279
|
-
await this.setFieldProp(field, 'precision', rmPrecision);
|
|
280
|
-
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
|
281
|
-
}
|
|
282
|
-
this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
|
|
283
|
-
}
|
|
284
147
|
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
|
285
148
|
if (newValue == undefined || newValue == oldValue) {
|
|
286
149
|
return;
|
|
@@ -377,7 +240,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
377
240
|
}
|
|
378
241
|
async componentWillRender() {
|
|
379
242
|
this._resourceID = await this.application.getResourceID();
|
|
380
|
-
this.dataExporterProviderStore();
|
|
381
243
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
|
382
244
|
if (this.configName === undefined) {
|
|
383
245
|
return;
|
|
@@ -389,70 +251,32 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
389
251
|
this.loadGridConfig();
|
|
390
252
|
this.loadFormConfig();
|
|
391
253
|
}
|
|
392
|
-
componentDidRender() {
|
|
393
|
-
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
394
|
-
this.addGridCustomValueFormattters();
|
|
395
|
-
this.setFieldsProps();
|
|
396
|
-
this.setCustomRenders();
|
|
397
|
-
this.setCustomEditors();
|
|
398
|
-
}
|
|
399
254
|
componentWillLoad() {
|
|
400
255
|
this.processMetadata();
|
|
401
256
|
this.onModeChange();
|
|
402
257
|
this.configDatasource();
|
|
403
|
-
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
|
404
258
|
}
|
|
405
259
|
componentDidLoad() {
|
|
406
260
|
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
|
407
261
|
}
|
|
408
|
-
setCustomRenders() {
|
|
409
|
-
if (!this._grid) {
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
for (const [fieldName, customRender] of this._customRenders) {
|
|
413
|
-
this._grid.addGridCustomRender(fieldName, customRender);
|
|
414
|
-
this._customRenders.delete(fieldName);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
setCustomEditors() {
|
|
418
|
-
if (!this._grid || !this._form) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
for (const [fieldName, customEditor] of this._customEditors) {
|
|
422
|
-
this._grid.addCustomEditor(fieldName, customEditor);
|
|
423
|
-
this._form.addCustomEditor(fieldName, customEditor);
|
|
424
|
-
this._customEditors.delete(fieldName);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
262
|
configDatasource() {
|
|
428
263
|
this._multiSelectionListDataSource.setApplication(this.application);
|
|
429
264
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
|
430
265
|
}
|
|
431
|
-
setFieldsProps() {
|
|
432
|
-
if (!this._form) {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
for (const [fieldName, props] of this._fieldsProps) {
|
|
436
|
-
for (const prop in props) {
|
|
437
|
-
this._form.setFieldProp(fieldName, prop, props[prop]);
|
|
438
|
-
}
|
|
439
|
-
this._fieldsProps.delete(fieldName);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
266
|
getTaskBarId() {
|
|
443
|
-
var _a, _b;
|
|
267
|
+
var _a, _b, _c;
|
|
444
268
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
|
445
269
|
return "snkSimpleCrudTaskbar.finish_edition";
|
|
446
270
|
}
|
|
447
271
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
|
448
272
|
!this.dataState.selectionInfo.isAllRecords() &&
|
|
449
|
-
this.dataState.selectionInfo.length > 0) {
|
|
273
|
+
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
450
274
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
|
451
275
|
}
|
|
452
276
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
|
453
277
|
}
|
|
454
278
|
initInMemoryDataUnit() {
|
|
455
|
-
this._inMemoryLoader = new InMemoryLoader(this._metadata
|
|
279
|
+
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
|
456
280
|
this.dataUnit = this._inMemoryLoader.dataUnit;
|
|
457
281
|
this.dataUnitReady.emit(this.dataUnit);
|
|
458
282
|
}
|
|
@@ -491,11 +315,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
491
315
|
var _a;
|
|
492
316
|
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
|
493
317
|
}
|
|
494
|
-
|
|
318
|
+
updateConfig() {
|
|
495
319
|
if (this._formConfigManager == undefined) {
|
|
496
320
|
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
497
321
|
}
|
|
498
322
|
this._formConfigManager.setConfig(this.formConfig);
|
|
323
|
+
return;
|
|
499
324
|
}
|
|
500
325
|
processMetadata() {
|
|
501
326
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
|
@@ -527,28 +352,11 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
527
352
|
};
|
|
528
353
|
}
|
|
529
354
|
}
|
|
530
|
-
addGridCustomValueFormattters() {
|
|
531
|
-
var _a, _b, _c;
|
|
532
|
-
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);
|
|
533
|
-
if (!metadataFields) {
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
const fieldsWithRmPrecision = [];
|
|
537
|
-
metadataFields.forEach((field) => {
|
|
538
|
-
var _a;
|
|
539
|
-
if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
|
|
540
|
-
fieldsWithRmPrecision.push(field.name);
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
fieldsWithRmPrecision.forEach(field => {
|
|
544
|
-
this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
355
|
onDataStateChange(evt) {
|
|
548
356
|
this.dataState = Object.assign({}, evt.detail);
|
|
549
357
|
}
|
|
550
358
|
getTaskBarDisabledButtons() {
|
|
551
|
-
var _a, _b, _c, _d
|
|
359
|
+
var _a, _b, _c, _d;
|
|
552
360
|
const disabledButtons = [];
|
|
553
361
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
|
554
362
|
disabledButtons.push(TaskbarElement.NEXT);
|
|
@@ -559,9 +367,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
559
367
|
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
|
560
368
|
disabledButtons.push(TaskbarElement.FORM_MODE);
|
|
561
369
|
}
|
|
562
|
-
if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
|
|
563
|
-
disabledButtons.push(TaskbarElement.CLONE);
|
|
564
|
-
}
|
|
565
370
|
return disabledButtons;
|
|
566
371
|
}
|
|
567
372
|
handleCancelEdit() {
|
|
@@ -705,23 +510,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
705
510
|
.then(() => {
|
|
706
511
|
this.setGridConfig(config);
|
|
707
512
|
this.closeGridConfig();
|
|
708
|
-
this.dataExporterProviderStore();
|
|
709
513
|
});
|
|
710
514
|
evt.stopPropagation();
|
|
711
515
|
}
|
|
712
|
-
async dataExporterProviderStore() {
|
|
713
|
-
if (this.dataUnit == undefined) {
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
if (this._grid == undefined) {
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
|
720
|
-
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
|
721
|
-
}
|
|
722
|
-
getDataExporterStoreKey() {
|
|
723
|
-
return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
|
|
724
|
-
}
|
|
725
516
|
setGridConfig(config) {
|
|
726
517
|
this.gridConfig = config;
|
|
727
518
|
CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
|
@@ -737,15 +528,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
737
528
|
closeFormConfig() {
|
|
738
529
|
this._showFormConfig = false;
|
|
739
530
|
}
|
|
740
|
-
getPageSize() {
|
|
741
|
-
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
|
742
|
-
return 0;
|
|
743
|
-
}
|
|
744
|
-
if (this.pageSize == undefined) {
|
|
745
|
-
return 150;
|
|
746
|
-
}
|
|
747
|
-
return this.pageSize;
|
|
748
|
-
}
|
|
749
531
|
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
|
750
532
|
handleShowFormConfig() {
|
|
751
533
|
return this._showFormConfig && !this.formLegacyConfigName;
|
|
@@ -754,35 +536,26 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
754
536
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
755
537
|
}
|
|
756
538
|
getFormConfig() {
|
|
757
|
-
var _a;
|
|
758
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
539
|
+
var _a, _b;
|
|
540
|
+
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);
|
|
759
541
|
if (!this.configName && !configFromManager) {
|
|
760
542
|
return this.formConfig;
|
|
761
543
|
}
|
|
762
544
|
return configFromManager;
|
|
763
545
|
}
|
|
764
|
-
updateFormConfig() {
|
|
765
|
-
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
|
766
|
-
this.setFormConfig(newConfig, true);
|
|
767
|
-
if (this._formConfigManager == undefined) {
|
|
768
|
-
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
|
769
|
-
}
|
|
770
|
-
this._formConfigManager.setConfig(this.formConfig);
|
|
771
|
-
}
|
|
772
546
|
/* istanbul ignore next */
|
|
773
547
|
render() {
|
|
774
548
|
var _a;
|
|
775
549
|
if (this.dataUnit == undefined) {
|
|
776
550
|
return;
|
|
777
551
|
}
|
|
778
|
-
return (h("snk-data-unit", {
|
|
552
|
+
return (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(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, 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: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, 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(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
779
553
|
? undefined
|
|
780
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab
|
|
554
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, 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() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && 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 })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
781
555
|
}
|
|
782
556
|
get _element() { return this; }
|
|
783
557
|
static get watchers() { return {
|
|
784
558
|
"resourceID": ["handleResourceIDChanged"],
|
|
785
|
-
"entityName": ["onChangeEntityName"],
|
|
786
559
|
"mode": ["onModeChange"],
|
|
787
560
|
"dataState": ["observeDataState"],
|
|
788
561
|
"formLegacyConfigName": ["observeFormLegacy"],
|
|
@@ -792,13 +565,11 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
792
565
|
}, [6, "snk-simple-crud", {
|
|
793
566
|
"dataState": [16],
|
|
794
567
|
"dataUnit": [16],
|
|
795
|
-
"entityName": [1, "entity-name"],
|
|
796
568
|
"mode": [2],
|
|
797
569
|
"gridConfig": [1040],
|
|
798
570
|
"formConfig": [1040],
|
|
799
571
|
"multipleSelection": [4, "multiple-selection"],
|
|
800
572
|
"useCancelConfirm": [4, "use-cancel-confirm"],
|
|
801
|
-
"pageSize": [2, "page-size"],
|
|
802
573
|
"resourceID": [1, "resource-i-d"],
|
|
803
574
|
"taskbarManager": [16],
|
|
804
575
|
"messagesBuilder": [1040],
|
|
@@ -809,9 +580,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
809
580
|
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
|
810
581
|
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
|
811
582
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
812
|
-
"autoFocus": [4, "auto-focus"],
|
|
813
|
-
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
814
|
-
"autoLoad": [4, "auto-load"],
|
|
815
583
|
"_showPopUpGridConfig": [32],
|
|
816
584
|
"_showFormConfig": [32],
|
|
817
585
|
"_currentViewMode": [32],
|
|
@@ -819,12 +587,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
819
587
|
"_fieldToGetFocus": [32],
|
|
820
588
|
"_customContainerId": [32],
|
|
821
589
|
"_formFields": [32],
|
|
822
|
-
"_fieldsProps": [32],
|
|
823
|
-
"addCustomEditor": [64],
|
|
824
|
-
"addGridCustomRender": [64],
|
|
825
|
-
"addCustomValueFormatter": [64],
|
|
826
|
-
"removeCustomValueFormatter": [64],
|
|
827
|
-
"setFieldProp": [64],
|
|
828
590
|
"goToView": [64],
|
|
829
591
|
"setMetadata": [64],
|
|
830
592
|
"setRecords": [64],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
|
4
|
-
import { P as PresentationMode } from './
|
|
5
|
-
import { s as store } from './
|
|
4
|
+
import { P as PresentationMode } from './index2.js';
|
|
5
|
+
import { s as store } from './index3.js';
|
|
6
6
|
import { d as defineCustomElement$4 } from './snk-actions-button2.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './snk-data-exporter2.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './snk-exporter-email-sender2.js';
|
|
@@ -54,7 +54,7 @@ const buildCustomButton = (def, className, dataElementId, action, isEnabled) =>
|
|
|
54
54
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions,
|
|
57
|
+
const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
|
58
58
|
var _a;
|
|
59
59
|
const title = getTitle(element);
|
|
60
60
|
switch (element) {
|
|
@@ -97,7 +97,7 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
|
97
97
|
case TaskbarElement.DIVIDER:
|
|
98
98
|
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
|
99
99
|
case TaskbarElement.DATA_EXPORTER:
|
|
100
|
-
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[
|
|
100
|
+
const provider = (_a = store.get("exporterProviders")) === null || _a === void 0 ? void 0 : _a[configName];
|
|
101
101
|
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element });
|
|
102
102
|
case TaskbarElement.ATTACH:
|
|
103
103
|
return iconButton("anexo", element, className, dataElementId, title, action, isEnabled);
|
|
@@ -306,9 +306,8 @@ const SnkTaskbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
306
306
|
className += "ez-padding-left--medium";
|
|
307
307
|
}
|
|
308
308
|
const taskbarElement = TaskbarElement[def.toString()];
|
|
309
|
-
const dataExporterStoreKey = this._element.dataset.exporterStoreKey || this.configName;
|
|
310
309
|
if (taskbarElement) {
|
|
311
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(),
|
|
310
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.buildDynamicActionsList(), this.configName, this.presentationMode);
|
|
312
311
|
}
|
|
313
312
|
else {
|
|
314
313
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -423,7 +423,6 @@ class ConfigStorage {
|
|
|
423
423
|
if (config == undefined) {
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
-
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
|
427
426
|
await this.deleteGridConfigCache(name, resourceID);
|
|
428
427
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
|
429
428
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher-e0382e5a.js';
|
|
4
4
|
|
|
@@ -72,12 +72,11 @@ class SnkFormConfigManager {
|
|
|
72
72
|
var _a;
|
|
73
73
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
|
74
74
|
if (fields != undefined && fields.length > 0) {
|
|
75
|
-
return fields.map(({ label, name, readOnly
|
|
75
|
+
return fields.map(({ label, name, readOnly }) => {
|
|
76
76
|
if (label == undefined) {
|
|
77
|
-
|
|
78
|
-
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required });
|
|
77
|
+
return dataUnit.getField(name);
|
|
79
78
|
}
|
|
80
|
-
return { name, label, readOnly
|
|
79
|
+
return { name, label, readOnly };
|
|
81
80
|
})
|
|
82
81
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
|
83
82
|
}
|
|
@@ -99,7 +98,7 @@ class SnkFormConfigManager {
|
|
|
99
98
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
100
99
|
return normalizedText.includes(normalizedFilter);
|
|
101
100
|
}
|
|
102
|
-
|
|
101
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
103
102
|
let fields = this.getFieldsList(dataUnit);
|
|
104
103
|
if (ignoreReadOnlyFormFields) {
|
|
105
104
|
fields = fields.filter(field => {
|
|
@@ -131,8 +130,8 @@ class SnkFormConfigManager {
|
|
|
131
130
|
this._onConfigChange(Object.assign({}, this._config));
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
135
|
-
return this.
|
|
133
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
|
134
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
|
136
135
|
}
|
|
137
136
|
getFormConfigFetcher() {
|
|
138
137
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -8,7 +8,7 @@ const snkDataUnitMessages = {
|
|
|
8
8
|
},
|
|
9
9
|
cancelInfo: {
|
|
10
10
|
clone: "Duplicação descartada!",
|
|
11
|
-
insert: "A inclusão
|
|
11
|
+
insert: "A inclusão descartada!",
|
|
12
12
|
update: "A edição foi descartada!"
|
|
13
13
|
},
|
|
14
14
|
confirm: {
|
|
@@ -29,7 +29,6 @@ const snkDataUnitMessages = {
|
|
|
29
29
|
forbiddenRemove: "Não é possível remover. Verifique as permissões de acesso.",
|
|
30
30
|
removeAllConfirmation: "Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",
|
|
31
31
|
removeAllInfo: "Os {{size}} registros foram removidos com sucesso!",
|
|
32
|
-
fieldNameRequired: "É necessário informar o nome da coluna."
|
|
33
32
|
};
|
|
34
33
|
|
|
35
34
|
const snkFilterBarMessages = {
|
|
@@ -285,7 +284,6 @@ const snkDataExporterMessages = {
|
|
|
285
284
|
},
|
|
286
285
|
label: {
|
|
287
286
|
currentPage: "Somente a página atual",
|
|
288
|
-
allRecords: "Todos os registros",
|
|
289
287
|
spreadsheet: "Planilha",
|
|
290
288
|
cube: "Cubo",
|
|
291
289
|
sendByEmail: "Enviar por email",
|
|
@@ -298,7 +296,6 @@ const snkDataExporterMessages = {
|
|
|
298
296
|
},
|
|
299
297
|
title: {
|
|
300
298
|
error: "Erro",
|
|
301
|
-
permission: "Falha detectada",
|
|
302
299
|
},
|
|
303
300
|
limitExceeded: {
|
|
304
301
|
title: "Atenção",
|
|
@@ -555,7 +552,7 @@ class SnkMessageBuilder {
|
|
|
555
552
|
this.loadAppMessages().then((msgs) => {
|
|
556
553
|
this._appMessages = msgs;
|
|
557
554
|
}, error => {
|
|
558
|
-
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages', error);
|
|
555
|
+
console.info('O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js', error);
|
|
559
556
|
});
|
|
560
557
|
}
|
|
561
558
|
/**
|
|
@@ -647,10 +644,17 @@ class SnkMessageBuilder {
|
|
|
647
644
|
return message;
|
|
648
645
|
}
|
|
649
646
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
647
|
+
loadAppMessages() {
|
|
648
|
+
return new Promise(async (accept, reject) => {
|
|
649
|
+
const messagesUrl = await this._application.getApplicationPath();
|
|
650
|
+
import(/* webpackIgnore: true */ `${messagesUrl}/messages/appmessages.js`)
|
|
651
|
+
.then(module => {
|
|
652
|
+
accept(module.default);
|
|
653
|
+
})
|
|
654
|
+
.catch(reason => {
|
|
655
|
+
reject(reason);
|
|
656
|
+
});
|
|
657
|
+
});
|
|
654
658
|
}
|
|
655
659
|
}
|
|
656
660
|
var OperationMap;
|