@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,19 +1,26 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
2
|
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher.js';
|
4
|
-
import { a as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
|
4
|
+
import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
|
5
5
|
import './index2.js';
|
6
|
-
import { a as SaveErrorsEnum, d as defineCustomElement$
|
6
|
+
import { a as SaveErrorsEnum, d as defineCustomElement$f } from './snk-actions-button2.js';
|
7
7
|
import './filter-item-type.enum.js';
|
8
8
|
import './form-config-fetcher.js';
|
9
9
|
import { V as VIEW_MODE } from './constants.js';
|
10
10
|
import { A as AutorizationType } from './auth-fetcher.js';
|
11
11
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
12
|
-
import { d as defineCustomElement$
|
13
|
-
import { d as defineCustomElement$
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
12
|
+
import { d as defineCustomElement$e } from './snk-config-options2.js';
|
13
|
+
import { d as defineCustomElement$d } from './snk-configurator2.js';
|
14
|
+
import { d as defineCustomElement$c } from './snk-data-exporter2.js';
|
15
|
+
import { d as defineCustomElement$b } from './snk-data-unit2.js';
|
16
|
+
import { d as defineCustomElement$a } from './snk-exporter-email-sender2.js';
|
17
|
+
import { d as defineCustomElement$9 } from './snk-field-config2.js';
|
18
|
+
import { d as defineCustomElement$8 } from './snk-form-config2.js';
|
19
|
+
import { d as defineCustomElement$7 } from './snk-grid-config2.js';
|
20
|
+
import { d as defineCustomElement$6 } from './snk-select-box2.js';
|
21
|
+
import { d as defineCustomElement$5 } from './snk-simple-bar2.js';
|
22
|
+
import { d as defineCustomElement$4 } from './snk-simple-crud2.js';
|
23
|
+
import { d as defineCustomElement$3 } from './snk-tab-config2.js';
|
17
24
|
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
18
25
|
|
19
26
|
const SERVICE$1 = {
|
@@ -389,7 +396,7 @@ const attachFetcherMetadataBuilder = {
|
|
389
396
|
label: "Attach List",
|
390
397
|
fields: [
|
391
398
|
{ name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: DataType.TEXT },
|
392
|
-
{ name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: DataType.TEXT },
|
399
|
+
{ name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: DataType.TEXT, readOnly: false },
|
393
400
|
{ name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: DataType.TEXT },
|
394
401
|
{ name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: DataType.TEXT },
|
395
402
|
{ name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: DataType.TEXT },
|
@@ -415,6 +422,7 @@ const SERVICE_LOAD = "Attach.load";
|
|
415
422
|
class AttachFetcherDataUnitFactory {
|
416
423
|
constructor(getMessage) {
|
417
424
|
this.getMessage = getMessage;
|
425
|
+
this._records = [];
|
418
426
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
419
427
|
}
|
420
428
|
initLoaders(dataUnit, fetcher, onSuccess) {
|
@@ -434,25 +442,30 @@ class AttachFetcherDataUnitFactory {
|
|
434
442
|
metadataLoader(_) {
|
435
443
|
return Promise.resolve(attachFetcherMetadataBuilder);
|
436
444
|
}
|
437
|
-
async dataLoader(
|
445
|
+
async dataLoader(dataUnit, request) {
|
438
446
|
if (!request.source) {
|
439
|
-
return Promise.resolve({ records:
|
447
|
+
return Promise.resolve({ records: this._records });
|
440
448
|
}
|
441
|
-
|
442
|
-
criteria
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
449
|
+
if (!Number.isNaN(Number(request.source))) {
|
450
|
+
const criteria = {
|
451
|
+
criteria: {
|
452
|
+
codata: request.source,
|
453
|
+
tipoAnexo: "N"
|
454
|
+
}
|
455
|
+
};
|
456
|
+
const applicationDataFetcher = await this._application.getDataFetcher();
|
457
|
+
const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
|
458
|
+
const records = [];
|
459
|
+
anexo.forEach((param) => {
|
460
|
+
records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
|
461
|
+
name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
|
462
|
+
}] }, param));
|
463
|
+
});
|
464
|
+
this._records = records;
|
465
|
+
}
|
466
|
+
let records = applyFilter(this._records, dataUnit, request.filters);
|
467
|
+
records = applySorting(records, dataUnit, request.sort);
|
468
|
+
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
456
469
|
}
|
457
470
|
saveLoader(changes, fetcher) {
|
458
471
|
return new Promise((resolve) => {
|
@@ -632,7 +645,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
632
645
|
this.back.emit();
|
633
646
|
});
|
634
647
|
};
|
635
|
-
this.fetcherType =
|
648
|
+
this.fetcherType = undefined;
|
636
649
|
this.fetcher = undefined;
|
637
650
|
this.dataUnit = undefined;
|
638
651
|
this.dataUnitBuilder = undefined;
|
@@ -644,8 +657,8 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
644
657
|
this.crudConfig = undefined;
|
645
658
|
}
|
646
659
|
registerKeyWatcher(newRegisterKey, oldRegisterKey) {
|
647
|
-
var _a, _b, _c, _d;
|
648
|
-
if (this._currentDataUnit
|
660
|
+
var _a, _b, _c, _d, _e, _f;
|
661
|
+
if (!this._currentDataUnit) {
|
649
662
|
this.loadAttachmentDataUnit();
|
650
663
|
}
|
651
664
|
if (oldRegisterKey !== newRegisterKey) {
|
@@ -660,11 +673,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
660
673
|
if (hasMoreOneItem)
|
661
674
|
return;
|
662
675
|
}
|
663
|
-
return this._currentDataUnit
|
664
|
-
.loadMetadata()
|
665
|
-
.then(() => {
|
666
|
-
this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
667
|
-
});
|
676
|
+
return (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
|
668
677
|
}
|
669
678
|
}
|
670
679
|
/**
|
@@ -730,7 +739,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
730
739
|
if (!this._currentDataUnit.metadata) {
|
731
740
|
this._currentDataUnit
|
732
741
|
.loadMetadata()
|
733
|
-
.then(() => this.crudConfig = anexoSistemaCrudConfig);
|
742
|
+
.then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
|
734
743
|
}
|
735
744
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
736
745
|
this._currentDataUnit.addFilterProvider({
|
@@ -742,25 +751,29 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
742
751
|
this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
|
743
752
|
}
|
744
753
|
loadAttach() {
|
745
|
-
var _a;
|
754
|
+
var _a, _b, _c;
|
746
755
|
this._currentFetcher = new AttachFetcher();
|
747
|
-
this._currentDataUnit = new DataUnit();
|
756
|
+
this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
748
757
|
this._currentDataUnit.addInterceptor({
|
749
|
-
interceptAction: (action) =>
|
758
|
+
interceptAction: (action) => {
|
759
|
+
var _a;
|
760
|
+
if (action.type === Action.METADATA_LOADED) {
|
761
|
+
this.crudConfig = Object.assign({}, attachCrudConfig);
|
762
|
+
(_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
|
763
|
+
}
|
764
|
+
return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
|
765
|
+
}
|
750
766
|
});
|
751
767
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
752
768
|
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
753
|
-
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
754
769
|
this.returnToGridMode();
|
770
|
+
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
755
771
|
});
|
756
772
|
if (!this._currentDataUnit.metadata) {
|
757
|
-
this._currentDataUnit
|
758
|
-
|
759
|
-
.
|
760
|
-
this.
|
761
|
-
this._currentDataUnit
|
762
|
-
.loadData(undefined, undefined, true, this.registerKey)
|
763
|
-
.then(this.disableEditFieldsNotInForm.bind(this));
|
773
|
+
(_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
|
774
|
+
var _a, _b;
|
775
|
+
this.crudConfig = Object.assign({}, attachCrudConfig);
|
776
|
+
(_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
|
764
777
|
});
|
765
778
|
}
|
766
779
|
}
|
@@ -778,15 +791,30 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
778
791
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
779
792
|
}
|
780
793
|
componentWillRender() {
|
794
|
+
if (!this.fetcherType) {
|
795
|
+
this.fetcherType = "AnexoSistema";
|
796
|
+
}
|
781
797
|
if (this._currentDataUnit == null) {
|
782
798
|
this.loadAttachmentDataUnit();
|
783
799
|
}
|
784
800
|
}
|
801
|
+
async handleOnDataStateChange({ detail }) {
|
802
|
+
if (this.fetcherType !== 'Attach')
|
803
|
+
return;
|
804
|
+
if (!detail.insertionMode) {
|
805
|
+
this._currentDataUnit.disableField('DESCRICAO');
|
806
|
+
}
|
807
|
+
else {
|
808
|
+
this._currentDataUnit.enableField('DESCRICAO');
|
809
|
+
}
|
810
|
+
await this._currentDataUnit.loadMetadata();
|
811
|
+
}
|
812
|
+
;
|
785
813
|
render() {
|
786
814
|
var _a, _b;
|
787
815
|
if (!this._currentDataUnit)
|
788
816
|
return null;
|
789
|
-
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
|
817
|
+
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
|
790
818
|
}
|
791
819
|
static get watchers() { return {
|
792
820
|
"registerKey": ["registerKeyWatcher"]
|
@@ -808,7 +836,7 @@ function defineCustomElement() {
|
|
808
836
|
if (typeof customElements === "undefined") {
|
809
837
|
return;
|
810
838
|
}
|
811
|
-
const components = ["snk-attach", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-simple-bar", "snk-simple-crud", "snk-taskbar", "taskbar-actions-button"];
|
839
|
+
const components = ["snk-attach", "snk-actions-button", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-grid-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
|
812
840
|
components.forEach(tagName => { switch (tagName) {
|
813
841
|
case "snk-attach":
|
814
842
|
if (!customElements.get(tagName)) {
|
@@ -817,30 +845,65 @@ function defineCustomElement() {
|
|
817
845
|
break;
|
818
846
|
case "snk-actions-button":
|
819
847
|
if (!customElements.get(tagName)) {
|
820
|
-
defineCustomElement$
|
848
|
+
defineCustomElement$f();
|
849
|
+
}
|
850
|
+
break;
|
851
|
+
case "snk-config-options":
|
852
|
+
if (!customElements.get(tagName)) {
|
853
|
+
defineCustomElement$e();
|
854
|
+
}
|
855
|
+
break;
|
856
|
+
case "snk-configurator":
|
857
|
+
if (!customElements.get(tagName)) {
|
858
|
+
defineCustomElement$d();
|
821
859
|
}
|
822
860
|
break;
|
823
861
|
case "snk-data-exporter":
|
824
862
|
if (!customElements.get(tagName)) {
|
825
|
-
defineCustomElement$
|
863
|
+
defineCustomElement$c();
|
826
864
|
}
|
827
865
|
break;
|
828
866
|
case "snk-data-unit":
|
829
867
|
if (!customElements.get(tagName)) {
|
830
|
-
defineCustomElement$
|
868
|
+
defineCustomElement$b();
|
831
869
|
}
|
832
870
|
break;
|
833
871
|
case "snk-exporter-email-sender":
|
834
872
|
if (!customElements.get(tagName)) {
|
835
|
-
defineCustomElement$
|
873
|
+
defineCustomElement$a();
|
874
|
+
}
|
875
|
+
break;
|
876
|
+
case "snk-field-config":
|
877
|
+
if (!customElements.get(tagName)) {
|
878
|
+
defineCustomElement$9();
|
879
|
+
}
|
880
|
+
break;
|
881
|
+
case "snk-form-config":
|
882
|
+
if (!customElements.get(tagName)) {
|
883
|
+
defineCustomElement$8();
|
884
|
+
}
|
885
|
+
break;
|
886
|
+
case "snk-grid-config":
|
887
|
+
if (!customElements.get(tagName)) {
|
888
|
+
defineCustomElement$7();
|
889
|
+
}
|
890
|
+
break;
|
891
|
+
case "snk-select-box":
|
892
|
+
if (!customElements.get(tagName)) {
|
893
|
+
defineCustomElement$6();
|
836
894
|
}
|
837
895
|
break;
|
838
896
|
case "snk-simple-bar":
|
839
897
|
if (!customElements.get(tagName)) {
|
840
|
-
defineCustomElement$
|
898
|
+
defineCustomElement$5();
|
841
899
|
}
|
842
900
|
break;
|
843
901
|
case "snk-simple-crud":
|
902
|
+
if (!customElements.get(tagName)) {
|
903
|
+
defineCustomElement$4();
|
904
|
+
}
|
905
|
+
break;
|
906
|
+
case "snk-tab-config":
|
844
907
|
if (!customElements.get(tagName)) {
|
845
908
|
defineCustomElement$3();
|
846
909
|
}
|
@@ -96,7 +96,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
96
96
|
const customElements = container === null || container === void 0 ? void 0 : container.querySelector('#SnkConfigContainerSlot');
|
97
97
|
if (!customElements)
|
98
98
|
return;
|
99
|
-
const configuratorCustomElement = customElements.
|
99
|
+
const configuratorCustomElement = customElements.firstElementChild;
|
100
100
|
if (!configuratorCustomElement)
|
101
101
|
return;
|
102
102
|
const insideCustomElementsContainer = this._element.querySelector("#slotContainer");
|
@@ -70,6 +70,9 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
70
70
|
this.presentationMode = PresentationMode.PRIMARY;
|
71
71
|
this.messagesBuilder = undefined;
|
72
72
|
this.useEnterLikeTab = false;
|
73
|
+
this.gridLegacyConfigName = undefined;
|
74
|
+
this.filterBarLegacyConfigName = undefined;
|
75
|
+
this.formLegacyConfigName = undefined;
|
73
76
|
this.disablePersonalizedFilter = undefined;
|
74
77
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
75
78
|
}
|
@@ -130,6 +133,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
130
133
|
setViewMode(viewMode) {
|
131
134
|
this._viewStack.show(viewMode);
|
132
135
|
this._currentViewMode = viewMode;
|
136
|
+
if (viewMode === VIEW_MODE.GRID) {
|
137
|
+
this._snkGrid.setFocus();
|
138
|
+
}
|
139
|
+
else if (viewMode === VIEW_MODE.FORM) {
|
140
|
+
this._guidesViewer.setFocus();
|
141
|
+
}
|
133
142
|
}
|
134
143
|
openConfig(viewMode) {
|
135
144
|
this._snkConfigurator.close();
|
@@ -221,34 +230,34 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
221
230
|
element.focus();
|
222
231
|
}
|
223
232
|
keyboardManager
|
224
|
-
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade." })
|
225
|
-
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados." })
|
226
|
-
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados." })
|
227
|
-
.bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro." })
|
228
|
-
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado." })
|
229
|
-
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado." })
|
233
|
+
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
|
234
|
+
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
235
|
+
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
236
|
+
.bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
|
237
|
+
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
238
|
+
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
230
239
|
.bind("ctrl + .", () => {
|
231
240
|
if (dataUnit.getSelectionInfo().records.length === 0) {
|
232
241
|
return dataUnit.selectFirst();
|
233
242
|
}
|
234
243
|
return dataUnit.nextRecord();
|
235
244
|
}, {
|
236
|
-
description: "Avança para o próximo registro."
|
245
|
+
description: "Avança para o próximo registro.", element: this._element
|
237
246
|
})
|
238
|
-
.bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior." })
|
247
|
+
.bind("ctrl + ,", dataUnit.previousRecord.bind(dataUnit), { description: "Retorna ao registro anterior.", element: this._element })
|
239
248
|
.bind("F5", async () => {
|
240
249
|
const currentView = await this._viewStack.getSelectedIndex();
|
241
250
|
if (VIEW_MODE.GRID === currentView) {
|
242
251
|
dataUnit.loadData();
|
243
252
|
}
|
244
|
-
}, { description: "Atualiza os dados." })
|
253
|
+
}, { description: "Atualiza os dados.", element: this._element })
|
245
254
|
.bind("Escape", () => {
|
246
255
|
if (dataUnit.isDirty()) {
|
247
256
|
dataUnit.cancelEdition();
|
248
257
|
}
|
249
258
|
}, {
|
250
259
|
debounceTime: 1000,
|
251
|
-
description: "Cancela uma ação."
|
260
|
+
description: "Cancela uma ação.", element: this._element
|
252
261
|
});
|
253
262
|
}
|
254
263
|
}
|
@@ -321,7 +330,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
321
330
|
return;
|
322
331
|
}
|
323
332
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
324
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
333
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
325
334
|
}
|
326
335
|
get _element() { return this; }
|
327
336
|
static get watchers() { return {
|
@@ -341,6 +350,9 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
341
350
|
"presentationMode": [1, "presentation-mode"],
|
342
351
|
"messagesBuilder": [1040],
|
343
352
|
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
353
|
+
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
354
|
+
"filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
|
355
|
+
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
344
356
|
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
345
357
|
"_dataUnit": [32],
|
346
358
|
"_dataState": [32],
|
@@ -1,15 +1,19 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
2
|
|
3
|
-
const snkCustomSlotElementsCss = ".
|
3
|
+
const snkCustomSlotElementsCss = ".sc-snk-custom-slot-elements-h{display:none}";
|
4
4
|
|
5
5
|
const SnkCustomSlotElements$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
6
6
|
constructor() {
|
7
7
|
super();
|
8
8
|
this.__registerHost();
|
9
|
+
this.snkCustomSlotElementsLoaded = createEvent(this, "snkCustomSlotElementsLoaded", 7);
|
9
10
|
this.slotName = 'CUSTOM_SLOT_ELEMENTS';
|
10
11
|
}
|
12
|
+
componentDidLoad() {
|
13
|
+
this.snkCustomSlotElementsLoaded.emit(this.slotName);
|
14
|
+
}
|
11
15
|
render() {
|
12
|
-
return (h(Host, { slot: this.slotName
|
16
|
+
return (h(Host, { slot: this.slotName, id: this.slotName, class: "custom-slot-elements-container" }, h("slot", null)));
|
13
17
|
}
|
14
18
|
static get style() { return snkCustomSlotElementsCss; }
|
15
19
|
}, [6, "snk-custom-slot-elements", {
|
@@ -439,14 +439,14 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
439
439
|
const pkObject = [];
|
440
440
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
441
441
|
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
442
|
-
const fields =
|
442
|
+
const fields = {};
|
443
443
|
fields['fields'] = [];
|
444
444
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
445
445
|
if (index === 0) {
|
446
446
|
pkObject[`PK_${name}`] = { type: this.parseDataType(type), value };
|
447
447
|
pkObject['pks'] = [];
|
448
448
|
}
|
449
|
-
const dataFields = { nome: name
|
449
|
+
const dataFields = { nome: `PK_${name}`, tipo: this.parseDataType(type), valor: value };
|
450
450
|
fields['fields'].push(dataFields);
|
451
451
|
pkObject['pks'].push(fields);
|
452
452
|
});
|
@@ -23,6 +23,7 @@ import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
23
23
|
import { d as defineCustomElement$o } from './snk-exporter-email-sender2.js';
|
24
24
|
import { d as defineCustomElement$n } from './snk-expression-group2.js';
|
25
25
|
import { d as defineCustomElement$m } from './snk-expression-item2.js';
|
26
|
+
import { d as defineCustomElement$l } from './snk-field-config2.js';
|
26
27
|
import { d as defineCustomElement$k } from './snk-filter-advanced-mode2.js';
|
27
28
|
import { d as defineCustomElement$j } from './snk-filter-assistent-mode2.js';
|
28
29
|
import { d as defineCustomElement$i } from './snk-filter-bar2.js';
|
@@ -30,6 +31,7 @@ import { d as defineCustomElement$h } from './snk-filter-detail2.js';
|
|
30
31
|
import { d as defineCustomElement$g } from './snk-filter-field-search2.js';
|
31
32
|
import { d as defineCustomElement$f } from './snk-filter-item2.js';
|
32
33
|
import { d as defineCustomElement$e } from './snk-filter-param-config2.js';
|
34
|
+
import { d as defineCustomElement$d } from './snk-form-config2.js';
|
33
35
|
import { d as defineCustomElement$c } from './snk-form-summary2.js';
|
34
36
|
import { d as defineCustomElement$b } from './snk-form-view2.js';
|
35
37
|
import { d as defineCustomElement$a } from './snk-grid2.js';
|
@@ -38,10 +40,8 @@ import { d as defineCustomElement$8 } from './snk-personalized-filter2.js';
|
|
38
40
|
import { d as defineCustomElement$7 } from './snk-select-box2.js';
|
39
41
|
import { d as defineCustomElement$6 } from './snk-simple-bar2.js';
|
40
42
|
import { d as defineCustomElement$5 } from './snk-simple-crud2.js';
|
41
|
-
import { d as defineCustomElement$2 } from './taskbar-actions-button2.js';
|
42
|
-
import { d as defineCustomElement$l } from './snk-field-config2.js';
|
43
|
-
import { d as defineCustomElement$d } from './snk-form-config2.js';
|
44
43
|
import { d as defineCustomElement$4 } from './snk-tab-config2.js';
|
44
|
+
import { d as defineCustomElement$2 } from './taskbar-actions-button2.js';
|
45
45
|
|
46
46
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
47
47
|
|
@@ -68,6 +68,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
68
68
|
this.presentationMode = undefined;
|
69
69
|
this.resourceID = undefined;
|
70
70
|
this.detailTaskbarCustomContainerId = undefined;
|
71
|
+
this.formLegacyConfigName = undefined;
|
71
72
|
this._hasToCreateFieldSearch = true;
|
72
73
|
this._breadcrumbItems = [];
|
73
74
|
this._guides = undefined;
|
@@ -104,6 +105,12 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
104
105
|
async findField() {
|
105
106
|
await openFieldSearch(this._moreOptions, this._fieldSearch);
|
106
107
|
}
|
108
|
+
/**
|
109
|
+
* Atribui o foco para o componente.
|
110
|
+
*/
|
111
|
+
async setFocus() {
|
112
|
+
this._container.focus();
|
113
|
+
}
|
107
114
|
exitViewer() {
|
108
115
|
if (this.dataUnit.isDirty()) {
|
109
116
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
@@ -365,11 +372,17 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
365
372
|
var _a;
|
366
373
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
367
374
|
}
|
375
|
+
addFormLegacyConfigName() {
|
376
|
+
if (this.formLegacyConfigName) {
|
377
|
+
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
378
|
+
}
|
379
|
+
}
|
368
380
|
componentWillLoad() {
|
369
381
|
if (this.resourceID == undefined) {
|
370
382
|
throw new Error("Erro interno: resourceID não informado");
|
371
383
|
}
|
372
384
|
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
385
|
+
this.addFormLegacyConfigName();
|
373
386
|
this._configManager.loadConfig();
|
374
387
|
}
|
375
388
|
componentDidRender() {
|
@@ -474,17 +487,14 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
474
487
|
render() {
|
475
488
|
var _a, _b;
|
476
489
|
if (this._formEditorConfigManager != undefined) {
|
477
|
-
return (h("snk-form-config", { dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null }));
|
490
|
+
return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null }));
|
478
491
|
}
|
479
|
-
if (!this.dataUnit) {
|
480
|
-
return;
|
481
|
-
}
|
482
|
-
if (!this._configManager.isLoaded) {
|
492
|
+
if (!this.dataUnit || !this._configManager.isLoaded) {
|
483
493
|
return;
|
484
494
|
}
|
485
495
|
this.loadTaskbarProcessor();
|
486
496
|
const showGuides = this._guides && (this._guides.length > 1);
|
487
|
-
return (h("section", { class: "snk-guides-viewer" }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
497
|
+
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
488
498
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
489
499
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
490
500
|
:
|
@@ -519,6 +529,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
519
529
|
"presentationMode": [1, "presentation-mode"],
|
520
530
|
"resourceID": [1, "resource-i-d"],
|
521
531
|
"detailTaskbarCustomContainerId": [1, "detail-taskbar-custom-container-id"],
|
532
|
+
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
522
533
|
"_hasToCreateFieldSearch": [32],
|
523
534
|
"_breadcrumbItems": [32],
|
524
535
|
"_guides": [32],
|
@@ -526,7 +537,8 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
526
537
|
"_formEditorDataUnit": [32],
|
527
538
|
"_fieldToGetFocus": [32],
|
528
539
|
"showFormConfig": [64],
|
529
|
-
"findField": [64]
|
540
|
+
"findField": [64],
|
541
|
+
"setFocus": [64]
|
530
542
|
}, [[2, "actionClick", "onActionClick"], [0, "snkContentCardChanged", "onContentCardChanged"]]]);
|
531
543
|
function defineCustomElement$1() {
|
532
544
|
if (typeof customElements === "undefined") {
|
@@ -978,7 +990,7 @@ function defineCustomElement() {
|
|
978
990
|
if (typeof customElements === "undefined") {
|
979
991
|
return;
|
980
992
|
}
|
981
|
-
const components = ["snk-detail-view", "snk-actions-button", "snk-attach", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-form-summary", "snk-form-view", "snk-grid", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-taskbar", "taskbar-actions-button"];
|
993
|
+
const components = ["snk-detail-view", "snk-actions-button", "snk-attach", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-field-config", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-form-config", "snk-form-summary", "snk-form-view", "snk-grid", "snk-grid-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
|
982
994
|
components.forEach(tagName => { switch (tagName) {
|
983
995
|
case "snk-detail-view":
|
984
996
|
if (!customElements.get(tagName)) {
|
@@ -995,6 +1007,16 @@ function defineCustomElement() {
|
|
995
1007
|
defineCustomElement$t();
|
996
1008
|
}
|
997
1009
|
break;
|
1010
|
+
case "snk-config-options":
|
1011
|
+
if (!customElements.get(tagName)) {
|
1012
|
+
defineCustomElement$s();
|
1013
|
+
}
|
1014
|
+
break;
|
1015
|
+
case "snk-configurator":
|
1016
|
+
if (!customElements.get(tagName)) {
|
1017
|
+
defineCustomElement$r();
|
1018
|
+
}
|
1019
|
+
break;
|
998
1020
|
case "snk-data-exporter":
|
999
1021
|
if (!customElements.get(tagName)) {
|
1000
1022
|
defineCustomElement$q();
|
@@ -1020,6 +1042,11 @@ function defineCustomElement() {
|
|
1020
1042
|
defineCustomElement$m();
|
1021
1043
|
}
|
1022
1044
|
break;
|
1045
|
+
case "snk-field-config":
|
1046
|
+
if (!customElements.get(tagName)) {
|
1047
|
+
defineCustomElement$l();
|
1048
|
+
}
|
1049
|
+
break;
|
1023
1050
|
case "snk-filter-advanced-mode":
|
1024
1051
|
if (!customElements.get(tagName)) {
|
1025
1052
|
defineCustomElement$k();
|
@@ -1055,6 +1082,11 @@ function defineCustomElement() {
|
|
1055
1082
|
defineCustomElement$e();
|
1056
1083
|
}
|
1057
1084
|
break;
|
1085
|
+
case "snk-form-config":
|
1086
|
+
if (!customElements.get(tagName)) {
|
1087
|
+
defineCustomElement$d();
|
1088
|
+
}
|
1089
|
+
break;
|
1058
1090
|
case "snk-form-summary":
|
1059
1091
|
if (!customElements.get(tagName)) {
|
1060
1092
|
defineCustomElement$c();
|
@@ -1095,6 +1127,11 @@ function defineCustomElement() {
|
|
1095
1127
|
defineCustomElement$5();
|
1096
1128
|
}
|
1097
1129
|
break;
|
1130
|
+
case "snk-tab-config":
|
1131
|
+
if (!customElements.get(tagName)) {
|
1132
|
+
defineCustomElement$4();
|
1133
|
+
}
|
1134
|
+
break;
|
1098
1135
|
case "snk-taskbar":
|
1099
1136
|
if (!customElements.get(tagName)) {
|
1100
1137
|
defineCustomElement$3();
|