@sankhyalabs/sankhyablocks 8.15.0-rc.9 → 8.15.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-d4c99a5e.js → ConfigStorage-942ce74b.js} +70 -7
- package/dist/cjs/{DataFetcher-99f0f6ed.js → DataFetcher-313debd8.js} +13 -5
- package/dist/cjs/{SnkFormConfigManager-3621bfc4.js → SnkFormConfigManager-f9dc0d28.js} +21 -13
- package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
- package/dist/cjs/SnkMultiSelectionListDataSource-303e85d1.js +140 -0
- package/dist/cjs/{auth-fetcher-5161d082.js → auth-fetcher-54f5ff9d.js} +1 -1
- package/dist/cjs/{form-config-fetcher-9f1a13ca.js → form-config-fetcher-2dd00e5b.js} +13 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8bbee432.js → pesquisa-fetcher-213797ec.js} +273 -50
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +519 -4
- package/dist/cjs/snk-application.cjs.entry.js +13 -8
- package/dist/cjs/snk-attach.cjs.entry.js +66 -46
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +25 -17
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +6 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-41c29713.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +31 -7
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +8 -2
- package/dist/cjs/snk-form.cjs.entry.js +11 -4
- package/dist/cjs/snk-grid.cjs.entry.js +40 -21
- package/dist/cjs/{snk-guides-viewer-e87f01b9.js → snk-guides-viewer-4b6ecda8.js} +20 -11
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +255 -21
- package/dist/cjs/snk-taskbar.cjs.entry.js +69 -8
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-application/snk-application.js +42 -2
- package/dist/collection/components/snk-attach/snk-attach.js +39 -24
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +71 -11
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -7
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +1 -1
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js +22 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +44 -3
- package/dist/collection/components/snk-form/snk-form.js +25 -1
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +20 -12
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +11 -5
- package/dist/collection/components/snk-grid/snk-grid.js +86 -16
- package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
- package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +421 -17
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +86 -8
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +9 -40
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +13 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/DataFetcher.js +13 -5
- package/dist/components/SnkFormConfigManager.js +19 -11
- package/dist/components/SnkMessageBuilder.js +4 -0
- package/dist/components/dataunit-fetcher.js +41 -39
- package/dist/components/field-search.js +93 -3
- package/dist/components/form-config-fetcher.js +12 -0
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-application2.js +9 -1
- package/dist/components/snk-attach2.js +115 -52
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +23 -11
- package/dist/components/snk-custom-slot-elements.js +7 -3
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-detail-view2.js +48 -11
- package/dist/components/snk-filter-bar2.js +29 -4
- package/dist/components/snk-filter-detail2.js +5 -1
- package/dist/components/snk-filter-item2.js +11 -6
- package/dist/components/snk-form-config2.js +7 -1
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +42 -18
- package/dist/components/snk-simple-crud2.js +317 -29
- package/dist/components/snk-taskbar2.js +75 -11
- package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-86187da3.js} +70 -7
- package/dist/esm/{DataFetcher-a650ae58.js → DataFetcher-c1baf61d.js} +13 -5
- package/dist/esm/{SnkFormConfigManager-692e20c7.js → SnkFormConfigManager-f53f9f87.js} +21 -13
- package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
- package/dist/esm/SnkMultiSelectionListDataSource-36918dbf.js +133 -0
- package/dist/esm/{auth-fetcher-17dc5b5e.js → auth-fetcher-039abba3.js} +1 -1
- package/dist/esm/{form-config-fetcher-f121f880.js → form-config-fetcher-30fb808f.js} +13 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-5a8cae10.js → pesquisa-fetcher-fe6f3826.js} +262 -43
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +518 -5
- package/dist/esm/snk-application.entry.js +13 -8
- package/dist/esm/snk-attach.entry.js +65 -45
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +25 -17
- package/dist/esm/snk-custom-slot-elements.entry.js +7 -3
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-de1d140d.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-filter-bar.entry.js +31 -7
- package/dist/esm/snk-filter-detail.entry.js +4 -1
- package/dist/esm/snk-filter-item.entry.js +10 -6
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +9 -3
- package/dist/esm/snk-form.entry.js +11 -4
- package/dist/esm/snk-grid.entry.js +41 -22
- package/dist/esm/{snk-guides-viewer-ba8ce538.js → snk-guides-viewer-113be3fd.js} +20 -11
- package/dist/esm/snk-guides-viewer.entry.js +6 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +256 -22
- package/dist/esm/snk-taskbar.entry.js +70 -9
- package/dist/sankhyablocks/p-032fe52e.js +1 -0
- package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
- package/dist/sankhyablocks/p-0899e0b5.entry.js +1 -0
- package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/p-154a7f33.entry.js +1 -0
- package/dist/sankhyablocks/p-15802c59.entry.js +1 -0
- package/dist/sankhyablocks/p-164666b1.js +65 -0
- package/dist/sankhyablocks/p-21a81901.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-328585d0.entry.js +1 -0
- package/dist/sankhyablocks/p-47bad461.entry.js +11 -0
- package/dist/sankhyablocks/{p-9a5d1b39.js → p-52c8e589.js} +1 -1
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-5cb07080.js +1 -0
- package/dist/sankhyablocks/p-74d349c3.entry.js +1 -0
- package/dist/sankhyablocks/p-7663f597.entry.js +1 -0
- package/dist/sankhyablocks/{p-50783a8b.js → p-913a9979.js} +1 -1
- package/dist/sankhyablocks/{p-827e4b01.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/p-af1ac81f.entry.js +1 -0
- package/dist/sankhyablocks/p-aff76a53.js +56 -0
- package/dist/sankhyablocks/p-b4525fc0.entry.js +1 -0
- package/dist/sankhyablocks/p-cce0865d.js +1 -0
- package/dist/sankhyablocks/{p-be75153c.js → p-dc7c9047.js} +1 -1
- package/dist/sankhyablocks/p-dec65f6c.entry.js +1 -0
- package/dist/sankhyablocks/p-df5451c7.js +26 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d608b62.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/{p-20b46647.entry.js → p-ee9536bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-f13f7616.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -1
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +8 -0
- package/dist/types/components/snk-form/snk-form.d.ts +6 -1
- package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +4 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
- package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
- package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
- package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +76 -3
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +171 -10
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
- package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-1c55becf.entry.js +0 -1
- package/dist/sankhyablocks/p-230f5148.entry.js +0 -1
- package/dist/sankhyablocks/p-2936303b.js +0 -1
- package/dist/sankhyablocks/p-2e4eb644.entry.js +0 -1
- package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
- package/dist/sankhyablocks/p-3e91d5ea.entry.js +0 -1
- package/dist/sankhyablocks/p-43de1258.entry.js +0 -1
- package/dist/sankhyablocks/p-4ce6cb02.entry.js +0 -11
- package/dist/sankhyablocks/p-5e681b7b.js +0 -65
- package/dist/sankhyablocks/p-5f74c859.entry.js +0 -1
- package/dist/sankhyablocks/p-67aedbe0.js +0 -56
- package/dist/sankhyablocks/p-69754d94.entry.js +0 -1
- package/dist/sankhyablocks/p-725d04ba.js +0 -1
- package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
- package/dist/sankhyablocks/p-8a3a2631.entry.js +0 -1
- package/dist/sankhyablocks/p-965b79a9.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a13ccb86.js +0 -26
- package/dist/sankhyablocks/p-aba0e87f.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-d26e0a02.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d7d85fa9.entry.js +0 -1
- package/dist/sankhyablocks/p-e3bd000e.entry.js +0 -1
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
- package/dist/sankhyablocks/p-fcdcb0e2.entry.js +0 -1
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -4,26 +4,31 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
7
8
|
const constants = require('./constants-35ddd366.js');
|
8
9
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
9
|
-
require('./DataFetcher-
|
10
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
10
|
+
require('./DataFetcher-313debd8.js');
|
11
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-213797ec.js');
|
12
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-303e85d1.js');
|
11
13
|
const index$1 = require('./index-0922807b.js');
|
12
14
|
require('./ISave-e91b70a7.js');
|
13
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./PreloadManager-84466da6.js');
|
16
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
|
-
require('./form-config-fetcher-
|
18
|
+
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
18
19
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
19
|
-
const
|
20
|
+
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
21
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f9dc0d28.js');
|
20
22
|
require('./index-102ba62d.js');
|
21
23
|
require('./PrintUtils-bcaeb82f.js');
|
22
|
-
require('./ResourceIDUtils-5ff86aa7.js');
|
23
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
25
|
+
require('./ResourceIDUtils-5ff86aa7.js');
|
24
26
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
25
27
|
|
26
|
-
const
|
28
|
+
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
29
|
+
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
30
|
+
|
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}";
|
27
32
|
|
28
33
|
const SnkSimpleCrud = class {
|
29
34
|
constructor(hostRef) {
|
@@ -32,20 +37,24 @@ const SnkSimpleCrud = class {
|
|
32
37
|
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
33
38
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
34
39
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
35
|
-
this.
|
36
|
-
this.
|
40
|
+
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
41
|
+
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
37
42
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
38
43
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
44
|
+
this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
|
39
45
|
this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
|
40
|
-
"snkSimpleCrudTaskbar.form_regular": this.
|
41
|
-
"snkSimpleCrudTaskbar.grid_regular": this.
|
42
|
-
"snkSimpleCrudTaskbar.form_selected": this.
|
43
|
-
"snkSimpleCrudTaskbar.grid_selected": this.
|
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),
|
44
50
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
45
51
|
});
|
52
|
+
this._showPopUpGridConfig = false;
|
53
|
+
this._showFormConfig = false;
|
46
54
|
this._currentViewMode = constants.VIEW_MODE.GRID;
|
47
55
|
this._config = undefined;
|
48
56
|
this._fieldToGetFocus = undefined;
|
57
|
+
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
49
58
|
this.dataState = undefined;
|
50
59
|
this.dataUnit = undefined;
|
51
60
|
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
@@ -54,11 +63,39 @@ const SnkSimpleCrud = class {
|
|
54
63
|
this._formFields = [];
|
55
64
|
this.multipleSelection = undefined;
|
56
65
|
this.useCancelConfirm = true;
|
66
|
+
this.resourceID = undefined;
|
57
67
|
this.taskbarManager = undefined;
|
58
68
|
this.messagesBuilder = undefined;
|
59
69
|
this.useEnterLikeTab = false;
|
60
70
|
this.actionsList = undefined;
|
61
71
|
this.configName = undefined;
|
72
|
+
this.showConfiguratorButtons = undefined;
|
73
|
+
this.gridLegacyConfigName = undefined;
|
74
|
+
this.formLegacyConfigName = undefined;
|
75
|
+
this.ignoreReadOnlyFormFields = false;
|
76
|
+
}
|
77
|
+
handleResourceIDChanged(newValue, oldValue) {
|
78
|
+
if (core.StringUtils.isEmpty(newValue)) {
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
if (newValue === oldValue) {
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
this.loadFormConfig(true);
|
85
|
+
this.loadGridConfig(true);
|
86
|
+
}
|
87
|
+
getButtons(selected, changeModeBtn) {
|
88
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
89
|
+
.concat(changeModeBtn));
|
90
|
+
}
|
91
|
+
addConfigButton(buttons) {
|
92
|
+
if (this.configName === undefined) {
|
93
|
+
return buttons;
|
94
|
+
}
|
95
|
+
return buttons.concat(taskbarElements.TaskbarElement.CONFIGURATOR);
|
96
|
+
}
|
97
|
+
get application() {
|
98
|
+
return core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
62
99
|
}
|
63
100
|
resolveInMemoryBtns(taskbarButtons) {
|
64
101
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -78,7 +115,10 @@ const SnkSimpleCrud = class {
|
|
78
115
|
}
|
79
116
|
actionClickListener(evt) {
|
80
117
|
const act = evt.detail;
|
81
|
-
if (act === taskbarElements.TaskbarElement.
|
118
|
+
if (act === taskbarElements.TaskbarElement.CONFIGURATOR) {
|
119
|
+
this._snkConfigurator.open();
|
120
|
+
}
|
121
|
+
else if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
82
122
|
this.goToView(constants.VIEW_MODE.GRID);
|
83
123
|
}
|
84
124
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
@@ -96,17 +136,129 @@ const SnkSimpleCrud = class {
|
|
96
136
|
this.dataStateChange.emit(newValue);
|
97
137
|
}
|
98
138
|
}
|
99
|
-
|
139
|
+
async observeFormLegacy(newValue, oldValue) {
|
140
|
+
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
141
|
+
}
|
142
|
+
async observeGridLegacy(newValue, oldValue) {
|
143
|
+
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
144
|
+
}
|
145
|
+
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
146
|
+
if (newValue == undefined || newValue == oldValue) {
|
147
|
+
return;
|
148
|
+
}
|
149
|
+
if (!this._gridConfigAlreadyLoaded) {
|
150
|
+
return;
|
151
|
+
}
|
152
|
+
await this.loadGridConfig(true);
|
153
|
+
}
|
154
|
+
async handleUpdateFormLegacyConfig(newValue, oldValue) {
|
155
|
+
if (newValue == undefined || newValue == oldValue) {
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
if (!this._formConfigAlreadyLoaded) {
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
this.loadFormConfig(true);
|
162
|
+
}
|
163
|
+
openConfig(viewMode) {
|
164
|
+
this._snkConfigurator.close();
|
165
|
+
if (viewMode === constants.VIEW_MODE.GRID) {
|
166
|
+
this.openGridConfig();
|
167
|
+
}
|
168
|
+
else if (viewMode === constants.VIEW_MODE.FORM) {
|
169
|
+
this.openFormConfig();
|
170
|
+
}
|
171
|
+
}
|
172
|
+
openGridConfig() {
|
173
|
+
this._grid.getColumnsState()
|
174
|
+
.then((gridColumns) => {
|
175
|
+
this._snkGridConfig.columns = gridColumns.filter(c => c.name);
|
176
|
+
this._snkGridConfig.selectedIndex = 0;
|
177
|
+
this._showPopUpGridConfig = true;
|
178
|
+
});
|
179
|
+
}
|
180
|
+
async openFormConfig() {
|
181
|
+
var _a, _b;
|
182
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
183
|
+
if (this.formLegacyConfigName) {
|
184
|
+
const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
|
185
|
+
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
|
186
|
+
await this.application.alert(title, message);
|
187
|
+
return;
|
188
|
+
}
|
189
|
+
this._showFormConfig = true;
|
190
|
+
}
|
191
|
+
addGridLegacyConfigName() {
|
192
|
+
if (this.gridLegacyConfigName && this.configName) {
|
193
|
+
ConfigStorage.ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
loadGridConfig(forceUpdate) {
|
197
|
+
if (this.configName === undefined) {
|
198
|
+
return;
|
199
|
+
}
|
200
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
201
|
+
return;
|
202
|
+
}
|
203
|
+
this.addGridLegacyConfigName();
|
204
|
+
this._gridConfigAlreadyLoaded = true;
|
205
|
+
return new Promise((accept, reject) => {
|
206
|
+
ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
|
207
|
+
.then(config => {
|
208
|
+
this.setGridConfig(config);
|
209
|
+
accept();
|
210
|
+
})
|
211
|
+
.catch(reason => {
|
212
|
+
reject(reason);
|
213
|
+
});
|
214
|
+
});
|
215
|
+
}
|
216
|
+
formConfigIsLoaded() {
|
217
|
+
return this.formConfig != undefined || this._formConfigAlreadyLoaded;
|
218
|
+
}
|
219
|
+
async loadFormConfig(forceLoad = false) {
|
220
|
+
if (this.configName === undefined) {
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
if (this._formConfigManager == undefined) {
|
224
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
225
|
+
this._formConfigManager.setConfig(this.formConfig);
|
226
|
+
}
|
227
|
+
if (this.formConfigIsLoaded() && !forceLoad) {
|
228
|
+
return;
|
229
|
+
}
|
230
|
+
this._formConfigAlreadyLoaded = true;
|
231
|
+
let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
|
232
|
+
if (loadedLegacyConfig != undefined) {
|
233
|
+
this._formConfigManager.setConfig(loadedLegacyConfig);
|
234
|
+
this.setFormConfig(loadedLegacyConfig);
|
235
|
+
return;
|
236
|
+
}
|
237
|
+
this.setFormConfig(await this._formConfigManager.loadConfig());
|
238
|
+
}
|
239
|
+
async componentWillRender() {
|
240
|
+
this._resourceID = await this.application.getResourceID();
|
100
241
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
242
|
+
if (this.configName === undefined) {
|
243
|
+
return;
|
244
|
+
}
|
245
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
246
|
+
return;
|
247
|
+
}
|
248
|
+
await this.addGridLegacyConfigName();
|
249
|
+
this.loadGridConfig();
|
250
|
+
this.loadFormConfig();
|
101
251
|
}
|
102
252
|
componentWillLoad() {
|
103
253
|
this.processMetadata();
|
104
254
|
this.onModeChange();
|
105
255
|
this.configDatasource();
|
106
256
|
}
|
257
|
+
componentDidLoad() {
|
258
|
+
utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
259
|
+
}
|
107
260
|
configDatasource() {
|
108
|
-
|
109
|
-
this._multiSelectionListDataSource.setApplication(application);
|
261
|
+
this._multiSelectionListDataSource.setApplication(this.application);
|
110
262
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
111
263
|
}
|
112
264
|
getTaskBarId() {
|
@@ -147,6 +299,27 @@ const SnkSimpleCrud = class {
|
|
147
299
|
getRecords() {
|
148
300
|
return Promise.resolve(this.dataUnit.records);
|
149
301
|
}
|
302
|
+
/**
|
303
|
+
* Usado para abrir o configurator do CRUD
|
304
|
+
*/
|
305
|
+
async openConfigurator() {
|
306
|
+
var _a;
|
307
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
308
|
+
}
|
309
|
+
/**
|
310
|
+
* Usado para fechar o configurator do CRUD
|
311
|
+
*/
|
312
|
+
async closeConfigurator() {
|
313
|
+
var _a;
|
314
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
315
|
+
}
|
316
|
+
updateConfig() {
|
317
|
+
if (this._formConfigManager == undefined) {
|
318
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
319
|
+
}
|
320
|
+
this._formConfigManager.setConfig(this.formConfig);
|
321
|
+
return;
|
322
|
+
}
|
150
323
|
processMetadata() {
|
151
324
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
152
325
|
const fieldMetadata = [];
|
@@ -201,6 +374,14 @@ const SnkSimpleCrud = class {
|
|
201
374
|
this.dataUnit.clearSelection();
|
202
375
|
}
|
203
376
|
}
|
377
|
+
handleConfiguratorEvent(evt, type) {
|
378
|
+
evt.stopImmediatePropagation();
|
379
|
+
if (type === 'SAVE') {
|
380
|
+
this.configuratorSave.emit();
|
381
|
+
return;
|
382
|
+
}
|
383
|
+
this.configuratorCancel.emit();
|
384
|
+
}
|
204
385
|
getColumnSearch(actionButton, item) {
|
205
386
|
if (this._columnSearch != undefined) {
|
206
387
|
return this._columnSearch;
|
@@ -242,7 +423,9 @@ const SnkSimpleCrud = class {
|
|
242
423
|
return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
|
243
424
|
}
|
244
425
|
handleFormSetFields(fields) {
|
245
|
-
this._formFields
|
426
|
+
if (!core.ObjectUtils.equals(this._formFields, fields)) {
|
427
|
+
this._formFields = fields !== null && fields !== void 0 ? fields : [];
|
428
|
+
}
|
246
429
|
}
|
247
430
|
fieldsOptionLoader(argument) {
|
248
431
|
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
@@ -314,16 +497,67 @@ const SnkSimpleCrud = class {
|
|
314
497
|
disconnectedCallback() {
|
315
498
|
window.removeEventListener("keydown", this._keyDownHandler);
|
316
499
|
}
|
500
|
+
gridConfigChangeHandler(evt) {
|
501
|
+
const config = evt.detail;
|
502
|
+
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
503
|
+
evt.stopPropagation();
|
504
|
+
}
|
505
|
+
modalConfigChangeHandler(evt) {
|
506
|
+
const config = evt.detail;
|
507
|
+
this._grid.setColumnsState(config.columns)
|
508
|
+
.then(() => {
|
509
|
+
this.setGridConfig(config);
|
510
|
+
this.closeGridConfig();
|
511
|
+
});
|
512
|
+
evt.stopPropagation();
|
513
|
+
}
|
514
|
+
setGridConfig(config) {
|
515
|
+
this.gridConfig = config;
|
516
|
+
SnkMultiSelectionListDataSource.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
517
|
+
}
|
518
|
+
setFormConfig(config, forceUpdate) {
|
519
|
+
if (this.formConfig && !forceUpdate)
|
520
|
+
return;
|
521
|
+
this.formConfig = config;
|
522
|
+
}
|
523
|
+
closeGridConfig() {
|
524
|
+
this._showPopUpGridConfig = false;
|
525
|
+
}
|
526
|
+
closeFormConfig() {
|
527
|
+
this._showFormConfig = false;
|
528
|
+
}
|
529
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
530
|
+
handleShowFormConfig() {
|
531
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
532
|
+
}
|
533
|
+
resolveResourceID() {
|
534
|
+
return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
535
|
+
}
|
536
|
+
getFormConfig() {
|
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);
|
539
|
+
if (!this.configName && !configFromManager) {
|
540
|
+
return this.formConfig;
|
541
|
+
}
|
542
|
+
return configFromManager;
|
543
|
+
}
|
544
|
+
/* istanbul ignore next */
|
317
545
|
render() {
|
318
546
|
var _a;
|
319
|
-
|
547
|
+
if (this.dataUnit == undefined) {
|
548
|
+
return;
|
549
|
+
}
|
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)
|
320
551
|
? undefined
|
321
|
-
: 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:
|
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() }))));
|
322
553
|
}
|
323
554
|
get _element() { return index.getElement(this); }
|
324
555
|
static get watchers() { return {
|
556
|
+
"resourceID": ["handleResourceIDChanged"],
|
325
557
|
"mode": ["onModeChange"],
|
326
|
-
"dataState": ["observeDataState"]
|
558
|
+
"dataState": ["observeDataState"],
|
559
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
560
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
327
561
|
}; }
|
328
562
|
};
|
329
563
|
SnkSimpleCrud.style = snkSimpleCrudCss;
|
@@ -35,12 +35,27 @@ const SnkTaskbar = class {
|
|
35
35
|
[taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
36
36
|
[taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
37
37
|
};
|
38
|
+
this.onSaveEvent = (action) => {
|
39
|
+
switch (action.type) {
|
40
|
+
case core.Action.FIELD_INVALIDATED:
|
41
|
+
case core.Action.DATA_SAVED:
|
42
|
+
case core.Action.SAVING_ERROR:
|
43
|
+
this._isWaitingForSave = false;
|
44
|
+
break;
|
45
|
+
case core.Action.SAVING_DATA:
|
46
|
+
this._isWaitingForSave = true;
|
47
|
+
break;
|
48
|
+
}
|
49
|
+
};
|
38
50
|
this._permissions = undefined;
|
39
51
|
this._overFlowedElements = [];
|
40
52
|
this._customElements = undefined;
|
41
53
|
this._customElementsId = undefined;
|
42
54
|
this._slotContainer = undefined;
|
43
55
|
this._hiddenActionsList = [];
|
56
|
+
this._lastWidth = undefined;
|
57
|
+
this._hasToUpdateOverFlow = false;
|
58
|
+
this._isWaitingForSave = false;
|
44
59
|
this.alignRigth = false;
|
45
60
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
46
61
|
this.customContainerId = undefined;
|
@@ -56,12 +71,29 @@ const SnkTaskbar = class {
|
|
56
71
|
this.presentationMode = index$1.PresentationMode.PRIMARY;
|
57
72
|
this.messagesBuilder = undefined;
|
58
73
|
}
|
74
|
+
handleCustomSlotElementsLoaded(event) {
|
75
|
+
if (this.hasToSearchCustomElements(event)) {
|
76
|
+
this.getCustomElements(true);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
hasToSearchCustomElements(event) {
|
80
|
+
return this.customSlotId === event.detail && !this._slotContainer;
|
81
|
+
}
|
59
82
|
observeButtons() {
|
60
83
|
this._definitions = undefined;
|
61
84
|
requestAnimationFrame(() => {
|
62
85
|
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
63
86
|
});
|
64
87
|
}
|
88
|
+
observeDisabledButtons() {
|
89
|
+
var _a;
|
90
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
91
|
+
}
|
92
|
+
observeLastWidth(newValue, oldValue) {
|
93
|
+
if (oldValue === 0 && newValue !== 0) {
|
94
|
+
this._hasToUpdateOverFlow = true;
|
95
|
+
}
|
96
|
+
}
|
65
97
|
// Internal methods
|
66
98
|
elementsFromString(strButtons) {
|
67
99
|
const elements = [];
|
@@ -130,7 +162,13 @@ const SnkTaskbar = class {
|
|
130
162
|
this.dataUnit.cancelEdition();
|
131
163
|
break;
|
132
164
|
case taskbarElements.TaskbarElement.SAVE:
|
133
|
-
this.
|
165
|
+
if (!this._isWaitingForSave) {
|
166
|
+
this._isWaitingForSave = true;
|
167
|
+
this.dataUnit.saveData()
|
168
|
+
.finally(() => {
|
169
|
+
this._isWaitingForSave = false;
|
170
|
+
});
|
171
|
+
}
|
134
172
|
break;
|
135
173
|
}
|
136
174
|
}
|
@@ -217,22 +255,28 @@ const SnkTaskbar = class {
|
|
217
255
|
}
|
218
256
|
return index.h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
219
257
|
}
|
220
|
-
getCustomElements() {
|
258
|
+
getCustomElements(searchOnDocument) {
|
221
259
|
var _a, _b;
|
222
260
|
this._customElementsId = [];
|
223
261
|
this._customElements = new Map();
|
224
|
-
this._slotContainer = this.buildSlotContainer();
|
262
|
+
this._slotContainer = this.buildSlotContainer(searchOnDocument);
|
225
263
|
const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
226
264
|
customElementsArray.forEach(item => this._customElements.set(item.id, item));
|
227
265
|
}
|
228
|
-
buildSlotContainer() {
|
266
|
+
buildSlotContainer(searchOnDocument) {
|
267
|
+
let slotContainer;
|
229
268
|
if (this.customContainerId) {
|
230
269
|
const container = document.querySelector(`#${this.customContainerId}`);
|
231
|
-
|
270
|
+
slotContainer = container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
|
232
271
|
}
|
233
272
|
else {
|
234
|
-
|
273
|
+
slotContainer = this._element.querySelector(`#${this.customSlotId}`);
|
274
|
+
}
|
275
|
+
// Caso nõa encontre o slot container dentro do próprio elemento, tenta buscar na DOM do document.
|
276
|
+
if (searchOnDocument && !slotContainer) {
|
277
|
+
slotContainer = document.querySelector(`#${this.customSlotId}`);
|
235
278
|
}
|
279
|
+
return slotContainer;
|
236
280
|
}
|
237
281
|
componentWillLoad() {
|
238
282
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -245,10 +289,20 @@ const SnkTaskbar = class {
|
|
245
289
|
this.getCustomElements();
|
246
290
|
}
|
247
291
|
componentWillRender() {
|
292
|
+
this.handleDefinitions();
|
293
|
+
this.validatePresentationMode();
|
294
|
+
this.updateOverFlowIfNeeded();
|
295
|
+
}
|
296
|
+
handleDefinitions() {
|
248
297
|
if (this._definitions == undefined && this._permissions) {
|
249
298
|
this._definitions = this.elementsFromString(this.buttons);
|
250
299
|
}
|
251
|
-
|
300
|
+
}
|
301
|
+
updateOverFlowIfNeeded() {
|
302
|
+
if (this._hasToUpdateOverFlow) {
|
303
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
304
|
+
this._hasToUpdateOverFlow = false;
|
305
|
+
}
|
252
306
|
}
|
253
307
|
handleOverFlow(overFlowingElements) {
|
254
308
|
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
@@ -312,9 +366,14 @@ const SnkTaskbar = class {
|
|
312
366
|
const dataInfo = { dataUnit: this.dataUnit };
|
313
367
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
314
368
|
this.handleOverFlowStrategy();
|
369
|
+
this.dataUnit.subscribe(this.onSaveEvent);
|
315
370
|
}
|
316
371
|
componentDidRender() {
|
317
372
|
this.appendCustomElementsInTaskbar();
|
373
|
+
this.updateLastWidth();
|
374
|
+
}
|
375
|
+
updateLastWidth() {
|
376
|
+
this._lastWidth = this._element.getBoundingClientRect().width;
|
318
377
|
}
|
319
378
|
disconnectedCallback() {
|
320
379
|
var _a;
|
@@ -360,7 +419,9 @@ const SnkTaskbar = class {
|
|
360
419
|
}
|
361
420
|
get _element() { return index.getElement(this); }
|
362
421
|
static get watchers() { return {
|
363
|
-
"buttons": ["observeButtons"]
|
422
|
+
"buttons": ["observeButtons"],
|
423
|
+
"disabledButtons": ["observeDisabledButtons"],
|
424
|
+
"_lastWidth": ["observeLastWidth"]
|
364
425
|
}; }
|
365
426
|
};
|
366
427
|
SnkTaskbar.style = snkTaskbarCss;
|
@@ -6,7 +6,6 @@
|
|
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",
|
9
|
-
"./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
|
10
9
|
"./components/snk-actions-button/snk-actions-button.js",
|
11
10
|
"./components/snk-actions-button/subcomponents/snk-actions-form.js",
|
12
11
|
"./components/snk-actions-button/subcomponents/snk-client-confirm.js",
|
@@ -35,12 +34,13 @@
|
|
35
34
|
"./components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js",
|
36
35
|
"./components/snk-filter-field-search/snk-filter-field-search.js",
|
37
36
|
"./components/snk-form/snk-form.js",
|
38
|
-
"./components/snk-form/subcomponents/snk-config
|
39
|
-
"./components/snk-form
|
40
|
-
"./components/snk-form/subcomponents/snk-
|
37
|
+
"./components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config.js",
|
38
|
+
"./components/snk-form-config/snk-form-config.js",
|
39
|
+
"./components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js",
|
40
|
+
"./components/snk-form-config/subcomponents/snk-field-config/snk-field-config.js",
|
41
41
|
"./components/snk-grid/snk-grid.js",
|
42
|
-
"./components/snk-grid
|
43
|
-
"./components/snk-grid/
|
42
|
+
"./components/snk-grid-config/snk-grid-config.js",
|
43
|
+
"./components/snk-grid-config/snk-select-box/snk-select-box.js",
|
44
44
|
"./components/snk-personalized-filter/snk-personalized-filter.js",
|
45
45
|
"./components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js",
|
46
46
|
"./components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js",
|
@@ -3,7 +3,7 @@ import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
3
3
|
import { h } from "@stencil/core";
|
4
4
|
import AppletCaller from "../../lib/applet-caller/applet-caller";
|
5
5
|
import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
|
6
|
-
import { ConfigStorage } from
|
6
|
+
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
7
7
|
import { DataFetcher } from "../../lib/http/data-fetcher/DataFetcher";
|
8
8
|
import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
|
9
9
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher";
|
@@ -33,6 +33,8 @@ export class SnkApplication {
|
|
33
33
|
this._isLoadedByPk = false;
|
34
34
|
this.messagesBuilder = undefined;
|
35
35
|
this.configName = undefined;
|
36
|
+
this.gridLegacyConfigName = undefined;
|
37
|
+
this.formLegacyConfigName = undefined;
|
36
38
|
this.loadByPK = undefined;
|
37
39
|
}
|
38
40
|
async processPendingActions(actionsLocker) {
|
@@ -941,7 +943,11 @@ export class SnkApplication {
|
|
941
943
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
942
944
|
this.registerPkChangeListener();
|
943
945
|
ErrorTracking.init();
|
944
|
-
|
946
|
+
let legacyConfig = {
|
947
|
+
gridLegacyConfig: this.gridLegacyConfigName,
|
948
|
+
formLegacyConfig: this.formLegacyConfigName
|
949
|
+
};
|
950
|
+
ConfigStorage.preload(this.applicationResourceID, this.configName, legacyConfig);
|
945
951
|
document.addEventListener("click", () => Workspace.applicationClick());
|
946
952
|
this._waitingAppReady.forEach(resolve => resolve());
|
947
953
|
}
|
@@ -1030,6 +1036,40 @@ export class SnkApplication {
|
|
1030
1036
|
"attribute": "config-name",
|
1031
1037
|
"reflect": false
|
1032
1038
|
},
|
1039
|
+
"gridLegacyConfigName": {
|
1040
|
+
"type": "string",
|
1041
|
+
"mutable": false,
|
1042
|
+
"complexType": {
|
1043
|
+
"original": "string",
|
1044
|
+
"resolved": "string",
|
1045
|
+
"references": {}
|
1046
|
+
},
|
1047
|
+
"required": false,
|
1048
|
+
"optional": false,
|
1049
|
+
"docs": {
|
1050
|
+
"tags": [],
|
1051
|
+
"text": "Chave da configura\u00E7\u00E3o legado da grade."
|
1052
|
+
},
|
1053
|
+
"attribute": "grid-legacy-config-name",
|
1054
|
+
"reflect": false
|
1055
|
+
},
|
1056
|
+
"formLegacyConfigName": {
|
1057
|
+
"type": "string",
|
1058
|
+
"mutable": false,
|
1059
|
+
"complexType": {
|
1060
|
+
"original": "string",
|
1061
|
+
"resolved": "string",
|
1062
|
+
"references": {}
|
1063
|
+
},
|
1064
|
+
"required": false,
|
1065
|
+
"optional": false,
|
1066
|
+
"docs": {
|
1067
|
+
"tags": [],
|
1068
|
+
"text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
|
1069
|
+
},
|
1070
|
+
"attribute": "form-legacy-config-name",
|
1071
|
+
"reflect": false
|
1072
|
+
},
|
1033
1073
|
"loadByPK": {
|
1034
1074
|
"type": "unknown",
|
1035
1075
|
"mutable": false,
|