@sankhyalabs/sankhyablocks 8.15.0-dev.6 → 8.15.0-dev.60
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-1ed8e92a.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-cb768be1.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-bec9c1a5.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-ceabfb7e.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-72125b13.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-303aafb4.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-1fa244c0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-2d972c2e.entry.js +1 -0
- package/dist/sankhyablocks/p-314e2d1a.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-3494a28e.entry.js +1 -0
- package/dist/sankhyablocks/p-35bd4df7.entry.js +1 -0
- package/dist/sankhyablocks/p-536eeb16.js +26 -0
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-563701f3.js +1 -0
- package/dist/sankhyablocks/p-61984566.entry.js +1 -0
- package/dist/sankhyablocks/p-61dd89eb.js +1 -0
- package/dist/sankhyablocks/p-64977b22.entry.js +1 -0
- package/dist/sankhyablocks/p-65b6dba3.entry.js +1 -0
- package/dist/sankhyablocks/p-6bc64fb0.entry.js +1 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/p-aedf37fb.js +65 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-b233f5aa.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-c73482cf.js +1 -0
- package/dist/sankhyablocks/p-cb3c7b4a.entry.js +11 -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-d911a023.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-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/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,241 +0,0 @@
|
|
1
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-aa159c5a.js';
|
2
|
-
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
|
4
|
-
class ResourceFetcher {
|
5
|
-
constructor() {
|
6
|
-
this.templateByQuery = new Map();
|
7
|
-
this.buldTemplates();
|
8
|
-
}
|
9
|
-
buldTemplates() {
|
10
|
-
this.templateByQuery.set("fetchResource", dist.gql `query($name: String!) {
|
11
|
-
$queryAlias$: fetchResource(name: $name){
|
12
|
-
resource
|
13
|
-
}
|
14
|
-
}`);
|
15
|
-
this.templateByQuery.set("saveResource", dist.gql `mutation($resource: InputResource!) {
|
16
|
-
$queryAlias$: saveResource(resource: $resource){
|
17
|
-
name
|
18
|
-
resource
|
19
|
-
}
|
20
|
-
}`);
|
21
|
-
}
|
22
|
-
loadResource(name) {
|
23
|
-
if (ResourceFetcher._loadingResource.has(name)) {
|
24
|
-
return ResourceFetcher._loadingResource.get(name);
|
25
|
-
}
|
26
|
-
const promiseLoadResource = new Promise((resolve, reject) => {
|
27
|
-
DataFetcher.get()
|
28
|
-
.callGraphQL({
|
29
|
-
values: { name },
|
30
|
-
query: this.templateByQuery.get("fetchResource"),
|
31
|
-
})
|
32
|
-
.then((result) => {
|
33
|
-
resolve(result === null || result === void 0 ? void 0 : result.resource);
|
34
|
-
ResourceFetcher._loadingResource.delete(name);
|
35
|
-
})
|
36
|
-
.catch((error) => {
|
37
|
-
reject(error);
|
38
|
-
ResourceFetcher._loadingResource.delete(name);
|
39
|
-
});
|
40
|
-
});
|
41
|
-
ResourceFetcher._loadingResource.set(name, promiseLoadResource);
|
42
|
-
return promiseLoadResource;
|
43
|
-
}
|
44
|
-
saveResource(resource, name) {
|
45
|
-
return new Promise((resolve, reject) => {
|
46
|
-
DataFetcher.get()
|
47
|
-
.callGraphQL({
|
48
|
-
values: {
|
49
|
-
resource: {
|
50
|
-
name: name,
|
51
|
-
resource: JSON.stringify(resource)
|
52
|
-
}
|
53
|
-
},
|
54
|
-
query: this.templateByQuery.get("saveResource")
|
55
|
-
})
|
56
|
-
.then((resp) => {
|
57
|
-
resolve(resp);
|
58
|
-
})
|
59
|
-
.catch((error) => {
|
60
|
-
reject(error);
|
61
|
-
});
|
62
|
-
});
|
63
|
-
}
|
64
|
-
}
|
65
|
-
ResourceFetcher._loadingResource = new Map();
|
66
|
-
|
67
|
-
class FormConfigFetcher extends ResourceFetcher {
|
68
|
-
constructor() {
|
69
|
-
super();
|
70
|
-
this.queryConfig = new Map();
|
71
|
-
this.buildTemplatesConfig();
|
72
|
-
}
|
73
|
-
buildTemplatesConfig() {
|
74
|
-
this.queryConfig.set("fetchUserAvailableConfigs", dist.gql `query($name: String!) {
|
75
|
-
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
76
|
-
name
|
77
|
-
origin
|
78
|
-
key
|
79
|
-
}
|
80
|
-
}`);
|
81
|
-
this.queryConfig.set("fetchLegacyConfig", dist.gql `query($name: String!) {
|
82
|
-
$queryAlias$: fetchLegacyConfig(name: $name){
|
83
|
-
name
|
84
|
-
resource
|
85
|
-
}
|
86
|
-
}`);
|
87
|
-
this.queryConfig.set("fetchDefaultConfig", dist.gql `query($name: String!) {
|
88
|
-
$queryAlias$: fetchDefaultConfig(name: $name){
|
89
|
-
name
|
90
|
-
resource
|
91
|
-
}
|
92
|
-
}`);
|
93
|
-
}
|
94
|
-
loadFormConfig(formName, resourceID) {
|
95
|
-
return new Promise((accept, reject) => {
|
96
|
-
Promise.all([
|
97
|
-
this.loadResource(this.getPath(resourceID, formName)),
|
98
|
-
this.loadResource(this.getPath(`FormCardState:${resourceID}`, formName, "form-card")),
|
99
|
-
this.loadResource(this.getPath(resourceID, formName, "summary")),
|
100
|
-
this.loadResource(this.getPath(resourceID, formName, "defaultValues"))
|
101
|
-
])
|
102
|
-
.then(([configAsString, formCardState, summary, defaultValues]) => {
|
103
|
-
let config;
|
104
|
-
if (configAsString != undefined) {
|
105
|
-
config = Object.assign(Object.assign({}, JSON.parse(configAsString)), { emptyConfig: false });
|
106
|
-
const { tabs, fields } = config;
|
107
|
-
if (tabs) {
|
108
|
-
const allTabs = new Map(tabs.map(t => [t.label, t]));
|
109
|
-
fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
|
110
|
-
}
|
111
|
-
config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
112
|
-
if ("readonly" in field) {
|
113
|
-
const readOnly = field['readonly'] === true;
|
114
|
-
delete field['readonly'];
|
115
|
-
field.readOnly = readOnly;
|
116
|
-
}
|
117
|
-
return field;
|
118
|
-
});
|
119
|
-
}
|
120
|
-
if (formCardState != undefined) {
|
121
|
-
if (config == undefined) {
|
122
|
-
config = { emptyConfig: true, fields: [] };
|
123
|
-
}
|
124
|
-
config.cardsState = new Map(JSON.parse(formCardState));
|
125
|
-
}
|
126
|
-
if (summary != undefined) {
|
127
|
-
if (config == undefined) {
|
128
|
-
config = { emptyConfig: true, fields: [] };
|
129
|
-
}
|
130
|
-
config.summary = new Map(Object.entries(JSON.parse(summary)));
|
131
|
-
}
|
132
|
-
if (defaultValues != undefined) {
|
133
|
-
if (config == undefined) {
|
134
|
-
config = { emptyConfig: true, fields: [] };
|
135
|
-
}
|
136
|
-
config.defaultVars = new Map(Object.entries(JSON.parse(defaultValues)));
|
137
|
-
}
|
138
|
-
accept(config);
|
139
|
-
})
|
140
|
-
.catch((error) => {
|
141
|
-
reject(error);
|
142
|
-
});
|
143
|
-
});
|
144
|
-
}
|
145
|
-
getTabName(tab) {
|
146
|
-
if (typeof tab === 'object') { // ITabConfig type
|
147
|
-
return tab.label;
|
148
|
-
}
|
149
|
-
return tab; //string type
|
150
|
-
}
|
151
|
-
saveCardState(cardsState, formName, resourceID) {
|
152
|
-
const completePath = this.getPath(`FormCardState:${resourceID}`, formName, "form-card");
|
153
|
-
return new Promise((resolve, reject) => {
|
154
|
-
this.saveResource(Array.from(cardsState.entries()), completePath)
|
155
|
-
.then((resp) => {
|
156
|
-
resolve(new Map(JSON.parse(resp.resource)));
|
157
|
-
})
|
158
|
-
.catch((error) => {
|
159
|
-
reject(error);
|
160
|
-
});
|
161
|
-
});
|
162
|
-
}
|
163
|
-
saveConfig(config, formName, resourceID) {
|
164
|
-
//Essas informações não devem ser salvas na configuração
|
165
|
-
delete config.cardsState;
|
166
|
-
delete config.defaultVars;
|
167
|
-
delete config.summary;
|
168
|
-
const completePath = this.getPath(resourceID, formName);
|
169
|
-
return new Promise((resolve, reject) => {
|
170
|
-
this.saveResource(config, completePath)
|
171
|
-
.then((resp) => {
|
172
|
-
resolve(JSON.parse(resp.resource));
|
173
|
-
})
|
174
|
-
.catch((error) => {
|
175
|
-
reject(error);
|
176
|
-
});
|
177
|
-
});
|
178
|
-
}
|
179
|
-
fetchUserAvailableConfigs(formName, resourceID) {
|
180
|
-
const name = this.getPath(resourceID, formName);
|
181
|
-
return new Promise((resolve, reject) => {
|
182
|
-
DataFetcher.get()
|
183
|
-
.callGraphQL({
|
184
|
-
values: { name },
|
185
|
-
query: this.queryConfig.get("fetchUserAvailableConfigs"),
|
186
|
-
})
|
187
|
-
.then((result) => {
|
188
|
-
resolve(result);
|
189
|
-
})
|
190
|
-
.catch((error) => {
|
191
|
-
reject(error);
|
192
|
-
});
|
193
|
-
});
|
194
|
-
}
|
195
|
-
fetchLegacyConfig(formName, resourceID) {
|
196
|
-
const name = this.getPath(resourceID, formName);
|
197
|
-
return new Promise((resolve, reject) => {
|
198
|
-
DataFetcher.get()
|
199
|
-
.callGraphQL({
|
200
|
-
values: { name },
|
201
|
-
query: this.queryConfig.get("fetchLegacyConfig"),
|
202
|
-
})
|
203
|
-
.then((result) => {
|
204
|
-
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
205
|
-
})
|
206
|
-
.catch((error) => {
|
207
|
-
reject(error);
|
208
|
-
});
|
209
|
-
});
|
210
|
-
}
|
211
|
-
fetchDefaultConfig(formName, resourceID) {
|
212
|
-
const name = this.getPath(resourceID, formName);
|
213
|
-
return new Promise((resolve, reject) => {
|
214
|
-
DataFetcher.get()
|
215
|
-
.callGraphQL({
|
216
|
-
values: { name },
|
217
|
-
query: this.queryConfig.get("fetchDefaultConfig"),
|
218
|
-
})
|
219
|
-
.then((result) => {
|
220
|
-
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
221
|
-
})
|
222
|
-
.catch((error) => {
|
223
|
-
reject(error);
|
224
|
-
});
|
225
|
-
});
|
226
|
-
}
|
227
|
-
getPath(resourceID, name, authority = "form") {
|
228
|
-
if (name) {
|
229
|
-
return `cfg://${authority}/${resourceID}/${name}`;
|
230
|
-
}
|
231
|
-
return `cfg://${authority}/${resourceID}`;
|
232
|
-
}
|
233
|
-
}
|
234
|
-
var UserConfigType;
|
235
|
-
(function (UserConfigType) {
|
236
|
-
UserConfigType["USER"] = "USER";
|
237
|
-
UserConfigType["DEFAULT"] = "DEFAULT";
|
238
|
-
UserConfigType["SHARED"] = "SHARED";
|
239
|
-
})(UserConfigType || (UserConfigType = {}));
|
240
|
-
|
241
|
-
export { FormConfigFetcher as F, ResourceFetcher as R, UserConfigType as U };
|
@@ -1,165 +0,0 @@
|
|
1
|
-
import { DataType } from '@sankhyalabs/core';
|
2
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-aa159c5a.js';
|
3
|
-
|
4
|
-
class PesquisaFetcher {
|
5
|
-
constructor() {
|
6
|
-
this._defaultPageSize = 100;
|
7
|
-
this._templateByQuery = new Map();
|
8
|
-
this._searchListenersByDataUnit = new Map();
|
9
|
-
this.buldTemplates();
|
10
|
-
}
|
11
|
-
buldTemplates() {
|
12
|
-
this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
13
|
-
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
14
|
-
value
|
15
|
-
label
|
16
|
-
}
|
17
|
-
}`);
|
18
|
-
}
|
19
|
-
loadSearchOptions(entityName, argument, criteria, options) {
|
20
|
-
var _a;
|
21
|
-
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
|
22
|
-
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
23
|
-
criteria === null || criteria === void 0 ? void 0 : criteria.params.forEach(param => {
|
24
|
-
if (param.dataType === DataType.OBJECT) {
|
25
|
-
param.value = JSON.stringify(param.value);
|
26
|
-
}
|
27
|
-
});
|
28
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, options);
|
29
|
-
const values = {
|
30
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
31
|
-
entityName,
|
32
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
33
|
-
options: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || options,
|
34
|
-
};
|
35
|
-
if (values.options) {
|
36
|
-
(_a = values.options) === null || _a === void 0 ? true : delete _a.dataUnitId;
|
37
|
-
}
|
38
|
-
return new Promise((resolve, reject) => {
|
39
|
-
DataFetcher.get()
|
40
|
-
.callGraphQL({
|
41
|
-
values,
|
42
|
-
query: this._templateByQuery.get("search"),
|
43
|
-
})
|
44
|
-
.then((result) => {
|
45
|
-
resolve(result);
|
46
|
-
})
|
47
|
-
.catch((error) => {
|
48
|
-
reject(error);
|
49
|
-
});
|
50
|
-
});
|
51
|
-
}
|
52
|
-
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
53
|
-
var _a, _b, _c;
|
54
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
55
|
-
const values = {
|
56
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
57
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
58
|
-
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || searchOptions,
|
59
|
-
};
|
60
|
-
const serviceName = "PesquisaSP.getSuggestion";
|
61
|
-
const externalCriteria = {
|
62
|
-
query: {
|
63
|
-
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
64
|
-
}
|
65
|
-
};
|
66
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
67
|
-
externalCriteria.params = {
|
68
|
-
param: values.criteria.params.map(param => {
|
69
|
-
let value = param.value;
|
70
|
-
let type = param.dataType;
|
71
|
-
if (type === DataType.OBJECT) {
|
72
|
-
value = value.value;
|
73
|
-
type = "S";
|
74
|
-
}
|
75
|
-
else {
|
76
|
-
type = convertParamType(param.dataType);
|
77
|
-
}
|
78
|
-
return { $: value, type };
|
79
|
-
})
|
80
|
-
};
|
81
|
-
}
|
82
|
-
const options = searchOptions != undefined
|
83
|
-
? {
|
84
|
-
"pkFieldName": searchOptions.codeFieldName,
|
85
|
-
"label": searchOptions.descriptionFieldName,
|
86
|
-
"fieldName": searchOptions.codeFieldName,
|
87
|
-
"useDescriptionOptions": false,
|
88
|
-
"enableRowsCounter": true
|
89
|
-
}
|
90
|
-
: undefined;
|
91
|
-
const reqBody = {
|
92
|
-
"serviceName": serviceName,
|
93
|
-
"requestBody": {
|
94
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_c = values.searchOptions) === null || _c === void 0 ? void 0 : _c.rootEntity }, { options }),
|
95
|
-
"clientEventList": {
|
96
|
-
"clientEvent": []
|
97
|
-
}
|
98
|
-
}
|
99
|
-
};
|
100
|
-
return new Promise((resolve, reject) => {
|
101
|
-
DataFetcher.get()
|
102
|
-
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
103
|
-
.then(result => resolve(result))
|
104
|
-
.catch(error => reject(error));
|
105
|
-
});
|
106
|
-
}
|
107
|
-
addSearchListener(entityName, dataUnitID, listener) {
|
108
|
-
var _a;
|
109
|
-
const dataUnitSearchListeners = this._searchListenersByDataUnit.get(dataUnitID) || [];
|
110
|
-
const entityListener = dataUnitSearchListeners.find(currentListener => currentListener.entity === entityName);
|
111
|
-
if (!entityListener) {
|
112
|
-
this._searchListenersByDataUnit.set(dataUnitID, [...dataUnitSearchListeners, { entity: entityName, listener }]);
|
113
|
-
}
|
114
|
-
else {
|
115
|
-
for (const type of Object.keys(listener)) {
|
116
|
-
if (type in entityListener.listener) {
|
117
|
-
const listenerFunctionIsEquals = ((_a = entityListener.listener[type]) === null || _a === void 0 ? void 0 : _a.toString()) === listener[type].toString();
|
118
|
-
if (listenerFunctionIsEquals)
|
119
|
-
continue;
|
120
|
-
entityListener.listener[type] = listener[type];
|
121
|
-
}
|
122
|
-
}
|
123
|
-
}
|
124
|
-
return () => {
|
125
|
-
const newListeners = dataUnitSearchListeners.filter(currentListener => currentListener.entity !== entityName);
|
126
|
-
if (!newListeners.length) {
|
127
|
-
this._searchListenersByDataUnit.delete(dataUnitID);
|
128
|
-
return;
|
129
|
-
}
|
130
|
-
this._searchListenersByDataUnit.set(dataUnitID, newListeners);
|
131
|
-
};
|
132
|
-
}
|
133
|
-
applySearchListener(listenerType, entityName, argument, criteria, searchOptions) {
|
134
|
-
var _a;
|
135
|
-
const dataUnitId = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.dataUnitId;
|
136
|
-
if (!dataUnitId)
|
137
|
-
return;
|
138
|
-
const entityListener = (_a = this._searchListenersByDataUnit.get(dataUnitId)) === null || _a === void 0 ? void 0 : _a.find(({ entity }) => entity === entityName);
|
139
|
-
if (!entityListener)
|
140
|
-
return;
|
141
|
-
const { listener } = entityListener;
|
142
|
-
if (!(listenerType in listener))
|
143
|
-
return;
|
144
|
-
return listener[listenerType]({ argument, criteria, searchOptions });
|
145
|
-
}
|
146
|
-
}
|
147
|
-
function convertParamType(dataType) {
|
148
|
-
//Alerta: Cuidado pra não contaminar o DataType com a implementação
|
149
|
-
//atual da pesquisa... em geral, somente inteiros,
|
150
|
-
//data (com ou sem hora) e string são realmente relevantes
|
151
|
-
switch (dataType) {
|
152
|
-
case DataType.NUMBER:
|
153
|
-
return "I";
|
154
|
-
case DataType.DATE:
|
155
|
-
return "D";
|
156
|
-
default:
|
157
|
-
return "S";
|
158
|
-
}
|
159
|
-
}
|
160
|
-
var SearchListenerType;
|
161
|
-
(function (SearchListenerType) {
|
162
|
-
SearchListenerType["beforeSearch"] = "beforeSearch";
|
163
|
-
})(SearchListenerType || (SearchListenerType = {}));
|
164
|
-
|
165
|
-
export { PesquisaFetcher as P };
|