@sankhyalabs/sankhyablocks 8.15.0-dev.3 → 8.15.0-dev.31
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-0d507a8f.js → ConfigStorage-d4c99a5e.js} +27 -17
- 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-467907f6.js → SnkFormConfigManager-0ffd098d.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- 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-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-de65b9fc.js → pesquisa-fetcher-94f6b316.js} +472 -46
- 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} +539 -9
- package/dist/cjs/snk-application.cjs.entry.js +98 -10
- package/dist/cjs/snk-attach.cjs.entry.js +398 -61
- package/dist/cjs/snk-crud.cjs.entry.js +15 -13
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -13
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +68 -11
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -4
- package/dist/cjs/snk-filter-modal.cjs.entry.js +16 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +8 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +53 -37
- package/dist/cjs/{snk-guides-viewer-7e87ffce.js → snk-guides-viewer-c7293cfa.js} +11 -13
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -11
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +166 -24
- package/dist/cjs/snk-taskbar.cjs.entry.js +91 -7
- package/dist/cjs/{taskbar-elements-b8c428a9.js → taskbar-elements-1e4fb2e0.js} +9 -9
- package/dist/collection/collection-manifest.json +7 -7
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +111 -5
- package/dist/collection/components/snk-attach/snk-attach.js +194 -38
- 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 +42 -4
- 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 +5 -5
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- 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 +3 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +84 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +0 -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 +175 -6
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +5 -1
- package/dist/collection/components/snk-form/snk-form.js +1 -1
- 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 +79 -31
- 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-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +5 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +279 -15
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +18 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +8 -8
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +129 -7
- package/dist/collection/lib/@types/index.js +1 -0
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- 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 +31 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +48 -29
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- 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/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +25 -15
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +91 -45
- package/dist/components/field-search.js +93 -3
- package/dist/components/index.d.ts +6 -6
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +94 -3
- package/dist/components/snk-attach2.js +454 -68
- package/dist/components/snk-crud.js +9 -3
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +33 -8
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +71 -9
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-filter-modal-item2.js +0 -1
- package/dist/components/snk-filter-modal.js +21 -3
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-form-config2.js +7 -1
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +51 -31
- package/dist/components/snk-personalized-filter-editor.js +3 -1
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +219 -25
- package/dist/components/snk-taskbar2.js +103 -15
- package/dist/components/taskbar-actions-button2.js +18 -2
- package/dist/esm/{ConfigStorage-379a9cba.js → ConfigStorage-39ed8aeb.js} +27 -17
- 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-587e9030.js → SnkFormConfigManager-dd450734.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- 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-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-e218c6d2.js → pesquisa-fetcher-f05a12ca.js} +462 -38
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +538 -10
- package/dist/esm/snk-application.entry.js +98 -10
- package/dist/esm/snk-attach.entry.js +398 -61
- package/dist/esm/snk-crud.entry.js +15 -13
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +11 -13
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +68 -11
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/snk-filter-modal-item.entry.js +3 -4
- package/dist/esm/snk-filter-modal.entry.js +16 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form-config.entry.js +9 -3
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +54 -38
- package/dist/esm/{snk-guides-viewer-2134aba2.js → snk-guides-viewer-47443f7c.js} +11 -13
- package/dist/esm/snk-guides-viewer.entry.js +9 -11
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
- package/dist/esm/snk-personalized-filter.entry.js +4 -4
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +166 -24
- package/dist/esm/snk-taskbar.entry.js +92 -8
- package/dist/esm/{taskbar-elements-26c981af.js → taskbar-elements-846c027c.js} +9 -9
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-2897fb8c.js +1 -0
- package/dist/sankhyablocks/p-30735d1e.entry.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/p-3c5b7cfc.entry.js +1 -0
- package/dist/sankhyablocks/p-3e2e2424.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/p-67aedbe0.js +56 -0
- package/dist/sankhyablocks/p-6ae58da0.js +1 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-729f5f5b.entry.js → p-746fc99e.entry.js} +1 -1
- package/dist/sankhyablocks/p-827e4b01.entry.js +1 -0
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-8c13d8d6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c49760e.js +1 -0
- package/dist/sankhyablocks/p-99b1926b.entry.js +1 -0
- package/dist/sankhyablocks/p-9d608b62.entry.js +1 -0
- package/dist/sankhyablocks/{p-2028633c.js → p-9ea14b61.js} +1 -1
- package/dist/sankhyablocks/p-9fb97691.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-b281e9e9.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-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-d78d4062.js +65 -0
- package/dist/sankhyablocks/p-ec18c04e.entry.js +11 -0
- package/dist/sankhyablocks/p-eefe9954.entry.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/p-fca66dda.entry.js +1 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-fdc4cb9b.entry.js} +1 -1
- package/dist/sankhyablocks/p-fe741404.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +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 +12 -2
- 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 +28 -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 +9 -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 +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +19 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +30 -1
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +7 -1
- package/dist/types/components/snk-form/snk-form.d.ts +1 -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 +10 -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/snk-simple-crud.d.ts +56 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -1
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +203 -23
- package/dist/types/lib/@types/index.d.ts +2 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- 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 +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +15 -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-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-0cd2e986.entry.js +0 -1
- package/dist/sankhyablocks/p-145c4434.js +0 -1
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-4396d1a6.js +0 -56
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-4b0ea83f.entry.js +0 -1
- package/dist/sankhyablocks/p-5534e08c.js +0 -1
- package/dist/sankhyablocks/p-58218eb7.entry.js +0 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +0 -1
- package/dist/sankhyablocks/p-7915c452.entry.js +0 -1
- package/dist/sankhyablocks/p-953346b9.entry.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a037f5b4.entry.js +0 -1
- package/dist/sankhyablocks/p-a49b1019.entry.js +0 -1
- package/dist/sankhyablocks/p-a7923832.entry.js +0 -1
- package/dist/sankhyablocks/p-aaa1438e.entry.js +0 -1
- package/dist/sankhyablocks/p-b52c2175.js +0 -1
- package/dist/sankhyablocks/p-ba627e85.js +0 -60
- package/dist/sankhyablocks/p-bf9b7149.entry.js +0 -11
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c259545b.entry.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-ca8e7da0.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-d1677df0.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 → snk-form-config}/SnkFormConfigManager.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}/SnkFormConfigManager.d.ts +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
@@ -4,21 +4,117 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const DataFetcher = require('./DataFetcher-
|
8
|
-
const
|
7
|
+
const DataFetcher = require('./DataFetcher-99f0f6ed.js');
|
8
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-94f6b316.js');
|
9
|
+
require('./index-0922807b.js');
|
10
|
+
const ISave = require('./ISave-e91b70a7.js');
|
11
|
+
require('./filter-item-type.enum-a7ffdaa6.js');
|
12
|
+
require('./form-config-fetcher-9f1a13ca.js');
|
9
13
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const taskbarElements = require('./taskbar-elements-b8c428a9.js');
|
14
|
+
const authFetcher = require('./auth-fetcher-5161d082.js');
|
15
|
+
const taskbarElements = require('./taskbar-elements-1e4fb2e0.js');
|
13
16
|
require('./PrintUtils-bcaeb82f.js');
|
14
17
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
18
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
16
|
-
require('./ResourceIDUtils-5ff86aa7.js');
|
17
19
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
18
|
-
require('./
|
20
|
+
require('./ResourceIDUtils-5ff86aa7.js');
|
19
21
|
require('./index-102ba62d.js');
|
20
22
|
|
23
|
+
const SERVICE$1 = {
|
24
|
+
save: "Attach.save",
|
25
|
+
delete: "Attach.remove",
|
26
|
+
view: "Attach.view",
|
27
|
+
repository: "RepositorioArquivoSP.abreArquivo"
|
28
|
+
};
|
21
29
|
class AttachFetcher {
|
30
|
+
constructor(dataUnitName) {
|
31
|
+
this.dataUnitName = dataUnitName;
|
32
|
+
}
|
33
|
+
async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
|
34
|
+
var _a, _b;
|
35
|
+
const isInsert = operation == "INSERT";
|
36
|
+
const dataBody = isInsert ? fields : record;
|
37
|
+
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)) {
|
38
|
+
throw new Error(ISave.SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
|
39
|
+
}
|
40
|
+
const reqBody = {
|
41
|
+
"anexo": {
|
42
|
+
"codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
|
43
|
+
"sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
|
44
|
+
"tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
|
45
|
+
"descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
|
46
|
+
"arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
|
47
|
+
"ehInclusao": isInsert ? "S" : "N",
|
48
|
+
"ehArquivoRepositorio": "N"
|
49
|
+
}
|
50
|
+
};
|
51
|
+
return new Promise((resolve, reject) => {
|
52
|
+
DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.save, JSON.stringify(reqBody))
|
53
|
+
.then(result => {
|
54
|
+
var _a;
|
55
|
+
return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
|
56
|
+
})
|
57
|
+
.catch(error => reject(error));
|
58
|
+
});
|
59
|
+
}
|
60
|
+
async edit(change) {
|
61
|
+
throw new Error("Method not implemented.");
|
62
|
+
}
|
63
|
+
async delete(record) {
|
64
|
+
var request = {
|
65
|
+
anexo: {
|
66
|
+
codata: record.CODATA,
|
67
|
+
tipo: record.TIPO,
|
68
|
+
descricao: record.DESCRICAO,
|
69
|
+
}
|
70
|
+
};
|
71
|
+
const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.delete, JSON.stringify(request));
|
72
|
+
return Promise.resolve(result);
|
73
|
+
}
|
74
|
+
async getDownloadKey(record) {
|
75
|
+
var _a, _b, _c;
|
76
|
+
if (record.EHARQUIVOREPOSITORIO == 'S') {
|
77
|
+
const request = {
|
78
|
+
config: {
|
79
|
+
path: record.ARQUIVO,
|
80
|
+
tipoconteudo: record.TIPOCONTEUDO
|
81
|
+
}
|
82
|
+
};
|
83
|
+
const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.repository, JSON.stringify(request));
|
84
|
+
return Promise.resolve({
|
85
|
+
chave: {
|
86
|
+
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
|
87
|
+
}
|
88
|
+
});
|
89
|
+
}
|
90
|
+
const criteria = {
|
91
|
+
anexo: {
|
92
|
+
codata: record.CODATA,
|
93
|
+
codemp: record.CODEMP,
|
94
|
+
sequencia: record.SEQUENCIA,
|
95
|
+
tipo: record.TIPO,
|
96
|
+
descricao: record.DESCRICAO,
|
97
|
+
tipoConteudo: record.TIPOCONTEUDO
|
98
|
+
}
|
99
|
+
};
|
100
|
+
const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE$1.view, JSON.stringify(criteria));
|
101
|
+
if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
|
102
|
+
return Promise.resolve({
|
103
|
+
chave: {
|
104
|
+
valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
|
105
|
+
}
|
106
|
+
});
|
107
|
+
}
|
108
|
+
return Promise.reject(new Error("File not found."));
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
const SERVICE = {
|
113
|
+
save: "AnexoSistemaSP.salvar",
|
114
|
+
delete: "AnexoSistemaSP.excluir",
|
115
|
+
download: "AnexoSistemaSP.baixar",
|
116
|
+
};
|
117
|
+
class AnexoSistemaFetcher {
|
22
118
|
constructor(entityName, registerKey, dataUnitName) {
|
23
119
|
var _a;
|
24
120
|
this.entityName = entityName;
|
@@ -36,14 +132,13 @@ class AttachFetcher {
|
|
36
132
|
}
|
37
133
|
async save(change) {
|
38
134
|
var _a, _b;
|
39
|
-
const serviceName = "AnexoSistemaSP.salvar";
|
40
135
|
let { updatingFields: fields } = change;
|
41
136
|
fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
|
42
137
|
try {
|
43
138
|
this.validateFields(fields);
|
44
139
|
const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
|
45
140
|
const reqBody = {
|
46
|
-
serviceName,
|
141
|
+
serviceName: SERVICE.save,
|
47
142
|
requestBody: {
|
48
143
|
params: {
|
49
144
|
resourceID: this.resourceID,
|
@@ -59,7 +154,7 @@ class AttachFetcher {
|
|
59
154
|
}
|
60
155
|
}
|
61
156
|
};
|
62
|
-
const result = await DataFetcher.DataFetcher.get().callServiceBroker(
|
157
|
+
const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
|
63
158
|
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 })]);
|
64
159
|
}
|
65
160
|
catch (error) {
|
@@ -68,7 +163,6 @@ class AttachFetcher {
|
|
68
163
|
}
|
69
164
|
async edit(change) {
|
70
165
|
var _a, _b, _c;
|
71
|
-
const serviceName = "AnexoSistemaSP.salvar";
|
72
166
|
let { updatingFields: fields, record } = change;
|
73
167
|
const getFieldValue = (fieldValue) => {
|
74
168
|
if (fields[fieldValue] !== undefined)
|
@@ -82,7 +176,7 @@ class AttachFetcher {
|
|
82
176
|
try {
|
83
177
|
this.validateFields(fields);
|
84
178
|
const reqBody = {
|
85
|
-
serviceName,
|
179
|
+
serviceName: SERVICE.save,
|
86
180
|
requestBody: {
|
87
181
|
params: {
|
88
182
|
resourceID: this.resourceID,
|
@@ -100,7 +194,7 @@ class AttachFetcher {
|
|
100
194
|
}
|
101
195
|
}
|
102
196
|
};
|
103
|
-
const result = await DataFetcher.DataFetcher.get().callServiceBroker(
|
197
|
+
const result = await DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
|
104
198
|
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 })]);
|
105
199
|
}
|
106
200
|
catch (error) {
|
@@ -109,10 +203,9 @@ class AttachFetcher {
|
|
109
203
|
}
|
110
204
|
delete(record) {
|
111
205
|
var _a;
|
112
|
-
const serviceName = "AnexoSistemaSP.excluir";
|
113
206
|
const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
|
114
207
|
const reqBody = {
|
115
|
-
serviceName,
|
208
|
+
serviceName: SERVICE.delete,
|
116
209
|
requestBody: {
|
117
210
|
paramsDelete: {
|
118
211
|
keyAttach: record.CHAVEARQUIVO,
|
@@ -124,17 +217,16 @@ class AttachFetcher {
|
|
124
217
|
}
|
125
218
|
};
|
126
219
|
return new Promise((resolve, reject) => {
|
127
|
-
DataFetcher.DataFetcher.get().callServiceBroker(
|
220
|
+
DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
|
128
221
|
.then(result => resolve(result))
|
129
222
|
.catch(error => reject(error));
|
130
223
|
});
|
131
224
|
}
|
132
225
|
getDownloadKey(record) {
|
133
226
|
var _a;
|
134
|
-
const serviceName = "AnexoSistemaSP.baixar";
|
135
227
|
const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
|
136
228
|
const reqBody = {
|
137
|
-
serviceName,
|
229
|
+
serviceName: SERVICE.download,
|
138
230
|
requestBody: {
|
139
231
|
paramsDown: {
|
140
232
|
nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
|
@@ -146,34 +238,37 @@ class AttachFetcher {
|
|
146
238
|
}
|
147
239
|
};
|
148
240
|
return new Promise((resolve, reject) => {
|
149
|
-
DataFetcher.DataFetcher.get().callServiceBroker(
|
241
|
+
DataFetcher.DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
|
150
242
|
.then(result => resolve(result))
|
151
243
|
.catch(error => reject(error));
|
152
244
|
});
|
153
245
|
}
|
154
246
|
}
|
155
247
|
|
156
|
-
class
|
248
|
+
class AnexoSistemaDataUnitFactory {
|
157
249
|
constructor(entityName, getMessage) {
|
158
250
|
this.entityName = entityName;
|
159
251
|
this.getMessage = getMessage;
|
160
252
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
161
253
|
}
|
162
|
-
initLoaders(dataUnit,
|
254
|
+
initLoaders(dataUnit, fetcher, onSuccess) {
|
163
255
|
if (!this.loader)
|
164
256
|
this.loader = dataUnit.dataLoader;
|
165
257
|
dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
166
|
-
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes,
|
258
|
+
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
|
167
259
|
if (recordIds.length)
|
168
260
|
onSuccess();
|
169
261
|
return recordIds;
|
170
262
|
});
|
171
|
-
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids,
|
263
|
+
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
|
172
264
|
if (recordIds.length)
|
173
265
|
onSuccess();
|
174
266
|
return recordIds;
|
175
267
|
});
|
176
268
|
}
|
269
|
+
metadataLoader(dataUnit) {
|
270
|
+
throw new Error("Method not implemented.");
|
271
|
+
}
|
177
272
|
dataLoader(dataUnit, request) {
|
178
273
|
return new Promise(resolve => {
|
179
274
|
this.loader(dataUnit, request).then(response => {
|
@@ -189,11 +284,11 @@ class AttachmentDataUnitBuilder {
|
|
189
284
|
});
|
190
285
|
});
|
191
286
|
}
|
192
|
-
saveLoader(changes,
|
287
|
+
saveLoader(changes, fetcher) {
|
193
288
|
return new Promise((resolve) => {
|
194
289
|
var _a;
|
195
290
|
const change = Array.isArray(changes) ? changes[0] : {};
|
196
|
-
const savePromise = ((_a = change === null || change === void 0 ? void 0 : change.record) === null || _a === void 0 ? void 0 : _a.NUATTACH) >= 0 ?
|
291
|
+
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);
|
197
292
|
savePromise(change).then((records) => {
|
198
293
|
resolve(records);
|
199
294
|
}).catch((error) => {
|
@@ -213,12 +308,12 @@ class AttachmentDataUnitBuilder {
|
|
213
308
|
});
|
214
309
|
});
|
215
310
|
}
|
216
|
-
removeLoader(dataUnit, ids,
|
311
|
+
removeLoader(dataUnit, ids, fetcher) {
|
217
312
|
return new Promise((resolve) => {
|
218
313
|
const { records } = dataUnit.getSelectionInfo();
|
219
314
|
const recordToDelete = records[0];
|
220
|
-
|
221
|
-
|
315
|
+
fetcher.delete(recordToDelete).then(() => {
|
316
|
+
pesquisaFetcher.PreloadManager.removeRecords(dataUnit, [recordToDelete]);
|
222
317
|
return resolve(ids);
|
223
318
|
});
|
224
319
|
});
|
@@ -258,6 +353,175 @@ class AttachmentDataUnitBuilder {
|
|
258
353
|
}
|
259
354
|
}
|
260
355
|
|
356
|
+
const application$1 = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
357
|
+
const getMessage$1 = (key) => {
|
358
|
+
var _a, _b;
|
359
|
+
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);
|
360
|
+
};
|
361
|
+
const attachCrudConfig = {
|
362
|
+
grid: {
|
363
|
+
columns: [
|
364
|
+
{ name: "CODATA", orderIndex: 0, width: 0 },
|
365
|
+
{ name: "DESCRICAO", orderIndex: 1, width: 0 },
|
366
|
+
{ name: "ARQUIVO", orderIndex: 2, width: 0 },
|
367
|
+
{ name: "DTALTER", orderIndex: 3, width: 0 },
|
368
|
+
{ name: "USUARIO", orderIndex: 4, width: 0 },
|
369
|
+
],
|
370
|
+
},
|
371
|
+
form: {
|
372
|
+
emptyConfig: false,
|
373
|
+
fields: [
|
374
|
+
{
|
375
|
+
name: "DESCRICAO",
|
376
|
+
label: getMessage$1("snkAttach.attachMetadata.lblDescription"),
|
377
|
+
visible: true,
|
378
|
+
readOnly: false,
|
379
|
+
required: true,
|
380
|
+
},
|
381
|
+
{
|
382
|
+
name: "CAMINHO_ARQUIVO",
|
383
|
+
label: getMessage$1("snkAttach.attachMetadata.lblFile"),
|
384
|
+
visible: true,
|
385
|
+
readOnly: false,
|
386
|
+
required: true,
|
387
|
+
},
|
388
|
+
],
|
389
|
+
},
|
390
|
+
};
|
391
|
+
const attachFetcherMetadataBuilder = {
|
392
|
+
name: "Attach",
|
393
|
+
label: "Attach List",
|
394
|
+
fields: [
|
395
|
+
{ name: "CODATA", label: getMessage$1("snkAttach.attachMetadata.lblCode"), dataType: core.DataType.TEXT },
|
396
|
+
{ name: "DESCRICAO", label: getMessage$1("snkAttach.attachMetadata.lblDescription"), dataType: core.DataType.TEXT },
|
397
|
+
{ name: "ARQUIVO", label: getMessage$1("snkAttach.attachMetadata.lblFileOrLink"), dataType: core.DataType.TEXT },
|
398
|
+
{ name: "USUARIO", label: getMessage$1("snkAttach.attachMetadata.lblUser"), dataType: core.DataType.TEXT },
|
399
|
+
{ name: "DTALTER", label: getMessage$1("snkAttach.attachMetadata.lblDate"), dataType: core.DataType.TEXT },
|
400
|
+
{
|
401
|
+
name: "CAMINHO_ARQUIVO",
|
402
|
+
label: getMessage$1("snkAttach.attachMetadata.lblFileUpload"),
|
403
|
+
dataType: core.DataType.OBJECT,
|
404
|
+
userInterface: core.UserInterface.FILE,
|
405
|
+
readOnly: false,
|
406
|
+
required: true,
|
407
|
+
visible: true,
|
408
|
+
properties: {
|
409
|
+
subTitle: getMessage$1("snkAttach.attachMetadata.lblSubTitle"),
|
410
|
+
MAX_FILES: 1,
|
411
|
+
STORAGESTRATEGY: "SESSION",
|
412
|
+
INTERNAL_FILENAME: "Attach.upload",
|
413
|
+
}
|
414
|
+
},
|
415
|
+
],
|
416
|
+
};
|
417
|
+
|
418
|
+
const SERVICE_LOAD = "Attach.load";
|
419
|
+
class AttachFetcherDataUnitFactory {
|
420
|
+
constructor(getMessage) {
|
421
|
+
this.getMessage = getMessage;
|
422
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
423
|
+
}
|
424
|
+
initLoaders(dataUnit, fetcher, onSuccess) {
|
425
|
+
dataUnit.metadataLoader = (dataUnit) => this.metadataLoader(dataUnit);
|
426
|
+
dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
427
|
+
dataUnit.saveLoader = (_, changes) => this.saveLoader(changes, fetcher).then((recordIds) => {
|
428
|
+
if (recordIds.length)
|
429
|
+
onSuccess();
|
430
|
+
return recordIds;
|
431
|
+
});
|
432
|
+
dataUnit.removeLoader = (dataUnit, ids) => this.removeLoader(dataUnit, ids, fetcher).then((recordIds) => {
|
433
|
+
if (recordIds.length)
|
434
|
+
onSuccess();
|
435
|
+
return recordIds;
|
436
|
+
});
|
437
|
+
}
|
438
|
+
metadataLoader(_) {
|
439
|
+
return Promise.resolve(attachFetcherMetadataBuilder);
|
440
|
+
}
|
441
|
+
async dataLoader(_, request) {
|
442
|
+
if (!request.source) {
|
443
|
+
return Promise.resolve({ records: [] });
|
444
|
+
}
|
445
|
+
const criteria = {
|
446
|
+
criteria: {
|
447
|
+
codata: request.source,
|
448
|
+
tipoAnexo: "N"
|
449
|
+
}
|
450
|
+
};
|
451
|
+
const applicationDataFetcher = await this._application.getDataFetcher();
|
452
|
+
const { anexos: { anexo = [] } } = await applicationDataFetcher.callServiceBroker(SERVICE_LOAD, JSON.stringify(criteria));
|
453
|
+
const records = [];
|
454
|
+
anexo.forEach((param) => {
|
455
|
+
records.push(Object.assign({ __record__id__: core.StringUtils.generateUUID(), CAMINHO_ARQUIVO: [{
|
456
|
+
name: param === null || param === void 0 ? void 0 : param.ARQUIVO,
|
457
|
+
}] }, param));
|
458
|
+
});
|
459
|
+
return Promise.resolve({ records });
|
460
|
+
}
|
461
|
+
saveLoader(changes, fetcher) {
|
462
|
+
return new Promise((resolve) => {
|
463
|
+
const change = Array.isArray(changes) ? changes[0] : {};
|
464
|
+
fetcher.save(change)
|
465
|
+
.then(resolve)
|
466
|
+
.catch((error) => {
|
467
|
+
if (error.message === ISave.SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED) {
|
468
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.title'), this.getMessage('snkAttach.alertValidation.descriptionCannotBeChanged.message'));
|
469
|
+
return resolve([]);
|
470
|
+
}
|
471
|
+
if (error.message === ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
472
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
473
|
+
return resolve([]);
|
474
|
+
}
|
475
|
+
if (error.message === ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
476
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
477
|
+
return resolve([]);
|
478
|
+
}
|
479
|
+
if (error.message) {
|
480
|
+
this._application.error((error.title || error.name), error.message);
|
481
|
+
return resolve([]);
|
482
|
+
}
|
483
|
+
resolve([]);
|
484
|
+
});
|
485
|
+
});
|
486
|
+
}
|
487
|
+
removeLoader(dataUnit, ids, fetcher) {
|
488
|
+
return new Promise((resolve) => {
|
489
|
+
dataUnit.getSelectionInfo().records.forEach(async (record) => {
|
490
|
+
this._application.hasAccess(authFetcher.AutorizationType.REMOVE)
|
491
|
+
.then(async (hasAccess) => {
|
492
|
+
if (hasAccess) {
|
493
|
+
await fetcher.delete(record);
|
494
|
+
resolve(ids);
|
495
|
+
}
|
496
|
+
});
|
497
|
+
});
|
498
|
+
});
|
499
|
+
}
|
500
|
+
getFilters() {
|
501
|
+
throw new Error('Method not implemented.');
|
502
|
+
}
|
503
|
+
getInterceptions(dataUnit, action, crudRef) {
|
504
|
+
return new Promise((resolve) => {
|
505
|
+
if (action.type === core.Action.EDITION_CANCELED) {
|
506
|
+
if (!dataUnit.isDirty())
|
507
|
+
return resolve(action);
|
508
|
+
return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
|
509
|
+
if (cancellationConfirmed) {
|
510
|
+
crudRef.goToView(constants.VIEW_MODE.GRID);
|
511
|
+
return resolve(action);
|
512
|
+
}
|
513
|
+
return resolve(undefined);
|
514
|
+
});
|
515
|
+
}
|
516
|
+
if (action.type === core.Action.DATA_SAVED) {
|
517
|
+
dataUnit.loadData();
|
518
|
+
return resolve(action);
|
519
|
+
}
|
520
|
+
resolve(action);
|
521
|
+
});
|
522
|
+
}
|
523
|
+
}
|
524
|
+
|
261
525
|
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
262
526
|
const getMessage = (key) => {
|
263
527
|
var _a, _b;
|
@@ -304,7 +568,7 @@ const buildTaskBarManager = () => {
|
|
304
568
|
};
|
305
569
|
};
|
306
570
|
|
307
|
-
const
|
571
|
+
const anexoSistemaCrudConfig = {
|
308
572
|
grid: {
|
309
573
|
columns: [
|
310
574
|
{ name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },
|
@@ -350,37 +614,60 @@ const SnkAttach = class {
|
|
350
614
|
constructor(hostRef) {
|
351
615
|
index.registerInstance(this, hostRef);
|
352
616
|
this.back = index.createEvent(this, "back", 7);
|
353
|
-
this.handleTaskbarClick = ({ detail: taskbar }) => {
|
617
|
+
this.handleTaskbarClick = async ({ detail: taskbar }) => {
|
354
618
|
if (["DOWNLOAD", "LINK"].includes(taskbar))
|
355
|
-
return this.downloadAttachment(this.
|
619
|
+
return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
|
620
|
+
if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
|
621
|
+
await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
|
622
|
+
}
|
356
623
|
};
|
357
624
|
this.handleBack = () => {
|
358
|
-
this.
|
625
|
+
this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
|
359
626
|
if (cancelationConfirmed)
|
360
627
|
this.back.emit();
|
361
628
|
});
|
362
629
|
};
|
363
630
|
this.handleFinish = () => {
|
364
|
-
if (!this.
|
631
|
+
if (!this._currentDataUnit.isDirty())
|
365
632
|
return this.back.emit();
|
366
|
-
this.
|
633
|
+
this._currentDataUnit.saveData().then(() => {
|
367
634
|
this.showFinishedToast();
|
368
635
|
this.back.emit();
|
369
636
|
});
|
370
637
|
};
|
638
|
+
this.fetcherType = "AnexoSistema";
|
639
|
+
this.fetcher = undefined;
|
640
|
+
this.dataUnit = undefined;
|
641
|
+
this.dataUnitBuilder = undefined;
|
371
642
|
this.registerKey = undefined;
|
372
643
|
this.entityName = undefined;
|
373
644
|
this.messagesBuilder = undefined;
|
374
|
-
this.
|
645
|
+
this._currentFetcher = undefined;
|
646
|
+
this._currentDataUnit = undefined;
|
375
647
|
this.crudConfig = undefined;
|
376
648
|
}
|
377
649
|
registerKeyWatcher(newRegisterKey, oldRegisterKey) {
|
378
|
-
var _a;
|
650
|
+
var _a, _b, _c, _d;
|
651
|
+
if (this._currentDataUnit == null) {
|
652
|
+
this.loadAttachmentDataUnit();
|
653
|
+
}
|
379
654
|
if (oldRegisterKey !== newRegisterKey) {
|
380
655
|
this.returnToGridMode();
|
381
|
-
|
382
|
-
|
383
|
-
|
656
|
+
if (this.fetcherType === "AnexoSistema") {
|
657
|
+
this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
658
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
659
|
+
return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
|
660
|
+
}
|
661
|
+
if (this.fetcherType === "Attach") {
|
662
|
+
const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
|
663
|
+
if (hasMoreOneItem)
|
664
|
+
return;
|
665
|
+
}
|
666
|
+
return this._currentDataUnit
|
667
|
+
.loadMetadata()
|
668
|
+
.then(() => {
|
669
|
+
this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
670
|
+
});
|
384
671
|
}
|
385
672
|
}
|
386
673
|
/**
|
@@ -403,56 +690,106 @@ const SnkAttach = class {
|
|
403
690
|
window.open(`${selectedRecord.LINK}`);
|
404
691
|
return;
|
405
692
|
}
|
406
|
-
this.
|
407
|
-
|
693
|
+
this._currentFetcher
|
694
|
+
.getDownloadKey(selectedRecord)
|
695
|
+
.then(({ chave }) => {
|
696
|
+
var _a;
|
697
|
+
let forceDownload = false;
|
698
|
+
if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
|
699
|
+
forceDownload = true;
|
700
|
+
}
|
701
|
+
window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
|
408
702
|
});
|
409
703
|
}
|
410
704
|
returnToGridMode() {
|
411
|
-
|
705
|
+
var _a;
|
706
|
+
(_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
|
412
707
|
if (this._crudElement)
|
413
708
|
this._crudElement.goToView(constants.VIEW_MODE.GRID);
|
414
709
|
}
|
415
710
|
loadAttachmentDataUnit() {
|
416
|
-
var _a;
|
417
711
|
try {
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
});
|
431
|
-
return this.dataUnit;
|
712
|
+
switch (this.fetcherType) {
|
713
|
+
case "AnexoSistema":
|
714
|
+
this.loadAnexoSistema();
|
715
|
+
break;
|
716
|
+
case "Attach":
|
717
|
+
this.loadAttach();
|
718
|
+
break;
|
719
|
+
default:
|
720
|
+
this._currentFetcher = this.fetcher;
|
721
|
+
this._currentDataUnit = this.dataUnit;
|
722
|
+
this._currentDataUnitBuilder = this.dataUnitBuilder;
|
723
|
+
}
|
432
724
|
}
|
433
725
|
catch (error) {
|
434
726
|
throw new Error('There was an error while creating the data unit');
|
435
727
|
}
|
436
728
|
}
|
729
|
+
loadAnexoSistema() {
|
730
|
+
var _a;
|
731
|
+
this._currentDataUnit = this._currentDataUnit || new pesquisaFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
732
|
+
this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
733
|
+
if (!this._currentDataUnit.metadata) {
|
734
|
+
this._currentDataUnit
|
735
|
+
.loadMetadata()
|
736
|
+
.then(() => this.crudConfig = anexoSistemaCrudConfig);
|
737
|
+
}
|
738
|
+
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
739
|
+
this._currentDataUnit.addFilterProvider({
|
740
|
+
getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
|
741
|
+
});
|
742
|
+
this._currentDataUnit.addInterceptor({
|
743
|
+
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
744
|
+
});
|
745
|
+
this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
|
746
|
+
}
|
747
|
+
loadAttach() {
|
748
|
+
var _a;
|
749
|
+
this._currentFetcher = new AttachFetcher();
|
750
|
+
this._currentDataUnit = new core.DataUnit();
|
751
|
+
this._currentDataUnit.addInterceptor({
|
752
|
+
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
753
|
+
});
|
754
|
+
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
755
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
756
|
+
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
757
|
+
this.returnToGridMode();
|
758
|
+
});
|
759
|
+
if (!this._currentDataUnit.metadata) {
|
760
|
+
this._currentDataUnit
|
761
|
+
.loadMetadata()
|
762
|
+
.then(() => {
|
763
|
+
this.crudConfig = attachCrudConfig;
|
764
|
+
this._currentDataUnit
|
765
|
+
.loadData(undefined, undefined, true, this.registerKey)
|
766
|
+
.then(this.disableEditFieldsNotInForm.bind(this));
|
767
|
+
});
|
768
|
+
}
|
769
|
+
}
|
437
770
|
disableEditFieldsNotInForm() {
|
438
771
|
var _a;
|
439
772
|
(_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
|
440
773
|
var _a;
|
441
774
|
const fieldName = column.name;
|
442
775
|
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
443
|
-
this.
|
776
|
+
this._currentDataUnit.disableField(fieldName);
|
444
777
|
}
|
445
778
|
});
|
446
779
|
}
|
447
780
|
componentWillLoad() {
|
448
781
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
449
|
-
|
782
|
+
}
|
783
|
+
componentWillRender() {
|
784
|
+
if (this._currentDataUnit == null) {
|
785
|
+
this.loadAttachmentDataUnit();
|
786
|
+
}
|
450
787
|
}
|
451
788
|
render() {
|
452
789
|
var _a, _b;
|
453
|
-
if (!this.
|
790
|
+
if (!this._currentDataUnit)
|
454
791
|
return null;
|
455
|
-
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.
|
792
|
+
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.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 }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
|
456
793
|
}
|
457
794
|
static get watchers() { return {
|
458
795
|
"registerKey": ["registerKeyWatcher"]
|