@sankhyalabs/sankhyablocks 8.15.0-dev.6 → 8.15.0-dev.61
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-7df9d3bb.js} +102 -30
- package/dist/cjs/IExporterProvider-c307e2b1.js +187 -0
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-7d850fbc.js → SnkFormConfigManager-4259edbe.js} +21 -13
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-66aa2557.js} +19 -1
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-e6112be7.js} +1 -1
- package/dist/cjs/{DataFetcher-ba94ed5b.js → form-config-fetcher-3c4daeb5.js} +258 -4
- 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-cbdaba63.js} +520 -86
- 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} +529 -13
- package/dist/cjs/snk-application.cjs.entry.js +62 -28
- package/dist/cjs/snk-attach.cjs.entry.js +422 -62
- package/dist/cjs/snk-crud.cjs.entry.js +17 -12
- package/dist/cjs/snk-data-exporter.cjs.entry.js +204 -82
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-abd2113f.js} +3 -38
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -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 +65 -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 +2 -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 +46 -27
- package/dist/cjs/snk-form.cjs.entry.js +10 -4
- package/dist/cjs/snk-grid.cjs.entry.js +95 -116
- package/dist/cjs/{snk-guides-viewer-cb176c4d.js → snk-guides-viewer-b0c44e0c.js} +15 -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 +2 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +367 -38
- package/dist/cjs/snk-taskbar.cjs.entry.js +124 -15
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-d9392685.js} +11 -11
- 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 +85 -2
- package/dist/collection/components/snk-attach/snk-attach.js +212 -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/exporter-strategy/ClientSideExporterStrategy.js +90 -0
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +42 -48
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
- package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
- 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 +159 -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 +102 -109
- 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 +548 -20
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +4 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +11 -11
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +167 -14
- package/dist/collection/lib/configs/ConfigStorage.js +86 -16
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +9 -40
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +7 -4
- 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/DataUnitDataLoader.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +11 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +32 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +36 -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 +12 -13
- 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 +93 -21
- package/dist/components/IExporterProvider.js +256 -0
- package/dist/components/ISave.js +42 -0
- package/dist/components/SnkFormConfigManager.js +19 -11
- package/dist/components/SnkMessageBuilder.js +19 -1
- package/dist/components/dataunit-fetcher.js +138 -91
- package/dist/components/form-config-fetcher.js +7035 -3
- package/dist/components/index.d.ts +6 -6
- package/dist/components/index2.js +198 -33
- package/dist/components/snk-actions-button2.js +3 -11
- package/dist/components/snk-application2.js +42 -3
- package/dist/components/snk-attach2.js +478 -70
- package/dist/components/snk-crud.js +18 -7
- package/dist/components/snk-data-exporter2.js +199 -82
- package/dist/components/snk-data-unit2.js +41 -39
- package/dist/components/snk-detail-view2.js +44 -12
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-expression-item2.js +1 -1
- package/dist/components/snk-filter-bar2.js +69 -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 +47 -27
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +96 -112
- 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 +421 -34
- package/dist/components/snk-taskbar2.js +144 -29
- package/dist/components/taskbar-actions-button2.js +4 -2
- package/dist/esm/{ConfigStorage-1244b8b0.js → ConfigStorage-928c3bf4.js} +93 -21
- package/dist/esm/IExporterProvider-e2a1195d.js +179 -0
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-9be0e7d4.js → SnkFormConfigManager-a87ade7a.js} +21 -13
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0a4becdd.js} +19 -1
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-e1cb288f.js} +1 -1
- package/dist/esm/{DataFetcher-aa159c5a.js → form-config-fetcher-e3094014.js} +257 -5
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-6d8e50bb.js} +494 -69
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +523 -9
- package/dist/esm/snk-application.entry.js +43 -9
- package/dist/esm/snk-attach.entry.js +422 -62
- package/dist/esm/snk-crud.entry.js +17 -12
- package/dist/esm/snk-data-exporter.entry.js +204 -82
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-29eba11a.js} +4 -39
- package/dist/esm/snk-data-unit.entry.js +3 -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 +65 -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 +2 -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 +47 -28
- package/dist/esm/snk-form.entry.js +10 -4
- package/dist/esm/snk-grid.entry.js +95 -116
- package/dist/esm/{snk-guides-viewer-eeb8f354.js → snk-guides-viewer-1fd41a25.js} +15 -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 +2 -3
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +359 -30
- package/dist/esm/snk-taskbar.entry.js +125 -16
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-ad766858.js} +11 -11
- package/dist/sankhyablocks/p-029bfc09.js +1 -0
- package/dist/sankhyablocks/p-07825198.js +1 -0
- package/dist/sankhyablocks/p-0e8702f0.js +1 -0
- package/dist/sankhyablocks/p-13ea113d.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-314e2d1a.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-3357af48.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-3c2a1f4d.js +65 -0
- package/dist/sankhyablocks/p-3e7167dd.js +1 -0
- package/dist/sankhyablocks/p-536eeb16.js +26 -0
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-587f9dcf.entry.js +1 -0
- package/dist/sankhyablocks/p-61984566.entry.js +1 -0
- package/dist/sankhyablocks/p-61dd89eb.js +1 -0
- package/dist/sankhyablocks/p-65b6dba3.entry.js +1 -0
- package/dist/sankhyablocks/p-6a7bc5c8.entry.js +1 -0
- package/dist/sankhyablocks/p-6c9edfd8.entry.js +1 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/p-89bde7d3.entry.js +1 -0
- package/dist/sankhyablocks/p-91dceecf.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-a40cbad8.entry.js +1 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-b86ea293.entry.js +1 -0
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-d8ddb2a4.entry.js +11 -0
- package/dist/sankhyablocks/p-df73ac00.entry.js +1 -0
- package/dist/sankhyablocks/p-e27496ed.js +56 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/p-f92f1f5f.entry.js +1 -0
- package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-application/snk-application.d.ts +15 -0
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +29 -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-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
- package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +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 +27 -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 -4
- 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 +98 -4
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +34 -1
- package/dist/types/components.d.ts +314 -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/DataUnitDataLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
- 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/fetchDataExporter/interfaces/IExporterColumnMetadata.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/http/data-fetcher/fetchers/pesquisa-fetcher.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/form-config-fetcher-df043d3d.js +0 -244
- 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/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
- package/dist/components/DataFetcher.js +0 -7021
- package/dist/components/field-search.js +0 -121
- package/dist/components/index3.js +0 -199
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/form-config-fetcher-36219cd3.js +0 -241
- 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-0dca29cb.entry.js +0 -1
- 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-32f0935f.js +0 -1
- package/dist/sankhyablocks/p-3520c088.entry.js +0 -1
- 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-9695f78b.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-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-e6380c60.js +0 -1
- package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
- package/dist/sankhyablocks/p-f514913b.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/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -1,8 +1,9 @@
|
|
1
|
-
import { DataType,
|
2
|
-
import { d as dist, D as DataFetcher } from './
|
1
|
+
import { DataType, ApplicationContext, ObjectUtils, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
|
+
import { d as dist, D as DataFetcher } from './form-config-fetcher.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';
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
6
|
+
import SortingUtils from '@sankhyalabs/core/dist/utils/SortingUtils';
|
6
7
|
import { R as ResourceIDUtils } from './ResourceIDUtils.js';
|
7
8
|
|
8
9
|
class PesquisaFetcher {
|
@@ -54,12 +55,12 @@ class PesquisaFetcher {
|
|
54
55
|
});
|
55
56
|
}
|
56
57
|
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
57
|
-
var _a, _b, _c;
|
58
|
+
var _a, _b, _c, _d, _e;
|
58
59
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
59
60
|
const values = {
|
60
61
|
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
61
62
|
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
62
|
-
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions)
|
63
|
+
searchOptions: Object.assign(Object.assign({}, searchOptions), listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions),
|
63
64
|
};
|
64
65
|
const serviceName = "PesquisaSP.getSuggestion";
|
65
66
|
const externalCriteria = {
|
@@ -67,10 +68,16 @@ class PesquisaFetcher {
|
|
67
68
|
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
68
69
|
}
|
69
70
|
};
|
70
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
71
|
+
if (((_c = (_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
71
72
|
externalCriteria.params = {
|
72
73
|
param: values.criteria.params.map(param => {
|
73
74
|
let value = param.value;
|
75
|
+
if (typeof value === "string") {
|
76
|
+
const match = /CTX\{([^}]+)\}/.exec(value);
|
77
|
+
if (match) {
|
78
|
+
value = ApplicationContext.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${match[1]})__`);
|
79
|
+
}
|
80
|
+
}
|
74
81
|
let type = param.dataType;
|
75
82
|
if (type === DataType.OBJECT) {
|
76
83
|
value = value.value;
|
@@ -84,18 +91,11 @@ class PesquisaFetcher {
|
|
84
91
|
};
|
85
92
|
}
|
86
93
|
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;
|
94
|
+
? Object.assign(Object.assign({}, values === null || values === void 0 ? void 0 : values.searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
|
95
95
|
const reqBody = {
|
96
96
|
"serviceName": serviceName,
|
97
97
|
"requestBody": {
|
98
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (
|
98
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_e = values.searchOptions) === null || _e === void 0 ? void 0 : _e.rootEntity }, { options }),
|
99
99
|
"clientEventList": {
|
100
100
|
"clientEvent": []
|
101
101
|
}
|
@@ -245,6 +245,9 @@ class ArrayRepository {
|
|
245
245
|
async count() {
|
246
246
|
return Promise.resolve(this._list.length);
|
247
247
|
}
|
248
|
+
getFromCache() {
|
249
|
+
return ObjectUtils.copy(this._list);
|
250
|
+
}
|
248
251
|
}
|
249
252
|
|
250
253
|
class PreloadManager {
|
@@ -266,17 +269,7 @@ class PreloadManager {
|
|
266
269
|
}
|
267
270
|
}
|
268
271
|
static getSortingFunction(dataUnit, sorting) {
|
269
|
-
|
270
|
-
return undefined;
|
271
|
-
}
|
272
|
-
return (recordA, recordB) => {
|
273
|
-
for (const sort of sorting) {
|
274
|
-
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
275
|
-
if (result != 0) {
|
276
|
-
return result;
|
277
|
-
}
|
278
|
-
}
|
279
|
-
};
|
272
|
+
return SortingUtils.getSortingFunction(dataUnit, sorting);
|
280
273
|
}
|
281
274
|
static async getDistinct(dataUnit, fieldName) {
|
282
275
|
if (!PreloadManager.isCacheEnabled(dataUnit)) {
|
@@ -313,7 +306,11 @@ class PreloadManager {
|
|
313
306
|
static async loadData(dataUnit, request, loadFromServer) {
|
314
307
|
try {
|
315
308
|
if (PreloadManager.isCacheEnabled(dataUnit)) {
|
316
|
-
|
309
|
+
const useCache = [
|
310
|
+
"EZ_GRID_LOADING_SOURCE",
|
311
|
+
DataUnit.CHANGING_PAGE_LOADING_SOURCE,
|
312
|
+
DataUnit.ALL_RECORDS_SELECTION_SOURCE
|
313
|
+
].includes(request.source);
|
317
314
|
if (useCache) {
|
318
315
|
const isCacheEmpty = await PreloadManager.getRepository(dataUnit).isEmpty();
|
319
316
|
if (!isCacheEmpty) {
|
@@ -380,10 +377,45 @@ class PreloadManager {
|
|
380
377
|
.catch(reason => reject(reason));
|
381
378
|
});
|
382
379
|
}
|
380
|
+
static getCachedRecords(dataUnit) {
|
381
|
+
return PreloadManager.getRepository(dataUnit).getFromCache();
|
382
|
+
}
|
383
383
|
}
|
384
384
|
PreloadManager._repositories = new Map();
|
385
385
|
PreloadManager._loadingStatus = new Map();
|
386
386
|
|
387
|
+
function applyFilter(records, dataUnit, filters) {
|
388
|
+
const columnFilters = ColumnFilterManager.getColumnFilters(filters, "");
|
389
|
+
if (!(columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.size)) {
|
390
|
+
return records;
|
391
|
+
}
|
392
|
+
const filterFunction = ColumnFilterManager.getFilterFunction(dataUnit, Array.from(columnFilters.values()));
|
393
|
+
if (filterFunction == undefined) {
|
394
|
+
return records;
|
395
|
+
}
|
396
|
+
return records.filter(filterFunction);
|
397
|
+
}
|
398
|
+
function applySorting(records, dataUnit, sorting) {
|
399
|
+
if (sorting == undefined || sorting.length == 0) {
|
400
|
+
return records;
|
401
|
+
}
|
402
|
+
const sortingFunction = PreloadManager.getSortingFunction(dataUnit, sorting);
|
403
|
+
if (sortingFunction == undefined) {
|
404
|
+
return records;
|
405
|
+
}
|
406
|
+
return records.sort(sortingFunction);
|
407
|
+
}
|
408
|
+
function buildPaginationInfo(records, offset = 0, limit = 0) {
|
409
|
+
const lastRecord = Math.min(offset + limit, records === null || records === void 0 ? void 0 : records.length);
|
410
|
+
return {
|
411
|
+
currentPage: limit === 0 ? 0 : Math.ceil(offset / limit),
|
412
|
+
firstRecord: offset,
|
413
|
+
lastRecord: lastRecord,
|
414
|
+
total: records === null || records === void 0 ? void 0 : records.length,
|
415
|
+
hasMore: !!((records === null || records === void 0 ? void 0 : records.length) - lastRecord),
|
416
|
+
};
|
417
|
+
}
|
418
|
+
|
387
419
|
class InMemoryLoader {
|
388
420
|
constructor(metadata, records) {
|
389
421
|
this.metadata = metadata;
|
@@ -399,6 +431,10 @@ class InMemoryLoader {
|
|
399
431
|
if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
|
400
432
|
this._initialRecords = this.dataUnit.records;
|
401
433
|
}
|
434
|
+
const addedRecords = this.dataUnit.getAddedRecords();
|
435
|
+
if (addedRecords) {
|
436
|
+
return [...this._initialRecords, ...addedRecords];
|
437
|
+
}
|
402
438
|
return this._initialRecords;
|
403
439
|
}
|
404
440
|
get dataUnit() {
|
@@ -441,7 +477,7 @@ class InMemoryLoader {
|
|
441
477
|
this._initialRecords = newRecords;
|
442
478
|
if (this._dataUnit) {
|
443
479
|
//Isso força o refresh internamente no datunit
|
444
|
-
this._dataUnit.
|
480
|
+
this._dataUnit.loadData();
|
445
481
|
}
|
446
482
|
}
|
447
483
|
get metadata() {
|
@@ -457,30 +493,9 @@ class InMemoryLoader {
|
|
457
493
|
return StringUtils.generateUUID();
|
458
494
|
}
|
459
495
|
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);
|
496
|
+
let records = applyFilter(recordsIn, dataUnit, request.filters);
|
497
|
+
records = applySorting(records, dataUnit, request.sort);
|
498
|
+
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
484
499
|
}
|
485
500
|
metadaLoader() {
|
486
501
|
return Promise.resolve(this._metadata);
|
@@ -513,48 +528,43 @@ class InMemoryLoader {
|
|
513
528
|
}
|
514
529
|
}
|
515
530
|
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
531
|
|
530
532
|
class DatasetStrategy {
|
531
533
|
canSlice() {
|
532
534
|
return false;
|
533
535
|
}
|
536
|
+
processSortingSide(request, dataUnit, serverSideFilters) {
|
537
|
+
var _a;
|
538
|
+
const localSorting = [];
|
539
|
+
const serverSorting = [];
|
540
|
+
if (request.sort != undefined) {
|
541
|
+
if (serverSideFilters.length === 0) {
|
542
|
+
return { localSorting: request.sort, serverSorting: [] };
|
543
|
+
}
|
544
|
+
for (const sort of request.sort) {
|
545
|
+
const descriptor = dataUnit.getField(sort.field);
|
546
|
+
const local = ((_a = descriptor === null || descriptor === void 0 ? void 0 : descriptor.properties) === null || _a === void 0 ? void 0 : _a.calculated) === "true" || (descriptor === null || descriptor === void 0 ? void 0 : descriptor.userInterface) === UserInterface.LONGTEXT;
|
547
|
+
if (local) {
|
548
|
+
localSorting.push(sort);
|
549
|
+
}
|
550
|
+
else {
|
551
|
+
serverSorting.push(sort);
|
552
|
+
}
|
553
|
+
}
|
554
|
+
}
|
555
|
+
return { localSorting, serverSorting };
|
556
|
+
}
|
534
557
|
async load(dataUnit, request, loadingInfo) {
|
558
|
+
var _a, _b;
|
535
559
|
if (dataUnit.metadata == undefined) {
|
536
560
|
return Promise.resolve({ records: [], loadingInfo });
|
537
561
|
}
|
538
562
|
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
|
-
}
|
563
|
+
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 : [];
|
564
|
+
const { localSorting, serverSorting } = this.processSortingSide(request, dataUnit, serverSideFilters);
|
555
565
|
const fields = this.getFieldsList(dataUnit);
|
556
566
|
const serviceName = "DatasetSP.loadRecords";
|
557
|
-
const requestBody = this.buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, serverSorting);
|
567
|
+
const requestBody = this.buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, serverSorting, serverSideFilters);
|
558
568
|
const params = loadingInfo.quiet ? { urlParams: { quietMode: "true" } } : undefined;
|
559
569
|
const { result: responseRecords, pagerID: pagerId } = await DataFetcher.get().callServiceBroker(serviceName, requestBody, params);
|
560
570
|
const records = this.processRecords(dataUnit, fields, responseRecords);
|
@@ -598,7 +608,7 @@ class DatasetStrategy {
|
|
598
608
|
}
|
599
609
|
return [descriptor.name, descriptionField];
|
600
610
|
}
|
601
|
-
buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, sorting) {
|
611
|
+
buildRequestBody(serviceName, fields, dataUnit, request, loadingInfo, sorting, serverSideFilters) {
|
602
612
|
const dataSetID = dataUnit.dataUnitId;
|
603
613
|
const dataUnitName = dataUnit.name;
|
604
614
|
const entityName = DataUnitFetcher.parseDataUnitName(dataUnitName).entityName;
|
@@ -617,7 +627,7 @@ class DatasetStrategy {
|
|
617
627
|
tryJoinedFields: true,
|
618
628
|
parallelLoader: useParallelLoader,
|
619
629
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
620
|
-
txProperties: this.getTxProperties(
|
630
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting, serverSideFilters),
|
621
631
|
useDefaultRowsLimit: false
|
622
632
|
}
|
623
633
|
};
|
@@ -628,12 +638,10 @@ class DatasetStrategy {
|
|
628
638
|
const moduleName = app.getModuleName();
|
629
639
|
return moduleName.replace("-bff", "");
|
630
640
|
}
|
631
|
-
getTxProperties(
|
632
|
-
var _a, _b;
|
641
|
+
getTxProperties(dataUnit, request, sorting, serverSideFilters) {
|
633
642
|
const txProperties = {
|
634
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
643
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
635
644
|
};
|
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
645
|
if (serverSideFilters.length !== 0) {
|
638
646
|
txProperties["__DATA_UNIT_ADAPTER__[criteria]"] = JSON.stringify(serverSideFilters);
|
639
647
|
}
|
@@ -643,6 +651,13 @@ class DatasetStrategy {
|
|
643
651
|
if (request.parentRecordId != undefined) {
|
644
652
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
645
653
|
}
|
654
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
655
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
656
|
+
return txProperties;
|
657
|
+
}
|
658
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
659
|
+
txProperties[name] = value;
|
660
|
+
});
|
646
661
|
return txProperties;
|
647
662
|
}
|
648
663
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -712,6 +727,9 @@ class DataUnitDataLoader {
|
|
712
727
|
});
|
713
728
|
});
|
714
729
|
}
|
730
|
+
static getCachedRecords(dataUnit) {
|
731
|
+
return PreloadManager.getCachedRecords(dataUnit);
|
732
|
+
}
|
715
733
|
static async loadFromServer(dataUnit, request, loadingInfo) {
|
716
734
|
try {
|
717
735
|
//Registramos a request com as informações de carga para determinarmos a última.
|
@@ -912,6 +930,7 @@ class DataUnitFetcher {
|
|
912
930
|
dataUnit.saveLoader = (_dataUnit, changes) => this.saveData(dataUnit, changes);
|
913
931
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
914
932
|
dataUnit.recordLoader = (dataUnit, recordIds) => this.loadRecord(dataUnit, recordIds);
|
933
|
+
dataUnit.allRecordsLoader = (dataUnit) => DataUnitDataLoader.getCachedRecords(dataUnit);
|
915
934
|
return dataUnit;
|
916
935
|
}
|
917
936
|
loadMetadata(dataUnit) {
|
@@ -972,14 +991,41 @@ class DataUnitFetcher {
|
|
972
991
|
});
|
973
992
|
});
|
974
993
|
}
|
994
|
+
addTransientProperties(dataUnit, updatingFields) {
|
995
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
996
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
997
|
+
return updatingFields;
|
998
|
+
}
|
999
|
+
if (updatingFields == undefined) {
|
1000
|
+
updatingFields = {};
|
1001
|
+
}
|
1002
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
1003
|
+
updatingFields[`transient.${name}`] = value;
|
1004
|
+
});
|
1005
|
+
return updatingFields;
|
1006
|
+
}
|
1007
|
+
getUpdatingFields(dataUnit, originalUpdatingFields) {
|
1008
|
+
if (originalUpdatingFields == undefined) {
|
1009
|
+
return;
|
1010
|
+
}
|
1011
|
+
const updatingFields = Object.assign({}, originalUpdatingFields);
|
1012
|
+
Object.keys(updatingFields).forEach(key => {
|
1013
|
+
const descriptor = dataUnit.getField(key);
|
1014
|
+
if (descriptor != undefined && descriptor.standAlone) {
|
1015
|
+
delete updatingFields[key];
|
1016
|
+
}
|
1017
|
+
});
|
1018
|
+
return this.addTransientProperties(dataUnit, updatingFields);
|
1019
|
+
}
|
975
1020
|
saveData(dataUnit, duChanges) {
|
976
1021
|
const updatedRecordsIds = [];
|
977
1022
|
const addedRecordsIds = [];
|
978
1023
|
const changes = duChanges.map((change) => {
|
979
|
-
const { dataUnit: changeDU, record,
|
1024
|
+
const { dataUnit: changeDU, record, operation } = change;
|
980
1025
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
1026
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
981
1027
|
let parsedUpdatingFields;
|
982
|
-
if (updatingFields) {
|
1028
|
+
if (updatingFields != undefined) {
|
983
1029
|
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
984
1030
|
const descriptor = dataUnitInstance.getField(fieldName);
|
985
1031
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
@@ -1027,7 +1073,8 @@ class DataUnitFetcher {
|
|
1027
1073
|
}
|
1028
1074
|
responseRecord.fields.forEach(({ name, value }) => {
|
1029
1075
|
var _a;
|
1030
|
-
|
1076
|
+
const valueFromString = (_a = dataUnitInstance === null || dataUnitInstance === void 0 ? void 0 : dataUnitInstance.valueFromString) === null || _a === void 0 ? void 0 : _a.call(dataUnitInstance, name, value);
|
1077
|
+
duRecord[name] = (valueFromString !== undefined) ? valueFromString : value;
|
1031
1078
|
});
|
1032
1079
|
dataUnitRecords.push(duRecord);
|
1033
1080
|
});
|
@@ -1102,4 +1149,4 @@ class DataUnitFetcher {
|
|
1102
1149
|
}
|
1103
1150
|
}
|
1104
1151
|
|
1105
|
-
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a };
|
1152
|
+
export { DataUnitFetcher as D, InMemoryLoader as I, PesquisaFetcher as P, PreloadManager as a, applyFilter as b, applySorting as c, buildPaginationInfo as d };
|