@sankhyalabs/sankhyablocks 8.15.0-dev.9 → 8.15.0-rc.10
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-302bbbd4.js → ConfigStorage-34be11ce.js} +70 -7
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-6211fb28.js} +7 -2
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-141aa18d.js} +15 -1
- package/dist/cjs/SnkMultiSelectionListDataSource-5213120b.js +140 -0
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-353e4af2.js → pesquisa-fetcher-94f6b316.js} +439 -39
- 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} +524 -8
- package/dist/cjs/snk-application.cjs.entry.js +44 -10
- package/dist/cjs/snk-attach.cjs.entry.js +392 -62
- package/dist/cjs/snk-crud.cjs.entry.js +17 -12
- package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -5
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-6026a9f7.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -12
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +44 -8
- package/dist/cjs/snk-filter-item.cjs.entry.js +4 -47
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +47 -27
- package/dist/cjs/snk-form.cjs.entry.js +11 -4
- package/dist/cjs/snk-grid.cjs.entry.js +40 -22
- package/dist/cjs/{snk-guides-viewer-e60ccc5e.js → snk-guides-viewer-508bb6fe.js} +16 -11
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -10
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +229 -27
- package/dist/cjs/snk-taskbar.cjs.entry.js +100 -14
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-3ecd1278.js} +9 -9
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +85 -2
- package/dist/collection/components/snk-attach/snk-attach.js +188 -39
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +95 -3
- 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.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +27 -3
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +6 -2
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -47
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +23 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +137 -3
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-form/snk-form.js +25 -1
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +6 -1
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +50 -30
- package/dist/collection/components/snk-grid/snk-grid.js +103 -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-pesquisa/snk-pesquisa.css +2 -4
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +378 -18
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +4 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -9
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +139 -13
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +17 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +29 -22
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +11 -12
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +2 -1
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkFormConfigManager.js +5 -0
- package/dist/components/SnkMessageBuilder.js +15 -1
- package/dist/components/dataunit-fetcher.js +58 -38
- package/dist/components/field-search.js +93 -3
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +41 -2
- package/dist/components/snk-attach2.js +448 -69
- package/dist/components/snk-crud.js +15 -3
- package/dist/components/snk-data-exporter2.js +6 -2
- package/dist/components/snk-detail-view2.js +40 -7
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +47 -6
- package/dist/components/snk-filter-item2.js +4 -47
- package/dist/components/snk-filter-modal.js +4 -2
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-form-config2.js +46 -26
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +41 -17
- package/dist/components/snk-personalized-filter-editor.js +3 -1
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +285 -29
- package/dist/components/snk-taskbar2.js +114 -24
- package/dist/components/taskbar-actions-button2.js +4 -2
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-101a2b4c.js} +70 -7
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-d86ba46f.js} +7 -2
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-9747ddd2.js} +15 -1
- package/dist/esm/SnkMultiSelectionListDataSource-7e7eada5.js +133 -0
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-0fc935a0.js → pesquisa-fetcher-f05a12ca.js} +429 -31
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +523 -9
- package/dist/esm/snk-application.entry.js +43 -9
- package/dist/esm/snk-attach.entry.js +392 -62
- package/dist/esm/snk-crud.entry.js +17 -12
- package/dist/esm/snk-data-exporter.entry.js +9 -5
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-4c343635.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +10 -12
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +44 -8
- package/dist/esm/snk-filter-item.entry.js +4 -47
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-modal.entry.js +2 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form-config.entry.js +48 -28
- package/dist/esm/snk-form.entry.js +11 -4
- package/dist/esm/snk-grid.entry.js +41 -23
- package/dist/esm/{snk-guides-viewer-98a8e45e.js → snk-guides-viewer-18859840.js} +16 -11
- package/dist/esm/snk-guides-viewer.entry.js +8 -10
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +229 -27
- package/dist/esm/snk-taskbar.entry.js +101 -15
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-2473c8ac.js} +9 -9
- package/dist/sankhyablocks/p-1f3174cb.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa5a18c.entry.js +11 -0
- package/dist/sankhyablocks/p-20b46647.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-2897fb8c.js +1 -0
- package/dist/sankhyablocks/{p-ff6064e7.js → p-2936303b.js} +1 -1
- package/dist/sankhyablocks/p-2b909f08.entry.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/p-5c0b53ce.js +56 -0
- package/dist/sankhyablocks/p-5dbc1a3f.js +1 -0
- package/dist/sankhyablocks/p-60fa6c7a.js +1 -0
- package/dist/sankhyablocks/p-64c1b368.entry.js +1 -0
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-6b28cc74.entry.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-7ddd95b6.entry.js} +1 -1
- package/dist/sankhyablocks/p-7e05bd83.entry.js +1 -0
- package/dist/sankhyablocks/p-7f97fee2.entry.js +1 -0
- package/dist/sankhyablocks/p-86801b08.entry.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-9a5d1b39.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-b41a622a.entry.js +1 -0
- package/dist/sankhyablocks/p-b4de81ac.entry.js +1 -0
- package/dist/sankhyablocks/p-ba4871b5.entry.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/p-d01ceda6.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-d304659d.entry.js +1 -0
- package/dist/sankhyablocks/p-d78d4062.js +65 -0
- package/dist/sankhyablocks/p-e4fb3308.entry.js +1 -0
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-application/snk-application.d.ts +15 -0
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-crud/snk-crud.d.ts +21 -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 +6 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -2
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +24 -1
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
- package/dist/types/components/snk-form/snk-form.d.ts +6 -1
- package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +1 -0
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +5 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +20 -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 +71 -4
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +28 -1
- package/dist/types/components.d.ts +265 -12
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +13 -6
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- 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/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-0874adb5.entry.js +0 -1
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-1d75d9f9.entry.js +0 -1
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-374d03f6.js +0 -1
- package/dist/sankhyablocks/p-41560fd8.entry.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-573a07c5.js +0 -1
- package/dist/sankhyablocks/p-6678d5d4.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-71439fd9.entry.js +0 -1
- package/dist/sankhyablocks/p-761ed32f.entry.js +0 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-90f9b4db.entry.js +0 -11
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a91bb13d.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-aa95fb2c.js +0 -56
- package/dist/sankhyablocks/p-abfa8101.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-b3020263.entry.js +0 -1
- package/dist/sankhyablocks/p-bf93a748.js +0 -60
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c6f89389.entry.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-cebae710.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /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/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +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
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,18 +1,123 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
|
2
|
+
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher.js';
|
4
|
-
import { a as SaveErrorsEnum, d as defineCustomElement$8 } from './snk-actions-button2.js';
|
5
|
-
import { V as VIEW_MODE } from './constants.js';
|
6
4
|
import { a as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
|
5
|
+
import './index2.js';
|
6
|
+
import { a as SaveErrorsEnum, d as defineCustomElement$f } from './snk-actions-button2.js';
|
7
|
+
import './filter-item-type.enum.js';
|
8
|
+
import './form-config-fetcher.js';
|
9
|
+
import { V as VIEW_MODE } from './constants.js';
|
10
|
+
import { A as AutorizationType } from './auth-fetcher.js';
|
7
11
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
8
|
-
import { d as defineCustomElement$
|
9
|
-
import { d as defineCustomElement$
|
10
|
-
import { d as defineCustomElement$
|
11
|
-
import { d as defineCustomElement$
|
12
|
-
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';
|
13
24
|
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
14
25
|
|
26
|
+
const SERVICE$1 = {
|
27
|
+
save: "Attach.save",
|
28
|
+
delete: "Attach.remove",
|
29
|
+
view: "Attach.view",
|
30
|
+
repository: "RepositorioArquivoSP.abreArquivo"
|
31
|
+
};
|
15
32
|
class AttachFetcher {
|
33
|
+
constructor(dataUnitName) {
|
34
|
+
this.dataUnitName = dataUnitName;
|
35
|
+
}
|
36
|
+
async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
|
37
|
+
var _a, _b;
|
38
|
+
const isInsert = operation == "INSERT";
|
39
|
+
const dataBody = isInsert ? fields : record;
|
40
|
+
if (!isInsert && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) !== (record === null || record === void 0 ? void 0 : record.DESCRICAO)) {
|
41
|
+
throw new Error(SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
|
42
|
+
}
|
43
|
+
const reqBody = {
|
44
|
+
"anexo": {
|
45
|
+
"codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
|
46
|
+
"sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
|
47
|
+
"tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
|
48
|
+
"descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
|
49
|
+
"arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
|
50
|
+
"ehInclusao": isInsert ? "S" : "N",
|
51
|
+
"ehArquivoRepositorio": "N"
|
52
|
+
}
|
53
|
+
};
|
54
|
+
return new Promise((resolve, reject) => {
|
55
|
+
DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
|
56
|
+
.then(result => {
|
57
|
+
var _a;
|
58
|
+
return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
|
59
|
+
})
|
60
|
+
.catch(error => reject(error));
|
61
|
+
});
|
62
|
+
}
|
63
|
+
async edit(change) {
|
64
|
+
throw new Error("Method not implemented.");
|
65
|
+
}
|
66
|
+
async delete(record) {
|
67
|
+
var request = {
|
68
|
+
anexo: {
|
69
|
+
codata: record.CODATA,
|
70
|
+
tipo: record.TIPO,
|
71
|
+
descricao: record.DESCRICAO,
|
72
|
+
}
|
73
|
+
};
|
74
|
+
const result = await DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
|
75
|
+
return Promise.resolve(result);
|
76
|
+
}
|
77
|
+
async getDownloadKey(record) {
|
78
|
+
var _a, _b, _c;
|
79
|
+
if (record.EHARQUIVOREPOSITORIO == 'S') {
|
80
|
+
const request = {
|
81
|
+
config: {
|
82
|
+
path: record.ARQUIVO,
|
83
|
+
tipoconteudo: record.TIPOCONTEUDO
|
84
|
+
}
|
85
|
+
};
|
86
|
+
const result = await DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
|
87
|
+
return Promise.resolve({
|
88
|
+
chave: {
|
89
|
+
valor: (_b = (_a = result === null || result === void 0 ? void 0 : result.responseBody) === null || _a === void 0 ? void 0 : _a.chave) === null || _b === void 0 ? void 0 : _b.valor
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
const criteria = {
|
94
|
+
anexo: {
|
95
|
+
codata: record.CODATA,
|
96
|
+
codemp: record.CODEMP,
|
97
|
+
sequencia: record.SEQUENCIA,
|
98
|
+
tipo: record.TIPO,
|
99
|
+
descricao: record.DESCRICAO,
|
100
|
+
tipoConteudo: record.TIPOCONTEUDO
|
101
|
+
}
|
102
|
+
};
|
103
|
+
const result = await DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
|
104
|
+
if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
|
105
|
+
return Promise.resolve({
|
106
|
+
chave: {
|
107
|
+
valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
|
108
|
+
}
|
109
|
+
});
|
110
|
+
}
|
111
|
+
return Promise.reject(new Error("File not found."));
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
const SERVICE = {
|
116
|
+
save: "AnexoSistemaSP.salvar",
|
117
|
+
delete: "AnexoSistemaSP.excluir",
|
118
|
+
download: "AnexoSistemaSP.baixar",
|
119
|
+
};
|
120
|
+
class AnexoSistemaFetcher {
|
16
121
|
constructor(entityName, registerKey, dataUnitName) {
|
17
122
|
var _a;
|
18
123
|
this.entityName = entityName;
|
@@ -30,14 +135,13 @@ class AttachFetcher {
|
|
30
135
|
}
|
31
136
|
async save(change) {
|
32
137
|
var _a, _b;
|
33
|
-
const serviceName = "AnexoSistemaSP.salvar";
|
34
138
|
let { updatingFields: fields } = change;
|
35
139
|
fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
|
36
140
|
try {
|
37
141
|
this.validateFields(fields);
|
38
142
|
const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
|
39
143
|
const reqBody = {
|
40
|
-
serviceName,
|
144
|
+
serviceName: SERVICE.save,
|
41
145
|
requestBody: {
|
42
146
|
params: {
|
43
147
|
resourceID: this.resourceID,
|
@@ -53,7 +157,7 @@ class AttachFetcher {
|
|
53
157
|
}
|
54
158
|
}
|
55
159
|
};
|
56
|
-
const result = await DataFetcher.get().callServiceBroker(
|
160
|
+
const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
|
57
161
|
return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
|
58
162
|
}
|
59
163
|
catch (error) {
|
@@ -62,7 +166,6 @@ class AttachFetcher {
|
|
62
166
|
}
|
63
167
|
async edit(change) {
|
64
168
|
var _a, _b, _c;
|
65
|
-
const serviceName = "AnexoSistemaSP.salvar";
|
66
169
|
let { updatingFields: fields, record } = change;
|
67
170
|
const getFieldValue = (fieldValue) => {
|
68
171
|
if (fields[fieldValue] !== undefined)
|
@@ -76,7 +179,7 @@ class AttachFetcher {
|
|
76
179
|
try {
|
77
180
|
this.validateFields(fields);
|
78
181
|
const reqBody = {
|
79
|
-
serviceName,
|
182
|
+
serviceName: SERVICE.save,
|
80
183
|
requestBody: {
|
81
184
|
params: {
|
82
185
|
resourceID: this.resourceID,
|
@@ -94,7 +197,7 @@ class AttachFetcher {
|
|
94
197
|
}
|
95
198
|
}
|
96
199
|
};
|
97
|
-
const result = await DataFetcher.get().callServiceBroker(
|
200
|
+
const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
|
98
201
|
return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
|
99
202
|
}
|
100
203
|
catch (error) {
|
@@ -103,10 +206,9 @@ class AttachFetcher {
|
|
103
206
|
}
|
104
207
|
delete(record) {
|
105
208
|
var _a;
|
106
|
-
const serviceName = "AnexoSistemaSP.excluir";
|
107
209
|
const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
|
108
210
|
const reqBody = {
|
109
|
-
serviceName,
|
211
|
+
serviceName: SERVICE.delete,
|
110
212
|
requestBody: {
|
111
213
|
paramsDelete: {
|
112
214
|
keyAttach: record.CHAVEARQUIVO,
|
@@ -118,17 +220,16 @@ class AttachFetcher {
|
|
118
220
|
}
|
119
221
|
};
|
120
222
|
return new Promise((resolve, reject) => {
|
121
|
-
DataFetcher.get().callServiceBroker(
|
223
|
+
DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
|
122
224
|
.then(result => resolve(result))
|
123
225
|
.catch(error => reject(error));
|
124
226
|
});
|
125
227
|
}
|
126
228
|
getDownloadKey(record) {
|
127
229
|
var _a;
|
128
|
-
const serviceName = "AnexoSistemaSP.baixar";
|
129
230
|
const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
|
130
231
|
const reqBody = {
|
131
|
-
serviceName,
|
232
|
+
serviceName: SERVICE.download,
|
132
233
|
requestBody: {
|
133
234
|
paramsDown: {
|
134
235
|
nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
|
@@ -140,34 +241,37 @@ class AttachFetcher {
|
|
140
241
|
}
|
141
242
|
};
|
142
243
|
return new Promise((resolve, reject) => {
|
143
|
-
DataFetcher.get().callServiceBroker(
|
244
|
+
DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
|
144
245
|
.then(result => resolve(result))
|
145
246
|
.catch(error => reject(error));
|
146
247
|
});
|
147
248
|
}
|
148
249
|
}
|
149
250
|
|
150
|
-
class
|
251
|
+
class AnexoSistemaDataUnitFactory {
|
151
252
|
constructor(entityName, getMessage) {
|
152
253
|
this.entityName = entityName;
|
153
254
|
this.getMessage = getMessage;
|
154
255
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
155
256
|
}
|
156
|
-
initLoaders(dataUnit,
|
257
|
+
initLoaders(dataUnit, fetcher, onSuccess) {
|
157
258
|
if (!this.loader)
|
158
259
|
this.loader = dataUnit.dataLoader;
|
159
260
|
dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
160
|
-
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes,
|
261
|
+
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
|
161
262
|
if (recordIds.length)
|
162
263
|
onSuccess();
|
163
264
|
return recordIds;
|
164
265
|
});
|
165
|
-
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids,
|
266
|
+
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
|
166
267
|
if (recordIds.length)
|
167
268
|
onSuccess();
|
168
269
|
return recordIds;
|
169
270
|
});
|
170
271
|
}
|
272
|
+
metadataLoader(dataUnit) {
|
273
|
+
throw new Error("Method not implemented.");
|
274
|
+
}
|
171
275
|
dataLoader(dataUnit, request) {
|
172
276
|
return new Promise(resolve => {
|
173
277
|
this.loader(dataUnit, request).then(response => {
|
@@ -183,11 +287,11 @@ class AttachmentDataUnitBuilder {
|
|
183
287
|
});
|
184
288
|
});
|
185
289
|
}
|
186
|
-
saveLoader(changes,
|
290
|
+
saveLoader(changes, fetcher) {
|
187
291
|
return new Promise((resolve) => {
|
188
292
|
var _a;
|
189
293
|
const change = Array.isArray(changes) ? changes[0] : {};
|
190
|
-
const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ?
|
294
|
+
const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ? fetcher.edit.bind(fetcher) : fetcher.save.bind(fetcher);
|
191
295
|
savePromise(change).then((records) => {
|
192
296
|
resolve(records);
|
193
297
|
}).catch((error) => {
|
@@ -207,11 +311,11 @@ class AttachmentDataUnitBuilder {
|
|
207
311
|
});
|
208
312
|
});
|
209
313
|
}
|
210
|
-
removeLoader(dataUnit, ids,
|
314
|
+
removeLoader(dataUnit, ids, fetcher) {
|
211
315
|
return new Promise((resolve) => {
|
212
316
|
const { records } = dataUnit.getSelectionInfo();
|
213
317
|
const recordToDelete = records[0];
|
214
|
-
|
318
|
+
fetcher.delete(recordToDelete).then(() => {
|
215
319
|
PreloadManager.removeRecords(dataUnit, [recordToDelete]);
|
216
320
|
return resolve(ids);
|
217
321
|
});
|
@@ -252,6 +356,175 @@ class AttachmentDataUnitBuilder {
|
|
252
356
|
}
|
253
357
|
}
|
254
358
|
|
359
|
+
const application$1 = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
360
|
+
const getMessage$1 = (key) => {
|
361
|
+
var _a, _b;
|
362
|
+
return (_b = (_a = application$1 === null || application$1 === void 0 ? void 0 : application$1.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage) === null || _b === void 0 ? void 0 : _b.call(_a, key, null);
|
363
|
+
};
|
364
|
+
const attachCrudConfig = {
|
365
|
+
grid: {
|
366
|
+
columns: [
|
367
|
+
{ name: "CODATA", orderIndex: 0, width: 0 },
|
368
|
+
{ name: "DESCRICAO", orderIndex: 1, width: 0 },
|
369
|
+
{ name: "ARQUIVO", orderIndex: 2, width: 0 },
|
370
|
+
{ name: "DTALTER", orderIndex: 3, width: 0 },
|
371
|
+
{ name: "USUARIO", orderIndex: 4, width: 0 },
|
372
|
+
],
|
373
|
+
},
|
374
|
+
form: {
|
375
|
+
emptyConfig: false,
|
376
|
+
fields: [
|
377
|
+
{
|
378
|
+
name: "DESCRICAO",
|
379
|
+
label: getMessage$1("snkAttach.attachMetadata.lblDescription"),
|
380
|
+
visible: true,
|
381
|
+
readOnly: false,
|
382
|
+
required: true,
|
383
|
+
},
|
384
|
+
{
|
385
|
+
name: "CAMINHO_ARQUIVO",
|
386
|
+
label: getMessage$1("snkAttach.attachMetadata.lblFile"),
|
387
|
+
visible: true,
|
388
|
+
readOnly: false,
|
389
|
+
required: true,
|
390
|
+
},
|
391
|
+
],
|
392
|
+
},
|
393
|
+
};
|
394
|
+
const attachFetcherMetadataBuilder = {
|
395
|
+
name: "Attach",
|
396
|
+
label: "Attach List",
|
397
|
+
fields: [
|
398
|
+
{ name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: DataType.TEXT },
|
399
|
+
{ name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: DataType.TEXT },
|
400
|
+
{ name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: DataType.TEXT },
|
401
|
+
{ name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: DataType.TEXT },
|
402
|
+
{ name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: DataType.TEXT },
|
403
|
+
{
|
404
|
+
name: "CAMINHO_ARQUIVO",
|
405
|
+
label: getMessage$1("snkAttach.attachMetadata.lblFileUpload"),
|
406
|
+
dataType: DataType.OBJECT,
|
407
|
+
userInterface: UserInterface.FILE,
|
408
|
+
readOnly: false,
|
409
|
+
required: true,
|
410
|
+
visible: true,
|
411
|
+
properties: {
|
412
|
+
subTitle: getMessage$1("snkAttach.attachMetadata.lblSubTitle"),
|
413
|
+
MAX_FILES: 1,
|
414
|
+
STORAGESTRATEGY: "SESSION",
|
415
|
+
INTERNAL_FILENAME: "Attach.upload",
|
416
|
+
}
|
417
|
+
},
|
418
|
+
],
|
419
|
+
};
|
420
|
+
|
421
|
+
const SERVICE_LOAD = "Attach.load";
|
422
|
+
class AttachFetcherDataUnitFactory {
|
423
|
+
constructor(getMessage) {
|
424
|
+
this.getMessage = getMessage;
|
425
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
426
|
+
}
|
427
|
+
initLoaders(dataUnit, fetcher, onSuccess) {
|
428
|
+
dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
|
429
|
+
dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
430
|
+
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
|
431
|
+
if (recordIds.length)
|
432
|
+
onSuccess();
|
433
|
+
return recordIds;
|
434
|
+
});
|
435
|
+
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
|
436
|
+
if (recordIds.length)
|
437
|
+
onSuccess();
|
438
|
+
return recordIds;
|
439
|
+
});
|
440
|
+
}
|
441
|
+
metadataLoader(_) {
|
442
|
+
return Promise.resolve(attachFetcherMetadataBuilder);
|
443
|
+
}
|
444
|
+
async dataLoader(_, request) {
|
445
|
+
if (!request.source) {
|
446
|
+
return Promise.resolve({ records: [] });
|
447
|
+
}
|
448
|
+
const criteria = {
|
449
|
+
criteria: {
|
450
|
+
codata: request.source,
|
451
|
+
tipoAnexo: "N"
|
452
|
+
}
|
453
|
+
};
|
454
|
+
const applicationDataFetcher = await this._application.getDataFetcher();
|
455
|
+
const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
|
456
|
+
const records = [];
|
457
|
+
anexo.forEach((param) => {
|
458
|
+
records.push(Object.assign({ __record__id__: StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
|
459
|
+
name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
|
460
|
+
}] }, param));
|
461
|
+
});
|
462
|
+
return Promise.resolve({ records });
|
463
|
+
}
|
464
|
+
saveLoader(changes, fetcher) {
|
465
|
+
return new Promise((resolve) => {
|
466
|
+
const change = Array.isArray(changes) ? changes[0] : {};
|
467
|
+
fetcher.save(change)
|
468
|
+
.then(resolve)
|
469
|
+
.catch((error) => {
|
470
|
+
if (error.message === SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
|
471
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
|
472
|
+
return resolve([]);
|
473
|
+
}
|
474
|
+
if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
475
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
476
|
+
return resolve([]);
|
477
|
+
}
|
478
|
+
if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
479
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
480
|
+
return resolve([]);
|
481
|
+
}
|
482
|
+
if (error.message) {
|
483
|
+
this._application.error((error.title || error.name), error.message);
|
484
|
+
return resolve([]);
|
485
|
+
}
|
486
|
+
resolve([]);
|
487
|
+
});
|
488
|
+
});
|
489
|
+
}
|
490
|
+
removeLoader(dataUnit, ids, fetcher) {
|
491
|
+
return new Promise((resolve) => {
|
492
|
+
dataUnit.getSelectionInfo().records.forEach(async (record) => {
|
493
|
+
this._application.hasAccess(AutorizationType.REMOVE)
|
494
|
+
.then(async (hasAccess) => {
|
495
|
+
if (hasAccess) {
|
496
|
+
await fetcher.delete(record);
|
497
|
+
resolve(ids);
|
498
|
+
}
|
499
|
+
});
|
500
|
+
});
|
501
|
+
});
|
502
|
+
}
|
503
|
+
getFilters() {
|
504
|
+
throw new Error('Method not implemented.');
|
505
|
+
}
|
506
|
+
getInterceptions(dataUnit, action, crudRef) {
|
507
|
+
return new Promise((resolve) => {
|
508
|
+
if (action.type === Action.EDITION_CANCELED) {
|
509
|
+
if (!dataUnit.isDirty())
|
510
|
+
return resolve(action);
|
511
|
+
return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
|
512
|
+
if (cancellationConfirmed) {
|
513
|
+
crudRef.goToView(VIEW_MODE.GRID);
|
514
|
+
return resolve(action);
|
515
|
+
}
|
516
|
+
return resolve(undefined);
|
517
|
+
});
|
518
|
+
}
|
519
|
+
if (action.type === Action.DATA_SAVED) {
|
520
|
+
dataUnit.loadData();
|
521
|
+
return resolve(action);
|
522
|
+
}
|
523
|
+
resolve(action);
|
524
|
+
});
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
255
528
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
256
529
|
const getMessage = (key) => {
|
257
530
|
var _a, _b;
|
@@ -298,7 +571,7 @@ const buildTaskBarManager = () => {
|
|
298
571
|
};
|
299
572
|
};
|
300
573
|
|
301
|
-
const
|
574
|
+
const anexoSistemaCrudConfig = {
|
302
575
|
grid: {
|
303
576
|
columns: [
|
304
577
|
{ name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
|
@@ -345,40 +618,60 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
345
618
|
super();
|
346
619
|
this.__registerHost();
|
347
620
|
this.back = createEvent(this, "back", 7);
|
348
|
-
this.handleTaskbarClick = ({ detail: taskbar }) => {
|
621
|
+
this.handleTaskbarClick = async ({ detail: taskbar }) => {
|
349
622
|
if (["DOWNLOAD", "LINK"].includes(taskbar))
|
350
|
-
return this.downloadAttachment(this.
|
623
|
+
return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
|
624
|
+
if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
|
625
|
+
await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
|
626
|
+
}
|
351
627
|
};
|
352
628
|
this.handleBack = () => {
|
353
|
-
this.
|
629
|
+
this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
|
354
630
|
if (cancelationConfirmed)
|
355
631
|
this.back.emit();
|
356
632
|
});
|
357
633
|
};
|
358
634
|
this.handleFinish = () => {
|
359
|
-
if (!this.
|
635
|
+
if (!this._currentDataUnit.isDirty())
|
360
636
|
return this.back.emit();
|
361
|
-
this.
|
637
|
+
this._currentDataUnit.saveData().then(() => {
|
362
638
|
this.showFinishedToast();
|
363
639
|
this.back.emit();
|
364
640
|
});
|
365
641
|
};
|
642
|
+
this.fetcherType = "AnexoSistema";
|
643
|
+
this.fetcher = undefined;
|
644
|
+
this.dataUnit = undefined;
|
645
|
+
this.dataUnitBuilder = undefined;
|
366
646
|
this.registerKey = undefined;
|
367
647
|
this.entityName = undefined;
|
368
648
|
this.messagesBuilder = undefined;
|
369
|
-
this.
|
649
|
+
this._currentFetcher = undefined;
|
650
|
+
this._currentDataUnit = undefined;
|
370
651
|
this.crudConfig = undefined;
|
371
652
|
}
|
372
653
|
registerKeyWatcher(newRegisterKey, oldRegisterKey) {
|
373
|
-
var _a;
|
374
|
-
if (this.
|
654
|
+
var _a, _b, _c, _d;
|
655
|
+
if (this._currentDataUnit == null) {
|
375
656
|
this.loadAttachmentDataUnit();
|
376
657
|
}
|
377
658
|
if (oldRegisterKey !== newRegisterKey) {
|
378
659
|
this.returnToGridMode();
|
379
|
-
|
380
|
-
|
381
|
-
|
660
|
+
if (this.fetcherType === "AnexoSistema") {
|
661
|
+
this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
662
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
663
|
+
return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
|
664
|
+
}
|
665
|
+
if (this.fetcherType === "Attach") {
|
666
|
+
const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
|
667
|
+
if (hasMoreOneItem)
|
668
|
+
return;
|
669
|
+
}
|
670
|
+
return this._currentDataUnit
|
671
|
+
.loadMetadata()
|
672
|
+
.then(() => {
|
673
|
+
this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
674
|
+
});
|
382
675
|
}
|
383
676
|
}
|
384
677
|
/**
|
@@ -401,44 +694,90 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
401
694
|
window.open(`${selectedRecord.LINK}`);
|
402
695
|
return;
|
403
696
|
}
|
404
|
-
this.
|
405
|
-
|
697
|
+
this._currentFetcher
|
698
|
+
.getDownloadKey(selectedRecord)
|
699
|
+
.then(({ chave }) => {
|
700
|
+
var _a;
|
701
|
+
let forceDownload = false;
|
702
|
+
if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
|
703
|
+
forceDownload = true;
|
704
|
+
}
|
705
|
+
window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
|
406
706
|
});
|
407
707
|
}
|
408
708
|
returnToGridMode() {
|
409
|
-
|
709
|
+
var _a;
|
710
|
+
(_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
|
410
711
|
if (this._crudElement)
|
411
712
|
this._crudElement.goToView(VIEW_MODE.GRID);
|
412
713
|
}
|
413
714
|
loadAttachmentDataUnit() {
|
414
|
-
var _a;
|
415
715
|
try {
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
});
|
429
|
-
return this.dataUnit;
|
716
|
+
switch (this.fetcherType) {
|
717
|
+
case "AnexoSistema":
|
718
|
+
this.loadAnexoSistema();
|
719
|
+
break;
|
720
|
+
case "Attach":
|
721
|
+
this.loadAttach();
|
722
|
+
break;
|
723
|
+
default:
|
724
|
+
this._currentFetcher = this.fetcher;
|
725
|
+
this._currentDataUnit = this.dataUnit;
|
726
|
+
this._currentDataUnitBuilder = this.dataUnitBuilder;
|
727
|
+
}
|
430
728
|
}
|
431
729
|
catch (error) {
|
432
730
|
throw new Error('There was an error while creating the data unit');
|
433
731
|
}
|
434
732
|
}
|
733
|
+
loadAnexoSistema() {
|
734
|
+
var _a;
|
735
|
+
this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
736
|
+
this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
737
|
+
if (!this._currentDataUnit.metadata) {
|
738
|
+
this._currentDataUnit
|
739
|
+
.loadMetadata()
|
740
|
+
.then(() => this.crudConfig = anexoSistemaCrudConfig);
|
741
|
+
}
|
742
|
+
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
743
|
+
this._currentDataUnit.addFilterProvider({
|
744
|
+
getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
|
745
|
+
});
|
746
|
+
this._currentDataUnit.addInterceptor({
|
747
|
+
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
748
|
+
});
|
749
|
+
this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
|
750
|
+
}
|
751
|
+
loadAttach() {
|
752
|
+
var _a;
|
753
|
+
this._currentFetcher = new AttachFetcher();
|
754
|
+
this._currentDataUnit = new DataUnit();
|
755
|
+
this._currentDataUnit.addInterceptor({
|
756
|
+
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
757
|
+
});
|
758
|
+
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
759
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
760
|
+
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
761
|
+
this.returnToGridMode();
|
762
|
+
});
|
763
|
+
if (!this._currentDataUnit.metadata) {
|
764
|
+
this._currentDataUnit
|
765
|
+
.loadMetadata()
|
766
|
+
.then(() => {
|
767
|
+
this.crudConfig = attachCrudConfig;
|
768
|
+
this._currentDataUnit
|
769
|
+
.loadData(undefined, undefined, true, this.registerKey)
|
770
|
+
.then(this.disableEditFieldsNotInForm.bind(this));
|
771
|
+
});
|
772
|
+
}
|
773
|
+
}
|
435
774
|
disableEditFieldsNotInForm() {
|
436
775
|
var _a;
|
437
776
|
(_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
|
438
777
|
var _a;
|
439
778
|
const fieldName = column.name;
|
440
779
|
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
441
|
-
this.
|
780
|
+
this._currentDataUnit.disableField(fieldName);
|
442
781
|
}
|
443
782
|
});
|
444
783
|
}
|
@@ -446,32 +785,37 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
446
785
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
447
786
|
}
|
448
787
|
componentWillRender() {
|
449
|
-
if (this.
|
788
|
+
if (this._currentDataUnit == null) {
|
450
789
|
this.loadAttachmentDataUnit();
|
451
790
|
}
|
452
791
|
}
|
453
792
|
render() {
|
454
793
|
var _a, _b;
|
455
|
-
if (!this.
|
794
|
+
if (!this._currentDataUnit)
|
456
795
|
return null;
|
457
|
-
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.
|
796
|
+
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")))))))));
|
458
797
|
}
|
459
798
|
static get watchers() { return {
|
460
799
|
"registerKey": ["registerKeyWatcher"]
|
461
800
|
}; }
|
462
801
|
static get style() { return snkAttachCss; }
|
463
802
|
}, [2, "snk-attach", {
|
803
|
+
"fetcherType": [1, "fetcher-type"],
|
804
|
+
"fetcher": [16],
|
805
|
+
"dataUnit": [16],
|
806
|
+
"dataUnitBuilder": [16],
|
464
807
|
"registerKey": [1, "register-key"],
|
465
808
|
"entityName": [1, "entity-name"],
|
466
809
|
"messagesBuilder": [1040],
|
467
|
-
"
|
810
|
+
"_currentFetcher": [32],
|
811
|
+
"_currentDataUnit": [32],
|
468
812
|
"crudConfig": [32]
|
469
813
|
}]);
|
470
814
|
function defineCustomElement() {
|
471
815
|
if (typeof customElements === "undefined") {
|
472
816
|
return;
|
473
817
|
}
|
474
|
-
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"];
|
818
|
+
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"];
|
475
819
|
components.forEach(tagName => { switch (tagName) {
|
476
820
|
case "snk-attach":
|
477
821
|
if (!customElements.get(tagName)) {
|
@@ -480,30 +824,65 @@ function defineCustomElement() {
|
|
480
824
|
break;
|
481
825
|
case "snk-actions-button":
|
482
826
|
if (!customElements.get(tagName)) {
|
483
|
-
defineCustomElement$
|
827
|
+
defineCustomElement$f();
|
828
|
+
}
|
829
|
+
break;
|
830
|
+
case "snk-config-options":
|
831
|
+
if (!customElements.get(tagName)) {
|
832
|
+
defineCustomElement$e();
|
833
|
+
}
|
834
|
+
break;
|
835
|
+
case "snk-configurator":
|
836
|
+
if (!customElements.get(tagName)) {
|
837
|
+
defineCustomElement$d();
|
484
838
|
}
|
485
839
|
break;
|
486
840
|
case "snk-data-exporter":
|
487
841
|
if (!customElements.get(tagName)) {
|
488
|
-
defineCustomElement$
|
842
|
+
defineCustomElement$c();
|
489
843
|
}
|
490
844
|
break;
|
491
845
|
case "snk-data-unit":
|
492
846
|
if (!customElements.get(tagName)) {
|
493
|
-
defineCustomElement$
|
847
|
+
defineCustomElement$b();
|
494
848
|
}
|
495
849
|
break;
|
496
850
|
case "snk-exporter-email-sender":
|
497
851
|
if (!customElements.get(tagName)) {
|
498
|
-
defineCustomElement$
|
852
|
+
defineCustomElement$a();
|
853
|
+
}
|
854
|
+
break;
|
855
|
+
case "snk-field-config":
|
856
|
+
if (!customElements.get(tagName)) {
|
857
|
+
defineCustomElement$9();
|
858
|
+
}
|
859
|
+
break;
|
860
|
+
case "snk-form-config":
|
861
|
+
if (!customElements.get(tagName)) {
|
862
|
+
defineCustomElement$8();
|
863
|
+
}
|
864
|
+
break;
|
865
|
+
case "snk-grid-config":
|
866
|
+
if (!customElements.get(tagName)) {
|
867
|
+
defineCustomElement$7();
|
868
|
+
}
|
869
|
+
break;
|
870
|
+
case "snk-select-box":
|
871
|
+
if (!customElements.get(tagName)) {
|
872
|
+
defineCustomElement$6();
|
499
873
|
}
|
500
874
|
break;
|
501
875
|
case "snk-simple-bar":
|
502
876
|
if (!customElements.get(tagName)) {
|
503
|
-
defineCustomElement$
|
877
|
+
defineCustomElement$5();
|
504
878
|
}
|
505
879
|
break;
|
506
880
|
case "snk-simple-crud":
|
881
|
+
if (!customElements.get(tagName)) {
|
882
|
+
defineCustomElement$4();
|
883
|
+
}
|
884
|
+
break;
|
885
|
+
case "snk-tab-config":
|
507
886
|
if (!customElements.get(tagName)) {
|
508
887
|
defineCustomElement$3();
|
509
888
|
}
|