@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,39 +1,131 @@
|
|
1
|
-
import { ApplicationContext, DataType, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
1
|
+
import { ApplicationContext, DataType, ElementIDUtils, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
2
|
+
import { CSSVarsUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
2
3
|
import { h } from '@stencil/core';
|
3
4
|
import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
|
4
5
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
5
|
-
import { PresentationMode } from '../../lib';
|
6
|
+
import { CrudUtils, FormConfigFetcher, PresentationMode } from '../../lib';
|
6
7
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
7
8
|
import InMemoryLoader from '../../lib/dataUnit/InMemoryLoader';
|
8
9
|
import SnkMultiSelectionListDataSource from '../snk-grid/filtercolumn/SnkMultiSelectionListDataSource';
|
9
10
|
import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
11
|
+
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
12
|
+
import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
|
13
|
+
import { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS } from './regular-buttons';
|
14
|
+
import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
|
15
|
+
import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
|
16
|
+
import store from "../../lib/store";
|
10
17
|
export class SnkSimpleCrud {
|
11
18
|
constructor() {
|
12
|
-
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
13
|
-
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
14
19
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
15
20
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
21
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
22
|
+
this._customEditors = new Map();
|
23
|
+
this._customRenders = new Map();
|
16
24
|
this._taskbarProcessor = new TaskbarProcessor({
|
17
|
-
"snkSimpleCrudTaskbar.form_regular": this.
|
18
|
-
"snkSimpleCrudTaskbar.grid_regular": this.
|
19
|
-
"snkSimpleCrudTaskbar.form_selected": this.
|
20
|
-
"snkSimpleCrudTaskbar.grid_selected": this.
|
25
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
|
26
|
+
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
27
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
|
28
|
+
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
21
29
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
22
30
|
});
|
31
|
+
this._showPopUpGridConfig = false;
|
32
|
+
this._showFormConfig = false;
|
23
33
|
this._currentViewMode = VIEW_MODE.GRID;
|
24
34
|
this._config = undefined;
|
25
35
|
this._fieldToGetFocus = undefined;
|
36
|
+
this._customContainerId = `SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
26
37
|
this.dataState = undefined;
|
27
38
|
this.dataUnit = undefined;
|
39
|
+
this.entityName = undefined;
|
28
40
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
29
41
|
this.gridConfig = undefined;
|
30
42
|
this.formConfig = undefined;
|
31
43
|
this._formFields = [];
|
44
|
+
this._fieldsProps = new Map();
|
32
45
|
this.multipleSelection = undefined;
|
33
46
|
this.useCancelConfirm = true;
|
47
|
+
this.pageSize = 150;
|
48
|
+
this.resourceID = undefined;
|
34
49
|
this.taskbarManager = undefined;
|
35
50
|
this.messagesBuilder = undefined;
|
36
51
|
this.useEnterLikeTab = false;
|
52
|
+
this.actionsList = undefined;
|
53
|
+
this.configName = undefined;
|
54
|
+
this.showConfiguratorButtons = undefined;
|
55
|
+
this.gridLegacyConfigName = undefined;
|
56
|
+
this.formLegacyConfigName = undefined;
|
57
|
+
this.ignoreReadOnlyFormFields = false;
|
58
|
+
this.autoFocus = true;
|
59
|
+
this.autoLoad = undefined;
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Registra um editor customizado para campos da grade e formulário.
|
63
|
+
*/
|
64
|
+
async addCustomEditor(fieldName, customEditor) {
|
65
|
+
if (this._grid && this._form) {
|
66
|
+
this._grid.addCustomEditor(fieldName, customEditor);
|
67
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
const newCustomEditors = new Map(this._customEditors);
|
71
|
+
newCustomEditors.set(fieldName, customEditor);
|
72
|
+
this._customEditors = newCustomEditors;
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* Registra um render customizado para colunas da grid.
|
76
|
+
*/
|
77
|
+
async addGridCustomRender(fieldName, customRender) {
|
78
|
+
if (this._grid) {
|
79
|
+
this._grid.addGridCustomRender(fieldName, customRender);
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
const newCustomRenders = new Map(this._customRenders);
|
83
|
+
newCustomRenders.set(fieldName, customRender);
|
84
|
+
this._customRenders = newCustomRenders;
|
85
|
+
}
|
86
|
+
handleResourceIDChanged(newValue, oldValue) {
|
87
|
+
if (StringUtils.isEmpty(newValue)) {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
if (newValue === oldValue) {
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
this.loadFormConfig(true);
|
94
|
+
this.loadGridConfig(true);
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* Registra um formatador de valores para uma coluna da grid.
|
98
|
+
*/
|
99
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
100
|
+
this._grid.addCustomValueFormatter(columnName, customFormatter);
|
101
|
+
}
|
102
|
+
/**
|
103
|
+
* Remove o formatador de valores de uma coluna da grid.
|
104
|
+
*/
|
105
|
+
async removeCustomValueFormatter(columnName) {
|
106
|
+
this._grid.removeCustomValueFormatter(columnName);
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
110
|
+
*/
|
111
|
+
async setFieldProp(fieldName, propName, value) {
|
112
|
+
const newCustomFieldProps = new Map(this._fieldsProps);
|
113
|
+
const currentProps = this._fieldsProps.get(fieldName);
|
114
|
+
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
115
|
+
this._fieldsProps = newCustomFieldProps;
|
116
|
+
}
|
117
|
+
getButtons(selected, extraButtons) {
|
118
|
+
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
119
|
+
.concat(extraButtons));
|
120
|
+
}
|
121
|
+
addConfigButton(buttons) {
|
122
|
+
if (this.configName === undefined) {
|
123
|
+
return buttons;
|
124
|
+
}
|
125
|
+
return buttons.concat(TaskbarElement.CONFIGURATOR);
|
126
|
+
}
|
127
|
+
get application() {
|
128
|
+
return ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
37
129
|
}
|
38
130
|
resolveInMemoryBtns(taskbarButtons) {
|
39
131
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -53,7 +145,10 @@ export class SnkSimpleCrud {
|
|
53
145
|
}
|
54
146
|
actionClickListener(evt) {
|
55
147
|
const act = evt.detail;
|
56
|
-
if (act === TaskbarElement.
|
148
|
+
if (act === TaskbarElement.CONFIGURATOR) {
|
149
|
+
this._snkConfigurator.open();
|
150
|
+
}
|
151
|
+
else if (act === TaskbarElement.GRID_MODE) {
|
57
152
|
this.goToView(VIEW_MODE.GRID);
|
58
153
|
}
|
59
154
|
else if (act === TaskbarElement.FORM_MODE) {
|
@@ -61,43 +156,221 @@ export class SnkSimpleCrud {
|
|
61
156
|
}
|
62
157
|
evt.stopPropagation();
|
63
158
|
}
|
159
|
+
async onChangeEntityName(newValue) {
|
160
|
+
if (this.dataUnit)
|
161
|
+
return;
|
162
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
163
|
+
this.dataUnit = await application.getDataUnit(newValue, null, null, this.configName);
|
164
|
+
}
|
64
165
|
onModeChange() {
|
65
166
|
if (this.mode == SIMPLE_CRUD_MODE.IN_MEMORY) {
|
66
167
|
this.initInMemoryDataUnit();
|
67
168
|
}
|
68
169
|
}
|
69
170
|
observeDataState(newValue, oldValue) {
|
171
|
+
this.handleDataStateChange(newValue, oldValue);
|
172
|
+
}
|
173
|
+
async observeFormLegacy(newValue, oldValue) {
|
174
|
+
await this.handleUpdateFormLegacyConfig(newValue, oldValue);
|
175
|
+
}
|
176
|
+
async observeGridLegacy(newValue, oldValue) {
|
177
|
+
await this.handleUpdateGridLegacyConfig(newValue, oldValue);
|
178
|
+
}
|
179
|
+
async handleDataStateChange(newValue, oldValue) {
|
70
180
|
if (ObjectUtils.objectToString(oldValue) != ObjectUtils.objectToString(newValue)) {
|
71
181
|
this.dataStateChange.emit(newValue);
|
72
182
|
}
|
183
|
+
await this.processRmPrecision();
|
184
|
+
}
|
185
|
+
async processRmPrecision() {
|
186
|
+
var _a, _b;
|
187
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
188
|
+
for (const field of fieldsWithRmPrecision || []) {
|
189
|
+
if (!field) {
|
190
|
+
continue;
|
191
|
+
}
|
192
|
+
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);
|
193
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
194
|
+
continue;
|
195
|
+
}
|
196
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
197
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
198
|
+
}
|
199
|
+
;
|
200
|
+
this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
|
201
|
+
}
|
202
|
+
async handleUpdateGridLegacyConfig(newValue, oldValue) {
|
203
|
+
if (newValue == undefined || newValue == oldValue) {
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
if (!this._gridConfigAlreadyLoaded) {
|
207
|
+
return;
|
208
|
+
}
|
209
|
+
await this.loadGridConfig(true);
|
210
|
+
}
|
211
|
+
async handleUpdateFormLegacyConfig(newValue, oldValue) {
|
212
|
+
if (newValue == undefined || newValue == oldValue) {
|
213
|
+
return;
|
214
|
+
}
|
215
|
+
if (!this._formConfigAlreadyLoaded) {
|
216
|
+
return;
|
217
|
+
}
|
218
|
+
this.loadFormConfig(true);
|
219
|
+
}
|
220
|
+
openConfig(viewMode) {
|
221
|
+
this._snkConfigurator.close();
|
222
|
+
if (viewMode === VIEW_MODE.GRID) {
|
223
|
+
this.openGridConfig();
|
224
|
+
}
|
225
|
+
else if (viewMode === VIEW_MODE.FORM) {
|
226
|
+
this.openFormConfig();
|
227
|
+
}
|
228
|
+
}
|
229
|
+
openGridConfig() {
|
230
|
+
this._grid.getColumnsState()
|
231
|
+
.then((gridColumns) => {
|
232
|
+
this._snkGridConfig.columns = gridColumns.filter(c => c.name);
|
233
|
+
this._snkGridConfig.selectedIndex = 0;
|
234
|
+
this._showPopUpGridConfig = true;
|
235
|
+
});
|
236
|
+
}
|
237
|
+
async openFormConfig() {
|
238
|
+
var _a, _b;
|
239
|
+
//No momento não daremos suporte para configuraçao de formulário quando houver legacy config
|
240
|
+
if (this.formLegacyConfigName) {
|
241
|
+
const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
|
242
|
+
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
|
243
|
+
await this.application.alert(title, message);
|
244
|
+
return;
|
245
|
+
}
|
246
|
+
this._showFormConfig = true;
|
73
247
|
}
|
74
|
-
|
248
|
+
addGridLegacyConfigName() {
|
249
|
+
if (this.gridLegacyConfigName && this.configName) {
|
250
|
+
ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
251
|
+
}
|
252
|
+
}
|
253
|
+
loadGridConfig(forceUpdate) {
|
254
|
+
if (this.configName === undefined) {
|
255
|
+
return;
|
256
|
+
}
|
257
|
+
if ((this.gridConfig != undefined || this._gridConfigAlreadyLoaded) && !forceUpdate) {
|
258
|
+
return;
|
259
|
+
}
|
260
|
+
this.addGridLegacyConfigName();
|
261
|
+
this._gridConfigAlreadyLoaded = true;
|
262
|
+
return new Promise((accept, reject) => {
|
263
|
+
ConfigStorage.loadGridConfig(this.configName, this.resolveResourceID())
|
264
|
+
.then(config => {
|
265
|
+
this.setGridConfig(config);
|
266
|
+
accept();
|
267
|
+
})
|
268
|
+
.catch(reason => {
|
269
|
+
reject(reason);
|
270
|
+
});
|
271
|
+
});
|
272
|
+
}
|
273
|
+
formConfigIsLoaded() {
|
274
|
+
return this.formConfig != undefined || this._formConfigAlreadyLoaded;
|
275
|
+
}
|
276
|
+
async loadFormConfig(forceLoad = false) {
|
277
|
+
if (this.configName === undefined) {
|
278
|
+
return;
|
279
|
+
}
|
280
|
+
if (this._formConfigManager == undefined) {
|
281
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
282
|
+
this._formConfigManager.setConfig(this.formConfig);
|
283
|
+
}
|
284
|
+
if (this.formConfigIsLoaded() && !forceLoad) {
|
285
|
+
return;
|
286
|
+
}
|
287
|
+
this._formConfigAlreadyLoaded = true;
|
288
|
+
let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
|
289
|
+
if (loadedLegacyConfig != undefined) {
|
290
|
+
this._formConfigManager.setConfig(loadedLegacyConfig);
|
291
|
+
this.setFormConfig(loadedLegacyConfig);
|
292
|
+
return;
|
293
|
+
}
|
294
|
+
this.setFormConfig(await this._formConfigManager.loadConfig());
|
295
|
+
}
|
296
|
+
async componentWillRender() {
|
297
|
+
this._resourceID = await this.application.getResourceID();
|
298
|
+
this.dataExporterProviderStore();
|
75
299
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.getTaskBarDisabledButtons());
|
300
|
+
if (this.configName === undefined) {
|
301
|
+
return;
|
302
|
+
}
|
303
|
+
if (this.gridConfig != undefined || this._gridConfigAlreadyLoaded) {
|
304
|
+
return;
|
305
|
+
}
|
306
|
+
await this.addGridLegacyConfigName();
|
307
|
+
this.loadGridConfig();
|
308
|
+
this.loadFormConfig();
|
309
|
+
}
|
310
|
+
componentDidRender() {
|
311
|
+
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
312
|
+
this.addGridCustomValueFormattters();
|
313
|
+
this.setFieldsProps();
|
314
|
+
this.setCustomRenders();
|
315
|
+
this.setCustomEditors();
|
76
316
|
}
|
77
317
|
componentWillLoad() {
|
78
318
|
this.processMetadata();
|
79
319
|
this.onModeChange();
|
80
320
|
this.configDatasource();
|
321
|
+
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
322
|
+
}
|
323
|
+
componentDidLoad() {
|
324
|
+
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
325
|
+
}
|
326
|
+
setCustomRenders() {
|
327
|
+
if (!this._grid) {
|
328
|
+
return;
|
329
|
+
}
|
330
|
+
for (const [fieldName, customRender] of this._customRenders) {
|
331
|
+
this._grid.addGridCustomRender(fieldName, customRender);
|
332
|
+
this._customRenders.delete(fieldName);
|
333
|
+
}
|
334
|
+
}
|
335
|
+
setCustomEditors() {
|
336
|
+
if (!this._grid || !this._form) {
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
340
|
+
this._grid.addCustomEditor(fieldName, customEditor);
|
341
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
342
|
+
this._customEditors.delete(fieldName);
|
343
|
+
}
|
81
344
|
}
|
82
345
|
configDatasource() {
|
83
|
-
|
84
|
-
this._multiSelectionListDataSource.setApplication(application);
|
346
|
+
this._multiSelectionListDataSource.setApplication(this.application);
|
85
347
|
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
86
348
|
}
|
349
|
+
setFieldsProps() {
|
350
|
+
if (!this._form) {
|
351
|
+
return;
|
352
|
+
}
|
353
|
+
for (const [fieldName, props] of this._fieldsProps) {
|
354
|
+
for (const prop in props) {
|
355
|
+
this._form.setFieldProp(fieldName, prop, props[prop]);
|
356
|
+
}
|
357
|
+
this._fieldsProps.delete(fieldName);
|
358
|
+
}
|
359
|
+
}
|
87
360
|
getTaskBarId() {
|
88
|
-
var _a, _b
|
361
|
+
var _a, _b;
|
89
362
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
90
363
|
return "snkSimpleCrudTaskbar.finish_edition";
|
91
364
|
}
|
92
365
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
93
366
|
!this.dataState.selectionInfo.isAllRecords() &&
|
94
|
-
|
367
|
+
this.dataState.selectionInfo.length > 0) {
|
95
368
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
96
369
|
}
|
97
370
|
return this._currentViewMode === VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
98
371
|
}
|
99
372
|
initInMemoryDataUnit() {
|
100
|
-
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
373
|
+
this._inMemoryLoader = new InMemoryLoader(this._metadata, undefined, { autoLoad: this.autoLoad });
|
101
374
|
this.dataUnit = this._inMemoryLoader.dataUnit;
|
102
375
|
this.dataUnitReady.emit(this.dataUnit);
|
103
376
|
}
|
@@ -122,6 +395,26 @@ export class SnkSimpleCrud {
|
|
122
395
|
getRecords() {
|
123
396
|
return Promise.resolve(this.dataUnit.records);
|
124
397
|
}
|
398
|
+
/**
|
399
|
+
* Usado para abrir o configurator do CRUD
|
400
|
+
*/
|
401
|
+
async openConfigurator() {
|
402
|
+
var _a;
|
403
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
404
|
+
}
|
405
|
+
/**
|
406
|
+
* Usado para fechar o configurator do CRUD
|
407
|
+
*/
|
408
|
+
async closeConfigurator() {
|
409
|
+
var _a;
|
410
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
|
411
|
+
}
|
412
|
+
async updateConfig() {
|
413
|
+
if (this._formConfigManager == undefined) {
|
414
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
415
|
+
}
|
416
|
+
this._formConfigManager.setConfig(this.formConfig);
|
417
|
+
}
|
125
418
|
processMetadata() {
|
126
419
|
const fieldsMetadataElem = this._element.querySelectorAll("snk-field-metadata");
|
127
420
|
const fieldMetadata = [];
|
@@ -152,11 +445,28 @@ export class SnkSimpleCrud {
|
|
152
445
|
};
|
153
446
|
}
|
154
447
|
}
|
448
|
+
addGridCustomValueFormattters() {
|
449
|
+
var _a, _b, _c;
|
450
|
+
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);
|
451
|
+
if (!metadataFields) {
|
452
|
+
return;
|
453
|
+
}
|
454
|
+
const fieldsWithRmPrecision = [];
|
455
|
+
metadataFields.forEach((field) => {
|
456
|
+
var _a;
|
457
|
+
if (((_a = field.properties) === null || _a === void 0 ? void 0 : _a.rm_precision) && !fieldsWithRmPrecision.includes(field.name)) {
|
458
|
+
fieldsWithRmPrecision.push(field.name);
|
459
|
+
}
|
460
|
+
});
|
461
|
+
fieldsWithRmPrecision.forEach(field => {
|
462
|
+
this.addCustomValueFormatter(field, this._rmPrecisionCustomValueFormatter);
|
463
|
+
});
|
464
|
+
}
|
155
465
|
onDataStateChange(evt) {
|
156
466
|
this.dataState = Object.assign({}, evt.detail);
|
157
467
|
}
|
158
468
|
getTaskBarDisabledButtons() {
|
159
|
-
var _a, _b, _c, _d;
|
469
|
+
var _a, _b, _c, _d, _e, _f;
|
160
470
|
const disabledButtons = [];
|
161
471
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
162
472
|
disabledButtons.push(TaskbarElement.NEXT);
|
@@ -167,6 +477,9 @@ export class SnkSimpleCrud {
|
|
167
477
|
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
168
478
|
disabledButtons.push(TaskbarElement.FORM_MODE);
|
169
479
|
}
|
480
|
+
if (((_f = (_e = this.dataState) === null || _e === void 0 ? void 0 : _e.selectionInfo) === null || _f === void 0 ? void 0 : _f.length) > 1) {
|
481
|
+
disabledButtons.push(TaskbarElement.CLONE);
|
482
|
+
}
|
170
483
|
return disabledButtons;
|
171
484
|
}
|
172
485
|
handleCancelEdit() {
|
@@ -176,6 +489,14 @@ export class SnkSimpleCrud {
|
|
176
489
|
this.dataUnit.clearSelection();
|
177
490
|
}
|
178
491
|
}
|
492
|
+
handleConfiguratorEvent(evt, type) {
|
493
|
+
evt.stopImmediatePropagation();
|
494
|
+
if (type === 'SAVE') {
|
495
|
+
this.configuratorSave.emit();
|
496
|
+
return;
|
497
|
+
}
|
498
|
+
this.configuratorCancel.emit();
|
499
|
+
}
|
179
500
|
getColumnSearch(actionButton, item) {
|
180
501
|
if (this._columnSearch != undefined) {
|
181
502
|
return this._columnSearch;
|
@@ -217,7 +538,9 @@ export class SnkSimpleCrud {
|
|
217
538
|
return (_b = (_a = this.formConfig) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : this._formFields;
|
218
539
|
}
|
219
540
|
handleFormSetFields(fields) {
|
220
|
-
this._formFields
|
541
|
+
if (!ObjectUtils.equals(this._formFields, fields)) {
|
542
|
+
this._formFields = fields !== null && fields !== void 0 ? fields : [];
|
543
|
+
}
|
221
544
|
}
|
222
545
|
fieldsOptionLoader(argument) {
|
223
546
|
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
@@ -232,7 +555,7 @@ export class SnkSimpleCrud {
|
|
232
555
|
}
|
233
556
|
getActionsList() {
|
234
557
|
var _a, _b;
|
235
|
-
|
558
|
+
const hardList = [{
|
236
559
|
value: StringUtils.generateUUID(),
|
237
560
|
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
|
238
561
|
disableCloseOnSelect: true,
|
@@ -241,6 +564,16 @@ export class SnkSimpleCrud {
|
|
241
564
|
? this.getColumnSearch(actionButton, item)
|
242
565
|
: this.getFieldSearch(actionButton, item)
|
243
566
|
}];
|
567
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
568
|
+
const taskbarID = this.getTopTaskBarId();
|
569
|
+
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
570
|
+
}
|
571
|
+
return hardList.concat(this.actionsList);
|
572
|
+
}
|
573
|
+
getTopTaskBarId() {
|
574
|
+
var _a;
|
575
|
+
return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
|
576
|
+
`snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
|
244
577
|
}
|
245
578
|
async keyDownListener(event) {
|
246
579
|
if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
|
@@ -279,11 +612,90 @@ export class SnkSimpleCrud {
|
|
279
612
|
disconnectedCallback() {
|
280
613
|
window.removeEventListener("keydown", this._keyDownHandler);
|
281
614
|
}
|
615
|
+
gridConfigChangeHandler(evt) {
|
616
|
+
const config = evt.detail;
|
617
|
+
ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
618
|
+
evt.stopPropagation();
|
619
|
+
}
|
620
|
+
modalConfigChangeHandler(evt) {
|
621
|
+
const config = evt.detail;
|
622
|
+
this._grid.setColumnsState(config.columns)
|
623
|
+
.then(() => {
|
624
|
+
this.setGridConfig(config);
|
625
|
+
this.closeGridConfig();
|
626
|
+
this.dataExporterProviderStore();
|
627
|
+
});
|
628
|
+
evt.stopPropagation();
|
629
|
+
}
|
630
|
+
async dataExporterProviderStore() {
|
631
|
+
if (this.dataUnit == undefined) {
|
632
|
+
return;
|
633
|
+
}
|
634
|
+
if (this._grid == undefined) {
|
635
|
+
return;
|
636
|
+
}
|
637
|
+
const dataExporterProvider = new ClientSideExporterProvider(this.dataUnit, this._grid);
|
638
|
+
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.getDataExporterStoreKey()]: dataExporterProvider }));
|
639
|
+
}
|
640
|
+
getDataExporterStoreKey() {
|
641
|
+
return `SnkSimpleCrudDataExporter:${this.configName == undefined ? this.dataUnit.name : this.configName}`;
|
642
|
+
}
|
643
|
+
setGridConfig(config) {
|
644
|
+
this.gridConfig = config;
|
645
|
+
CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
646
|
+
}
|
647
|
+
setFormConfig(config, forceUpdate) {
|
648
|
+
if (this.formConfig && !forceUpdate)
|
649
|
+
return;
|
650
|
+
this.formConfig = config;
|
651
|
+
}
|
652
|
+
closeGridConfig() {
|
653
|
+
this._showPopUpGridConfig = false;
|
654
|
+
}
|
655
|
+
closeFormConfig() {
|
656
|
+
this._showFormConfig = false;
|
657
|
+
}
|
658
|
+
getPageSize() {
|
659
|
+
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
660
|
+
return 0;
|
661
|
+
}
|
662
|
+
if (this.pageSize == undefined) {
|
663
|
+
return 150;
|
664
|
+
}
|
665
|
+
return this.pageSize;
|
666
|
+
}
|
667
|
+
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
668
|
+
handleShowFormConfig() {
|
669
|
+
return this._showFormConfig && !this.formLegacyConfigName;
|
670
|
+
}
|
671
|
+
resolveResourceID() {
|
672
|
+
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
673
|
+
}
|
674
|
+
getFormConfig() {
|
675
|
+
var _a, _b;
|
676
|
+
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);
|
677
|
+
if (!this.configName && !configFromManager) {
|
678
|
+
return this.formConfig;
|
679
|
+
}
|
680
|
+
return configFromManager;
|
681
|
+
}
|
682
|
+
updateFormConfig() {
|
683
|
+
const newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
684
|
+
this.setFormConfig(newConfig, true);
|
685
|
+
if (this._formConfigManager == undefined) {
|
686
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
687
|
+
}
|
688
|
+
this._formConfigManager.setConfig(this.formConfig);
|
689
|
+
}
|
690
|
+
/* istanbul ignore next */
|
282
691
|
render() {
|
283
692
|
var _a;
|
284
|
-
|
693
|
+
if (this.dataUnit == undefined) {
|
694
|
+
return;
|
695
|
+
}
|
696
|
+
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)
|
285
697
|
? undefined
|
286
|
-
: 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.
|
698
|
+
: 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() }))));
|
287
699
|
}
|
288
700
|
static get is() { return "snk-simple-crud"; }
|
289
701
|
static get encapsulation() { return "scoped"; }
|
@@ -339,6 +751,23 @@ export class SnkSimpleCrud {
|
|
339
751
|
"text": ""
|
340
752
|
}
|
341
753
|
},
|
754
|
+
"entityName": {
|
755
|
+
"type": "string",
|
756
|
+
"mutable": false,
|
757
|
+
"complexType": {
|
758
|
+
"original": "string",
|
759
|
+
"resolved": "string",
|
760
|
+
"references": {}
|
761
|
+
},
|
762
|
+
"required": false,
|
763
|
+
"optional": false,
|
764
|
+
"docs": {
|
765
|
+
"tags": [],
|
766
|
+
"text": "Define o nome da entidade que o componente vai utilizar para fazer as opera\u00E7\u00F5es de CRUD"
|
767
|
+
},
|
768
|
+
"attribute": "entity-name",
|
769
|
+
"reflect": false
|
770
|
+
},
|
342
771
|
"mode": {
|
343
772
|
"type": "number",
|
344
773
|
"mutable": false,
|
@@ -364,7 +793,7 @@ export class SnkSimpleCrud {
|
|
364
793
|
},
|
365
794
|
"gridConfig": {
|
366
795
|
"type": "unknown",
|
367
|
-
"mutable":
|
796
|
+
"mutable": true,
|
368
797
|
"complexType": {
|
369
798
|
"original": "IGridConfig",
|
370
799
|
"resolved": "IGridConfig",
|
@@ -384,7 +813,7 @@ export class SnkSimpleCrud {
|
|
384
813
|
},
|
385
814
|
"formConfig": {
|
386
815
|
"type": "unknown",
|
387
|
-
"mutable":
|
816
|
+
"mutable": true,
|
388
817
|
"complexType": {
|
389
818
|
"original": "IFormConfig",
|
390
819
|
"resolved": "IFormConfig",
|
@@ -437,6 +866,41 @@ export class SnkSimpleCrud {
|
|
437
866
|
"reflect": false,
|
438
867
|
"defaultValue": "true"
|
439
868
|
},
|
869
|
+
"pageSize": {
|
870
|
+
"type": "number",
|
871
|
+
"mutable": false,
|
872
|
+
"complexType": {
|
873
|
+
"original": "number",
|
874
|
+
"resolved": "number",
|
875
|
+
"references": {}
|
876
|
+
},
|
877
|
+
"required": false,
|
878
|
+
"optional": false,
|
879
|
+
"docs": {
|
880
|
+
"tags": [],
|
881
|
+
"text": "Determina quantas linhas s\u00E3o retornadas por p\u00E1gina."
|
882
|
+
},
|
883
|
+
"attribute": "page-size",
|
884
|
+
"reflect": false,
|
885
|
+
"defaultValue": "150"
|
886
|
+
},
|
887
|
+
"resourceID": {
|
888
|
+
"type": "string",
|
889
|
+
"mutable": false,
|
890
|
+
"complexType": {
|
891
|
+
"original": "string",
|
892
|
+
"resolved": "string",
|
893
|
+
"references": {}
|
894
|
+
},
|
895
|
+
"required": false,
|
896
|
+
"optional": false,
|
897
|
+
"docs": {
|
898
|
+
"tags": [],
|
899
|
+
"text": "Identificador de recursos como configura\u00E7\u00F5es e acesso."
|
900
|
+
},
|
901
|
+
"attribute": "resource-i-d",
|
902
|
+
"reflect": false
|
903
|
+
},
|
440
904
|
"taskbarManager": {
|
441
905
|
"type": "unknown",
|
442
906
|
"mutable": false,
|
@@ -494,15 +958,163 @@ export class SnkSimpleCrud {
|
|
494
958
|
"attribute": "use-enter-like-tab",
|
495
959
|
"reflect": false,
|
496
960
|
"defaultValue": "false"
|
961
|
+
},
|
962
|
+
"actionsList": {
|
963
|
+
"type": "unknown",
|
964
|
+
"mutable": false,
|
965
|
+
"complexType": {
|
966
|
+
"original": "Array<Action>",
|
967
|
+
"resolved": "Action[]",
|
968
|
+
"references": {
|
969
|
+
"Array": {
|
970
|
+
"location": "global"
|
971
|
+
},
|
972
|
+
"Action": {
|
973
|
+
"location": "import",
|
974
|
+
"path": "../snk-taskbar/snk-taskbar"
|
975
|
+
}
|
976
|
+
}
|
977
|
+
},
|
978
|
+
"required": false,
|
979
|
+
"optional": false,
|
980
|
+
"docs": {
|
981
|
+
"tags": [],
|
982
|
+
"text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\" do componente snk-taskbar."
|
983
|
+
}
|
984
|
+
},
|
985
|
+
"configName": {
|
986
|
+
"type": "string",
|
987
|
+
"mutable": true,
|
988
|
+
"complexType": {
|
989
|
+
"original": "string",
|
990
|
+
"resolved": "string",
|
991
|
+
"references": {}
|
992
|
+
},
|
993
|
+
"required": false,
|
994
|
+
"optional": false,
|
995
|
+
"docs": {
|
996
|
+
"tags": [],
|
997
|
+
"text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
|
998
|
+
},
|
999
|
+
"attribute": "config-name",
|
1000
|
+
"reflect": false
|
1001
|
+
},
|
1002
|
+
"showConfiguratorButtons": {
|
1003
|
+
"type": "boolean",
|
1004
|
+
"mutable": false,
|
1005
|
+
"complexType": {
|
1006
|
+
"original": "boolean",
|
1007
|
+
"resolved": "boolean",
|
1008
|
+
"references": {}
|
1009
|
+
},
|
1010
|
+
"required": false,
|
1011
|
+
"optional": false,
|
1012
|
+
"docs": {
|
1013
|
+
"tags": [],
|
1014
|
+
"text": "Usado para exibir os bot\u00F5es de a\u00E7\u00E3o do snk-configurator."
|
1015
|
+
},
|
1016
|
+
"attribute": "show-configurator-buttons",
|
1017
|
+
"reflect": false
|
1018
|
+
},
|
1019
|
+
"gridLegacyConfigName": {
|
1020
|
+
"type": "string",
|
1021
|
+
"mutable": false,
|
1022
|
+
"complexType": {
|
1023
|
+
"original": "string",
|
1024
|
+
"resolved": "string",
|
1025
|
+
"references": {}
|
1026
|
+
},
|
1027
|
+
"required": false,
|
1028
|
+
"optional": false,
|
1029
|
+
"docs": {
|
1030
|
+
"tags": [],
|
1031
|
+
"text": "Chave da configura\u00E7\u00E3o legado da grade."
|
1032
|
+
},
|
1033
|
+
"attribute": "grid-legacy-config-name",
|
1034
|
+
"reflect": false
|
1035
|
+
},
|
1036
|
+
"formLegacyConfigName": {
|
1037
|
+
"type": "string",
|
1038
|
+
"mutable": false,
|
1039
|
+
"complexType": {
|
1040
|
+
"original": "string",
|
1041
|
+
"resolved": "string",
|
1042
|
+
"references": {}
|
1043
|
+
},
|
1044
|
+
"required": false,
|
1045
|
+
"optional": false,
|
1046
|
+
"docs": {
|
1047
|
+
"tags": [],
|
1048
|
+
"text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
|
1049
|
+
},
|
1050
|
+
"attribute": "form-legacy-config-name",
|
1051
|
+
"reflect": false
|
1052
|
+
},
|
1053
|
+
"ignoreReadOnlyFormFields": {
|
1054
|
+
"type": "boolean",
|
1055
|
+
"mutable": false,
|
1056
|
+
"complexType": {
|
1057
|
+
"original": "boolean",
|
1058
|
+
"resolved": "boolean",
|
1059
|
+
"references": {}
|
1060
|
+
},
|
1061
|
+
"required": false,
|
1062
|
+
"optional": false,
|
1063
|
+
"docs": {
|
1064
|
+
"tags": [],
|
1065
|
+
"text": "Ignora os campos \"somente leitura\" no modo de inser\u00E7\u00E3o."
|
1066
|
+
},
|
1067
|
+
"attribute": "ignore-read-only-form-fields",
|
1068
|
+
"reflect": false,
|
1069
|
+
"defaultValue": "false"
|
1070
|
+
},
|
1071
|
+
"autoFocus": {
|
1072
|
+
"type": "boolean",
|
1073
|
+
"mutable": false,
|
1074
|
+
"complexType": {
|
1075
|
+
"original": "boolean",
|
1076
|
+
"resolved": "boolean",
|
1077
|
+
"references": {}
|
1078
|
+
},
|
1079
|
+
"required": false,
|
1080
|
+
"optional": true,
|
1081
|
+
"docs": {
|
1082
|
+
"tags": [],
|
1083
|
+
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
1084
|
+
},
|
1085
|
+
"attribute": "auto-focus",
|
1086
|
+
"reflect": false,
|
1087
|
+
"defaultValue": "true"
|
1088
|
+
},
|
1089
|
+
"autoLoad": {
|
1090
|
+
"type": "boolean",
|
1091
|
+
"mutable": false,
|
1092
|
+
"complexType": {
|
1093
|
+
"original": "boolean",
|
1094
|
+
"resolved": "boolean",
|
1095
|
+
"references": {}
|
1096
|
+
},
|
1097
|
+
"required": false,
|
1098
|
+
"optional": true,
|
1099
|
+
"docs": {
|
1100
|
+
"tags": [],
|
1101
|
+
"text": "Define se a carga dos dados ser\u00E1 feita assim que o componente for carregado."
|
1102
|
+
},
|
1103
|
+
"attribute": "auto-load",
|
1104
|
+
"reflect": false
|
497
1105
|
}
|
498
1106
|
};
|
499
1107
|
}
|
500
1108
|
static get states() {
|
501
1109
|
return {
|
1110
|
+
"_showPopUpGridConfig": {},
|
1111
|
+
"_showFormConfig": {},
|
502
1112
|
"_currentViewMode": {},
|
503
1113
|
"_config": {},
|
504
1114
|
"_fieldToGetFocus": {},
|
505
|
-
"
|
1115
|
+
"_customContainerId": {},
|
1116
|
+
"_formFields": {},
|
1117
|
+
"_fieldsProps": {}
|
506
1118
|
};
|
507
1119
|
}
|
508
1120
|
static get events() {
|
@@ -583,10 +1195,162 @@ export class SnkSimpleCrud {
|
|
583
1195
|
}
|
584
1196
|
}
|
585
1197
|
}
|
1198
|
+
}, {
|
1199
|
+
"method": "configuratorSave",
|
1200
|
+
"name": "configuratorSave",
|
1201
|
+
"bubbles": true,
|
1202
|
+
"cancelable": true,
|
1203
|
+
"composed": true,
|
1204
|
+
"docs": {
|
1205
|
+
"tags": [],
|
1206
|
+
"text": "Emitido quando salva a configura\u00E7\u00E3o no configurator do CRUD."
|
1207
|
+
},
|
1208
|
+
"complexType": {
|
1209
|
+
"original": "any",
|
1210
|
+
"resolved": "any",
|
1211
|
+
"references": {}
|
1212
|
+
}
|
1213
|
+
}, {
|
1214
|
+
"method": "configuratorCancel",
|
1215
|
+
"name": "configuratorCancel",
|
1216
|
+
"bubbles": true,
|
1217
|
+
"cancelable": true,
|
1218
|
+
"composed": true,
|
1219
|
+
"docs": {
|
1220
|
+
"tags": [],
|
1221
|
+
"text": "Emitido quando cancela o salvamento da configura\u00E7\u00E3o no configurator do CRUD."
|
1222
|
+
},
|
1223
|
+
"complexType": {
|
1224
|
+
"original": "any",
|
1225
|
+
"resolved": "any",
|
1226
|
+
"references": {}
|
1227
|
+
}
|
586
1228
|
}];
|
587
1229
|
}
|
588
1230
|
static get methods() {
|
589
1231
|
return {
|
1232
|
+
"addCustomEditor": {
|
1233
|
+
"complexType": {
|
1234
|
+
"signature": "(fieldName: string, customEditor: ICustomEditor) => Promise<void>",
|
1235
|
+
"parameters": [{
|
1236
|
+
"tags": [],
|
1237
|
+
"text": ""
|
1238
|
+
}, {
|
1239
|
+
"tags": [],
|
1240
|
+
"text": ""
|
1241
|
+
}],
|
1242
|
+
"references": {
|
1243
|
+
"Promise": {
|
1244
|
+
"location": "global"
|
1245
|
+
},
|
1246
|
+
"ICustomEditor": {
|
1247
|
+
"location": "import",
|
1248
|
+
"path": "@sankhyalabs/ezui/dist/types/utils"
|
1249
|
+
}
|
1250
|
+
},
|
1251
|
+
"return": "Promise<void>"
|
1252
|
+
},
|
1253
|
+
"docs": {
|
1254
|
+
"text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
|
1255
|
+
"tags": []
|
1256
|
+
}
|
1257
|
+
},
|
1258
|
+
"addGridCustomRender": {
|
1259
|
+
"complexType": {
|
1260
|
+
"signature": "(fieldName: string, customRender: ICustomRender) => Promise<void>",
|
1261
|
+
"parameters": [{
|
1262
|
+
"tags": [],
|
1263
|
+
"text": ""
|
1264
|
+
}, {
|
1265
|
+
"tags": [],
|
1266
|
+
"text": ""
|
1267
|
+
}],
|
1268
|
+
"references": {
|
1269
|
+
"Promise": {
|
1270
|
+
"location": "global"
|
1271
|
+
},
|
1272
|
+
"ICustomRender": {
|
1273
|
+
"location": "import",
|
1274
|
+
"path": "@sankhyalabs/ezui/dist/types/utils"
|
1275
|
+
}
|
1276
|
+
},
|
1277
|
+
"return": "Promise<void>"
|
1278
|
+
},
|
1279
|
+
"docs": {
|
1280
|
+
"text": "Registra um render customizado para colunas da grid.",
|
1281
|
+
"tags": []
|
1282
|
+
}
|
1283
|
+
},
|
1284
|
+
"addCustomValueFormatter": {
|
1285
|
+
"complexType": {
|
1286
|
+
"signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
|
1287
|
+
"parameters": [{
|
1288
|
+
"tags": [],
|
1289
|
+
"text": ""
|
1290
|
+
}, {
|
1291
|
+
"tags": [],
|
1292
|
+
"text": ""
|
1293
|
+
}],
|
1294
|
+
"references": {
|
1295
|
+
"Promise": {
|
1296
|
+
"location": "global"
|
1297
|
+
},
|
1298
|
+
"ICustomFormatter": {
|
1299
|
+
"location": "import",
|
1300
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces"
|
1301
|
+
}
|
1302
|
+
},
|
1303
|
+
"return": "Promise<void>"
|
1304
|
+
},
|
1305
|
+
"docs": {
|
1306
|
+
"text": "Registra um formatador de valores para uma coluna da grid.",
|
1307
|
+
"tags": []
|
1308
|
+
}
|
1309
|
+
},
|
1310
|
+
"removeCustomValueFormatter": {
|
1311
|
+
"complexType": {
|
1312
|
+
"signature": "(columnName: string) => Promise<void>",
|
1313
|
+
"parameters": [{
|
1314
|
+
"tags": [],
|
1315
|
+
"text": ""
|
1316
|
+
}],
|
1317
|
+
"references": {
|
1318
|
+
"Promise": {
|
1319
|
+
"location": "global"
|
1320
|
+
}
|
1321
|
+
},
|
1322
|
+
"return": "Promise<void>"
|
1323
|
+
},
|
1324
|
+
"docs": {
|
1325
|
+
"text": "Remove o formatador de valores de uma coluna da grid.",
|
1326
|
+
"tags": []
|
1327
|
+
}
|
1328
|
+
},
|
1329
|
+
"setFieldProp": {
|
1330
|
+
"complexType": {
|
1331
|
+
"signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
|
1332
|
+
"parameters": [{
|
1333
|
+
"tags": [],
|
1334
|
+
"text": ""
|
1335
|
+
}, {
|
1336
|
+
"tags": [],
|
1337
|
+
"text": ""
|
1338
|
+
}, {
|
1339
|
+
"tags": [],
|
1340
|
+
"text": ""
|
1341
|
+
}],
|
1342
|
+
"references": {
|
1343
|
+
"Promise": {
|
1344
|
+
"location": "global"
|
1345
|
+
}
|
1346
|
+
},
|
1347
|
+
"return": "Promise<void>"
|
1348
|
+
},
|
1349
|
+
"docs": {
|
1350
|
+
"text": "Altera/adiciona uma propriedade nos metadados do campo.",
|
1351
|
+
"tags": []
|
1352
|
+
}
|
1353
|
+
},
|
590
1354
|
"goToView": {
|
591
1355
|
"complexType": {
|
592
1356
|
"signature": "(view: VIEW_MODE) => Promise<void>",
|
@@ -681,17 +1445,77 @@ export class SnkSimpleCrud {
|
|
681
1445
|
"text": "",
|
682
1446
|
"tags": []
|
683
1447
|
}
|
1448
|
+
},
|
1449
|
+
"openConfigurator": {
|
1450
|
+
"complexType": {
|
1451
|
+
"signature": "() => Promise<void>",
|
1452
|
+
"parameters": [],
|
1453
|
+
"references": {
|
1454
|
+
"Promise": {
|
1455
|
+
"location": "global"
|
1456
|
+
}
|
1457
|
+
},
|
1458
|
+
"return": "Promise<void>"
|
1459
|
+
},
|
1460
|
+
"docs": {
|
1461
|
+
"text": "Usado para abrir o configurator do CRUD",
|
1462
|
+
"tags": []
|
1463
|
+
}
|
1464
|
+
},
|
1465
|
+
"closeConfigurator": {
|
1466
|
+
"complexType": {
|
1467
|
+
"signature": "() => Promise<void>",
|
1468
|
+
"parameters": [],
|
1469
|
+
"references": {
|
1470
|
+
"Promise": {
|
1471
|
+
"location": "global"
|
1472
|
+
}
|
1473
|
+
},
|
1474
|
+
"return": "Promise<void>"
|
1475
|
+
},
|
1476
|
+
"docs": {
|
1477
|
+
"text": "Usado para fechar o configurator do CRUD",
|
1478
|
+
"tags": []
|
1479
|
+
}
|
1480
|
+
},
|
1481
|
+
"updateConfig": {
|
1482
|
+
"complexType": {
|
1483
|
+
"signature": "() => Promise<void>",
|
1484
|
+
"parameters": [],
|
1485
|
+
"references": {
|
1486
|
+
"Promise": {
|
1487
|
+
"location": "global"
|
1488
|
+
}
|
1489
|
+
},
|
1490
|
+
"return": "Promise<void>"
|
1491
|
+
},
|
1492
|
+
"docs": {
|
1493
|
+
"text": "",
|
1494
|
+
"tags": []
|
1495
|
+
}
|
684
1496
|
}
|
685
1497
|
};
|
686
1498
|
}
|
687
1499
|
static get elementRef() { return "_element"; }
|
688
1500
|
static get watchers() {
|
689
1501
|
return [{
|
1502
|
+
"propName": "resourceID",
|
1503
|
+
"methodName": "handleResourceIDChanged"
|
1504
|
+
}, {
|
1505
|
+
"propName": "entityName",
|
1506
|
+
"methodName": "onChangeEntityName"
|
1507
|
+
}, {
|
690
1508
|
"propName": "mode",
|
691
1509
|
"methodName": "onModeChange"
|
692
1510
|
}, {
|
693
1511
|
"propName": "dataState",
|
694
1512
|
"methodName": "observeDataState"
|
1513
|
+
}, {
|
1514
|
+
"propName": "formLegacyConfigName",
|
1515
|
+
"methodName": "observeFormLegacy"
|
1516
|
+
}, {
|
1517
|
+
"propName": "gridLegacyConfigName",
|
1518
|
+
"methodName": "observeGridLegacy"
|
695
1519
|
}];
|
696
1520
|
}
|
697
1521
|
static get listeners() {
|