@sankhyalabs/sankhyablocks 8.15.0-dev.5 → 8.15.0-dev.50
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-8009ecb2.js → ConfigStorage-8d4e9d53.js} +94 -21
- 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-7d850fbc.js → SnkFormConfigManager-33995e92.js} +21 -13
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-66aa2557.js} +19 -1
- package/dist/cjs/SnkMultiSelectionListDataSource-8b5bfa05.js +140 -0
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-bb8e9ae4.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-d73f4449.js} +13 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bd4c52da.js → pesquisa-fetcher-036a9588.js} +498 -76
- 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} +538 -8
- package/dist/cjs/snk-application.cjs.entry.js +44 -10
- package/dist/cjs/snk-attach.cjs.entry.js +413 -62
- package/dist/cjs/snk-crud.cjs.entry.js +17 -12
- package/dist/cjs/snk-data-exporter.cjs.entry.js +10 -6
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-41c29713.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -12
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +61 -10
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +13 -6
- 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 +37 -22
- package/dist/cjs/{snk-guides-viewer-cb176c4d.js → snk-guides-viewer-2f61fb02.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 +264 -27
- package/dist/cjs/snk-taskbar.cjs.entry.js +123 -15
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-3ecd1278.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 +94 -11
- package/dist/collection/components/snk-attach/snk-attach.js +203 -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 +118 -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 +7 -3
- 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-detail.js +22 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +31 -6
- 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 +24 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +154 -5
- 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 +20 -12
- 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 +100 -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 +10 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +467 -19
- 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 +9 -9
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +166 -14
- package/dist/collection/lib/configs/ConfigStorage.js +86 -16
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +5 -40
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- 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 +37 -23
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
- 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/message/resources/snk-simple-crud.msg.js +4 -0
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +92 -19
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkFormConfigManager.js +19 -11
- package/dist/components/SnkMessageBuilder.js +19 -1
- package/dist/components/dataunit-fetcher.js +116 -77
- package/dist/components/field-search.js +93 -3
- package/dist/components/form-config-fetcher.js +12 -0
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +41 -2
- package/dist/components/snk-attach2.js +469 -69
- package/dist/components/snk-crud.js +15 -3
- package/dist/components/snk-data-exporter2.js +7 -3
- 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 +64 -8
- package/dist/components/snk-filter-detail2.js +5 -1
- package/dist/components/snk-filter-item2.js +14 -6
- 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 +38 -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 +325 -31
- package/dist/components/snk-taskbar2.js +139 -25
- package/dist/components/taskbar-actions-button2.js +18 -2
- package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-6e241cd7.js} +94 -21
- 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-9be0e7d4.js → SnkFormConfigManager-7a4e678f.js} +21 -13
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0a4becdd.js} +19 -1
- package/dist/esm/SnkMultiSelectionListDataSource-4274be27.js +133 -0
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-8ec448b0.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-765b8498.js} +13 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-a9e27c84.js} +486 -69
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +537 -9
- package/dist/esm/snk-application.entry.js +43 -9
- package/dist/esm/snk-attach.entry.js +413 -62
- package/dist/esm/snk-crud.entry.js +17 -12
- package/dist/esm/snk-data-exporter.entry.js +10 -6
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-de1d140d.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +10 -12
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +61 -10
- package/dist/esm/snk-filter-detail.entry.js +4 -1
- package/dist/esm/snk-filter-item.entry.js +13 -6
- 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 +38 -23
- package/dist/esm/{snk-guides-viewer-eeb8f354.js → snk-guides-viewer-16974807.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 +264 -27
- package/dist/esm/snk-taskbar.entry.js +124 -16
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-2473c8ac.js} +9 -9
- package/dist/sankhyablocks/p-004c356e.js +26 -0
- package/dist/sankhyablocks/p-0624f62d.js +56 -0
- package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
- package/dist/sankhyablocks/p-1048bd26.entry.js +1 -0
- package/dist/sankhyablocks/{p-e6380c60.js → p-125bb902.js} +1 -1
- package/dist/sankhyablocks/p-1c7d57e5.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/{p-3520c088.entry.js → p-24ed6ad6.entry.js} +1 -1
- package/dist/sankhyablocks/p-32331e9b.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-3f88728d.js +1 -0
- package/dist/sankhyablocks/p-433f0d45.entry.js +1 -0
- package/dist/sankhyablocks/p-4ab95a67.entry.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-52c8e589.js} +1 -1
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/p-751bd42a.entry.js +1 -0
- package/dist/sankhyablocks/p-85af23fe.entry.js +1 -0
- package/dist/sankhyablocks/{p-f514913b.entry.js → p-ac77949b.entry.js} +1 -1
- package/dist/sankhyablocks/p-ae4fc9a9.js +1 -0
- package/dist/sankhyablocks/p-b10b9934.entry.js +1 -0
- package/dist/sankhyablocks/p-b11aa1e0.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-bf39bdb8.entry.js +1 -0
- package/dist/sankhyablocks/p-c6751382.entry.js +11 -0
- package/dist/sankhyablocks/p-d0126ca0.js +65 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-d6321b12.entry.js +1 -0
- package/dist/sankhyablocks/p-dcce8ca0.entry.js +1 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/p-efeca7ba.js +1 -0
- package/dist/sankhyablocks/p-f7d0fab9.entry.js +1 -0
- package/dist/sankhyablocks/p-fbc60023.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 +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 +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 +40 -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 +16 -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-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +7 -3
- 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 +26 -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 +2 -1
- 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 +19 -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 +85 -4
- 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 +34 -1
- package/dist/types/components.d.ts +298 -12
- package/dist/types/lib/configs/ConfigStorage.d.ts +25 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/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 +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -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 +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-0874adb5.entry.js +0 -1
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-0d7863ed.js +0 -26
- package/dist/sankhyablocks/p-11081798.entry.js +0 -1
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-29804fc5.js +0 -60
- package/dist/sankhyablocks/p-374d03f6.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-585294ee.js +0 -56
- package/dist/sankhyablocks/p-6977a26c.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-6d20d38c.entry.js +0 -1
- package/dist/sankhyablocks/p-776ee8e3.js +0 -1
- package/dist/sankhyablocks/p-7d51d949.entry.js +0 -11
- package/dist/sankhyablocks/p-809f367d.entry.js +0 -1
- package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
- package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-ca4d337a.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
- package/dist/sankhyablocks/p-d1f5bc50.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
- package/dist/sankhyablocks/p-fd8814b9.entry.js +0 -1
- package/dist/sankhyablocks/p-ff6064e7.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
@@ -232,7 +232,7 @@ class PersonalizedFilterFetcher {
|
|
232
232
|
assistent
|
233
233
|
}
|
234
234
|
}`);
|
235
|
-
this.templateByQuery.set("savePersonalizedFilter", dist.gql `
|
235
|
+
this.templateByQuery.set("savePersonalizedFilter", dist.gql `
|
236
236
|
mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
|
237
237
|
$queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
|
238
238
|
id
|
@@ -254,11 +254,11 @@ class PersonalizedFilterFetcher {
|
|
254
254
|
}
|
255
255
|
}`);
|
256
256
|
}
|
257
|
-
async loadPersonalizedFilter(resourceID, filterID, configName) {
|
257
|
+
async loadPersonalizedFilter(resourceID, filterID, configName, legacyConfigName) {
|
258
258
|
return new Promise((resolve, reject) => {
|
259
259
|
DataFetcher.get()
|
260
260
|
.callGraphQL({
|
261
|
-
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID },
|
261
|
+
values: { name: this.resolveURI(resourceID, configName) + "/" + filterID + this.resolveLegacyConfigName(legacyConfigName) },
|
262
262
|
query: this.templateByQuery.get("fetchFilterAssistent"),
|
263
263
|
})
|
264
264
|
.then((resp) => {
|
@@ -270,6 +270,9 @@ class PersonalizedFilterFetcher {
|
|
270
270
|
});
|
271
271
|
});
|
272
272
|
}
|
273
|
+
resolveLegacyConfigName(legacyConfigName) {
|
274
|
+
return legacyConfigName ? `?legacyResourceID=${legacyConfigName}` : '';
|
275
|
+
}
|
273
276
|
async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
274
277
|
if (!personalizedFilter || Object.keys(personalizedFilter).length == 0) {
|
275
278
|
return Promise.reject(new Error("personalizedFilter não pode ser vazio"));
|
@@ -351,17 +354,37 @@ class PersonalizedFilterFetcher {
|
|
351
354
|
}
|
352
355
|
}
|
353
356
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
357
|
+
var CONFIG_SOURCE;
|
358
|
+
(function (CONFIG_SOURCE) {
|
359
|
+
CONFIG_SOURCE["form"] = "form";
|
360
|
+
CONFIG_SOURCE["grid"] = "grid";
|
361
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
362
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
359
363
|
class ConfigStorage {
|
360
|
-
static
|
364
|
+
static addFilterBarLegacyConfig(configName, legacyConfigName) {
|
365
|
+
this.validateConfigName(configName, legacyConfigName);
|
366
|
+
this.filterBarLegacyConfig.set(configName, legacyConfigName);
|
367
|
+
}
|
368
|
+
static addFormLegacyConfig(configName, legacyConfigName) {
|
369
|
+
this.validateConfigName(configName, legacyConfigName);
|
370
|
+
this.formLegacyConfig.set(configName, legacyConfigName);
|
371
|
+
}
|
372
|
+
static addGridLegacyConfig(configName, legacyConfigName) {
|
373
|
+
this.validateConfigName(configName, legacyConfigName);
|
374
|
+
this.gridLegacyConfig.set(configName, legacyConfigName);
|
375
|
+
}
|
376
|
+
static preload(resourceID, configName, legacyConfigs) {
|
377
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.gridLegacyConfig)) {
|
378
|
+
ConfigStorage.addGridLegacyConfig(configName, legacyConfigs.gridLegacyConfig);
|
379
|
+
}
|
380
|
+
if (configName && (legacyConfigs === null || legacyConfigs === void 0 ? void 0 : legacyConfigs.formLegacyConfig)) {
|
381
|
+
ConfigStorage.addFormLegacyConfig(configName, legacyConfigs.formLegacyConfig);
|
382
|
+
}
|
361
383
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
362
384
|
ConfigStorage.loadGridConfig(configName, resourceID);
|
363
385
|
}
|
364
386
|
static async loadFilterBarConfig(name, resourceID, urlParams) {
|
387
|
+
urlParams = this.handleLegacyConfig(name, CONFIG_SOURCE.filterBar, urlParams);
|
365
388
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar, resourceID);
|
366
389
|
if (!ConfigStorage.configById.has(cacheID)) {
|
367
390
|
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(resourceID, name, urlParams));
|
@@ -369,6 +392,7 @@ class ConfigStorage {
|
|
369
392
|
return ConfigStorage.configById.get(cacheID);
|
370
393
|
}
|
371
394
|
static async loadFormConfig(name, resourceID) {
|
395
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
372
396
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form, resourceID);
|
373
397
|
if (!ConfigStorage.configById.has(cacheID)) {
|
374
398
|
ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, resourceID));
|
@@ -376,6 +400,7 @@ class ConfigStorage {
|
|
376
400
|
return ConfigStorage.configById.get(cacheID);
|
377
401
|
}
|
378
402
|
static async loadGridConfig(name, resourceID) {
|
403
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
379
404
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid, resourceID);
|
380
405
|
if (!ConfigStorage.configById.has(cacheID)) {
|
381
406
|
ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, resourceID));
|
@@ -383,13 +408,12 @@ class ConfigStorage {
|
|
383
408
|
return ConfigStorage.configById.get(cacheID);
|
384
409
|
}
|
385
410
|
static async saveFilterBarConfig(config, name, resourceID) {
|
386
|
-
|
387
|
-
this.configById.delete(cacheID);
|
411
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
388
412
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
389
413
|
}
|
390
414
|
static async saveFormConfig(config, name, resourceID) {
|
391
|
-
|
392
|
-
this.
|
415
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.form);
|
416
|
+
await this.deleteFormConfigCache(name, resourceID);
|
393
417
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
394
418
|
}
|
395
419
|
static async saveCardState(config, name, resourceID) {
|
@@ -399,18 +423,17 @@ class ConfigStorage {
|
|
399
423
|
if (config == undefined) {
|
400
424
|
return;
|
401
425
|
}
|
402
|
-
|
403
|
-
this.configById.delete(cacheID);
|
426
|
+
await this.deleteGridConfigCache(name, resourceID);
|
404
427
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
405
428
|
}
|
406
429
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
407
|
-
|
430
|
+
const legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
431
|
+
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName, legacyConfigName);
|
408
432
|
}
|
409
433
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
410
|
-
//Ao criar ou alterar um filtro personalizado,
|
434
|
+
//Ao criar ou alterar um filtro personalizado,
|
411
435
|
//precisamos remover o cache do status da filterbar.
|
412
|
-
|
413
|
-
this.configById.delete(cacheID);
|
436
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
414
437
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
415
438
|
}
|
416
439
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -419,6 +442,51 @@ class ConfigStorage {
|
|
419
442
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
420
443
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
421
444
|
}
|
445
|
+
static async deleteGridConfigCache(name, resourceID) {
|
446
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
447
|
+
}
|
448
|
+
static async deleteFormConfigCache(name, resourceID) {
|
449
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
450
|
+
}
|
451
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
452
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
453
|
+
}
|
454
|
+
static validateConfigName(configName, legacyConfigName) {
|
455
|
+
if (!configName)
|
456
|
+
throw Error(this.CONFIG_NAME_ERROR_MESSAGE);
|
457
|
+
if (!legacyConfigName)
|
458
|
+
throw Error(this.LEGACY_CONFIG_NAME_ERROR_MESSAGE);
|
459
|
+
}
|
460
|
+
static handleLegacyConfig(configName, configSource, urlParams) {
|
461
|
+
let legacyConfigName;
|
462
|
+
switch (configSource) {
|
463
|
+
case CONFIG_SOURCE.filterBar:
|
464
|
+
legacyConfigName = this.filterBarLegacyConfig.get(configName);
|
465
|
+
break;
|
466
|
+
case CONFIG_SOURCE.grid:
|
467
|
+
legacyConfigName = this.gridLegacyConfig.get(configName);
|
468
|
+
break;
|
469
|
+
case CONFIG_SOURCE.form:
|
470
|
+
legacyConfigName = this.formLegacyConfig.get(configName);
|
471
|
+
}
|
472
|
+
const params = urlParams ? Object.assign({}, urlParams) : {};
|
473
|
+
if (legacyConfigName) {
|
474
|
+
params['legacyResourceID'] = legacyConfigName;
|
475
|
+
}
|
476
|
+
return params;
|
477
|
+
}
|
478
|
+
static handleLegacyConfigAsString(name, source) {
|
479
|
+
const params = this.handleLegacyConfig(name, source);
|
480
|
+
const legacyResourceID = params['legacyResourceID'];
|
481
|
+
if (legacyResourceID) {
|
482
|
+
name = name + `?legacyResourceID=${legacyResourceID}`;
|
483
|
+
}
|
484
|
+
return name;
|
485
|
+
}
|
486
|
+
static async deleteConfigCache(name, resourceID, source) {
|
487
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
488
|
+
this.configById.delete(cacheID);
|
489
|
+
}
|
422
490
|
static buildCacheID(name, source, resourceID) {
|
423
491
|
if (name == undefined) {
|
424
492
|
return `req_${source}_${resourceID}`;
|
@@ -426,6 +494,11 @@ class ConfigStorage {
|
|
426
494
|
return `req_${source}_${name}_${resourceID}`;
|
427
495
|
}
|
428
496
|
}
|
497
|
+
ConfigStorage.CONFIG_NAME_ERROR_MESSAGE = "ConfigName precisa ser informado.";
|
498
|
+
ConfigStorage.LEGACY_CONFIG_NAME_ERROR_MESSAGE = "LegacyConfigName precisa ser informado.";
|
499
|
+
ConfigStorage.filterBarLegacyConfig = new Map();
|
500
|
+
ConfigStorage.formLegacyConfig = new Map();
|
501
|
+
ConfigStorage.gridLegacyConfig = new Map();
|
429
502
|
ConfigStorage.configById = new Map();
|
430
503
|
ConfigStorage.filterBarConfigFetcher = new FilterBarConfigFetcher();
|
431
504
|
ConfigStorage.formConfigFetcher = new FormConfigFetcher();
|
@@ -6786,7 +6786,6 @@ class DataFetcher {
|
|
6786
6786
|
if (http.readyState == 4 && http.status == 200) {
|
6787
6787
|
try {
|
6788
6788
|
const jsonResp = JSON.parse(http.responseText);
|
6789
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6790
6789
|
/**
|
6791
6790
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
6792
6791
|
*
|
@@ -6797,8 +6796,10 @@ class DataFetcher {
|
|
6797
6796
|
if (this.isServiceBrokerError(jsonResp)) {
|
6798
6797
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
6799
6798
|
}
|
6800
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
6801
|
-
|
6799
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
6800
|
+
if (jsonResp.statusMessage) {
|
6801
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
6802
|
+
}
|
6802
6803
|
}
|
6803
6804
|
else {
|
6804
6805
|
accept(jsonResp.responseBody);
|
@@ -6806,6 +6807,7 @@ class DataFetcher {
|
|
6806
6807
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
6807
6808
|
}
|
6808
6809
|
}
|
6810
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
6809
6811
|
}
|
6810
6812
|
catch (err) {
|
6811
6813
|
console.warn(`Erro ao executar serviço: ${err}`);
|
@@ -8,6 +8,11 @@ class SnkFormConfigManager {
|
|
8
8
|
this._configName = configName;
|
9
9
|
this._onConfigChange = onConfigChange;
|
10
10
|
}
|
11
|
+
addFormLegacyConfig(legacyConfigName) {
|
12
|
+
if (this._configName) {
|
13
|
+
ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
|
14
|
+
}
|
15
|
+
}
|
11
16
|
async loadConfig() {
|
12
17
|
return new Promise(resolve => {
|
13
18
|
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
@@ -93,16 +98,19 @@ class SnkFormConfigManager {
|
|
93
98
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
94
99
|
return normalizedText.includes(normalizedFilter);
|
95
100
|
}
|
96
|
-
getInsertionConfig(dataUnit) {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
if (
|
101
|
-
|
101
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
102
|
+
let fields = this.getFieldsList(dataUnit);
|
103
|
+
if (ignoreReadOnlyFormFields) {
|
104
|
+
fields = fields.filter(field => {
|
105
|
+
if (dataUnit) {
|
106
|
+
const def = dataUnit.getField(field.name);
|
107
|
+
if (def && def.readOnly) {
|
108
|
+
return false;
|
109
|
+
}
|
102
110
|
}
|
103
|
-
|
104
|
-
|
105
|
-
}
|
111
|
+
return !field.readOnly;
|
112
|
+
});
|
113
|
+
}
|
106
114
|
return Object.assign(Object.assign({}, this._config), { fields });
|
107
115
|
}
|
108
116
|
setConfig(config) {
|
@@ -122,8 +130,8 @@ class SnkFormConfigManager {
|
|
122
130
|
this._onConfigChange(Object.assign({}, this._config));
|
123
131
|
}
|
124
132
|
}
|
125
|
-
getConfig(insertionMode, dataUnit) {
|
126
|
-
return insertionMode ? this.getInsertionConfig(dataUnit) : Object.assign({}, this._config);
|
133
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
134
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
127
135
|
}
|
128
136
|
getFormConfigFetcher() {
|
129
137
|
if (this._formConfigFetcher == undefined) {
|
@@ -146,6 +146,10 @@ const snkCrudMessages = {
|
|
146
146
|
|
147
147
|
const snkSimpleCrudMessages = {
|
148
148
|
findColumn: "Busca de colunas",
|
149
|
+
formConfigUnavaliable: {
|
150
|
+
title: "Aviso",
|
151
|
+
message: 'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'
|
152
|
+
}
|
149
153
|
};
|
150
154
|
|
151
155
|
const fileViewerMessages = {
|
@@ -286,7 +290,8 @@ const snkDataExporterMessages = {
|
|
286
290
|
},
|
287
291
|
message: {
|
288
292
|
emailSuccess: "E-mail enviado com sucesso",
|
289
|
-
exportError: "
|
293
|
+
exportError: "Falha ao exportar dados",
|
294
|
+
unknownFailure: "O motivo da falha não pode ser identificado.",
|
290
295
|
exportPermission: "O usuário não possui permissão para exportar o arquivo.",
|
291
296
|
},
|
292
297
|
title: {
|
@@ -351,11 +356,24 @@ const snkAttachMessages = {
|
|
351
356
|
anyLinkOrFileFilled: {
|
352
357
|
title: "Atenção",
|
353
358
|
message: `É necessário preencher o campo "Link" ou anexar um arquivo.`
|
359
|
+
},
|
360
|
+
descriptionCannotBeChanged: {
|
361
|
+
title: "Atenção",
|
362
|
+
message: "O campo 'Descrição' não pode ser alterado."
|
354
363
|
}
|
355
364
|
},
|
356
365
|
taskbar: {
|
357
366
|
titleDownload: "Fazer download",
|
358
367
|
titleLink: "Abrir link",
|
368
|
+
},
|
369
|
+
attachMetadata: {
|
370
|
+
lblCode: "Código",
|
371
|
+
lblDescription: "Descrição",
|
372
|
+
lblFileOrLink: "Arquivo / Link",
|
373
|
+
lblUser: "Usuário",
|
374
|
+
lblDate: "Data de alteração",
|
375
|
+
lblFile: "Arquivo",
|
376
|
+
lblSubTitle: "Clique para selecionar um arquivo",
|
359
377
|
}
|
360
378
|
};
|
361
379
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DataType, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation,
|
1
|
+
import { DataType, ApplicationContext, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
2
|
import { d as dist, D as DataFetcher } from './DataFetcher.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -54,7 +54,7 @@ class PesquisaFetcher {
|
|
54
54
|
});
|
55
55
|
}
|
56
56
|
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
57
|
-
var _a, _b, _c;
|
57
|
+
var _a, _b, _c, _d;
|
58
58
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
59
59
|
const values = {
|
60
60
|
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
@@ -67,10 +67,16 @@ class PesquisaFetcher {
|
|
67
67
|
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
68
68
|
}
|
69
69
|
};
|
70
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
70
|
+
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
71
71
|
externalCriteria.params = {
|
72
72
|
param: values.criteria.params.map(param => {
|
73
73
|
let value = param.value;
|
74
|
+
if (typeof value === "string") {
|
75
|
+
const match = /CTX\{([^}]+)\}/.exec(value);
|
76
|
+
if (match) {
|
77
|
+
value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
|
78
|
+
}
|
79
|
+
}
|
74
80
|
let type = param.dataType;
|
75
81
|
if (type === DataType.OBJECT) {
|
76
82
|
value = value.value;
|
@@ -84,18 +90,11 @@ class PesquisaFetcher {
|
|
84
90
|
};
|
85
91
|
}
|
86
92
|
const options = searchOptions != undefined
|
87
|
-
? {
|
88
|
-
"pkFieldName": searchOptions.codeFieldName,
|
89
|
-
"label": searchOptions.descriptionFieldName,
|
90
|
-
"fieldName": searchOptions.codeFieldName,
|
91
|
-
"useDescriptionOptions": false,
|
92
|
-
"enableRowsCounter": true
|
93
|
-
}
|
94
|
-
: undefined;
|
93
|
+
? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
95
94
|
const reqBody = {
|
96
95
|
"serviceName": serviceName,
|
97
96
|
"requestBody": {
|
98
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (
|
97
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_d = values.searchOptions) === null || _d === void 0 ? void 0 : _d.rootEntity }, { options }),
|
99
98
|
"clientEventList": {
|
100
99
|
"clientEvent": []
|
101
100
|
}
|
@@ -384,6 +383,38 @@ class PreloadManager {
|
|
384
383
|
PreloadManager._repositories = new Map();
|
385
384
|
PreloadManager._loadingStatus = new Map();
|
386
385
|
|
386
|
+
function applyFilter(records, dataUnit, filters) {
|
387
|
+
const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
|
388
|
+
if (!(columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.size)) {
|
389
|
+
return records;
|
390
|
+
}
|
391
|
+
const filterFunction = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
392
|
+
if (filterFunction == undefined) {
|
393
|
+
return records;
|
394
|
+
}
|
395
|
+
return records.filter(filterFunction);
|
396
|
+
}
|
397
|
+
function applySorting(records, dataUnit, sorting) {
|
398
|
+
if (sorting == undefined || sorting.length == 0) {
|
399
|
+
return records;
|
400
|
+
}
|
401
|
+
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
402
|
+
if (sortingFunction == undefined) {
|
403
|
+
return records;
|
404
|
+
}
|
405
|
+
return records.sort(sortingFunction);
|
406
|
+
}
|
407
|
+
function buildPaginationInfo(records, offset = 0, limit = 0) {
|
408
|
+
const lastRecord = Math.min(offset + limit, records.length);
|
409
|
+
return {
|
410
|
+
currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
|
411
|
+
firstRecord: offset,
|
412
|
+
lastRecord: lastRecord,
|
413
|
+
total: records.length,
|
414
|
+
hasMore: !!(records.length - lastRecord),
|
415
|
+
};
|
416
|
+
}
|
417
|
+
|
387
418
|
class InMemoryLoader {
|
388
419
|
constructor(metadata, records) {
|
389
420
|
this.metadata = metadata;
|
@@ -399,7 +430,7 @@ class InMemoryLoader {
|
|
399
430
|
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
400
431
|
this._initialRecords = this.dataUnit.records;
|
401
432
|
}
|
402
|
-
return this._initialRecords;
|
433
|
+
return [...this._initialRecords, ...this.dataUnit.getAddedRecords()];
|
403
434
|
}
|
404
435
|
get dataUnit() {
|
405
436
|
return this._dataUnit;
|
@@ -457,30 +488,9 @@ class InMemoryLoader {
|
|
457
488
|
return StringUtils.generateUUID();
|
458
489
|
}
|
459
490
|
inMemoryLoader(dataUnit, request, recordsIn) {
|
460
|
-
let records =
|
461
|
-
records =
|
462
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(request,
|
463
|
-
}
|
464
|
-
applyFilter(records, dataUnit, filters) {
|
465
|
-
const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
|
466
|
-
if (columnFilters == undefined || columnFilters.size == 0) {
|
467
|
-
return records;
|
468
|
-
}
|
469
|
-
const filterFunciton = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
470
|
-
if (filterFunciton == undefined) {
|
471
|
-
return records;
|
472
|
-
}
|
473
|
-
return records.filter(filterFunciton);
|
474
|
-
}
|
475
|
-
applySorting(records, dataUnit, sorting) {
|
476
|
-
if (sorting == undefined || sorting.length == 0) {
|
477
|
-
return records;
|
478
|
-
}
|
479
|
-
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
480
|
-
if (sortingFunction == undefined) {
|
481
|
-
return records;
|
482
|
-
}
|
483
|
-
return records.sort(sortingFunction);
|
491
|
+
let records = applyFilter(recordsIn, dataUnit, request.filters);
|
492
|
+
records = applySorting(records, dataUnit, request.sort);
|
493
|
+
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
484
494
|
}
|
485
495
|
metadaLoader() {
|
486
496
|
return Promise.resolve(this._metadata);
|
@@ -513,48 +523,44 @@ class InMemoryLoader {
|
|
513
523
|
}
|
514
524
|
}
|
515
525
|
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
|
516
|
-
function buildPaginationInfo({ offset, limit }, records) {
|
517
|
-
if (offset === undefined || limit === undefined) {
|
518
|
-
return undefined;
|
519
|
-
}
|
520
|
-
const lastRecord = Math.min(offset + limit, records.length);
|
521
|
-
return {
|
522
|
-
currentPage: Math.ceil(offset / limit),
|
523
|
-
firstRecord: offset,
|
524
|
-
lastRecord: lastRecord,
|
525
|
-
total: records.length,
|
526
|
-
hasMore: !!(records.length - lastRecord),
|
527
|
-
};
|
528
|
-
}
|
529
526
|
|
530
527
|
class DatasetStrategy {
|
531
528
|
canSlice() {
|
532
529
|
return false;
|
533
530
|
}
|
531
|
+
processSortingSide(request, dataUnit, serverSideFilters) {
|
532
|
+
const localSorting = [];
|
533
|
+
const serverSorting = [];
|
534
|
+
if (request.sort != undefined) {
|
535
|
+
if (serverSideFilters.length === 0) {
|
536
|
+
return { localSorting: request.sort, serverSorting: [] };
|
537
|
+
}
|
538
|
+
for (const sort of request.sort) {
|
539
|
+
const descriptor = dataUnit.getField(sort.field);
|
540
|
+
const local = descriptor != undefined
|
541
|
+
&& descriptor.properties != undefined
|
542
|
+
&& descriptor.properties.calculated === "true";
|
543
|
+
if (local) {
|
544
|
+
localSorting.push(sort);
|
545
|
+
}
|
546
|
+
else {
|
547
|
+
serverSorting.push(sort);
|
548
|
+
}
|
549
|
+
}
|
550
|
+
}
|
551
|
+
return { localSorting, serverSorting };
|
552
|
+
}
|
534
553
|
async load(dataUnit, request, loadingInfo) {
|
554
|
+
var _a, _b;
|
535
555
|
if (dataUnit.metadata == undefined) {
|
536
556
|
return Promise.resolve({ records: [], loadingInfo });
|
537
557
|
}
|
538
558
|
try {
|
539
|
-
const
|
540
|
-
const serverSorting =
|
541
|
-
if (request.sort != undefined) {
|
542
|
-
for (const sort of request.sort) {
|
543
|
-
const descriptor = dataUnit.getField(sort.field);
|
544
|
-
const local = descriptor != undefined
|
545
|
-
&& descriptor.properties != undefined
|
546
|
-
&& descriptor.properties.calculated === "true";
|
547
|
-
if (local) {
|
548
|
-
localSorting.push(sort);
|
549
|
-
}
|
550
|
-
else {
|
551
|
-
serverSorting.push(sort);
|
552
|
-
}
|
553
|
-
}
|
554
|
-
}
|
559
|
+
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
560
|
+
const { localSorting, serverSorting } = this.processSortingSide(request, dataUnit, serverSideFilters);
|
555
561
|
const fields = this.getFieldsList(dataUnit);
|
556
562
|
const serviceName = "DatasetSP.loadRecords";
|
557
|
-
const requestBody = this.buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, serverSorting);
|
563
|
+
const requestBody = this.buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, serverSorting, serverSideFilters);
|
558
564
|
const params = loadingInfo.quiet ? { urlParams: { quietMode: "true" } } : undefined;
|
559
565
|
const { result: responseRecords, pagerID: pagerId } = await DataFetcher.get().callServiceBroker(serviceName, requestBody, params);
|
560
566
|
const records = this.processRecords(dataUnit, fields, responseRecords);
|
@@ -598,7 +604,7 @@ class DatasetStrategy {
|
|
598
604
|
}
|
599
605
|
return [descriptor.name, descriptionField];
|
600
606
|
}
|
601
|
-
buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, sorting) {
|
607
|
+
buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, sorting, serverSideFilters) {
|
602
608
|
const dataSetID = dataUnit.dataUnitId;
|
603
609
|
const dataUnitName = dataUnit.name;
|
604
610
|
const entityName = DataUnitFetcher.parseDataUnitName(dataUnitName).entityName;
|
@@ -617,7 +623,7 @@ class DatasetStrategy {
|
|
617
623
|
tryJoinedFields: true,
|
618
624
|
parallelLoader: useParallelLoader,
|
619
625
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
620
|
-
txProperties: this.getTxProperties(
|
626
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting, serverSideFilters),
|
621
627
|
useDefaultRowsLimit: false
|
622
628
|
}
|
623
629
|
};
|
@@ -628,12 +634,10 @@ class DatasetStrategy {
|
|
628
634
|
const moduleName = app.getModuleName();
|
629
635
|
return moduleName.replace("-bff", "");
|
630
636
|
}
|
631
|
-
getTxProperties(
|
632
|
-
var _a, _b;
|
637
|
+
getTxProperties(dataUnit, request, sorting, serverSideFilters) {
|
633
638
|
const txProperties = {
|
634
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
639
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
635
640
|
};
|
636
|
-
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
637
641
|
if (serverSideFilters.length !== 0) {
|
638
642
|
txProperties["__DATA_UNIT_ADAPTER__[criteria]"] = JSON.stringify(serverSideFilters);
|
639
643
|
}
|
@@ -643,6 +647,13 @@ class DatasetStrategy {
|
|
643
647
|
if (request.parentRecordId != undefined) {
|
644
648
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
645
649
|
}
|
650
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
651
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
652
|
+
return txProperties;
|
653
|
+
}
|
654
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
655
|
+
txProperties[name] = value;
|
656
|
+
});
|
646
657
|
return txProperties;
|
647
658
|
}
|
648
659
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -972,14 +983,41 @@ class DataUnitFetcher {
|
|
972
983
|
});
|
973
984
|
});
|
974
985
|
}
|
986
|
+
addTransientProperties(dataUnit, updatingFields) {
|
987
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
988
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
989
|
+
return updatingFields;
|
990
|
+
}
|
991
|
+
if (updatingFields == undefined) {
|
992
|
+
updatingFields = {};
|
993
|
+
}
|
994
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
995
|
+
updatingFields[`transient.${name}`] = value;
|
996
|
+
});
|
997
|
+
return updatingFields;
|
998
|
+
}
|
999
|
+
getUpdatingFields(dataUnit, originalUpdatingFields) {
|
1000
|
+
if (originalUpdatingFields == undefined) {
|
1001
|
+
return;
|
1002
|
+
}
|
1003
|
+
const updatingFields = Object.assign({}, originalUpdatingFields);
|
1004
|
+
Object.keys(updatingFields).forEach(key => {
|
1005
|
+
const descriptor = dataUnit.getField(key);
|
1006
|
+
if (descriptor != undefined && descriptor.standAlone) {
|
1007
|
+
delete updatingFields[key];
|
1008
|
+
}
|
1009
|
+
});
|
1010
|
+
return this.addTransientProperties(dataUnit, updatingFields);
|
1011
|
+
}
|
975
1012
|
saveData(dataUnit, duChanges) {
|
976
1013
|
const updatedRecordsIds = [];
|
977
1014
|
const addedRecordsIds = [];
|
978
1015
|
const changes = duChanges.map((change) => {
|
979
|
-
const { dataUnit: changeDU, record,
|
1016
|
+
const { dataUnit: changeDU, record, operation } = change;
|
980
1017
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
1018
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
981
1019
|
let parsedUpdatingFields;
|
982
|
-
if (updatingFields) {
|
1020
|
+
if (updatingFields != undefined) {
|
983
1021
|
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
984
1022
|
const descriptor = dataUnitInstance.getField(fieldName);
|
985
1023
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
@@ -1027,7 +1065,8 @@ class DataUnitFetcher {
|
|
1027
1065
|
}
|
1028
1066
|
responseRecord.fields.forEach(({ name, value }) => {
|
1029
1067
|
var _a;
|
1030
|
-
|
1068
|
+
const valueFromString = (_a = dataUnitInstance === null || dataUnitInstance === void 0 ? void 0 : dataUnitInstance.valueFromString) === null || _a === void 0 ? void 0 : _a.call(dataUnitInstance, name, value);
|
1069
|
+
duRecord[name] = (valueFromString !== undefined) ? valueFromString : value;
|
1031
1070
|
});
|
1032
1071
|
dataUnitRecords.push(duRecord);
|
1033
1072
|
});
|
@@ -1102,4 +1141,4 @@ class DataUnitFetcher {
|
|
1102
1141
|
}
|
1103
1142
|
}
|
1104
1143
|
|
1105
|
-
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a };
|
1144
|
+
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a, applyFilter as b, applySorting as c, buildPaginationInfo as d };
|