@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
@@ -1,25 +1,30 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import {
|
2
|
+
import { StringUtils, ApplicationContext, ObjectUtils, DataType, UserInterface, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
4
|
import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
|
4
5
|
import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
|
5
|
-
import './DataFetcher-
|
6
|
-
import { I as InMemoryLoader } from './pesquisa-fetcher-
|
6
|
+
import './DataFetcher-c1baf61d.js';
|
7
|
+
import { I as InMemoryLoader } from './pesquisa-fetcher-fe6f3826.js';
|
8
|
+
import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-36918dbf.js';
|
7
9
|
import { P as PresentationMode } from './index-0ece87a6.js';
|
8
10
|
import './ISave-d8c8bc59.js';
|
9
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
-
import './PreloadManager-c1c2f2b4.js';
|
12
13
|
import './filter-item-type.enum-d45e026f.js';
|
13
|
-
import './form-config-fetcher-
|
14
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
|
14
15
|
import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-efbe307f.js';
|
15
|
-
import {
|
16
|
+
import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
|
17
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-f53f9f87.js';
|
16
18
|
import './index-bdf75557.js';
|
17
19
|
import './PrintUtils-3e4ff0f5.js';
|
18
|
-
import './ResourceIDUtils-a114189a.js';
|
19
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
21
|
+
import './ResourceIDUtils-a114189a.js';
|
20
22
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
21
23
|
|
22
|
-
const
|
24
|
+
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
25
|
+
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
26
|
+
|
27
|
+
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}";
|
23
28
|
|
24
29
|
const SnkSimpleCrud = class {
|
25
30
|
constructor(hostRef) {
|
@@ -28,20 +33,24 @@ const SnkSimpleCrud = class {
|
|
28
33
|
this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
|
29
34
|
this.actionClick = createEvent(this, "actionClick", 7);
|
30
35
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
31
|
-
this.
|
32
|
-
this.
|
36
|
+
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
37
|
+
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
33
38
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
34
39
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
40
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
35
41
|
this._taskbarProcessor = new TaskbarProcessor({
|
36
|
-
"snkSimpleCrudTaskbar.form_regular": this.
|
37
|
-
"snkSimpleCrudTaskbar.grid_regular": this.
|
38
|
-
"snkSimpleCrudTaskbar.form_selected": this.
|
39
|
-
"snkSimpleCrudTaskbar.grid_selected": this.
|
42
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, TaskbarElement.GRID_MODE),
|
43
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, TaskbarElement.FORM_MODE),
|
44
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, TaskbarElement.GRID_MODE),
|
45
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, TaskbarElement.FORM_MODE),
|
40
46
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
41
47
|
});
|
48
|
+
this._showPopUpGridConfig = false;
|
49
|
+
this._showFormConfig = false;
|
42
50
|
this._currentViewMode = VIEW_MODE.GRID;
|
43
51
|
this._config = undefined;
|
44
52
|
this._fieldToGetFocus = undefined;
|
53
|
+
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
45
54
|
this.dataState = undefined;
|
46
55
|
this.dataUnit = undefined;
|
47
56
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
@@ -50,11 +59,39 @@ const SnkSimpleCrud = class {
|
|
50
59
|
this._formFields = [];
|
51
60
|
this.multipleSelection = undefined;
|
52
61
|
this.useCancelConfirm = true;
|
62
|
+
this.resourceID = undefined;
|
53
63
|
this.taskbarManager = undefined;
|
54
64
|
this.messagesBuilder = undefined;
|
55
65
|
this.useEnterLikeTab = false;
|
56
66
|
this.actionsList = undefined;
|
57
67
|
this.configName = undefined;
|
68
|
+
this.showConfiguratorButtons = undefined;
|
69
|
+
this.gridLegacyConfigName = undefined;
|
70
|
+
this.formLegacyConfigName = undefined;
|
71
|
+
this.ignoreReadOnlyFormFields = false;
|
72
|
+
}
|
73
|
+
handleResourceIDChanged(newValue, oldValue) {
|
74
|
+
if (StringUtils.isEmpty(newValue)) {
|
75
|
+
return;
|
76
|
+
}
|
77
|
+
if (newValue === oldValue) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
this.loadFormConfig(true);
|
81
|
+
this.loadGridConfig(true);
|
82
|
+
}
|
83
|
+
getButtons(selected, changeModeBtn) {
|
84
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
85
|
+
.concat(changeModeBtn));
|
86
|
+
}
|
87
|
+
addConfigButton(buttons) {
|
88
|
+
if (this.configName === undefined) {
|
89
|
+
return buttons;
|
90
|
+
}
|
91
|
+
return buttons.concat(TaskbarElement.CONFIGURATOR);
|
92
|
+
}
|
93
|
+
get application() {
|
94
|
+
return ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
58
95
|
}
|
59
96
|
resolveInMemoryBtns(taskbarButtons) {
|
60
97
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -74,7 +111,10 @@ const SnkSimpleCrud = class {
|
|
74
111
|
}
|
75
112
|
actionClickListener(evt) {
|
76
113
|
const act = evt.detail;
|
77
|
-
if (act === TaskbarElement.
|
114
|
+
if (act === TaskbarElement.CONFIGURATOR) {
|
115
|
+
this._snkConfigurator.open();
|
116
|
+
}
|
117
|
+
else if (act === TaskbarElement.GRID_MODE) {
|
78
118
|
this.goToView(VIEW_MODE.GRID);
|
79
119
|
}
|
80
120
|
else if (act === TaskbarElement.FORM_MODE) {
|
@@ -92,17 +132,129 @@ const SnkSimpleCrud = class {
|
|
92
132
|
this.dataStateChange.emit(newValue);
|
93
133
|
}
|
94
134
|
}
|
95
|
-
|
135
|
+
async observeFormLegacy(newValue, oldValue) {
|
136
|
+
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
137
|
+
}
|
138
|
+
async observeGridLegacy(newValue, oldValue) {
|
139
|
+
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
140
|
+
}
|
141
|
+
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
142
|
+
if (newValue == undefined || newValue == oldValue) {
|
143
|
+
return;
|
144
|
+
}
|
145
|
+
if (!this._gridConfigAlreadyLoaded) {
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
await this.loadGridConfig(true);
|
149
|
+
}
|
150
|
+
async handleUpdateFormLegacyConfig(newValue, oldValue) {
|
151
|
+
if (newValue == undefined || newValue == oldValue) {
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
if (!this._formConfigAlreadyLoaded) {
|
155
|
+
return;
|
156
|
+
}
|
157
|
+
this.loadFormConfig(true);
|
158
|
+
}
|
159
|
+
openConfig(viewMode) {
|
160
|
+
this._snkConfigurator.close();
|
161
|
+
if (viewMode === VIEW_MODE.GRID) {
|
162
|
+
this.openGridConfig();
|
163
|
+
}
|
164
|
+
else if (viewMode === VIEW_MODE.FORM) {
|
165
|
+
this.openFormConfig();
|
166
|
+
}
|
167
|
+
}
|
168
|
+
openGridConfig() {
|
169
|
+
this._grid.getColumnsState()
|
170
|
+
.then((gridColumns) => {
|
171
|
+
this._snkGridConfig.columns = gridColumns.filter(c => c.name);
|
172
|
+
this._snkGridConfig.selectedIndex = 0;
|
173
|
+
this._showPopUpGridConfig = true;
|
174
|
+
});
|
175
|
+
}
|
176
|
+
async openFormConfig() {
|
177
|
+
var _a, _b;
|
178
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
179
|
+
if (this.formLegacyConfigName) {
|
180
|
+
const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
|
181
|
+
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
|
182
|
+
await this.application.alert(title, message);
|
183
|
+
return;
|
184
|
+
}
|
185
|
+
this._showFormConfig = true;
|
186
|
+
}
|
187
|
+
addGridLegacyConfigName() {
|
188
|
+
if (this.gridLegacyConfigName && this.configName) {
|
189
|
+
ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
loadGridConfig(forceUpdate) {
|
193
|
+
if (this.configName === undefined) {
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
this.addGridLegacyConfigName();
|
200
|
+
this._gridConfigAlreadyLoaded = true;
|
201
|
+
return new Promise((accept, reject) => {
|
202
|
+
ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
|
203
|
+
.then(config => {
|
204
|
+
this.setGridConfig(config);
|
205
|
+
accept();
|
206
|
+
})
|
207
|
+
.catch(reason => {
|
208
|
+
reject(reason);
|
209
|
+
});
|
210
|
+
});
|
211
|
+
}
|
212
|
+
formConfigIsLoaded() {
|
213
|
+
return this.formConfig != undefined || this._formConfigAlreadyLoaded;
|
214
|
+
}
|
215
|
+
async loadFormConfig(forceLoad = false) {
|
216
|
+
if (this.configName === undefined) {
|
217
|
+
return;
|
218
|
+
}
|
219
|
+
if (this._formConfigManager == undefined) {
|
220
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
221
|
+
this._formConfigManager.setConfig(this.formConfig);
|
222
|
+
}
|
223
|
+
if (this.formConfigIsLoaded() && !forceLoad) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
this._formConfigAlreadyLoaded = true;
|
227
|
+
let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
|
228
|
+
if (loadedLegacyConfig != undefined) {
|
229
|
+
this._formConfigManager.setConfig(loadedLegacyConfig);
|
230
|
+
this.setFormConfig(loadedLegacyConfig);
|
231
|
+
return;
|
232
|
+
}
|
233
|
+
this.setFormConfig(await this._formConfigManager.loadConfig());
|
234
|
+
}
|
235
|
+
async componentWillRender() {
|
236
|
+
this._resourceID = await this.application.getResourceID();
|
96
237
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
238
|
+
if (this.configName === undefined) {
|
239
|
+
return;
|
240
|
+
}
|
241
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
242
|
+
return;
|
243
|
+
}
|
244
|
+
await this.addGridLegacyConfigName();
|
245
|
+
this.loadGridConfig();
|
246
|
+
this.loadFormConfig();
|
97
247
|
}
|
98
248
|
componentWillLoad() {
|
99
249
|
this.processMetadata();
|
100
250
|
this.onModeChange();
|
101
251
|
this.configDatasource();
|
102
252
|
}
|
253
|
+
componentDidLoad() {
|
254
|
+
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
255
|
+
}
|
103
256
|
configDatasource() {
|
104
|
-
|
105
|
-
this._multiSelectionListDataSource.setApplication(application);
|
257
|
+
this._multiSelectionListDataSource.setApplication(this.application);
|
106
258
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
107
259
|
}
|
108
260
|
getTaskBarId() {
|
@@ -143,6 +295,27 @@ const SnkSimpleCrud = class {
|
|
143
295
|
getRecords() {
|
144
296
|
return Promise.resolve(this.dataUnit.records);
|
145
297
|
}
|
298
|
+
/**
|
299
|
+
* Usado para abrir o configurator do CRUD
|
300
|
+
*/
|
301
|
+
async openConfigurator() {
|
302
|
+
var _a;
|
303
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
304
|
+
}
|
305
|
+
/**
|
306
|
+
* Usado para fechar o configurator do CRUD
|
307
|
+
*/
|
308
|
+
async closeConfigurator() {
|
309
|
+
var _a;
|
310
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
311
|
+
}
|
312
|
+
updateConfig() {
|
313
|
+
if (this._formConfigManager == undefined) {
|
314
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
315
|
+
}
|
316
|
+
this._formConfigManager.setConfig(this.formConfig);
|
317
|
+
return;
|
318
|
+
}
|
146
319
|
processMetadata() {
|
147
320
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
148
321
|
const fieldMetadata = [];
|
@@ -197,6 +370,14 @@ const SnkSimpleCrud = class {
|
|
197
370
|
this.dataUnit.clearSelection();
|
198
371
|
}
|
199
372
|
}
|
373
|
+
handleConfiguratorEvent(evt, type) {
|
374
|
+
evt.stopImmediatePropagation();
|
375
|
+
if (type === 'SAVE') {
|
376
|
+
this.configuratorSave.emit();
|
377
|
+
return;
|
378
|
+
}
|
379
|
+
this.configuratorCancel.emit();
|
380
|
+
}
|
200
381
|
getColumnSearch(actionButton, item) {
|
201
382
|
if (this._columnSearch != undefined) {
|
202
383
|
return this._columnSearch;
|
@@ -238,7 +419,9 @@ const SnkSimpleCrud = class {
|
|
238
419
|
return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
|
239
420
|
}
|
240
421
|
handleFormSetFields(fields) {
|
241
|
-
this._formFields
|
422
|
+
if (!ObjectUtils.equals(this._formFields, fields)) {
|
423
|
+
this._formFields = fields !== null && fields !== void 0 ? fields : [];
|
424
|
+
}
|
242
425
|
}
|
243
426
|
fieldsOptionLoader(argument) {
|
244
427
|
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
@@ -310,16 +493,67 @@ const SnkSimpleCrud = class {
|
|
310
493
|
disconnectedCallback() {
|
311
494
|
window.removeEventListener("keydown", this._keyDownHandler);
|
312
495
|
}
|
496
|
+
gridConfigChangeHandler(evt) {
|
497
|
+
const config = evt.detail;
|
498
|
+
ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
499
|
+
evt.stopPropagation();
|
500
|
+
}
|
501
|
+
modalConfigChangeHandler(evt) {
|
502
|
+
const config = evt.detail;
|
503
|
+
this._grid.setColumnsState(config.columns)
|
504
|
+
.then(() => {
|
505
|
+
this.setGridConfig(config);
|
506
|
+
this.closeGridConfig();
|
507
|
+
});
|
508
|
+
evt.stopPropagation();
|
509
|
+
}
|
510
|
+
setGridConfig(config) {
|
511
|
+
this.gridConfig = config;
|
512
|
+
CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
513
|
+
}
|
514
|
+
setFormConfig(config, forceUpdate) {
|
515
|
+
if (this.formConfig && !forceUpdate)
|
516
|
+
return;
|
517
|
+
this.formConfig = config;
|
518
|
+
}
|
519
|
+
closeGridConfig() {
|
520
|
+
this._showPopUpGridConfig = false;
|
521
|
+
}
|
522
|
+
closeFormConfig() {
|
523
|
+
this._showFormConfig = false;
|
524
|
+
}
|
525
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
526
|
+
handleShowFormConfig() {
|
527
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
528
|
+
}
|
529
|
+
resolveResourceID() {
|
530
|
+
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
531
|
+
}
|
532
|
+
getFormConfig() {
|
533
|
+
var _a, _b;
|
534
|
+
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);
|
535
|
+
if (!this.configName && !configFromManager) {
|
536
|
+
return this.formConfig;
|
537
|
+
}
|
538
|
+
return configFromManager;
|
539
|
+
}
|
540
|
+
/* istanbul ignore next */
|
313
541
|
render() {
|
314
542
|
var _a;
|
315
|
-
|
543
|
+
if (this.dataUnit == undefined) {
|
544
|
+
return;
|
545
|
+
}
|
546
|
+
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)
|
316
547
|
? undefined
|
317
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class:
|
548
|
+
: 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() }))));
|
318
549
|
}
|
319
550
|
get _element() { return getElement(this); }
|
320
551
|
static get watchers() { return {
|
552
|
+
"resourceID": ["handleResourceIDChanged"],
|
321
553
|
"mode": ["onModeChange"],
|
322
|
-
"dataState": ["observeDataState"]
|
554
|
+
"dataState": ["observeDataState"],
|
555
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
556
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
323
557
|
}; }
|
324
558
|
};
|
325
559
|
SnkSimpleCrud.style = snkSimpleCrudCss;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import { StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
2
|
+
import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
4
4
|
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-2473c8ac.js';
|
5
5
|
import { P as PresentationMode } from './index-0ece87a6.js';
|
@@ -31,12 +31,27 @@ const SnkTaskbar = class {
|
|
31
31
|
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
32
32
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
33
33
|
};
|
34
|
+
this.onSaveEvent = (action) => {
|
35
|
+
switch (action.type) {
|
36
|
+
case Action.FIELD_INVALIDATED:
|
37
|
+
case Action.DATA_SAVED:
|
38
|
+
case Action.SAVING_ERROR:
|
39
|
+
this._isWaitingForSave = false;
|
40
|
+
break;
|
41
|
+
case Action.SAVING_DATA:
|
42
|
+
this._isWaitingForSave = true;
|
43
|
+
break;
|
44
|
+
}
|
45
|
+
};
|
34
46
|
this._permissions = undefined;
|
35
47
|
this._overFlowedElements = [];
|
36
48
|
this._customElements = undefined;
|
37
49
|
this._customElementsId = undefined;
|
38
50
|
this._slotContainer = undefined;
|
39
51
|
this._hiddenActionsList = [];
|
52
|
+
this._lastWidth = undefined;
|
53
|
+
this._hasToUpdateOverFlow = false;
|
54
|
+
this._isWaitingForSave = false;
|
40
55
|
this.alignRigth = false;
|
41
56
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
42
57
|
this.customContainerId = undefined;
|
@@ -52,12 +67,29 @@ const SnkTaskbar = class {
|
|
52
67
|
this.presentationMode = PresentationMode.PRIMARY;
|
53
68
|
this.messagesBuilder = undefined;
|
54
69
|
}
|
70
|
+
handleCustomSlotElementsLoaded(event) {
|
71
|
+
if (this.hasToSearchCustomElements(event)) {
|
72
|
+
this.getCustomElements(true);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
hasToSearchCustomElements(event) {
|
76
|
+
return this.customSlotId === event.detail && !this._slotContainer;
|
77
|
+
}
|
55
78
|
observeButtons() {
|
56
79
|
this._definitions = undefined;
|
57
80
|
requestAnimationFrame(() => {
|
58
81
|
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
59
82
|
});
|
60
83
|
}
|
84
|
+
observeDisabledButtons() {
|
85
|
+
var _a;
|
86
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate();
|
87
|
+
}
|
88
|
+
observeLastWidth(newValue, oldValue) {
|
89
|
+
if (oldValue === 0 && newValue !== 0) {
|
90
|
+
this._hasToUpdateOverFlow = true;
|
91
|
+
}
|
92
|
+
}
|
61
93
|
// Internal methods
|
62
94
|
elementsFromString(strButtons) {
|
63
95
|
const elements = [];
|
@@ -126,7 +158,13 @@ const SnkTaskbar = class {
|
|
126
158
|
this.dataUnit.cancelEdition();
|
127
159
|
break;
|
128
160
|
case TaskbarElement.SAVE:
|
129
|
-
this.
|
161
|
+
if (!this._isWaitingForSave) {
|
162
|
+
this._isWaitingForSave = true;
|
163
|
+
this.dataUnit.saveData()
|
164
|
+
.finally(() => {
|
165
|
+
this._isWaitingForSave = false;
|
166
|
+
});
|
167
|
+
}
|
130
168
|
break;
|
131
169
|
}
|
132
170
|
}
|
@@ -213,22 +251,28 @@ const SnkTaskbar = class {
|
|
213
251
|
}
|
214
252
|
return h("span", { class: "ez-padding-left--medium", key: elementId, id: elementId });
|
215
253
|
}
|
216
|
-
getCustomElements() {
|
254
|
+
getCustomElements(searchOnDocument) {
|
217
255
|
var _a, _b;
|
218
256
|
this._customElementsId = [];
|
219
257
|
this._customElements = new Map();
|
220
|
-
this._slotContainer = this.buildSlotContainer();
|
258
|
+
this._slotContainer = this.buildSlotContainer(searchOnDocument);
|
221
259
|
const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
222
260
|
customElementsArray.forEach(item => this._customElements.set(item.id, item));
|
223
261
|
}
|
224
|
-
buildSlotContainer() {
|
262
|
+
buildSlotContainer(searchOnDocument) {
|
263
|
+
let slotContainer;
|
225
264
|
if (this.customContainerId) {
|
226
265
|
const container = document.querySelector(`#${this.customContainerId}`);
|
227
|
-
|
266
|
+
slotContainer = container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
|
228
267
|
}
|
229
268
|
else {
|
230
|
-
|
269
|
+
slotContainer = this._element.querySelector(`#${this.customSlotId}`);
|
270
|
+
}
|
271
|
+
// Caso nõa encontre o slot container dentro do próprio elemento, tenta buscar na DOM do document.
|
272
|
+
if (searchOnDocument && !slotContainer) {
|
273
|
+
slotContainer = document.querySelector(`#${this.customSlotId}`);
|
231
274
|
}
|
275
|
+
return slotContainer;
|
232
276
|
}
|
233
277
|
componentWillLoad() {
|
234
278
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -241,10 +285,20 @@ const SnkTaskbar = class {
|
|
241
285
|
this.getCustomElements();
|
242
286
|
}
|
243
287
|
componentWillRender() {
|
288
|
+
this.handleDefinitions();
|
289
|
+
this.validatePresentationMode();
|
290
|
+
this.updateOverFlowIfNeeded();
|
291
|
+
}
|
292
|
+
handleDefinitions() {
|
244
293
|
if (this._definitions == undefined && this._permissions) {
|
245
294
|
this._definitions = this.elementsFromString(this.buttons);
|
246
295
|
}
|
247
|
-
|
296
|
+
}
|
297
|
+
updateOverFlowIfNeeded() {
|
298
|
+
if (this._hasToUpdateOverFlow) {
|
299
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
300
|
+
this._hasToUpdateOverFlow = false;
|
301
|
+
}
|
248
302
|
}
|
249
303
|
handleOverFlow(overFlowingElements) {
|
250
304
|
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
@@ -308,9 +362,14 @@ const SnkTaskbar = class {
|
|
308
362
|
const dataInfo = { dataUnit: this.dataUnit };
|
309
363
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
310
364
|
this.handleOverFlowStrategy();
|
365
|
+
this.dataUnit.subscribe(this.onSaveEvent);
|
311
366
|
}
|
312
367
|
componentDidRender() {
|
313
368
|
this.appendCustomElementsInTaskbar();
|
369
|
+
this.updateLastWidth();
|
370
|
+
}
|
371
|
+
updateLastWidth() {
|
372
|
+
this._lastWidth = this._element.getBoundingClientRect().width;
|
314
373
|
}
|
315
374
|
disconnectedCallback() {
|
316
375
|
var _a;
|
@@ -356,7 +415,9 @@ const SnkTaskbar = class {
|
|
356
415
|
}
|
357
416
|
get _element() { return getElement(this); }
|
358
417
|
static get watchers() { return {
|
359
|
-
"buttons": ["observeButtons"]
|
418
|
+
"buttons": ["observeButtons"],
|
419
|
+
"disabledButtons": ["observeDisabledButtons"],
|
420
|
+
"_lastWidth": ["observeLastWidth"]
|
360
421
|
}; }
|
361
422
|
};
|
362
423
|
SnkTaskbar.style = snkTaskbarCss;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{C as t}from"./p-aff76a53.js";import{ObjectUtils as e,StringUtils as s}from"@sankhyalabs/core";import{F as i}from"./p-df5451c7.js";class n{constructor(t,e,s){this._resourceID=e,this._configName=t,this._onConfigChange=s}addFormLegacyConfig(e){this._configName&&t.addFormLegacyConfig(this._configName,e)}async loadConfig(){return new Promise((e=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{this.setConfig(t),e(t)})).catch((t=>{console.warn(t)}))}))}saveConfig(s){const i=e.copy(s);return new Promise((e=>{t.saveFormConfig(s,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},i),t)),e(Object.assign(Object.assign({},i),t))}))}))}saveCardState(e,s,i){return new Promise((n=>{var r;const h=(null===(r=this._config)||void 0===r?void 0:r.cardsState)||new Map,a=h.get(e);h.set(e,"fixed"===i?this.updateFixSequence(Object.assign(Object.assign({},a),{fixed:s.fixed}),h):Object.assign(Object.assign({},a),{[i]:s[i]})),t.saveCardState(h,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:h}),n(t)}))}))}updateFixSequence(t,e){let s=-1;return Array.from(e.values()).forEach((e=>{e.fixed||delete t.fixSequence,null!=e.fixSequence&&(s=Math.max(s,e.fixSequence))})),t.fixed?t.fixSequence=s+1:delete t.fixSequence,t}getFieldsList(t,e){var s;const i=null===(s=this._config)||void 0===s?void 0:s.fields;return null!=i&&i.length>0?i.map((({label:e,name:s,readOnly:i})=>null==e?t.getField(s):{name:s,label:e,readOnly:i})).filter((t=>this.isFieldVisible(t,e))):null!=t?t.metadata.fields.filter((t=>this.isFieldVisible(t,e))).map((({label:t,name:e,readOnly:s})=>({label:t,name:e,readOnly:s}))):[]}isFieldVisible(t,e){if(!1===t.visible)return!1;if(null==e)return!0;const i=s.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),n=s.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return i.includes(n)}getInsertionConfig(t,e){let s=this.getFieldsList(t);return e&&(s=s.filter((e=>{if(t){const s=t.getField(e.name);if(s&&s.readOnly)return!1}return!e.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:e,summary:s,defaultVars:i}=this._config||{};this._config=Object.assign({},t),e&&(this._config.cardsState=e),s&&(this._config.summary=s),i&&(this._config.defaultVars=i),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,e,s){return t?this.getInsertionConfig(e,null==s||s):Object.assign({},this._config)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new i),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}}export{n as S}
|
@@ -0,0 +1 @@
|
|
1
|
+
export{S as snk_data_unit}from"./p-52c8e589.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-32556aa6.js";
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as i,c as s,h as t,F as e,g as a}from"./p-d2d301a6.js";import{ElementIDUtils as r,ApplicationContext as n,StringUtils as d,DataType as o}from"@sankhyalabs/core";import{UserInterface as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{T as l}from"./p-ae4fc9a9.js";import{C as c}from"./p-aff76a53.js";import{P as u}from"./p-38289a55.js";import{T as g,o as T,b as k}from"./p-c2495304.js";import{s as m}from"./p-6dc031de.js";import{S as v,C as E}from"./p-cce0865d.js";import{SelectionMode as f}from"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-dc7c9047.js";import"./p-164666b1.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-ff1990ad.js";import"./p-df5451c7.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";const O=class{constructor(t){i(this,t),this.actionClick=s(this,"actionClick",7),this.gridDoubleClick=s(this,"gridDoubleClick",7),this._topTaskbarProcessor=new g({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.singleTaskbar":[],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE"],"snkGridTopTaskbar.finish_edition.secondary":[],"snkGridTopTaskbar.finish_edition.singleTaskbar":[]}),this._headerTaskbarProcessor=new g({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","FORM_MODE","CONFIGURATOR","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.singleTaskbar.detail.unselected":["INSERT","FORM_MODE","CONFIGURATOR","REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.singleTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","FORM_MODE","CONFIGURATOR","REFRESH"],"snkGridHeaderTaskbar.singleTaskbar.finish_edition":["CANCEL","SAVE"]}),this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this._showSnkFilterBar=!0,this.columnFilterDataSource=new v,this.configName=void 0,this.filterBarTitle=void 0,this.resourceID=void 0,this.selectionToastConfig=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=u.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.gridHeaderCustomSlotId="GRID_HEADER_CUSTOM_ELEMENTS",this.topTaskbarCustomSlotId="GRID_TASKBAR_CUSTOM_ELEMENTS",this.disablePersonalizedFilter=void 0,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}async getFilterBar(){return this._snkFilterBar}async findColumn(){await T(this._moreOptions,this._columnSearch)}async setFocus(){this._grid.setFocus()}async handleGridLegacyConfigName(i,s){i&&i!==s&&(this.addGridLegacyConfigName(),this.loadConfig())}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i,E.assertDefaultSorting(this._gridConfig,this._dataUnit)}loadConfig(){c.loadGridConfig(this.configName,this.resourceID).then((i=>{this.setGridConfig(i)})).catch((i=>{console.warn(i)}))}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&c.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}gridConfigChangeHandler(i){c.saveGridConfig(i.detail,this.configName,this.resourceID),i.stopPropagation()}modalConfigChangeHandler(i){const s=i.detail;this._grid.setColumnsState(s.columns).then((()=>{this.setGridConfig(s),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}buildColumnsMetadata(i){const s=[];return null==i||i.forEach((i=>{var t,e;if(i.hidden&&"RECDESP"!==i.name)return;const a=null===(t=this._dataUnit)||void 0===t?void 0:t.getField(i.name);if(s.push({label:i.label,id:i.name,width:i.width,type:null==a?void 0:a.dataType,userInterface:null==a?void 0:a.userInterface}),null!=(null===(e=null==a?void 0:a.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const i=a.properties.mergedFrom;s.push({label:a.properties.DESCRIPTIONENTITY,id:`${i?i+".":""}${a.properties.ENTITYNAME}.${a.properties.DESCRIPTIONFIELD}`,width:200,type:o.TEXT,userInterface:h.LONGTEXT})}})),s||[]}getPaginationInfo(){var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const s=i.firstRecord;return s>0?s-1:s}async dataExporterProviderStore(){var i;const s=await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getSelectedRecordsIDsInfo()),t={getFilters:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},getColumnsMetadata:async()=>{var i;const s=await(null===(i=this._grid)||void 0===i?void 0:i.getColumnsState());return this.buildColumnsMetadata(s)},getOrders:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getSort()},getResourceURI:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.name},getSelectedNumber:()=>{var i,s;return null===(s=null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)||void 0===s?void 0:s.length},getTotalRecords:()=>{var i,s,t;const{total:e}=(null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(t=null===(s=this._dataUnit)||void 0===s?void 0:s.records)||void 0===t?void 0:t.length},getSelectedIDs:()=>s||[],getOffset:()=>this.getExporterOffset(this.getPaginationInfo()),getLimit:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.pageSize},getRecordID:()=>{var i,s,t;return null===(t=null===(s=null===(i=this._dataUnit)||void 0===i?void 0:i.records)||void 0===s?void 0:s[0])||void 0===t?void 0:t.__record__id__}};m.set("exporterProviders",Object.assign(Object.assign({},m.get("exporterProviders")),{[this.configName]:t}))}addElementID(){r.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}finshLoading(){E.assertDefaultSorting(this._gridConfig,this._dataUnit),this.addElementID(),null!=this.columnFilterDataSource&&(this.columnFilterDataSource.setApplication(this._application),this.columnFilterDataSource.setDataUnit(this._dataUnit))}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?this.finshLoading():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.finshLoading()})),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),this._snkDataUnit.addEventListener("dataStateChange",(i=>{this._dataState=i.detail})),this._snkDataUnit.addEventListener("cancelEdition",(()=>{var i;(null===(i=this._dataState)||void 0===i?void 0:i.recordsIsEmpty)&&this._dataUnit.clearSelection()}));break}i=i.parentElement}this.addGridLegacyConfigName(),this.loadConfig()}getHeaderDisabledButtons(){var i;const s=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&s.push(l.CLONE,"ATTACH"),this._dataState.selectionInfo.isAllRecords()&&s.push("REMOVE")),s}getInvisibleButtons(){let i=[];return this._dataUnit&&0!==this._dataUnit.records.length||i.push("DATA_EXPORTER"),this._dataState&&this._dataState.selectionInfo.mode===f.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}componentWillRender(){const i=this.getInvisibleButtons();this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(),this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),i),this._topTaskbarProcessor.process(this.getTopTaskBarId(),this.taskbarManager,this._dataState,void 0,i),this.dataExporterProviderStore()}getHeaderTaskbarId(){var i,s;const t=this._dataState&&!!(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length),e={primary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",secondary:this.isDetail?"snkGridHeaderTaskbar.detail":"snkGridHeaderTaskbar",singleTaskbar:this.isDetail?"snkGridHeaderTaskbar.singleTaskbar.detail":"snkGridHeaderTaskbar.singleTaskbar"}[this.presentationMode];let a=t?`${e}.selected`:`${e}.unselected`;return(null===(s=this._dataState)||void 0===s?void 0:s.isDirty)&&this.presentationMode===u.SINGLE_TASKBAR&&(a="snkGridHeaderTaskbar.singleTaskbar.finish_edition"),a}getTopTaskBarId(){var i;const s={primary:"",secondary:".secondary",singleTaskbar:".singleTaskbar"}[this.presentationMode];return(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${s}`:`snkGridTopTaskbar.regular${s}`}getPrimaryButton(){return{primary:"INSERT",secondary:"",singleTaskbar:"INSERT"}[this.presentationMode]}getColumnSearch(i,s){return null!=this._columnSearch||(this._moreOptions=i,this._columnSearch=k(s,(({argument:i})=>new Promise((s=>{this._grid.filterColumns(i).then((i=>{s(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(s=>{null!=s&&(this._grid.locateColumn(s.value),i.hideActions())}))),this._columnSearch}getActionsList(){const i=[{value:d.generateUUID(),label:this.messagesBuilder.getMessage("snkGrid.findColumn",{}),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,s)=>this.getColumnSearch(i,s)}];if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const s=this.getTopTaskBarId();return i.concat(this.taskbarManager.getMoreOptions(s,this.configName,this._dataState,this.actionsList))}return i.concat(this.actionsList)}handleFilterConfigUpdated(i){this._showSnkFilterBar=!!i.length&&(1!==i.length||"PERSONALIZED_FILTER_GROUP"!==i[0].id||i[0].groupedItems.length>0)}render(){if(this._dataUnit)return t("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},t("div",{class:"snk-grid__header ez-margin-bottom--medium"},this._showSnkFilterBar&&t(e,null,t("snk-filter-bar",{ref:i=>this._snkFilterBar=i,title:this.filterBarTitle,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this.resourceID,onConfigUpdated:i=>this.handleFilterConfigUpdated(i.detail),disablePersonalizedFilter:this.disablePersonalizedFilter,filterBarLegacyConfigName:this.filterBarLegacyConfigName}),t("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"})),t("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.topTaskbarCustomSlotId,overflowStrategy:"none"},t("slot",{name:this.topTaskbarCustomSlotId}))),t("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===u.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:i=>this.gridDoubleClick.emit(i.detail),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,columnfilterDataSource:this.columnFilterDataSource,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,canEdit:this.canEdit},t("snk-taskbar",{id:"teste",dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this._headerTaskbarProcessor.buttons,presentationMode:this.presentationMode,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.getActionsList(),primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.gridHeaderCustomSlotId},t("slot",{name:this.gridHeaderCustomSlotId}))),t("div",{class:"ez-col ez-col--sd-12"},t("slot",{name:"SnkGridFooter"})),t("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},t("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(r.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resourceID})))}get _element(){return a(this)}static get watchers(){return{gridLegacyConfigName:["handleGridLegacyConfigName"]}}};O.style=".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{O as snk_grid}
|