@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,479 +0,0 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-4151acc8.js';
|
6
|
-
import { O as ORDER_VALUES } from './constants-8457af36.js';
|
7
|
-
import './form-config-fetcher-36219cd3.js';
|
8
|
-
import './DataFetcher-aa159c5a.js';
|
9
|
-
import './PrintUtils-3e4ff0f5.js';
|
10
|
-
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
-
import './filter-item-type.enum-d45e026f.js';
|
12
|
-
|
13
|
-
const snkGridConfigCss = ".sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, \"Roboto\");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}";
|
14
|
-
|
15
|
-
const SnkGridConfig = class {
|
16
|
-
constructor(hostRef) {
|
17
|
-
registerInstance(this, hostRef);
|
18
|
-
this.configChange = createEvent(this, "configChange", 7);
|
19
|
-
this.configCancel = createEvent(this, "configCancel", 7);
|
20
|
-
this._orderListItems = [];
|
21
|
-
this._orderPriorityList = [];
|
22
|
-
this._columListItems = [];
|
23
|
-
this._selectedIndex = -1;
|
24
|
-
this._dataChanged = false;
|
25
|
-
this._componenteInternalKey = Date.now();
|
26
|
-
this.selectedIndex = 0;
|
27
|
-
this.application = undefined;
|
28
|
-
this.columns = undefined;
|
29
|
-
this.config = undefined;
|
30
|
-
this.configName = undefined;
|
31
|
-
this.resourceID = undefined;
|
32
|
-
}
|
33
|
-
/* Creation Methods */
|
34
|
-
/**
|
35
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
36
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
37
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
38
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
39
|
-
*/
|
40
|
-
getMessage(key, params) {
|
41
|
-
return this.application.messagesBuilder.getMessage(key, params);
|
42
|
-
}
|
43
|
-
createOrderList() {
|
44
|
-
let newList = [];
|
45
|
-
this.columns.filter(col => { var _a; return StringUtils.getBooleanValue((_a = col === null || col === void 0 ? void 0 : col.props) === null || _a === void 0 ? void 0 : _a.get("sortable"), true); }).forEach((column) => {
|
46
|
-
var _a;
|
47
|
-
let configItem = (_a = this.config) === null || _a === void 0 ? void 0 : _a.columns.find((item) => item.name === column.name);
|
48
|
-
let item = { name: column.name, label: column.label };
|
49
|
-
if (configItem) {
|
50
|
-
item['orderIndex'] = configItem.orderIndex;
|
51
|
-
item['ascending'] = configItem.ascending;
|
52
|
-
}
|
53
|
-
if (!column.hidden) {
|
54
|
-
newList.push(item);
|
55
|
-
}
|
56
|
-
});
|
57
|
-
newList.sort((a, b) => {
|
58
|
-
//OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
|
59
|
-
if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
|
60
|
-
if (a.ascending != undefined)
|
61
|
-
return -1;
|
62
|
-
if (b.ascending != undefined)
|
63
|
-
return 1;
|
64
|
-
return 0;
|
65
|
-
//Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
|
66
|
-
}
|
67
|
-
else if (a.ascending != undefined && b.ascending != undefined) {
|
68
|
-
return (a.orderIndex - b.orderIndex);
|
69
|
-
//Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
|
70
|
-
}
|
71
|
-
else if (a.ascending != undefined || b.ascending != undefined) {
|
72
|
-
if (a.ascending != undefined)
|
73
|
-
return -1;
|
74
|
-
if (b.ascending != undefined)
|
75
|
-
return 1;
|
76
|
-
return 0;
|
77
|
-
}
|
78
|
-
return (a.orderIndex - b.orderIndex);
|
79
|
-
});
|
80
|
-
this._orderListItems = newList;
|
81
|
-
}
|
82
|
-
createColumnList() {
|
83
|
-
let visibleGroup = {
|
84
|
-
group: this.getMessage("snkGridConfig.group.visible"),
|
85
|
-
items: [],
|
86
|
-
};
|
87
|
-
let hiddenGroup = {
|
88
|
-
group: this.getMessage("snkGridConfig.group.hidden"),
|
89
|
-
items: [],
|
90
|
-
sort: ORDER_VALUES.asc.value
|
91
|
-
};
|
92
|
-
this.columns.forEach((column) => {
|
93
|
-
let item = { label: column.label };
|
94
|
-
if (column.hidden) {
|
95
|
-
hiddenGroup.items.push(item);
|
96
|
-
}
|
97
|
-
else {
|
98
|
-
visibleGroup.items.push(item);
|
99
|
-
}
|
100
|
-
});
|
101
|
-
this._columListItems = [visibleGroup, hiddenGroup];
|
102
|
-
}
|
103
|
-
buildColumnListSlot(item, group) {
|
104
|
-
const dataElementId = `configItem_${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(item.label))}`;
|
105
|
-
return (h("div", null, h("ez-check", { mode: CheckMode.SWITCH, id: CheckMode.SWITCH + ((item === null || item === void 0 ? void 0 : item.label) || '') + ((group === null || group === void 0 ? void 0 : group.group) || ''), value: group.group === this.getMessage("snkGridConfig.group.visible"), "data-element-id": dataElementId, onEzChange: (evt) => { this.switchColumnGroup(evt, item); } })));
|
106
|
-
}
|
107
|
-
buildOrderListSlot(item) {
|
108
|
-
const dataElementId = `${this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${StringUtils.toCamelCase(item.label)}`;
|
109
|
-
let selectedOption = ORDER_VALUES.none.value;
|
110
|
-
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
111
|
-
selectedOption = item.ascending == true ? ORDER_VALUES.asc.value : ORDER_VALUES.desc.value;
|
112
|
-
}
|
113
|
-
return (h("div", null, h("snk-select-box", { selectedOption: selectedOption, key: 'snk-select-box-' + this._componenteInternalKey + '-' + item, "data-element-id": dataElementId, onEzChange: (evt) => { evt.stopPropagation(); this.updateOrder(evt.detail, item.label); } })));
|
114
|
-
}
|
115
|
-
updateOrder(sortOrder, updatedItemLabel) {
|
116
|
-
var _a;
|
117
|
-
this._dataChanged = true;
|
118
|
-
let newList = [...this.columns];
|
119
|
-
let newItem = newList.find((item) => item.label === updatedItemLabel);
|
120
|
-
if (newItem) {
|
121
|
-
newItem.sort = sortOrder.value === ORDER_VALUES.none.value ? undefined : sortOrder.value;
|
122
|
-
}
|
123
|
-
let orderArray;
|
124
|
-
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
125
|
-
this._orderPriorityList.find((item) => item.label === newItem.label).sort = sortOrder;
|
126
|
-
this._orderPriorityList.filter((item) => item.sort).map((item, index) => {
|
127
|
-
if (item.label === newItem.label) {
|
128
|
-
newItem.sortIndex = index;
|
129
|
-
}
|
130
|
-
});
|
131
|
-
}
|
132
|
-
else {
|
133
|
-
orderArray = newList.filter((item) => item.sort && item.hidden !== true)
|
134
|
-
.map((item, index) => {
|
135
|
-
return { label: item.label, orderIndex: index };
|
136
|
-
});
|
137
|
-
orderArray.forEach((element) => {
|
138
|
-
newList.find((item) => item.label === element.label).sortIndex = element.orderIndex;
|
139
|
-
});
|
140
|
-
}
|
141
|
-
this.columns = newList;
|
142
|
-
}
|
143
|
-
/* Actions Methods */
|
144
|
-
switchColumnGroup(evt, switchedItem) {
|
145
|
-
evt.stopPropagation();
|
146
|
-
let newList = [...this._columListItems];
|
147
|
-
this._dataChanged = true;
|
148
|
-
if (evt.detail === true) {
|
149
|
-
let hiddenGroup = newList.find((group) => group.group === this.getMessage("snkGridConfig.group.hidden"));
|
150
|
-
let index = hiddenGroup.items.findIndex((item) => item.label === switchedItem.label);
|
151
|
-
if (index >= 0) {
|
152
|
-
hiddenGroup.items.splice(index, 1);
|
153
|
-
}
|
154
|
-
let visibleGroup = newList.find((group) => group.group === this.getMessage("snkGridConfig.group.visible"));
|
155
|
-
visibleGroup.items.push(switchedItem);
|
156
|
-
this._columListItems = newList;
|
157
|
-
this.createOrderList();
|
158
|
-
}
|
159
|
-
else if (evt.detail === false) {
|
160
|
-
let visibleGroup = newList.find((group) => group.group === this.getMessage("snkGridConfig.group.visible"));
|
161
|
-
let index = visibleGroup.items.findIndex((item) => item.label === switchedItem.label);
|
162
|
-
if (index >= 0) {
|
163
|
-
visibleGroup.items.splice(index, 1);
|
164
|
-
}
|
165
|
-
let hiddenGroup = newList.find((group) => group.group === this.getMessage("snkGridConfig.group.hidden"));
|
166
|
-
hiddenGroup.items.push(switchedItem);
|
167
|
-
this._columListItems = newList;
|
168
|
-
this.createOrderList();
|
169
|
-
}
|
170
|
-
}
|
171
|
-
finish() {
|
172
|
-
if (!this._dataChanged) {
|
173
|
-
this.closeConfig();
|
174
|
-
return;
|
175
|
-
}
|
176
|
-
let newColumnList = [];
|
177
|
-
this._columListItems.forEach((group) => {
|
178
|
-
group.items.forEach((item) => {
|
179
|
-
const baseColumn = this.columns.find((column) => column.label === item.label);
|
180
|
-
let newColumnItem = Object.assign({}, baseColumn);
|
181
|
-
if (group.group === this.getMessage("snkGridConfig.group.hidden")) {
|
182
|
-
newColumnItem.hidden = true;
|
183
|
-
}
|
184
|
-
else {
|
185
|
-
newColumnItem.hidden = false;
|
186
|
-
}
|
187
|
-
newColumnList.push(newColumnItem);
|
188
|
-
});
|
189
|
-
});
|
190
|
-
this.columns = newColumnList;
|
191
|
-
this._dataChanged = false;
|
192
|
-
this.closeConfig();
|
193
|
-
this.save();
|
194
|
-
}
|
195
|
-
save() {
|
196
|
-
var _a;
|
197
|
-
let _newConfig;
|
198
|
-
if (this.config) {
|
199
|
-
_newConfig = this.config;
|
200
|
-
}
|
201
|
-
else {
|
202
|
-
_newConfig = this.createConfigFromState(this.columns);
|
203
|
-
}
|
204
|
-
let _newColumnConfigList = [];
|
205
|
-
let orderArray;
|
206
|
-
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
207
|
-
orderArray = this.columns.filter((item) => item.sort && item.hidden !== true)
|
208
|
-
.map((item) => {
|
209
|
-
return { label: item.label, orderIndex: 0 };
|
210
|
-
});
|
211
|
-
let indexCount = 0;
|
212
|
-
let newOrderArray = [];
|
213
|
-
this._orderPriorityList.forEach((orderPriorityItem) => {
|
214
|
-
let item = orderArray.find((column) => column.label === orderPriorityItem.label);
|
215
|
-
if (item) {
|
216
|
-
item.orderIndex = indexCount;
|
217
|
-
newOrderArray.push(item);
|
218
|
-
indexCount++;
|
219
|
-
}
|
220
|
-
});
|
221
|
-
if (newOrderArray.length > 0) {
|
222
|
-
orderArray = newOrderArray;
|
223
|
-
}
|
224
|
-
}
|
225
|
-
for (let i = 0; i < this.columns.length; i++) {
|
226
|
-
const column = this.columns[i];
|
227
|
-
let _newColumnConfig = _newConfig.columns.find((_newColumnConfig) => column.name === _newColumnConfig.name);
|
228
|
-
if (column.hidden === true && _newColumnConfig) {
|
229
|
-
continue;
|
230
|
-
}
|
231
|
-
if (_newColumnConfig) {
|
232
|
-
_newColumnConfig.width = column.width;
|
233
|
-
}
|
234
|
-
else if (column.hidden === false) {
|
235
|
-
_newColumnConfig = { name: column.name, width: column.width, orderIndex: 0 };
|
236
|
-
}
|
237
|
-
if (_newColumnConfig) {
|
238
|
-
if (column.sort) {
|
239
|
-
_newColumnConfig.ascending = column.sort.toUpperCase() === ORDER_VALUES.asc.value ? true : false;
|
240
|
-
if (orderArray) {
|
241
|
-
adjustPriorityOrder(column, _newColumnConfig);
|
242
|
-
}
|
243
|
-
else {
|
244
|
-
_newColumnConfig.orderIndex = column.sortIndex;
|
245
|
-
}
|
246
|
-
}
|
247
|
-
else {
|
248
|
-
delete _newColumnConfig.ascending;
|
249
|
-
_newColumnConfig.orderIndex = 0;
|
250
|
-
}
|
251
|
-
_newColumnConfigList.push(_newColumnConfig);
|
252
|
-
}
|
253
|
-
}
|
254
|
-
_newConfig.columns = _newColumnConfigList;
|
255
|
-
ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
|
256
|
-
.then((savedConfig) => {
|
257
|
-
this.configChange.emit(savedConfig);
|
258
|
-
this._orderList.clearHistory();
|
259
|
-
ApplicationUtils.info(this.getMessage("snkGridConfig.info.successfullyConfigSaved"), { iconName: "check" });
|
260
|
-
});
|
261
|
-
function adjustPriorityOrder(column, _newColumnConfig) {
|
262
|
-
if (orderArray) {
|
263
|
-
let orderItem = orderArray.find((item) => item.label === column.label);
|
264
|
-
if (orderItem) {
|
265
|
-
_newColumnConfig.orderIndex = orderItem.orderIndex;
|
266
|
-
}
|
267
|
-
}
|
268
|
-
}
|
269
|
-
}
|
270
|
-
createConfigFromState(state) {
|
271
|
-
let newConfig = { columns: [] };
|
272
|
-
state.forEach((columnState) => {
|
273
|
-
if (!columnState.hidden) {
|
274
|
-
let newConfigColumn = { name: columnState.name };
|
275
|
-
if (columnState.width) {
|
276
|
-
newConfigColumn['width'] = columnState.width;
|
277
|
-
}
|
278
|
-
if (columnState.sort) {
|
279
|
-
newConfigColumn['ascending'] = (columnState.sort.toUpperCase() === ORDER_VALUES.asc.value);
|
280
|
-
newConfigColumn['orderIndex'] = columnState.sortIndex;
|
281
|
-
}
|
282
|
-
else {
|
283
|
-
newConfigColumn['orderIndex'] = 0;
|
284
|
-
}
|
285
|
-
if (newConfigColumn) {
|
286
|
-
newConfig.columns.push(newConfigColumn);
|
287
|
-
}
|
288
|
-
}
|
289
|
-
});
|
290
|
-
return newConfig;
|
291
|
-
}
|
292
|
-
async locateColumn(evt, searchingText) {
|
293
|
-
var _a;
|
294
|
-
const hitEnter = evt.key === "Enter";
|
295
|
-
if (!searchingText) {
|
296
|
-
searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
|
297
|
-
}
|
298
|
-
let newSelected = -1;
|
299
|
-
if (this.selectedIndex === 1) {
|
300
|
-
if (searchingText) {
|
301
|
-
const matchedIndexes = [];
|
302
|
-
let orderListDatasource;
|
303
|
-
await this._orderList.getList().then((listGroup) => {
|
304
|
-
orderListDatasource = listGroup;
|
305
|
-
orderListDatasource.forEach((column, index) => {
|
306
|
-
if (this.compareWords(column, searchingText)) {
|
307
|
-
matchedIndexes.push(index);
|
308
|
-
}
|
309
|
-
});
|
310
|
-
});
|
311
|
-
if (matchedIndexes.length > 0) {
|
312
|
-
if (hitEnter) {
|
313
|
-
for (let j = 0; j < matchedIndexes.length; j++) {
|
314
|
-
if (matchedIndexes[j] > this._selectedIndex) {
|
315
|
-
newSelected = matchedIndexes[j];
|
316
|
-
break;
|
317
|
-
}
|
318
|
-
}
|
319
|
-
}
|
320
|
-
if (newSelected === -1) {
|
321
|
-
newSelected = matchedIndexes[0];
|
322
|
-
}
|
323
|
-
}
|
324
|
-
this._selectedIndex = newSelected;
|
325
|
-
let selectedColumn;
|
326
|
-
selectedColumn = orderListDatasource[newSelected];
|
327
|
-
if (selectedColumn) {
|
328
|
-
this._orderList.setSelection(selectedColumn, true);
|
329
|
-
}
|
330
|
-
else {
|
331
|
-
this._orderList.removeSelection();
|
332
|
-
}
|
333
|
-
}
|
334
|
-
else {
|
335
|
-
this._orderList.removeSelection();
|
336
|
-
}
|
337
|
-
}
|
338
|
-
else {
|
339
|
-
if (searchingText) {
|
340
|
-
const matchedIndexes = [];
|
341
|
-
this.columns.forEach((column, index) => {
|
342
|
-
if (this.compareWords(column, searchingText)) {
|
343
|
-
matchedIndexes.push(index);
|
344
|
-
}
|
345
|
-
});
|
346
|
-
if (matchedIndexes.length > 0) {
|
347
|
-
if (hitEnter) {
|
348
|
-
for (let j = 0; j < matchedIndexes.length; j++) {
|
349
|
-
if (matchedIndexes[j] > this._selectedIndex) {
|
350
|
-
newSelected = matchedIndexes[j];
|
351
|
-
break;
|
352
|
-
}
|
353
|
-
}
|
354
|
-
}
|
355
|
-
if (newSelected === -1) {
|
356
|
-
newSelected = matchedIndexes[0];
|
357
|
-
}
|
358
|
-
}
|
359
|
-
this._selectedIndex = newSelected;
|
360
|
-
let selectedColumn = this.columns[newSelected];
|
361
|
-
if (selectedColumn) {
|
362
|
-
const listItem = this._columListItems.map(group => group.items).flat().find(item => item.label === selectedColumn.label);
|
363
|
-
if (listItem)
|
364
|
-
this._columnList.setSelection(listItem, true);
|
365
|
-
}
|
366
|
-
else {
|
367
|
-
this._columnList.removeSelection();
|
368
|
-
}
|
369
|
-
}
|
370
|
-
else {
|
371
|
-
this._columnList.removeSelection();
|
372
|
-
}
|
373
|
-
}
|
374
|
-
}
|
375
|
-
compareWords(column, searchingText) {
|
376
|
-
var _a, _b;
|
377
|
-
const columnLabel = (_a = StringUtils.replaceAccentuatedChars(column === null || column === void 0 ? void 0 : column.label)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
378
|
-
const argument = (_b = StringUtils.replaceAccentuatedChars(searchingText)) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
379
|
-
if (StringUtils.isEmpty(columnLabel) || StringUtils.isEmpty(argument)) {
|
380
|
-
return false;
|
381
|
-
}
|
382
|
-
return columnLabel.includes(argument);
|
383
|
-
}
|
384
|
-
getColumnNames() {
|
385
|
-
const listNames = [];
|
386
|
-
listNames.push(this.getMessage("snkGridConfig.tab.columns"));
|
387
|
-
listNames.push(this.getMessage("snkGridConfig.tab.lineOrdering"));
|
388
|
-
return listNames.join(',');
|
389
|
-
}
|
390
|
-
closeConfig() {
|
391
|
-
this._orderList.scrollToTop();
|
392
|
-
this._columnList.scrollToTop();
|
393
|
-
this._searchElement.value = "";
|
394
|
-
if (this._dataChanged) {
|
395
|
-
let options = {
|
396
|
-
canClose: false,
|
397
|
-
labelCancel: this.getMessage("snkGridConfig.confirm.cancel"),
|
398
|
-
labelConfirm: this.getMessage("snkGridConfig.confirm.save"),
|
399
|
-
btnConfirmDanger: false
|
400
|
-
};
|
401
|
-
ApplicationUtils.confirm(this.getMessage("snkGridConfig.confirm.alert"), this.getMessage("snkGridConfig.confirm.msgCancel"), null, DialogType.WARN, options)
|
402
|
-
.then((response) => {
|
403
|
-
if (!response) {
|
404
|
-
this._dataChanged = false;
|
405
|
-
this.configCancel.emit();
|
406
|
-
this._orderList.clearHistory();
|
407
|
-
this._componenteInternalKey = Date.now();
|
408
|
-
}
|
409
|
-
else {
|
410
|
-
this.finish();
|
411
|
-
}
|
412
|
-
});
|
413
|
-
}
|
414
|
-
else {
|
415
|
-
this.configCancel.emit();
|
416
|
-
this._orderList.clearHistory();
|
417
|
-
}
|
418
|
-
}
|
419
|
-
/* Handlers */
|
420
|
-
handleTabChange(tab) {
|
421
|
-
if ((tab === null || tab === void 0 ? void 0 : tab.index) != undefined) {
|
422
|
-
if (this.selectedIndex !== tab.index) {
|
423
|
-
if (tab.index === 0) {
|
424
|
-
this._orderList.scrollToTop();
|
425
|
-
}
|
426
|
-
else if (tab.index === 1) {
|
427
|
-
this._columnList.scrollToTop();
|
428
|
-
}
|
429
|
-
this._searchElement.value = "";
|
430
|
-
}
|
431
|
-
if (tab.index === 1) {
|
432
|
-
this.createOrderList();
|
433
|
-
}
|
434
|
-
this.selectedIndex = tab.index;
|
435
|
-
}
|
436
|
-
}
|
437
|
-
handleColumnListChange(evt) {
|
438
|
-
var _a;
|
439
|
-
if (evt.detail) {
|
440
|
-
let visibleItems = (_a = evt.detail.find((group) => group.group === this.getMessage("snkGridConfig.group.visible"))) === null || _a === void 0 ? void 0 : _a.items;
|
441
|
-
if (visibleItems) {
|
442
|
-
this._dataChanged = true;
|
443
|
-
this._orderListItems = visibleItems;
|
444
|
-
}
|
445
|
-
}
|
446
|
-
}
|
447
|
-
handleOrderListChange(evt) {
|
448
|
-
if (evt.detail) {
|
449
|
-
let orderPriorityList = evt.detail;
|
450
|
-
if (orderPriorityList) {
|
451
|
-
this._dataChanged = true;
|
452
|
-
this._orderPriorityList = orderPriorityList;
|
453
|
-
}
|
454
|
-
}
|
455
|
-
}
|
456
|
-
componentWillRender() {
|
457
|
-
var _a;
|
458
|
-
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
459
|
-
this.createColumnList();
|
460
|
-
}
|
461
|
-
}
|
462
|
-
componentDidRender() {
|
463
|
-
var _a;
|
464
|
-
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
465
|
-
this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
|
466
|
-
}
|
467
|
-
}
|
468
|
-
componentDidLoad() {
|
469
|
-
ElementIDUtils.addIDInfo(this._element);
|
470
|
-
}
|
471
|
-
render() {
|
472
|
-
return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "" }, h("label", { class: "title" }, this.getMessage("snkGridConfig.gridConfiguration")), h("label", { class: "subtitle" }, this.getMessage("snkGridConfig.columnVisibilityOrder"))), h("div", { class: "button-close" }, h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "tabselector-container" }, h("ez-tabselector", { selectedIndex: this.selectedIndex, onEzChange: (evt) => { this.handleTabChange(evt.detail); }, tabs: this.getColumnNames() })), h("div", null, h("ez-text-input", { "data-element-id": "searchColums", ref: (el) => this._searchElement = el, label: this.getMessage("snkGridConfig.findColumn"), onKeyUp: (evt) => this.locateColumn(evt) }, h("ez-icon", { slot: "leftIcon", size: "medium", iconName: "search" })))), h("div", { class: "grid-config__main" }, h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedIndex === 0 ? "" : "hidden", dataSource: this._columListItems, onEzChange: (evt) => this.handleColumnListChange(evt), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true, "data-element-id": "configCols" }), h("div", { class: this.selectedIndex === 1 ? "group-name" : "hidden" }, this.getMessage("snkGridConfig.info.sortingSequence")), h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedIndex === 1 ? "height-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, onEzChange: (evt) => this.handleOrderListChange(evt), ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item), "data-element-id": "configDataOrder" })), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: this.getMessage("snkGridConfig.cancel"), onClick: () => this.closeConfig() }), h("ez-button", { label: this.getMessage("snkGridConfig.complete"), class: "ez-button--primary", onClick: () => this.finish() }))));
|
473
|
-
}
|
474
|
-
static get assetsDirs() { return ["../assets"]; }
|
475
|
-
get _element() { return getElement(this); }
|
476
|
-
};
|
477
|
-
SnkGridConfig.style = snkGridConfigCss;
|
478
|
-
|
479
|
-
export { SnkGridConfig as snk_grid_config };
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
|
-
import { O as ORDER_VALUES } from './constants-8457af36.js';
|
3
|
-
|
4
|
-
const snkSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
5
|
-
|
6
|
-
const SelectBox = class {
|
7
|
-
constructor(hostRef) {
|
8
|
-
registerInstance(this, hostRef);
|
9
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
10
|
-
this.selectedOption = ORDER_VALUES.none;
|
11
|
-
}
|
12
|
-
render() {
|
13
|
-
return (h("ez-combo-box", { class: "grid-config-combo ez-input--inverted", label: "", suppressSearch: true, value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, Object.keys(ORDER_VALUES).map((key) => {
|
14
|
-
return h("option", { value: ORDER_VALUES[key].value }, ORDER_VALUES[key].label);
|
15
|
-
})));
|
16
|
-
}
|
17
|
-
static get assetsDirs() { return ["../assets"]; }
|
18
|
-
};
|
19
|
-
SelectBox.style = snkSelectBoxCss;
|
20
|
-
|
21
|
-
export { SelectBox as snk_select_box };
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,c as t,h as e,H as s}from"./p-d2d301a6.js";import{ElementIDUtils as r}from"@sankhyalabs/core";import{DataBinder as o}from"@sankhyalabs/ezui/dist/collection/utils/form";const a=class{constructor(e){i(this,e),this.snkContentCardChanged=t(this,"snkContentCardChanged",7),this.snkRequestClearFieldToFocus=t(this,"snkRequestClearFieldToFocus",7),this.formItemsReady=t(this,"formItemsReady",7),this.levelPath=void 0,this.label=void 0,this.name=void 0,this.fields=void 0,this.formMetadata=void 0,this.dataUnit=void 0,this.contracted=void 0,this.fixed=!1,this.summaryFields=void 0,this.canExpand=!0,this.canFix=!0,this.recordsValidator=void 0,this.fieldToFocus=void 0}async showUp(){this._formView&&this._formView.showUp()}changeFix(){this.fixed=!this.fixed,this.emitEvent("fixed")}changeContracted(){this.contracted=!this.contracted,this.emitEvent("presentation")}emitEvent(i){this.snkContentCardChanged.emit({formName:this.name,cardConfig:{fixed:this.fixed,presentation:this.contracted?"CONTRACTED":"EXPANDED"},propertyChanged:i})}getCardSummary(){const i={};return this.getSummaryFields().forEach((({field:t,label:e})=>{var s;const r=this.dataUnit.getFormattedValue(t);""!==r&&(null==e&&(e=null===(s=this.dataUnit.getField(t))||void 0===s?void 0:s.label),i[e]=r)})),i}getSummaryFields(){return null==this.summaryFields?this.fields.map((i=>{const t=this.dataUnit.getField(i.name);return{field:i.name,label:i.label||(null==t?void 0:t.label)}})):this.summaryFields}bindFields(i){null==this._dataBinder&&null!=this.dataUnit&&(this._dataBinder=new o(this.dataUnit)),this._dataBinder&&this._dataBinder.bind(i,this.dataUnit.dataUnitId,this.formMetadata,this.recordsValidator)}handleFormItemsReady(i){i.stopPropagation(),this.formItemsReady.emit(Object.assign(Object.assign({},i.detail),{formId:this.name}))}disconnectedCallback(){null!=this._dataBinder&&this._dataBinder.onDisconnectedCallback()}componentDidRender(){null!=this.fieldToFocus&&this.fields.some((i=>i.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.snkRequestClearFieldToFocus.emit()}))}render(){return e(s,{class:"ez-box__container"},e("div",{class:"summary-header ez-flex ez-size-width--full"},e("div",{class:"ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9"},this.levelPath?e("span",{class:"level-path"},this.levelPath+" /"):void 0,this.label),e("div",{class:"ez-flex ez-flex--justify-end ez-col--sd-3"},this.canFix&&e("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.fixed?"un-pin":"push-pin","data-element-id":r.getInternalIDInfo("toggleFixed_ezFormCard"),onClick:()=>this.changeFix(),title:this.fixed?"Desafixar":"Fixar"}),this.canExpand&&e("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.contracted?"chevron-down":"chevron-up","data-element-id":r.getInternalIDInfo("toggleExpand_ezFormCard"),onClick:()=>this.changeContracted(),title:this.contracted?"Expandir":"Resumir"}))),e("slot",null),this.contracted?e("snk-form-summary",{summary:this.getCardSummary()}):e("ez-form-view",{ref:i=>this._formView=i,fields:this.fields,onEzContentReady:i=>this.bindFields(i.detail),onFormItemsReady:i=>this.handleFormItemsReady(i)}))}};a.style=".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";export{a as snk_form_view}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{ApplicationContext as o,ObjectUtils as r,DataType as n,ElementIDUtils as l}from"@sankhyalabs/core";import{ApplicationUtils as a,DialogType as d}from"@sankhyalabs/ezui/dist/collection/utils";import{D as h,a as c,b as p}from"./p-38289a55.js";import{R as u}from"./p-b0ef4383.js";import{D as m}from"./p-9695f78b.js";import{S as v}from"./p-32f0935f.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff6064e7.js";class x{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===h.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===h.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[h.EXPORT_PAGE_TO_PDF,h.EXPORT_PAGE_TO_XLS];if(t===h.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===h.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===h.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===h.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===h.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportByEmail(t,e){t===h.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:h.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:h.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,group:t}}getCurrentPage(){return{id:h.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:h.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:h.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:h.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function f(t){var{methodName:e}=t,i=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(t,["methodName"]);const s=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${e}`,n={serviceName:s,requestBody:i};return new Promise(((t,e)=>{m.get().callServiceBroker(s,r.objectToString(n)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>e(t)))}))}const E=5e3,b=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._items=[],this._showDropdown=!1,this._releasedToExport=[h.EXPORT_TO_PDF,h.EXPORT_TO_XLS,h.EXPORT_BY_EMAIL,h.EXPORT_PDF_TO_EMAIL,h.EXPORT_XLS_TO_EMAIL,h.EXPORT_PAGE_TO_PDF,h.EXPORT_PAGE_TO_XLS],this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=c[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:c.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,titleGrid:this._appLabel},(()=>{this._snkEmailSender.close(),a.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=v.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){if(null==this.provider||null==t||null==e)return;const i=this.provider.getFilters(),s=await this.provider.getColumnsMetadata(),o=this.provider.getOrders(),r=this.provider.getResourceURI(),n=this.provider.getSelectedIDs(),l=t.exportOption,d=[h.EXPORT_PAGE_TO_PDF,h.EXPORT_PAGE_TO_XLS];delete t.exportOption;let c=Object.assign({filters:i,columns:s,sort:o,resourceURI:r,selectedIDs:n.slice(0,E)},t);if(d.includes(l)||"page"==t.type){const t=this.provider.getOffset(),e=this.provider.getLimit();c=Object.assign(Object.assign({},c),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(c=Object.assign(Object.assign({},c),{offset:0,limit:E,selectedIDs:[]}));f(c).then((t=>e(t))).catch((t=>a.error(this.getMessage("snkDataExporter.message.exportError"),t?t.statusMessage:this.getMessage("snkDataExporter.message.exportError"))))}getOptionKey(t){return Object.keys(h).find((e=>h[e]===t))}dispatchExporter(t){var e;const i=this.getOptionKey(t),s=null!==(e=p[i])&&void 0!==e?e:p.EXPORT_TO_PDF,r=p[i]===p.EXPORT_TO_XLS;this.resolveExporter({methodName:h[`EXPORT_TO_${s}`],fileName:this._appLabel,titleGrid:this._appLabel,exportOption:t,limit:E},(t=>{!function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),a.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:s,isDownload:r}))}))}async processExporter(t){var e,i,s,o;const r=null==t?void 0:t.detail,n=[h.EXPORT_PAGE_TO_PDF,h.EXPORT_PAGE_TO_XLS],l=null===(e=null==r?void 0:r.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==r?void 0:r.id)===h.EXPORT_CURRENT_PAGE)return;const c=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),p=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),u=null===(o=this.provider)||void 0===o?void 0:o.getLimit();let m=!1;if(n.includes(null==r?void 0:r.id)&&u<=E||l?m=!1:(null==c?void 0:c.length)?m=c.length>E:p>E&&(m=!0),m){const t=E.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await a.confirm(e.title,e.description,null,d.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(l)return this.openPersonalizedReports(r.id),void(this._showDropdown=!1);this._releasedToExport.includes(null==r?void 0:r.id)&&(r.id===h.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(r.id),this._showDropdown=!1)}loadItems(){const t=[];this._releasedToExport.forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e;const i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID();if(null==i)return void(this._items=t);const s=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>m.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:i});null==s||s.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e;const i=[],s=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(e=this.provider)||void 0===e||e.getSelectedIDs().forEach((({name:t,type:e,value:s},o)=>{const r=[];r.fields=[],0===o&&(i[`PK_${t}`]={type:this.parseDataType(e),value:s},i.pks=[]),r.fields.push({nome:t,tipo:e,valor:s}),i.pks.push(r)})),this._application.openApp(`${u}${s}`,i)}parseDataType(t){switch(t){case n.NUMBER:return"I";case n.DATE:return"D";default:return"S"}}loadDropdown(){var t,e;this._selectedNumber=(null===(e=null===(t=this.provider)||void 0===t?void 0:t.getSelectedIDs())||void 0===e?void 0:e.length)||0,this._itemBuilder=new x(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(l.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};b.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{b as snk_data_exporter}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{UserInterface as t,DateUtils as s}from"@sankhyalabs/core";import e from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import{P as i}from"./p-c22c1d8e.js";class r{setDataUnit(t){this._dataUnit=t}setApplication(t){this._application=t}formatLabel(e,i){const{userInterface:r}=this._dataUnit.getField(e);return r===t.DATETIME?s.formatDate(this._dataUnit.valueFromString(e,i)):String(this._dataUnit.getFormattedValue(e,i))}async getStaticOptions(t){return Promise.resolve(null==t?void 0:await i.getDistinct(this._dataUnit,t))}fetchData(s,e){return new Promise((i=>{this._application.executeSelectDistinct(this._dataUnit,e,s).then((s=>{i(s.map((s=>this._dataUnit.getField(e).userInterface===t.SEARCH?Object.assign(Object.assign({},JSON.parse(s)),{check:!0}):{value:s,label:this.formatLabel(e,s),check:!0})))}))}))}sortItems(t,s){return e.defaultSorterMultSelectionOption(this._dataUnit,t,s)}}export{r as S}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import{d as e,D as s}from"./p-9695f78b.js";import{ObjectUtils as t}from"@sankhyalabs/core";class r{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
|
2
|
-
$queryAlias$: fetchResource(name: $name){
|
3
|
-
resource
|
4
|
-
}
|
5
|
-
}`),this.templateByQuery.set("saveResource",e.gql`mutation($resource: InputResource!) {
|
6
|
-
$queryAlias$: saveResource(resource: $resource){
|
7
|
-
name
|
8
|
-
resource
|
9
|
-
}
|
10
|
-
}`)}loadResource(e){if(r._loadingResource.has(e))return r._loadingResource.get(e);const t=new Promise(((t,n)=>{s.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchResource")}).then((s=>{t(null==s?void 0:s.resource),r._loadingResource.delete(e)})).catch((s=>{n(s),r._loadingResource.delete(e)}))}));return r._loadingResource.set(e,t),t}saveResource(e,t){return new Promise(((r,n)=>{s.get().callGraphQL({values:{resource:{name:t,resource:JSON.stringify(e)}},query:this.templateByQuery.get("saveResource")}).then((e=>{r(e)})).catch((e=>{n(e)}))}))}}r._loadingResource=new Map;class n extends r{constructor(){super(),this.queryConfig=new Map,this.buildTemplatesConfig()}buildTemplatesConfig(){this.queryConfig.set("fetchUserAvailableConfigs",e.gql`query($name: String!) {
|
11
|
-
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
12
|
-
name
|
13
|
-
origin
|
14
|
-
key
|
15
|
-
}
|
16
|
-
}`),this.queryConfig.set("fetchLegacyConfig",e.gql`query($name: String!) {
|
17
|
-
$queryAlias$: fetchLegacyConfig(name: $name){
|
18
|
-
name
|
19
|
-
resource
|
20
|
-
}
|
21
|
-
}`),this.queryConfig.set("fetchDefaultConfig",e.gql`query($name: String!) {
|
22
|
-
$queryAlias$: fetchDefaultConfig(name: $name){
|
23
|
-
name
|
24
|
-
resource
|
25
|
-
}
|
26
|
-
}`)}loadFormConfig(e,s){return new Promise(((t,r)=>{Promise.all([this.loadResource(this.getPath(s,e)),this.loadResource(this.getPath(`FormCardState:${s}`,e,"form-card")),this.loadResource(this.getPath(s,e,"summary")),this.loadResource(this.getPath(s,e,"defaultValues"))]).then((([e,s,r,n])=>{let a;if(null!=e){a=Object.assign(Object.assign({},JSON.parse(e)),{emptyConfig:!1});const{tabs:s,fields:t}=a;if(s){const e=new Map(s.map((e=>[e.label,e])));null==t||t.forEach((s=>{var t;return s.tab=(null===(t=e.get(this.getTabName(s.tab)))||void 0===t?void 0:t.label)||e.get(this.getTabName(s.tab))}))}a.fields=null==t?void 0:t.map((e=>{if("readonly"in e){const s=!0===e.readonly;delete e.readonly,e.readOnly=s}return e}))}null!=s&&(null==a&&(a={emptyConfig:!0,fields:[]}),a.cardsState=new Map(JSON.parse(s))),null!=r&&(null==a&&(a={emptyConfig:!0,fields:[]}),a.summary=new Map(Object.entries(JSON.parse(r)))),null!=n&&(null==a&&(a={emptyConfig:!0,fields:[]}),a.defaultVars=new Map(Object.entries(JSON.parse(n)))),t(a)})).catch((e=>{r(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveCardState(e,s,t){const r=this.getPath(`FormCardState:${t}`,s,"form-card");return new Promise(((s,t)=>{this.saveResource(Array.from(e.entries()),r).then((e=>{s(new Map(JSON.parse(e.resource)))})).catch((e=>{t(e)}))}))}saveConfig(e,s,t){delete e.cardsState,delete e.defaultVars,delete e.summary;const r=this.getPath(t,s);return new Promise(((s,t)=>{this.saveResource(e,r).then((e=>{s(JSON.parse(e.resource))})).catch((e=>{t(e)}))}))}fetchUserAvailableConfigs(e,t){const r=this.getPath(t,e);return new Promise(((e,t)=>{s.get().callGraphQL({values:{name:r},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((s=>{e(s)})).catch((e=>{t(e)}))}))}fetchLegacyConfig(e,r){const n=this.getPath(r,e);return new Promise(((e,r)=>{s.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchLegacyConfig")}).then((s=>{e(t.stringToObject((null==s?void 0:s.resource)||""))})).catch((e=>{r(e)}))}))}fetchDefaultConfig(e,r){const n=this.getPath(r,e);return new Promise(((e,r)=>{s.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchDefaultConfig")}).then((s=>{e(t.stringToObject((null==s?void 0:s.resource)||""))})).catch((e=>{r(e)}))}))}getPath(e,s,t="form"){return s?`cfg://${t}/${e}/${s}`:`cfg://${t}/${e}`}}var a;!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(a||(a={}));export{n as F,r as R,a as U}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as s,c as i,h as t,g as a}from"./p-d2d301a6.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{S as o}from"./p-573a07c5.js";import{R as e}from"./p-688dcb4c.js";import"./p-aa95fb2c.js";import"./p-0d7863ed.js";import"./p-9695f78b.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const n=class{constructor(t){s(this,t),this.exit=i(this,"exit",7),this.actionClick=i(this,"actionClick",7),this.formItemsReady=i(this,"formItemsReady",7),this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}closeConfig(){this.hideConfig()}dataunitReady(){h.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}async componentWillLoad(){let s=this._element.parentElement;for(;s;){if("SNK-DATA-UNIT"===s.tagName.toUpperCase()){this._snkDataUnit=s,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(s=>{this._dataUnit=s.detail})),this._snkDataUnit.addEventListener("dataStateChange",(s=>{this._dataState=s.detail}));break}s=s.parentElement}null==this.resourceID&&(this.resourceID=await e.getResourceID()),this._configManager=new o(this.configName,this.resourceID),this._configManager.loadConfig()}render(){if(this._dataUnit&&this._dataState)return t("section",null,t("div",{class:"ez-row"},t("div",{class:"ez-col ez-col--sd-12"},t("ez-form",{key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataState.insertionMode,this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&t("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return a(this)}};n.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";export{n as snk_form}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as s,h as i,g as e}from"./p-d2d301a6.js";import{ElementIDUtils as o}from"@sankhyalabs/core";import{F as h}from"./p-ff1990ad.js";const r=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this.value=void 0,this.config=void 0}ezChangeListener(t){this.value=t.detail.value,this.valueChanged.emit(this.value)}async show(){this._comboElement.setFocus()}componentDidLoad(){this._element&&o.addIDInfo(this._element,"filterContentEditor")}render(){if(this.config&&this.config.type===h.MULTI_SELECT)return i("ez-combo-box",{id:this.config.id,ref:t=>this._comboElement=t,label:this.config.label,value:this.config.value,options:this.config.props.options})}get _element(){return e(this)}};export{r as snk_filter_multi_select}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,h as i,H as s,g as e,c as n}from"./p-d2d301a6.js";import{ApplicationContext as o,StringUtils as a,ErrorException as c,WarningException as r,ObjectUtils as l,DateUtils as h,ArrayUtils as d,ElementIDUtils as u}from"@sankhyalabs/core";import{D as p}from"./p-9695f78b.js";import{P as m}from"./p-eaad0aa8.js";import"./p-d9bb09b3.js";import"./p-38289a55.js";import"./p-9e7d65a4.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-3891ae6f.js";import"./p-c22c1d8e.js";import"./p-ff1990ad.js";import"./p-0d7863ed.js";import{R as v}from"./p-688dcb4c.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";class b{execute(t){var i;const s={actionID:t.actionID,refreshType:null===(i=t.actionConfig.javaCall)||void 0===i?void 0:i.refreshType};return new Promise((t=>{t({execSource:s,callback:this.callExecJava})}))}async callExecJava(t){const i={requestBody:{javaCall:t}};await p.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(i))}}class w{execute(t){var i;const s={actionID:t.actionID,refreshType:null===(i=t.actionConfig.runScript)||void 0===i?void 0:i.refreshType};return new Promise((t=>{t({execSource:s,callback:this.callExecScript})}))}async callExecScript(t){const i={runScript:t};await p.get().callServiceBroker("ActionButtonsSP.executeScript",i)}}class f{constructor(){this._application=o.getContextValue("__SNK__APPLICATION__")}async execute(t,i){const s=t.resourceID;if(!s)return;let e=await this.buildLaunchObject(t,i);return this._application.openApp(s,e),null}buildLaunchObject(t,i){return new Promise((s=>{let e=t.actionConfig.params.param;if(e&&e.length>0){let n={},o=[];e.forEach((s=>{const e=s.localField;let r=i.getFieldValue(e);if(!r){let s=i.getField(e).label;throw s=a.isEmpty(i.getField(e).label)?e:s,new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:t.description,localFieldLabel:s}))}r=a.isEmpty(r.toString())?void 0:r.toString(),n[s.targetField]=r,o.push({fieldName:s.targetField,value:r})})),n.ACTION_PARAMETERS=o,n.call_time=Date.now(),s(n)}s(null)}))}}class k{execute(t){var i,s,e;const n=null===(i=t.actionConfig.dbCall)||void 0===i?void 0:i.name,o=null===(s=t.actionConfig.dbCall)||void 0===s?void 0:s.rootEntity,a={actionID:t.actionID,refreshType:null===(e=t.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((t=>{t({execSource:a,callback:this.callExecProcedure})}))}async callExecProcedure(t){const i={requestBody:{stpCall:t}};await p.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(i))}}var _,y;!function(t){t.LAUNCH_SCREEN="LC",t.JAVASCRIPT="SC",t.JAVA="RJ",t.PROCEDURE="SP",t.EMBEDDED="EB"}(_||(_={}));class S{constructor(t){this.actionType=t,this._application=o.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case _.LAUNCH_SCREEN:return new f;case _.JAVASCRIPT:return new w;case _.JAVA:return new b;case _.PROCEDURE:return new k;default:throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(t){t.NONE="NONE",t.PARENT="PARENT",t.MASTER="MASTER",t.ALL="ALL"}(y||(y={}));const A="__MASTER_ROW__";class P{constructor(t,i,s){var e;this._lastValuesCache={},this._actionsExecuteInterface=t,this._dataUnit=i,this._selectedRows=(null===(e=null==i?void 0:i.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==i?void 0:i.getSelectionInfo().records,this._application=o.getContextValue("__SNK__APPLICATION__"),this._appResourceId=s}apply(t,i){this._application.closePopUp(),this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:s,callback:e})=>{this.resolvePromptParams(t,s,i).then((()=>{this.actionExecute(s,e)}))}))}async execute(t){var i;if(!t.actionConfig)throw new r(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:t.description}));if(null===(i=t.actionConfig.params)||void 0===i?void 0:i.promptParam){const i=t.actionConfig.params.promptParam;let s=!1;for(let t=0;t<i.length;t++)if(!s&&"true"===i[t].saveLast){s=!0;break}s&&(t.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(t));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=l.copy(t),e.applyParameters=t=>{this.apply(t,s)},e.openPopup()}else t.type!=_.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:t,callback:i})=>{this.actionExecute(t,i)})):this._actionsExecuteInterface.execute(t,this._dataUnit)}loadSavedValuesIntoParams(t){return this.loadLastValues(t).then((i=>{let s=t.actionConfig.params.promptParam;return i&&i.param.forEach((t=>{s=s.map((i=>i.name!==t.paramName?i:Object.assign(Object.assign({},i),"B"===i.paramType?{value:"S"===t.$}:{value:t.$})))})),s}))}actionExecute(t,i){t.virtualPage=this.buildVirtualPage(),this.prepareAndExecute(t,i),this.recordsReloader(t.refreshType)}resolvePromptParams(t,i,s){return new Promise((e=>{let n=[];t.actionConfig.params.promptParam.forEach((t=>{n.push(this.buildPromptParam(t))})),this.putParamsOnExecSource(n,i),s&&this.saveLastValues(t,n),e()}))}buildPromptParam(t){let i,s,e=t.paramType,n=!1,o=t.value;switch(e){case m.DATE:e="D";break;case m.DATETIME:e="H";break;case m.DECIMAL:e="F",i={"sk-precision":Number(t.precision)};break;case m.BOOLEAN:e="S",n=!0,o=t.value?"S":"N";break;case m.ENTITY:i={"sk-entity-name":t.entityName,"sk-allow-show-hierarchical-mode":t.hierarchyEntity,"sk-data-type":"S"},t.hierarchyEntity&&t.entityPK&&(s=t.entityPK),o=t.value?Number(t.value):null;break;case m.OPTIONS:e="O";let a=t.options.split(";").map((function(t,i){let s,e;if(t.indexOf("=")>-1){let i=t.split("=");s=i[0],e=i[1]}else s=i+1,e=t;return{data:s,value:e}}));i={"sk-options":a}}return{description:t.label,required:"true"==t.required,fieldName:t.name,fieldNameOri:t.name,entityPK:s,paramType:t.paramType,type:e,isCheckbox:n,saveLast:t.saveLast,fieldProp:i,value:o,isGeneratedName:t.isGeneratedName}}putParamsOnExecSource(t,i){i.params={param:[]},t.forEach((t=>{if(t.isGeneratedName&&t.value)throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));a.isEmpty(t.value)||i.params.param.push({type:this.getParamDataType(t.paramType),paramName:t.fieldName,$:this.getParamValue(t)})}))}getParamDataType(t){let i;switch(t){case"D":i="F";break;case"DT":case"DH":i="D";break;case"B":case"ENTITY":case"SO":i="S";break;default:i=t}return i}getParamValue(t){let i=t.value;return i?("DT"==t.paramType?i=h.formatDate(i):"DH"==t.paramType&&(i=h.formatDateTime(i)),i):i}async loadLastValues(t){const i=await this.buildResourceId(t.actionID);return new Promise(((t,s)=>{if(this._lastValuesCache[i])t(this._lastValuesCache[i]);else{const e={config:{chave:i,tipo:"T"}};p.get().callServiceBroker("SystemUtilsSP.getConf",e).then((s=>{var e,n;let o;(null===(n=null===(e=s.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=s.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[i]=o,t(o)})).catch((t=>{s(t)}))}}))}async saveLastValues(t,i){if(this._application){let s={params:{param:[]}};i.forEach((t=>{"true"==t.saveLast&&s.params.param.push({paramName:t.fieldName,$:t.value})}));const e=await this.buildResourceId(t.actionID);this._lastValuesCache[e]=s.params,this._application.saveConfig(e,s)}}async buildResourceId(t){return this._appResourceId+".actionconfig."+t}prepareAndExecute(t,i){this.addRows(t),i(t)}addRows(t){const i={row:[]},s=this._selectedRows;for(const t in s){const e=s[t],n={};e.hasOwnProperty(A)&&(n.master="S",n.entityName=e.__ENTITY_NAME__,delete e[A],delete e.__ENTITY_NAME__);for(const t in e)"NUFIN"===t&&(n.field||(n.field=[]),n.field.push({fieldName:t,$:e[t]}));i.row.push(n)}i.row.length>0&&(t.rows=i)}recordsReloader(t){switch(t){case y.NONE:break;case y.PARENT:case y.MASTER:case y.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var t,i,s,e;if(null===(i=null===(t=this._dataUnit)||void 0===t?void 0:t.getSelectionInfo())||void 0===i?void 0:i.isAllRecords())return{filters:{filters:null===(s=this._dataUnit)||void 0===s?void 0:s.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class N{async clientConfirm(t,i){return new Promise((s=>{const e=o.getContextValue("__SNK__APPLICATION__");let n="";t.content.event.hasOwnProperty("stpCall")?(i.requestBody=t.content.event.stpCall,n=_.PROCEDURE):t.content.event.hasOwnProperty("runScript")?(i.requestBody=t.content.event.runScript,n=_.JAVASCRIPT):t.content.event.hasOwnProperty("javaCall")&&(i.requestBody=t.content.event.javaCall,n=_.JAVA);let a={type:"S",sequence:t.content.event.sequence};i.requestBody.params?Array.isArray(i.requestBody.params.param)||(i.requestBody.params.param=[i.requestBody.params.param]):i.requestBody.params={param:[]},i.requestBody.params.param.push(a);const c=t.content.event.title.$,r=t.content.event.message.$;let l;switch(n){case _.JAVASCRIPT:l={runScript:i.requestBody};break;case _.PROCEDURE:l={requestBody:{stpCall:i.requestBody}};break;case _.JAVA:l={requestBody:{javaCall:i.requestBody}}}if("S"==t.content.event.showNoOption){a.paramName="__ESCOLHA_SIMNAO__";const t=document.createElement("snk-client-confirm");window.document.body.appendChild(t),t.titleMessage=c,t.message=r,t.accept=async()=>{a.$="S",await i.reCall(l),s()},t.cancel=async()=>{a.$="N",await i.reCall(l),s()},t.openPopup()}else e.confirm(c,r,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((async t=>{t&&(a.paramName="__CONFIRMACAO__",a.$="S",await i.reCall(l),s())}))}))}}const x=class{constructor(i){t(this,i),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this.handleClick=t=>{const i=this._actions.find((i=>i.actionID==t.detail.id)),s=new S(i.type).executor;new P(s,this._dataUnit,this._resourceID).execute(Object.assign({},i)),this._showDropdown=!1},this._items=[],this._showDropdown=!1,this._actions=[],this._isOrderActions=!1}async getActions(){let t={param:{entityName:this._entityName,resourceID:this._resourceID}};return p.get().callServiceBroker("ActionButtonsSP.getActions",t).then((t=>{var i;(null===(i=t.actions)||void 0===i?void 0:i.action)&&(this._actions=this._isOrderActions?d.sortAlphabetically(t.actions.action,"description"):t.actions.action)}))}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}positionDropdown(){var t;const i=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();i&&this._dropdownParent&&(this._dropdownParent.style.top=i.y+i.height+5+"px",this._dropdownParent.style.left=i.x+"px")}closeDropdown(t){const i=null==t?void 0:t.target;i&&(i.closest(".snk-actions-button")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}async componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__"),this._isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas");const t=this._element.parentElement;this._dataUnit=null==t?void 0:t.dataUnit,this._resourceID=null==t?void 0:t.resourceID,this._entityName=this._dataUnit.name.split("/")[2],null==this._resourceID&&(this._resourceID=await v.getResourceID()),this.setEvents(),this.getActions().then((()=>{this.loadItems()}))}async componentDidLoad(){if(this._element&&(u.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const t=new N;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,t.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((t=>{this._items.push({id:t.actionID,label:t.description})}))}getElementID(t){return{[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:u.getInternalIDInfo(t)}}render(){return i(s,null,this._actions&&this._actions.length>0&&i("div",{class:`ez-padding-left--medium snk-actions-button\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},i("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),i("div",Object.assign({ref:t=>this._dropdownParent=t,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&i("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.handleClick(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&i("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};x.style=".sc-snk-actions-button-h{display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";const O=class{constructor(i){t(this,i),this.taskbarActionSelected=n(this,"taskbarActionSelected",7),this.taskbarActionsOpened=n(this,"taskbarActionsOpened",7),this.taskbarActionsButtonDisconnected=n(this,"taskbarActionsButtonDisconnected",7),this._showDropdown=!1,this.title=void 0,this.enabled=void 0,this.actions=void 0}async handleKeyDown(t){"Escape"!==t.key&&"Esc"!==t.key||await this.hideActions()}async handleClose(){await this.hideActions()}async showActions(){this._showDropdown=!0,requestAnimationFrame((()=>{this._element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))}async hideActions(){this._showDropdown=!1}async isOpened(){return this._showDropdown}controlDropdown(){this._showDropdown=!this._showDropdown}loadItems(){return this.actions.filter((t=>void 0!==t)).map((t=>{var i;return{id:t.value,label:t.label,value:t.value,type:null!==(i=t.type)&&void 0!==i?i:"item",children:t.children,iconName:t.iconName,subAction:t.subAction,group:t.group,disableCloseOnSelect:t.disableCloseOnSelect}}))}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this.actions)||void 0===t?void 0:t.length)>0}onSelectAction(t){const i=this.actions.map((t=>Object.assign(Object.assign({},t),{id:t.value}))),s=this.getSelectedAction(t.id,i);this.taskbarActionSelected.emit(s),s.disableCloseOnSelect||(this._showDropdown=!1)}getSelectedAction(t,i){let s;for(const e of i){if(e.id===t){s=e;break}(null==e?void 0:e.children)&&(s=this.getSelectedAction(t,e.children))}return s}dropdownItemBuilder(t,s){const e=this.actions.find((i=>i.value===t.id));if(!e||!e.itemBuilder)return;const n=e.itemBuilder(this._element,e);return"string"==typeof n?i("div",{innerHTML:n}):n}initializeEagerItems(){var t;null===(t=this.actions)||void 0===t||t.forEach((t=>{var i;t&&t.eagerInitialize&&t.itemBuilder&&(null===(i=t.itemBuilder)||void 0===i||i.call(t,this._element,t))}))}componentDidLoad(){this.initializeEagerItems()}componentDidRender(){this._showDropdown&&this.taskbarActionsOpened.emit(this._element)}disconnectedCallback(){this.taskbarActionsButtonDisconnected.emit()}render(){return i(s,null,i("div",{class:"ez-padding-left--medium "+(this.canShowDropdown()?" ez-elevation--16":"")},i("ez-button",{title:this.title,mode:"icon",iconName:"dots-vertical",size:"small",enabled:this.enabled,onClick:()=>this.controlDropdown()}),this.canShowDropdown()&&i("ez-dropdown",{items:this.loadItems(),onEzClick:t=>this.onSelectAction(t.detail),onEzOutsideClick:()=>this._showDropdown=!1,itemBuilder:(t,i)=>this.dropdownItemBuilder(t,i)})))}get _element(){return e(this)}};O.style=".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";export{x as snk_actions_button,O as taskbar_actions_button}
|