@sankhyalabs/sankhyablocks 8.15.0-dev.8 → 8.15.0-dev.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-302bbbd4.js → ConfigStorage-942ce74b.js} +70 -7
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-313debd8.js} +18 -8
- package/dist/cjs/IExporterProvider-0c814e9a.js +230 -0
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-52f99b4d.js} +23 -15
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-4a95fe86.js} +25 -13
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-54f5ff9d.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-14108bec.js → dataunit-fetcher-620b29a1.js} +409 -77
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-2dd00e5b.js} +13 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-ef050a47.js → pesquisa-fetcher-680e198f.js} +12 -13
- 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} +526 -8
- package/dist/cjs/snk-application.cjs.entry.js +88 -26
- package/dist/cjs/snk-attach.cjs.entry.js +441 -65
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +125 -28
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +6 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +207 -83
- package/dist/cjs/snk-data-unit-eca53cfc.js +671 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +11 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +52 -13
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +65 -8
- 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-view.cjs.entry.js +67 -0
- package/dist/cjs/snk-form.cjs.entry.js +60 -8
- package/dist/cjs/snk-grid.cjs.entry.js +200 -122
- package/dist/cjs/{snk-guides-viewer-c8b9374f.js → snk-guides-viewer-5d5f0f25.js} +56 -20
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -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 +512 -40
- package/dist/cjs/snk-taskbar.cjs.entry.js +164 -21
- package/dist/cjs/{taskbar-elements-01b85b99.js → taskbar-elements-d9392685.js} +11 -11
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +148 -24
- package/dist/collection/components/snk-attach/snk-attach.js +231 -44
- 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-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +359 -19
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +137 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +161 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +163 -13
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +1 -1
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js +22 -1
- 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 +54 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +58 -0
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +44 -50
- 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 +501 -216
- package/dist/collection/components/snk-data-unit/test/resources/metadataMock.js +24 -0
- 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 +175 -3
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-form/snk-form.js +126 -5
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +22 -14
- 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 +360 -115
- 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 +847 -23
- 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 +218 -20
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +35 -0
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +15 -42
- package/dist/collection/lib/dataUnit/ValueFormatter.js +4 -0
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- package/dist/collection/lib/dataUnit/interfaces/InMemoryLoaderConfig.js +1 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +18 -8
- 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 +30 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IBuildRequestBodyLoadRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +87 -24
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.js +22 -0
- 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/SnkMessageBuilder.js +25 -32
- 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-data-unit.msg.js +1 -0
- 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 +68 -5
- package/dist/components/DataFetcher.js +18 -8
- package/dist/components/IExporterProvider.js +298 -0
- package/dist/components/ISave.js +42 -0
- package/dist/components/SnkFormConfigManager.js +21 -13
- package/dist/components/SnkMessageBuilder.js +25 -13
- package/dist/components/dataunit-fetcher.js +185 -241
- package/dist/components/form-config-fetcher.js +12 -0
- package/dist/components/index.d.ts +6 -6
- package/dist/components/index2.js +198 -33
- package/dist/{esm/pesquisa-fetcher-dd3ca0a5.js → components/pesquisa-fetcher.js} +13 -14
- package/dist/components/snk-actions-button2.js +4 -10
- package/dist/components/snk-application2.js +86 -20
- package/dist/components/snk-attach2.js +496 -72
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +133 -23
- package/dist/components/snk-custom-slot-elements.js +7 -3
- package/dist/components/snk-data-exporter2.js +202 -83
- package/dist/components/snk-data-unit2.js +464 -214
- package/dist/components/snk-detail-view2.js +137 -23
- 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 -6
- 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-view2.js +72 -1
- package/dist/components/snk-form.js +60 -5
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +209 -119
- 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 +574 -36
- package/dist/components/snk-taskbar2.js +186 -36
- package/dist/components/taskbar-actions-button2.js +4 -2
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-86187da3.js} +70 -7
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-c1baf61d.js} +18 -8
- package/dist/esm/IExporterProvider-c0194569.js +221 -0
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/RecordIDUtils-87d02110.js +41 -0
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-5b0d69cd.js} +23 -15
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-3a767111.js} +25 -13
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-039abba3.js} +1 -1
- package/dist/esm/{dataunit-fetcher-cbec1594.js → dataunit-fetcher-3fbf9d12.js} +392 -70
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-30fb808f.js} +13 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-fetcher-03c8f919.js +164 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +525 -9
- package/dist/esm/snk-application.entry.js +88 -26
- package/dist/esm/snk-attach.entry.js +441 -65
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +125 -28
- package/dist/esm/snk-custom-slot-elements.entry.js +7 -3
- package/dist/esm/snk-data-exporter.entry.js +208 -84
- package/dist/esm/snk-data-unit-49b898f7.js +669 -0
- package/dist/esm/snk-data-unit.entry.js +11 -2
- package/dist/esm/snk-detail-view.entry.js +52 -13
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +65 -8
- 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-view.entry.js +67 -0
- package/dist/esm/snk-form.entry.js +60 -8
- package/dist/esm/snk-grid.entry.js +200 -122
- package/dist/esm/{snk-guides-viewer-8da24475.js → snk-guides-viewer-ef8c4eec.js} +56 -20
- package/dist/esm/snk-guides-viewer.entry.js +10 -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 +505 -33
- package/dist/esm/snk-taskbar.entry.js +165 -22
- package/dist/esm/{taskbar-elements-d4d0b424.js → taskbar-elements-ad766858.js} +11 -11
- package/dist/sankhyablocks/p-039c7148.entry.js +1 -0
- package/dist/sankhyablocks/p-04821c60.entry.js +1 -0
- package/dist/sankhyablocks/p-060fdb6c.js +1 -0
- package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-21a81901.entry.js +1 -0
- package/dist/sankhyablocks/p-294df368.entry.js +1 -0
- package/dist/sankhyablocks/p-2ac8bd11.entry.js +1 -0
- package/dist/sankhyablocks/p-32062be4.entry.js +1 -0
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-3f1efb97.entry.js +1 -0
- package/dist/sankhyablocks/p-47b60deb.entry.js +1 -0
- package/dist/sankhyablocks/p-4ce73e88.js +1 -0
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-58687027.entry.js +1 -0
- package/dist/sankhyablocks/p-5fa1576b.entry.js +11 -0
- package/dist/sankhyablocks/p-61dd89eb.js +1 -0
- package/dist/sankhyablocks/p-672302c3.js +60 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/p-7663f597.entry.js +1 -0
- package/dist/sankhyablocks/p-8322ccdb.entry.js +1 -0
- package/dist/sankhyablocks/p-913a9979.js +1 -0
- package/dist/sankhyablocks/p-9863d682.js +1 -0
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/p-a64baa0f.entry.js +1 -0
- package/dist/sankhyablocks/p-af8efd95.js +6 -0
- package/dist/sankhyablocks/p-aff76a53.js +56 -0
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
- package/dist/sankhyablocks/p-ba05fdb8.entry.js +1 -0
- package/dist/sankhyablocks/p-babe7665.js +1 -0
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-d26365ad.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-dc7c9047.js} +1 -1
- package/dist/sankhyablocks/p-df5451c7.js +26 -0
- package/dist/sankhyablocks/p-e5c25e0b.entry.js +1 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/p-f88cfc3c.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 +27 -5
- 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 +34 -10
- 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/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +57 -1
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +24 -1
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +28 -3
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +30 -1
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +6 -0
- 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 +24 -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-data-unit/snk-data-unit.d.ts +61 -2
- package/dist/types/components/snk-data-unit/test/resources/metadataMock.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 +31 -1
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
- package/dist/types/components/snk-form/snk-form.d.ts +20 -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 +69 -7
- 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 +142 -6
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +38 -1
- package/dist/types/components.d.ts +536 -18
- package/dist/types/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.d.ts +11 -0
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -3
- package/dist/types/lib/dataUnit/ValueFormatter.d.ts +2 -0
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
- package/dist/types/lib/dataUnit/interfaces/InMemoryLoaderConfig.d.ts +3 -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/interfaces/IBuildRequestBodyLoadRowMetadata.d.ts +10 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRowMetadata.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/test/resources/metadataMock.d.ts +20 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +3 -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/snk-data-unit-1bc69073.js +0 -462
- 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/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/snk-data-unit-6208ebf0.js +0 -460
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-03dcc5ff.entry.js +0 -1
- 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-1d75d9f9.entry.js +0 -1
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-25927311.entry.js +0 -1
- package/dist/sankhyablocks/p-32f0935f.js +0 -1
- package/dist/sankhyablocks/p-374d03f6.js +0 -1
- package/dist/sankhyablocks/p-3891ae6f.js +0 -60
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-573a07c5.js +0 -1
- package/dist/sankhyablocks/p-5f74c859.entry.js +0 -1
- package/dist/sankhyablocks/p-69754d94.entry.js +0 -1
- package/dist/sankhyablocks/p-6977a26c.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-761ed32f.entry.js +0 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-8d70b5d5.entry.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e4bb55.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-aa0ae6bc.entry.js +0 -1
- package/dist/sankhyablocks/p-aa95fb2c.js +0 -56
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-ba3d3fa9.entry.js +0 -11
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-c4d19840.entry.js +0 -1
- package/dist/sankhyablocks/p-c6e477ff.js +0 -1
- package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
- package/dist/sankhyablocks/p-cb7419e0.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d81f20c4.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-e6380c60.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,22 +1,92 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import {
|
2
|
+
import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
4
5
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
5
6
|
import './DataFetcher.js';
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import {
|
7
|
+
import './pesquisa-fetcher.js';
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, R as RmPrecisionCustomValueFormatter, b as buildFieldSearch, o as openFieldSearch, a as CrudUtils } from './IExporterProvider.js';
|
9
|
+
import { D as DataExporterOption, P as PresentationMode } from './ISave.js';
|
9
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
12
|
+
import { I as InMemoryLoader } from './dataunit-fetcher.js';
|
11
13
|
import './filter-item-type.enum.js';
|
12
|
-
import './form-config-fetcher.js';
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import {
|
14
|
+
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
15
|
+
import { C as ConfigStorage } from './ConfigStorage.js';
|
16
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
|
17
|
+
import { g as getSelectedIDs, d as defineCustomElement$9 } from './snk-data-unit2.js';
|
18
|
+
import { s as store } from './index2.js';
|
19
|
+
import { d as defineCustomElement$d } from './snk-actions-button2.js';
|
20
|
+
import { d as defineCustomElement$c } from './snk-config-options2.js';
|
21
|
+
import { d as defineCustomElement$b } from './snk-configurator2.js';
|
22
|
+
import { d as defineCustomElement$a } from './snk-data-exporter2.js';
|
23
|
+
import { d as defineCustomElement$8 } from './snk-exporter-email-sender2.js';
|
24
|
+
import { d as defineCustomElement$7 } from './snk-field-config2.js';
|
25
|
+
import { d as defineCustomElement$6 } from './snk-form-config2.js';
|
26
|
+
import { d as defineCustomElement$5 } from './snk-grid-config2.js';
|
27
|
+
import { d as defineCustomElement$4 } from './snk-select-box2.js';
|
28
|
+
import { d as defineCustomElement$3 } from './snk-tab-config2.js';
|
17
29
|
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
18
30
|
|
19
|
-
const
|
31
|
+
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
32
|
+
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
33
|
+
|
34
|
+
class ClientSideExporterProvider extends CommonsExporter {
|
35
|
+
getSelectedNumber() {
|
36
|
+
return this.dataUnit.getSelectionInfo().length;
|
37
|
+
}
|
38
|
+
getTotalRecords() {
|
39
|
+
var _a, _b, _c;
|
40
|
+
const { total } = ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo()) || {};
|
41
|
+
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
42
|
+
}
|
43
|
+
getSelectedIDs() {
|
44
|
+
return getSelectedIDs(this.dataUnit);
|
45
|
+
}
|
46
|
+
getRecordID() {
|
47
|
+
var _a, _b, _c;
|
48
|
+
return (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
49
|
+
}
|
50
|
+
async getRecords() {
|
51
|
+
if (this.dataUnit.records.length === 0) {
|
52
|
+
return Promise.resolve([]);
|
53
|
+
}
|
54
|
+
const selectionInfo = this.dataUnit.getSelectionInfo();
|
55
|
+
const records = selectionInfo.isEmpty() || selectionInfo.isAllRecords() ? await selectionInfo.getAllRecords() : selectionInfo.records;
|
56
|
+
return Promise.resolve(records == undefined ? [] : records);
|
57
|
+
}
|
58
|
+
getHiddenOptions() {
|
59
|
+
return [
|
60
|
+
DataExporterOption.EXPORT_BY_EMAIL,
|
61
|
+
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
62
|
+
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
63
|
+
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
64
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
65
|
+
];
|
66
|
+
}
|
67
|
+
formatValue(record, column) {
|
68
|
+
const { id, descriptionFrom } = column;
|
69
|
+
const value = record[descriptionFrom || id];
|
70
|
+
if (value == undefined) {
|
71
|
+
return "";
|
72
|
+
}
|
73
|
+
if (descriptionFrom != undefined) {
|
74
|
+
return value.label;
|
75
|
+
}
|
76
|
+
const fieldDescriptor = this.dataUnit.getField(id);
|
77
|
+
if (fieldDescriptor.userInterface === UserInterface.SEARCH) {
|
78
|
+
return value.value;
|
79
|
+
}
|
80
|
+
if (column.customFormatter) {
|
81
|
+
const ezGridColumn = this.getColumnsState().find(columnState => column.id === columnState.name);
|
82
|
+
const formattedValue = column.customFormatter.format(value, ezGridColumn, record.__record__id__);
|
83
|
+
return formattedValue;
|
84
|
+
}
|
85
|
+
return this.dataUnit.getFormattedValue(id, value);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
|
20
90
|
|
21
91
|
const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
22
92
|
constructor() {
|
@@ -26,31 +96,118 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
26
96
|
this.dataUnitReady = createEvent(this, "dataUnitReady", 3);
|
27
97
|
this.actionClick = createEvent(this, "actionClick", 7);
|
28
98
|
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
29
|
-
this.
|
30
|
-
this.
|
99
|
+
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
100
|
+
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
31
101
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
32
102
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
103
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
104
|
+
this._customEditors = new Map();
|
105
|
+
this._customRenders = new Map();
|
33
106
|
this._taskbarProcessor = new TaskbarProcessor({
|
34
|
-
"snkSimpleCrudTaskbar.form_regular": this.
|
35
|
-
"snkSimpleCrudTaskbar.grid_regular": this.
|
36
|
-
"snkSimpleCrudTaskbar.form_selected": this.
|
37
|
-
"snkSimpleCrudTaskbar.grid_selected": this.
|
107
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
|
108
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
109
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
|
110
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
38
111
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
39
112
|
});
|
113
|
+
this._showPopUpGridConfig = false;
|
114
|
+
this._showFormConfig = false;
|
40
115
|
this._currentViewMode = VIEW_MODE.GRID;
|
41
116
|
this._config = undefined;
|
42
117
|
this._fieldToGetFocus = undefined;
|
118
|
+
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
43
119
|
this.dataState = undefined;
|
44
120
|
this.dataUnit = undefined;
|
121
|
+
this.entityName = undefined;
|
45
122
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
46
123
|
this.gridConfig = undefined;
|
47
124
|
this.formConfig = undefined;
|
48
125
|
this._formFields = [];
|
126
|
+
this._fieldsProps = new Map();
|
49
127
|
this.multipleSelection = undefined;
|
50
128
|
this.useCancelConfirm = true;
|
129
|
+
this.pageSize = 150;
|
130
|
+
this.resourceID = undefined;
|
51
131
|
this.taskbarManager = undefined;
|
52
132
|
this.messagesBuilder = undefined;
|
53
133
|
this.useEnterLikeTab = false;
|
134
|
+
this.actionsList = undefined;
|
135
|
+
this.configName = undefined;
|
136
|
+
this.showConfiguratorButtons = undefined;
|
137
|
+
this.gridLegacyConfigName = undefined;
|
138
|
+
this.formLegacyConfigName = undefined;
|
139
|
+
this.ignoreReadOnlyFormFields = false;
|
140
|
+
this.autoFocus = true;
|
141
|
+
this.autoLoad = undefined;
|
142
|
+
}
|
143
|
+
/**
|
144
|
+
* Registra um editor customizado para campos da grade e formulário.
|
145
|
+
*/
|
146
|
+
async addCustomEditor(fieldName, customEditor) {
|
147
|
+
if (this._grid && this._form) {
|
148
|
+
this._grid.addCustomEditor(fieldName, customEditor);
|
149
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
150
|
+
return;
|
151
|
+
}
|
152
|
+
const newCustomEditors = new Map(this._customEditors);
|
153
|
+
newCustomEditors.set(fieldName, customEditor);
|
154
|
+
this._customEditors = newCustomEditors;
|
155
|
+
}
|
156
|
+
/**
|
157
|
+
* Registra um render customizado para colunas da grid.
|
158
|
+
*/
|
159
|
+
async addGridCustomRender(fieldName, customRender) {
|
160
|
+
if (this._grid) {
|
161
|
+
this._grid.addGridCustomRender(fieldName, customRender);
|
162
|
+
return;
|
163
|
+
}
|
164
|
+
const newCustomRenders = new Map(this._customRenders);
|
165
|
+
newCustomRenders.set(fieldName, customRender);
|
166
|
+
this._customRenders = newCustomRenders;
|
167
|
+
}
|
168
|
+
handleResourceIDChanged(newValue, oldValue) {
|
169
|
+
if (StringUtils.isEmpty(newValue)) {
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
if (newValue === oldValue) {
|
173
|
+
return;
|
174
|
+
}
|
175
|
+
this.loadFormConfig(true);
|
176
|
+
this.loadGridConfig(true);
|
177
|
+
}
|
178
|
+
/**
|
179
|
+
* Registra um formatador de valores para uma coluna da grid.
|
180
|
+
*/
|
181
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
182
|
+
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
183
|
+
}
|
184
|
+
/**
|
185
|
+
* Remove o formatador de valores de uma coluna da grid.
|
186
|
+
*/
|
187
|
+
async removeCustomValueFormatter(columnName) {
|
188
|
+
this._grid.removeCustomValueFormatter(columnName);
|
189
|
+
}
|
190
|
+
/**
|
191
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
192
|
+
*/
|
193
|
+
async setFieldProp(fieldName, propName, value) {
|
194
|
+
const newCustomFieldProps = new Map(this._fieldsProps);
|
195
|
+
const currentProps = this._fieldsProps.get(fieldName);
|
196
|
+
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
197
|
+
this._fieldsProps = newCustomFieldProps;
|
198
|
+
}
|
199
|
+
getButtons(selected, extraButtons) {
|
200
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
201
|
+
.concat(extraButtons));
|
202
|
+
}
|
203
|
+
addConfigButton(buttons) {
|
204
|
+
if (this.configName === undefined) {
|
205
|
+
return buttons;
|
206
|
+
}
|
207
|
+
return buttons.concat(TaskbarElement.CONFIGURATOR);
|
208
|
+
}
|
209
|
+
get application() {
|
210
|
+
return ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
54
211
|
}
|
55
212
|
resolveInMemoryBtns(taskbarButtons) {
|
56
213
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -70,7 +227,10 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
70
227
|
}
|
71
228
|
actionClickListener(evt) {
|
72
229
|
const act = evt.detail;
|
73
|
-
if (act === TaskbarElement.
|
230
|
+
if (act === TaskbarElement.CONFIGURATOR) {
|
231
|
+
this._snkConfigurator.open();
|
232
|
+
}
|
233
|
+
else if (act === TaskbarElement.GRID_MODE) {
|
74
234
|
this.goToView(VIEW_MODE.GRID);
|
75
235
|
}
|
76
236
|
else if (act === TaskbarElement.FORM_MODE) {
|
@@ -78,43 +238,220 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
78
238
|
}
|
79
239
|
evt.stopPropagation();
|
80
240
|
}
|
241
|
+
async onChangeEntityName(newValue) {
|
242
|
+
if (this.dataUnit)
|
243
|
+
return;
|
244
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
245
|
+
this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
|
246
|
+
}
|
81
247
|
onModeChange() {
|
82
248
|
if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
|
83
249
|
this.initInMemoryDataUnit();
|
84
250
|
}
|
85
251
|
}
|
86
252
|
observeDataState(newValue, oldValue) {
|
253
|
+
this.handleDataStateChange(newValue, oldValue);
|
254
|
+
}
|
255
|
+
async observeFormLegacy(newValue, oldValue) {
|
256
|
+
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
257
|
+
}
|
258
|
+
async observeGridLegacy(newValue, oldValue) {
|
259
|
+
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
260
|
+
}
|
261
|
+
async handleDataStateChange(newValue, oldValue) {
|
87
262
|
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
88
263
|
this.dataStateChange.emit(newValue);
|
89
264
|
}
|
265
|
+
await this.processRmPrecision();
|
266
|
+
}
|
267
|
+
async processRmPrecision() {
|
268
|
+
var _a, _b;
|
269
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
270
|
+
for (const field of fieldsWithRmPrecision || []) {
|
271
|
+
if (!field) {
|
272
|
+
continue;
|
273
|
+
}
|
274
|
+
const rmPrecision = (_b = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata) === null || _b === void 0 ? void 0 : _b.getProp('rm_precision', field);
|
275
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
276
|
+
continue;
|
277
|
+
}
|
278
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
279
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
280
|
+
}
|
281
|
+
this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
|
282
|
+
}
|
283
|
+
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
284
|
+
if (newValue == undefined || newValue == oldValue) {
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
if (!this._gridConfigAlreadyLoaded) {
|
288
|
+
return;
|
289
|
+
}
|
290
|
+
await this.loadGridConfig(true);
|
291
|
+
}
|
292
|
+
async handleUpdateFormLegacyConfig(newValue, oldValue) {
|
293
|
+
if (newValue == undefined || newValue == oldValue) {
|
294
|
+
return;
|
295
|
+
}
|
296
|
+
if (!this._formConfigAlreadyLoaded) {
|
297
|
+
return;
|
298
|
+
}
|
299
|
+
this.loadFormConfig(true);
|
300
|
+
}
|
301
|
+
openConfig(viewMode) {
|
302
|
+
this._snkConfigurator.close();
|
303
|
+
if (viewMode === VIEW_MODE.GRID) {
|
304
|
+
this.openGridConfig();
|
305
|
+
}
|
306
|
+
else if (viewMode === VIEW_MODE.FORM) {
|
307
|
+
this.openFormConfig();
|
308
|
+
}
|
309
|
+
}
|
310
|
+
openGridConfig() {
|
311
|
+
this._grid.getColumnsState()
|
312
|
+
.then((gridColumns) => {
|
313
|
+
this._snkGridConfig.columns = gridColumns.filter(c => c.name);
|
314
|
+
this._snkGridConfig.selectedIndex = 0;
|
315
|
+
this._showPopUpGridConfig = true;
|
316
|
+
});
|
317
|
+
}
|
318
|
+
async openFormConfig() {
|
319
|
+
var _a, _b;
|
320
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
321
|
+
if (this.formLegacyConfigName) {
|
322
|
+
const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
|
323
|
+
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
|
324
|
+
await this.application.alert(title, message);
|
325
|
+
return;
|
326
|
+
}
|
327
|
+
this._showFormConfig = true;
|
90
328
|
}
|
91
|
-
|
329
|
+
addGridLegacyConfigName() {
|
330
|
+
if (this.gridLegacyConfigName && this.configName) {
|
331
|
+
ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
332
|
+
}
|
333
|
+
}
|
334
|
+
loadGridConfig(forceUpdate) {
|
335
|
+
if (this.configName === undefined) {
|
336
|
+
return;
|
337
|
+
}
|
338
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
339
|
+
return;
|
340
|
+
}
|
341
|
+
this.addGridLegacyConfigName();
|
342
|
+
this._gridConfigAlreadyLoaded = true;
|
343
|
+
return new Promise((accept, reject) => {
|
344
|
+
ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
|
345
|
+
.then(config => {
|
346
|
+
this.setGridConfig(config);
|
347
|
+
accept();
|
348
|
+
})
|
349
|
+
.catch(reason => {
|
350
|
+
reject(reason);
|
351
|
+
});
|
352
|
+
});
|
353
|
+
}
|
354
|
+
formConfigIsLoaded() {
|
355
|
+
return this.formConfig != undefined || this._formConfigAlreadyLoaded;
|
356
|
+
}
|
357
|
+
async loadFormConfig(forceLoad = false) {
|
358
|
+
if (this.configName === undefined) {
|
359
|
+
return;
|
360
|
+
}
|
361
|
+
if (this._formConfigManager == undefined) {
|
362
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
363
|
+
this._formConfigManager.setConfig(this.formConfig);
|
364
|
+
}
|
365
|
+
if (this.formConfigIsLoaded() && !forceLoad) {
|
366
|
+
return;
|
367
|
+
}
|
368
|
+
this._formConfigAlreadyLoaded = true;
|
369
|
+
let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
|
370
|
+
if (loadedLegacyConfig != undefined) {
|
371
|
+
this._formConfigManager.setConfig(loadedLegacyConfig);
|
372
|
+
this.setFormConfig(loadedLegacyConfig);
|
373
|
+
return;
|
374
|
+
}
|
375
|
+
this.setFormConfig(await this._formConfigManager.loadConfig());
|
376
|
+
}
|
377
|
+
async componentWillRender() {
|
378
|
+
this._resourceID = await this.application.getResourceID();
|
379
|
+
this.dataExporterProviderStore();
|
92
380
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
381
|
+
if (this.configName === undefined) {
|
382
|
+
return;
|
383
|
+
}
|
384
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
385
|
+
return;
|
386
|
+
}
|
387
|
+
await this.addGridLegacyConfigName();
|
388
|
+
this.loadGridConfig();
|
389
|
+
this.loadFormConfig();
|
390
|
+
}
|
391
|
+
componentDidRender() {
|
392
|
+
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
393
|
+
this.addGridCustomValueFormattters();
|
394
|
+
this.setFieldsProps();
|
395
|
+
this.setCustomRenders();
|
396
|
+
this.setCustomEditors();
|
93
397
|
}
|
94
398
|
componentWillLoad() {
|
95
399
|
this.processMetadata();
|
96
400
|
this.onModeChange();
|
97
401
|
this.configDatasource();
|
402
|
+
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
403
|
+
}
|
404
|
+
componentDidLoad() {
|
405
|
+
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
406
|
+
}
|
407
|
+
setCustomRenders() {
|
408
|
+
if (!this._grid) {
|
409
|
+
return;
|
410
|
+
}
|
411
|
+
for (const [fieldName, customRender] of this._customRenders) {
|
412
|
+
this._grid.addGridCustomRender(fieldName, customRender);
|
413
|
+
this._customRenders.delete(fieldName);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
setCustomEditors() {
|
417
|
+
if (!this._grid || !this._form) {
|
418
|
+
return;
|
419
|
+
}
|
420
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
421
|
+
this._grid.addCustomEditor(fieldName, customEditor);
|
422
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
423
|
+
this._customEditors.delete(fieldName);
|
424
|
+
}
|
98
425
|
}
|
99
426
|
configDatasource() {
|
100
|
-
|
101
|
-
this._multiSelectionListDataSource.setApplication(application);
|
427
|
+
this._multiSelectionListDataSource.setApplication(this.application);
|
102
428
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
103
429
|
}
|
430
|
+
setFieldsProps() {
|
431
|
+
if (!this._form) {
|
432
|
+
return;
|
433
|
+
}
|
434
|
+
for (const [fieldName, props] of this._fieldsProps) {
|
435
|
+
for (const prop in props) {
|
436
|
+
this._form.setFieldProp(fieldName, prop, props[prop]);
|
437
|
+
}
|
438
|
+
this._fieldsProps.delete(fieldName);
|
439
|
+
}
|
440
|
+
}
|
104
441
|
getTaskBarId() {
|
105
|
-
var _a, _b
|
442
|
+
var _a, _b;
|
106
443
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
107
444
|
return "snkSimpleCrudTaskbar.finish_edition";
|
108
445
|
}
|
109
446
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
110
447
|
!this.dataState.selectionInfo.isAllRecords() &&
|
111
|
-
|
448
|
+
this.dataState.selectionInfo.length > 0) {
|
112
449
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
113
450
|
}
|
114
451
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
115
452
|
}
|
116
453
|
initInMemoryDataUnit() {
|
117
|
-
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
454
|
+
this._inMemoryLoader = new InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
|
118
455
|
this.dataUnit = this._inMemoryLoader.dataUnit;
|
119
456
|
this.dataUnitReady.emit(this.dataUnit);
|
120
457
|
}
|
@@ -139,6 +476,26 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
139
476
|
getRecords() {
|
140
477
|
return Promise.resolve(this.dataUnit.records);
|
141
478
|
}
|
479
|
+
/**
|
480
|
+
* Usado para abrir o configurator do CRUD
|
481
|
+
*/
|
482
|
+
async openConfigurator() {
|
483
|
+
var _a;
|
484
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
485
|
+
}
|
486
|
+
/**
|
487
|
+
* Usado para fechar o configurator do CRUD
|
488
|
+
*/
|
489
|
+
async closeConfigurator() {
|
490
|
+
var _a;
|
491
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
492
|
+
}
|
493
|
+
async updateConfig() {
|
494
|
+
if (this._formConfigManager == undefined) {
|
495
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
496
|
+
}
|
497
|
+
this._formConfigManager.setConfig(this.formConfig);
|
498
|
+
}
|
142
499
|
processMetadata() {
|
143
500
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
144
501
|
const fieldMetadata = [];
|
@@ -169,11 +526,28 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
169
526
|
};
|
170
527
|
}
|
171
528
|
}
|
529
|
+
addGridCustomValueFormattters() {
|
530
|
+
var _a, _b, _c;
|
531
|
+
const metadataFields = ((_a = this._metadata) === null || _a === void 0 ? void 0 : _a.fields) || ((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.fields);
|
532
|
+
if (!metadataFields) {
|
533
|
+
return;
|
534
|
+
}
|
535
|
+
const fieldsWithRmPrecision = [];
|
536
|
+
metadataFields.forEach((field) => {
|
537
|
+
var _a;
|
538
|
+
if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
|
539
|
+
fieldsWithRmPrecision.push(field.name);
|
540
|
+
}
|
541
|
+
});
|
542
|
+
fieldsWithRmPrecision.forEach(field => {
|
543
|
+
this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
|
544
|
+
});
|
545
|
+
}
|
172
546
|
onDataStateChange(evt) {
|
173
547
|
this.dataState = Object.assign({}, evt.detail);
|
174
548
|
}
|
175
549
|
getTaskBarDisabledButtons() {
|
176
|
-
var _a, _b, _c, _d;
|
550
|
+
var _a, _b, _c, _d, _e, _f;
|
177
551
|
const disabledButtons = [];
|
178
552
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
179
553
|
disabledButtons.push(TaskbarElement.NEXT);
|
@@ -184,6 +558,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
184
558
|
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
185
559
|
disabledButtons.push(TaskbarElement.FORM_MODE);
|
186
560
|
}
|
561
|
+
if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
|
562
|
+
disabledButtons.push(TaskbarElement.CLONE);
|
563
|
+
}
|
187
564
|
return disabledButtons;
|
188
565
|
}
|
189
566
|
handleCancelEdit() {
|
@@ -193,6 +570,14 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
193
570
|
this.dataUnit.clearSelection();
|
194
571
|
}
|
195
572
|
}
|
573
|
+
handleConfiguratorEvent(evt, type) {
|
574
|
+
evt.stopImmediatePropagation();
|
575
|
+
if (type === 'SAVE') {
|
576
|
+
this.configuratorSave.emit();
|
577
|
+
return;
|
578
|
+
}
|
579
|
+
this.configuratorCancel.emit();
|
580
|
+
}
|
196
581
|
getColumnSearch(actionButton, item) {
|
197
582
|
if (this._columnSearch != undefined) {
|
198
583
|
return this._columnSearch;
|
@@ -234,7 +619,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
234
619
|
return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
|
235
620
|
}
|
236
621
|
handleFormSetFields(fields) {
|
237
|
-
this._formFields
|
622
|
+
if (!ObjectUtils.equals(this._formFields, fields)) {
|
623
|
+
this._formFields = fields !== null && fields !== void 0 ? fields : [];
|
624
|
+
}
|
238
625
|
}
|
239
626
|
fieldsOptionLoader(argument) {
|
240
627
|
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
@@ -249,7 +636,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
249
636
|
}
|
250
637
|
getActionsList() {
|
251
638
|
var _a, _b;
|
252
|
-
|
639
|
+
const hardList = [{
|
253
640
|
value: StringUtils.generateUUID(),
|
254
641
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
255
642
|
disableCloseOnSelect: true,
|
@@ -258,6 +645,16 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
258
645
|
? this.getColumnSearch(actionButton, item)
|
259
646
|
: this.getFieldSearch(actionButton, item)
|
260
647
|
}];
|
648
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
649
|
+
const taskbarID = this.getTopTaskBarId();
|
650
|
+
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
651
|
+
}
|
652
|
+
return hardList.concat(this.actionsList);
|
653
|
+
}
|
654
|
+
getTopTaskBarId() {
|
655
|
+
var _a;
|
656
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
|
657
|
+
`snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
|
261
658
|
}
|
262
659
|
async keyDownListener(event) {
|
263
660
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
@@ -296,43 +693,149 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
296
693
|
disconnectedCallback() {
|
297
694
|
window.removeEventListener("keydown", this._keyDownHandler);
|
298
695
|
}
|
696
|
+
gridConfigChangeHandler(evt) {
|
697
|
+
const config = evt.detail;
|
698
|
+
ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
699
|
+
evt.stopPropagation();
|
700
|
+
}
|
701
|
+
modalConfigChangeHandler(evt) {
|
702
|
+
const config = evt.detail;
|
703
|
+
this._grid.setColumnsState(config.columns)
|
704
|
+
.then(() => {
|
705
|
+
this.setGridConfig(config);
|
706
|
+
this.closeGridConfig();
|
707
|
+
this.dataExporterProviderStore();
|
708
|
+
});
|
709
|
+
evt.stopPropagation();
|
710
|
+
}
|
711
|
+
async dataExporterProviderStore() {
|
712
|
+
if (this.dataUnit == undefined) {
|
713
|
+
return;
|
714
|
+
}
|
715
|
+
if (this._grid == undefined) {
|
716
|
+
return;
|
717
|
+
}
|
718
|
+
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
719
|
+
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
720
|
+
}
|
721
|
+
getDataExporterStoreKey() {
|
722
|
+
return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
|
723
|
+
}
|
724
|
+
setGridConfig(config) {
|
725
|
+
this.gridConfig = config;
|
726
|
+
CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
727
|
+
}
|
728
|
+
setFormConfig(config, forceUpdate) {
|
729
|
+
if (this.formConfig && !forceUpdate)
|
730
|
+
return;
|
731
|
+
this.formConfig = config;
|
732
|
+
}
|
733
|
+
closeGridConfig() {
|
734
|
+
this._showPopUpGridConfig = false;
|
735
|
+
}
|
736
|
+
closeFormConfig() {
|
737
|
+
this._showFormConfig = false;
|
738
|
+
}
|
739
|
+
getPageSize() {
|
740
|
+
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
741
|
+
return 0;
|
742
|
+
}
|
743
|
+
if (this.pageSize == undefined) {
|
744
|
+
return 150;
|
745
|
+
}
|
746
|
+
return this.pageSize;
|
747
|
+
}
|
748
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
749
|
+
handleShowFormConfig() {
|
750
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
751
|
+
}
|
752
|
+
resolveResourceID() {
|
753
|
+
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
754
|
+
}
|
755
|
+
getFormConfig() {
|
756
|
+
var _a, _b;
|
757
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
758
|
+
if (!this.configName && !configFromManager) {
|
759
|
+
return this.formConfig;
|
760
|
+
}
|
761
|
+
return configFromManager;
|
762
|
+
}
|
763
|
+
updateFormConfig() {
|
764
|
+
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
765
|
+
this.setFormConfig(newConfig, true);
|
766
|
+
if (this._formConfigManager == undefined) {
|
767
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
768
|
+
}
|
769
|
+
this._formConfigManager.setConfig(this.formConfig);
|
770
|
+
}
|
771
|
+
/* istanbul ignore next */
|
299
772
|
render() {
|
300
773
|
var _a;
|
301
|
-
|
774
|
+
if (this.dataUnit == undefined) {
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
302
778
|
? undefined
|
303
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.
|
779
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
304
780
|
}
|
305
781
|
get _element() { return this; }
|
306
782
|
static get watchers() { return {
|
783
|
+
"resourceID": ["handleResourceIDChanged"],
|
784
|
+
"entityName": ["onChangeEntityName"],
|
307
785
|
"mode": ["onModeChange"],
|
308
|
-
"dataState": ["observeDataState"]
|
786
|
+
"dataState": ["observeDataState"],
|
787
|
+
"formLegacyConfigName": ["observeFormLegacy"],
|
788
|
+
"gridLegacyConfigName": ["observeGridLegacy"]
|
309
789
|
}; }
|
310
790
|
static get style() { return snkSimpleCrudCss; }
|
311
791
|
}, [6, "snk-simple-crud", {
|
312
792
|
"dataState": [16],
|
313
793
|
"dataUnit": [16],
|
794
|
+
"entityName": [1, "entity-name"],
|
314
795
|
"mode": [2],
|
315
|
-
"gridConfig": [
|
316
|
-
"formConfig": [
|
796
|
+
"gridConfig": [1040],
|
797
|
+
"formConfig": [1040],
|
317
798
|
"multipleSelection": [4, "multiple-selection"],
|
318
799
|
"useCancelConfirm": [4, "use-cancel-confirm"],
|
800
|
+
"pageSize": [2, "page-size"],
|
801
|
+
"resourceID": [1, "resource-i-d"],
|
319
802
|
"taskbarManager": [16],
|
320
803
|
"messagesBuilder": [1040],
|
321
804
|
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
805
|
+
"actionsList": [16],
|
806
|
+
"configName": [1025, "config-name"],
|
807
|
+
"showConfiguratorButtons": [4, "show-configurator-buttons"],
|
808
|
+
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
809
|
+
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
810
|
+
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
811
|
+
"autoFocus": [4, "auto-focus"],
|
812
|
+
"autoLoad": [4, "auto-load"],
|
813
|
+
"_showPopUpGridConfig": [32],
|
814
|
+
"_showFormConfig": [32],
|
322
815
|
"_currentViewMode": [32],
|
323
816
|
"_config": [32],
|
324
817
|
"_fieldToGetFocus": [32],
|
818
|
+
"_customContainerId": [32],
|
325
819
|
"_formFields": [32],
|
820
|
+
"_fieldsProps": [32],
|
821
|
+
"addCustomEditor": [64],
|
822
|
+
"addGridCustomRender": [64],
|
823
|
+
"addCustomValueFormatter": [64],
|
824
|
+
"removeCustomValueFormatter": [64],
|
825
|
+
"setFieldProp": [64],
|
326
826
|
"goToView": [64],
|
327
827
|
"setMetadata": [64],
|
328
828
|
"setRecords": [64],
|
329
|
-
"getRecords": [64]
|
829
|
+
"getRecords": [64],
|
830
|
+
"openConfigurator": [64],
|
831
|
+
"closeConfigurator": [64],
|
832
|
+
"updateConfig": [64]
|
330
833
|
}, [[0, "actionClick", "actionClickListener"]]]);
|
331
834
|
function defineCustomElement() {
|
332
835
|
if (typeof customElements === "undefined") {
|
333
836
|
return;
|
334
837
|
}
|
335
|
-
const components = ["snk-simple-crud", "snk-actions-button", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-taskbar", "taskbar-actions-button"];
|
838
|
+
const components = ["snk-simple-crud", "snk-actions-button", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-grid-config", "snk-select-box", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
|
336
839
|
components.forEach(tagName => { switch (tagName) {
|
337
840
|
case "snk-simple-crud":
|
338
841
|
if (!customElements.get(tagName)) {
|
@@ -341,20 +844,55 @@ function defineCustomElement() {
|
|
341
844
|
break;
|
342
845
|
case "snk-actions-button":
|
343
846
|
if (!customElements.get(tagName)) {
|
344
|
-
defineCustomElement$
|
847
|
+
defineCustomElement$d();
|
848
|
+
}
|
849
|
+
break;
|
850
|
+
case "snk-config-options":
|
851
|
+
if (!customElements.get(tagName)) {
|
852
|
+
defineCustomElement$c();
|
853
|
+
}
|
854
|
+
break;
|
855
|
+
case "snk-configurator":
|
856
|
+
if (!customElements.get(tagName)) {
|
857
|
+
defineCustomElement$b();
|
345
858
|
}
|
346
859
|
break;
|
347
860
|
case "snk-data-exporter":
|
348
861
|
if (!customElements.get(tagName)) {
|
349
|
-
defineCustomElement$
|
862
|
+
defineCustomElement$a();
|
350
863
|
}
|
351
864
|
break;
|
352
865
|
case "snk-data-unit":
|
353
866
|
if (!customElements.get(tagName)) {
|
354
|
-
defineCustomElement$
|
867
|
+
defineCustomElement$9();
|
355
868
|
}
|
356
869
|
break;
|
357
870
|
case "snk-exporter-email-sender":
|
871
|
+
if (!customElements.get(tagName)) {
|
872
|
+
defineCustomElement$8();
|
873
|
+
}
|
874
|
+
break;
|
875
|
+
case "snk-field-config":
|
876
|
+
if (!customElements.get(tagName)) {
|
877
|
+
defineCustomElement$7();
|
878
|
+
}
|
879
|
+
break;
|
880
|
+
case "snk-form-config":
|
881
|
+
if (!customElements.get(tagName)) {
|
882
|
+
defineCustomElement$6();
|
883
|
+
}
|
884
|
+
break;
|
885
|
+
case "snk-grid-config":
|
886
|
+
if (!customElements.get(tagName)) {
|
887
|
+
defineCustomElement$5();
|
888
|
+
}
|
889
|
+
break;
|
890
|
+
case "snk-select-box":
|
891
|
+
if (!customElements.get(tagName)) {
|
892
|
+
defineCustomElement$4();
|
893
|
+
}
|
894
|
+
break;
|
895
|
+
case "snk-tab-config":
|
358
896
|
if (!customElements.get(tagName)) {
|
359
897
|
defineCustomElement$3();
|
360
898
|
}
|