@sankhyalabs/sankhyablocks 8.16.0-dev.6 → 8.16.0-dev.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-9b965af9.js} +2 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-42636ac1.js} +64 -22
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-e059eb72.js} +28 -20
- package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
- package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-51caf3d0.js} +72 -16
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-a78242d1.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-228016f4.js} +48 -20
- package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-91fba2b1.js} +42 -2
- package/dist/cjs/index-f9e81701.js +12 -32
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-2ec4811b.js} +10 -2
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_4.cjs.entry.js → snk-actions-button_5.cjs.entry.js} +130 -36
- package/dist/cjs/snk-application.cjs.entry.js +119 -61
- package/dist/cjs/snk-attach.cjs.entry.js +46 -33
- package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +398 -12
- package/dist/cjs/snk-crud.cjs.entry.js +23 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +23 -24
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-3d9b6ed4.js} +66 -34
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +12 -12
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1422 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -1
- package/dist/cjs/snk-grid.cjs.entry.js +67 -21
- package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-421555af.js} +29 -13
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +4 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +97 -44
- package/dist/cjs/snk-taskbar.cjs.entry.js +64 -38
- package/dist/collection/collection-manifest.json +12 -31
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-actions-button/interfaces/index.js +1 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
- package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +28 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
- package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
- package/dist/collection/components/snk-application/snk-application.js +44 -54
- package/dist/collection/components/snk-attach/snk-attach.js +25 -16
- package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js +8 -4
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
- package/dist/collection/components/snk-crud/snk-crud.js +122 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +72 -6
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +7 -7
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +3 -5
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +81 -32
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css +13 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -3
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +5 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +3 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +79 -21
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
- package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
- package/dist/collection/components/snk-form-config/snk-form-config.js +49 -8
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +119 -8
- package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +159 -35
- package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +22 -0
- package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +179 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +106 -38
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +45 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +10 -2
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
- package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
- package/dist/collection/lib/utils/CrudUtils.js +25 -16
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/collection/sw.js +46 -0
- package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +65 -21
- package/dist/components/DataFetcher.js +29 -21
- package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
- package/dist/components/SnkFormConfigManager.js +70 -14
- package/dist/components/SnkMessageBuilder.js +7 -3
- package/dist/components/dataunit-fetcher.js +47 -17
- package/dist/components/form-config-fetcher.js +41 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/pesquisa-fetcher.js +10 -2
- package/dist/components/snk-actions-button2.js +39 -35
- package/dist/components/snk-application2.js +114 -55
- package/dist/components/snk-attach2.js +54 -59
- package/dist/components/snk-crud.js +84 -58
- package/dist/components/snk-data-exporter2.js +16 -17
- package/dist/components/snk-data-unit2.js +68 -72
- package/dist/components/snk-detail-view2.js +114 -104
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +41 -22
- package/dist/components/snk-filter-binary-select.js +1 -1
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-filter-item2.js +5 -1
- package/dist/components/snk-filter-modal.js +3 -1
- package/dist/components/snk-filter-text.js +2 -1
- package/dist/components/snk-form-config2.js +34 -9
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +62 -12
- package/dist/components/snk-personalized-filter-editor.js +4 -4
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +104 -64
- package/dist/components/snk-simple-form-config.d.ts +11 -0
- package/dist/components/snk-simple-form-config.js +6 -0
- package/dist/components/snk-simple-form-config2.js +119 -0
- package/dist/components/snk-taskbar2.js +66 -40
- package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-ff99377a.js} +2 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-071e0b6a.js} +65 -24
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-5034df59.js} +29 -21
- package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
- package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-a7770e24.js} +72 -16
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-0b78ca31.js} +1 -1
- package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-56cb648b.js} +48 -18
- package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-0c2620ef.js} +42 -2
- package/dist/esm/index-a7d3d3f1.js +12 -32
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-24e5bba0.js} +11 -3
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_4.entry.js → snk-actions-button_5.entry.js} +132 -39
- package/dist/esm/snk-application.entry.js +119 -61
- package/dist/esm/snk-attach.entry.js +47 -34
- package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +399 -15
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +24 -9
- package/dist/esm/snk-data-exporter.entry.js +24 -25
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-9fa7d2b9.js} +66 -34
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +13 -13
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +1415 -0
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-text.entry.js +2 -1
- package/dist/esm/snk-grid.entry.js +62 -16
- package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-b740a1fe.js} +30 -14
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter-editor.entry.js +4 -4
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +95 -42
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +65 -39
- package/dist/sankhyablocks/p-00278e07.js +1 -0
- package/dist/sankhyablocks/p-036b4807.entry.js +1 -0
- package/dist/sankhyablocks/p-0d2a2e9e.entry.js +1 -0
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/p-23736d75.js +1 -0
- package/dist/sankhyablocks/p-29643bef.entry.js +1 -0
- package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
- package/dist/sankhyablocks/p-342eeb3b.js +1 -0
- package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-35882caf.entry.js} +1 -1
- package/dist/sankhyablocks/p-365d8ed4.entry.js +1 -0
- package/dist/sankhyablocks/p-399e1b74.entry.js +1 -0
- package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
- package/dist/sankhyablocks/p-47178038.entry.js +1 -0
- package/dist/sankhyablocks/p-47d24ac8.js +60 -0
- package/dist/sankhyablocks/p-53ae0296.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-619aeac8.entry.js +1 -0
- package/dist/sankhyablocks/p-65650e05.entry.js +1 -0
- package/dist/sankhyablocks/p-72a451c8.js +1 -0
- package/dist/sankhyablocks/{p-52920496.js → p-763edad2.js} +1 -1
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/p-82274cb0.js +1 -0
- package/dist/sankhyablocks/p-89c92727.entry.js +1 -0
- package/dist/sankhyablocks/{p-c1d57831.entry.js → p-89da2953.entry.js} +1 -1
- package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
- package/dist/sankhyablocks/p-8cf0a9fe.entry.js +1 -0
- package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
- package/dist/sankhyablocks/p-acca8a69.js +26 -0
- package/dist/sankhyablocks/p-c271fbf1.js +1 -0
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/p-c629c07a.entry.js +1 -0
- package/dist/sankhyablocks/p-c76e7e28.entry.js +1 -0
- package/dist/sankhyablocks/p-e6683406.js +6 -0
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-e9432f45.entry.js} +1 -1
- package/dist/sankhyablocks/p-eda55eef.entry.js +11 -0
- package/dist/sankhyablocks/p-fcc662c6.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
- package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
- package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
- package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
- package/dist/types/components/snk-application/snk-application.d.ts +9 -13
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +21 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +9 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +21 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +24 -3
- package/dist/types/components/snk-simple-form-config/snk-simple-form-config.d.ts +33 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +197 -0
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +8 -2
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
- package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +4 -3
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
- package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
- package/dist/cjs/snk-form.cjs.entry.js +0 -143
- package/dist/esm/snk-config-options.entry.js +0 -235
- package/dist/esm/snk-filter-bar.entry.js +0 -710
- package/dist/esm/snk-filter-item.entry.js +0 -308
- package/dist/esm/snk-filter-list.entry.js +0 -148
- package/dist/esm/snk-filter-modal.entry.js +0 -245
- package/dist/esm/snk-form.entry.js +0 -139
- package/dist/sankhyablocks/p-045eae4d.entry.js +0 -11
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-2a408684.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
- package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
- package/dist/sankhyablocks/p-4f3717df.entry.js +0 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +0 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-7a85fd49.entry.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-913a9979.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-af8efd95.js +0 -6
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
- package/dist/sankhyablocks/p-c2495304.js +0 -1
- package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
- package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-df5451c7.js +0 -26
- package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -5,7 +5,7 @@ import { E as EPresentationMode } from './presentationMode.js';
|
|
5
5
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
6
6
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
7
7
|
|
8
|
-
const snkPersonalizedFilterEditorCss = ".sc-snk-personalized-filter-editor-h{--snk-filter-personalized__max-height:21;--snk-filter-personalized__max-width:21.5}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}.SnkFilterPersonalized_list-container-chip.sc-snk-personalized-filter-editor{width:400px}.SnkFilterPersonalized_list-scroller.sc-snk-personalized-filter-editor{display:block;max-height:calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));cursor:auto;--ez-scroller__max-height:300px}.SnkFilterPersonalized_checkbox.sc-snk-personalized-filter-editor{display:grid;grid-template-columns:auto auto;justify-content:start}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor:has(.SnkFilterPersonalized_list-item--chip){gap:var(--space--small, 6px);max-width:calc(var(--space--md) * var(--snk-filter-personalized__max-width))}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor{display:flex;border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover{background-color:var(--background--medium, #f0f3f7)}.SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:none;align-items:center}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover .SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:flex}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor{display:flex;flex-direction:column;border:var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor .sc-snk-personalized-filter-editor:first-of-type{gap:var(--space--3xs)}";
|
8
|
+
const snkPersonalizedFilterEditorCss = ".sc-snk-personalized-filter-editor-h{--snk-filter-personalized__max-height:21;--snk-filter-personalized__max-width:21.5}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}.SnkFilterPersonalized_list-container-chip.sc-snk-personalized-filter-editor{width:400px}.SnkFilterPersonalized_list-scroller.sc-snk-personalized-filter-editor{display:block;max-height:calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));cursor:auto;--ez-scroller__max-height:300px}.SnkFilterPersonalized_checkbox.sc-snk-personalized-filter-editor{display:grid;grid-template-columns:auto auto;justify-content:start}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor:has(.SnkFilterPersonalized_list-item--chip){gap:var(--space--small, 6px);max-width:calc(var(--space--md) * var(--snk-filter-personalized__max-width))}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor{display:flex;border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover{background-color:var(--background--medium, #f0f3f7)}.SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:none;align-items:center;gap:var(--space--3xs)}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover .SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:flex}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor{display:flex;flex-direction:column;border:var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor .sc-snk-personalized-filter-editor:first-of-type{gap:var(--space--3xs)}.SnkFilterPersonalized_list-icon.sc-snk-personalized-filter-editor{--ez-icon--color:var(--title--primary, #2B3A54);cursor:pointer}.SnkFilterPersonalized_list-icon.sc-snk-personalized-filter-editor:hover{outline:none;color:var(--color--primary-600, #007a5a);fill:var(--color--primary-600, #007a5a);--ez-icon--color:var(--color--primary-600, #007a5a)}";
|
9
9
|
|
10
10
|
const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
11
11
|
constructor() {
|
@@ -48,15 +48,15 @@ const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
48
48
|
}
|
49
49
|
getItemContent(item) {
|
50
50
|
var _a, _b;
|
51
|
-
const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id,
|
51
|
+
const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
|
52
52
|
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
53
|
-
return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-
|
53
|
+
return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-flex--justify-between ez-size-width--full" }, h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
|
54
54
|
}
|
55
55
|
buildModalListActions(item, isVariable) {
|
56
56
|
if (!this.isModalMode())
|
57
57
|
return;
|
58
58
|
return (this.isModalMode() ?
|
59
|
-
h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-
|
59
|
+
h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-icon", { class: 'SnkFilterPersonalized_list-icon', iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-icon", { class: 'SnkFilterPersonalized_list-icon', iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
|
60
60
|
:
|
61
61
|
isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))));
|
62
62
|
}
|
@@ -151,7 +151,7 @@ const SnkPrintSelector$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
151
151
|
render() {
|
152
152
|
return (h(Host, null, h("ez-popup", Object.assign({ size: 'small', heightMode: 'full', useHeader: false, ref: (ref) => this._ezPopup = ref }, this.getElementID("snk-print-selector")), h("ez-modal-container", { modalTitle: this.getMessage("snkPrintSelector.title.printerSelection"), okButtonLabel: this.getMessage("snkPrintSelector.button.print"), okButtonStatus: this._selectedPrinter ? ModalButtonStatus.ENABLED : ModalButtonStatus.DISABLED, cancelButtonLabel: this.getMessage("snkPrintSelector.button.cancel"), onEzModalAction: (evt) => this.handleModalAction(evt.detail) }, this._isSingleJob &&
|
153
153
|
h("div", { class: 'ez-flex ez-margin-bottom--large' }, h("div", { class: 'ez-flex ez-margin-right--large' }, h("span", { class: 'ez-text ez-text--bold ez-text--medium ez-padding-right--small' }, this.getMessage("snkPrintSelector.subtitle.document")), h("span", { class: 'ez-text ez-text--primary ez-text--medium' }, this._printJobData.pendingPrinters[0].docTypeDescription)), h("div", { class: 'ez-flex ez-margin-right--large' }, h("span", { class: 'ez-text ez-text--bold ez-text--medium ez-padding-right--small' }, this.getMessage("snkPrintSelector.subtitle.jobs")), h("span", { class: 'ez-text ez-text--primary ez-text--medium' }, this._printJobData.pendingPrinters[0].printJobCount))), h("ez-tabselector", { tabs: this.buildIdTabSelector(), onEzChange: (evt) => this.onChangeTab(evt), selectedTab: this._printServerActive ? this.REMOTE_PRINTERS_TAB : this.LOCAL_PRINTERS_TAB }), h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", { hidePolicy: 'hide' }, this._printServerActive &&
|
154
|
-
h("div", { class: `list-scroll ez-size-height--full ${this._isSingleJob ? 'with-header' : 'without-header'}` }, h("ez-list", { ref: (ref) => this._remotePrintersList = ref, class: `ez-padding-top--medium ${this._hasRemotePrinters ? '' : 'hidden'}`, dataSource: this._remotePrintersDataSource, onEzSelectItem: (evt) => this.onSelectPrinter(evt.detail, false), itemLeftSlotBuilder: this.buildPrinterIcon, useGroups: true, ezSelectable: true, hoverFeedback: true, "data-element-id": 'remotePrintersList' }), !this._hasRemotePrinters && this.renderNoPrinters())), h("stack-item", { hidePolicy: 'hide' }, h("div", { class: `list-scroll ez-size-height--full ${this._isSingleJob ? 'with-header' : 'without-header'}` }, h("ez-list", { ref: (ref) => this._localPrintersList = ref, class: `ez-padding-top--medium ${this._hasLocalPrinters ? '' : 'hidden'}`, dataSource: this._localPrintersDataSource, onEzSelectItem: (evt) => this.onSelectPrinter(evt.detail, true), itemLeftSlotBuilder: this.buildPrinterIcon, ezSelectable: true, hoverFeedback: true }), !this._hasLocalPrinters && this.renderNoPrinters()))), h("ez-check", { label: this.getMessage("snkPrintSelector.message.savePrinter"), onEzChange: evt => this._saveSubstitute = evt.detail
|
154
|
+
h("div", { class: `list-scroll ez-size-height--full ${this._isSingleJob ? 'with-header' : 'without-header'}` }, h("ez-list", { ref: (ref) => this._remotePrintersList = ref, class: `ez-padding-top--medium ${this._hasRemotePrinters ? '' : 'hidden'}`, dataSource: this._remotePrintersDataSource, onEzSelectItem: (evt) => this.onSelectPrinter(evt.detail, false), itemLeftSlotBuilder: this.buildPrinterIcon, useGroups: true, ezSelectable: true, hoverFeedback: true, "data-element-id": 'remotePrintersList' }), !this._hasRemotePrinters && this.renderNoPrinters())), h("stack-item", { hidePolicy: 'hide' }, h("div", { class: `list-scroll ez-size-height--full ${this._isSingleJob ? 'with-header' : 'without-header'}` }, h("ez-list", { ref: (ref) => this._localPrintersList = ref, class: `ez-padding-top--medium ${this._hasLocalPrinters ? '' : 'hidden'}`, dataSource: this._localPrintersDataSource, onEzSelectItem: (evt) => this.onSelectPrinter(evt.detail, true), itemLeftSlotBuilder: this.buildPrinterIcon, ezSelectable: true, hoverFeedback: true }), !this._hasLocalPrinters && this.renderNoPrinters()))), h("ez-check", { label: this.getMessage("snkPrintSelector.message.savePrinter"), onEzChange: evt => this._saveSubstitute = evt.detail })))));
|
155
155
|
}
|
156
156
|
get element() { return this; }
|
157
157
|
static get style() { return snkPrintSelectorCss; }
|
@@ -33,7 +33,7 @@ const SnkSimpleBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
33
33
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
34
34
|
}
|
35
35
|
render() {
|
36
|
-
return (h("div", { class: "simple-bar__container ez-margin-vertical--
|
36
|
+
return (h("div", { class: "simple-bar__container ez-margin-vertical--small ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
|
37
37
|
}
|
38
38
|
get _element() { return this; }
|
39
39
|
static get style() { return snkSimpleBarCss; }
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType, JSUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
2
|
+
import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType, JSUtils, FloatingManager, KeyboardManager, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
5
5
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
6
6
|
import './DataFetcher.js';
|
7
7
|
import './pesquisa-fetcher.js';
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, R as RmPrecisionCustomValueFormatter, b as buildFieldSearch, o as openFieldSearch, a as CrudUtils } from './
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, T as TaskbarProcessor, R as RmPrecisionCustomValueFormatter, c as ContinuousInsertUtils, b as buildFieldSearch, o as openFieldSearch, a as CrudUtils } from './ContinuousInsertUtils.js';
|
9
9
|
import { D as DataExporterOption, P as PresentationMode } from './ISave.js';
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -14,18 +14,16 @@ import './filter-item-type.enum.js';
|
|
14
14
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
15
15
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
16
16
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager.js';
|
17
|
-
import { g as
|
17
|
+
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
|
18
18
|
import { s as store } from './index2.js';
|
19
|
-
import { d as defineCustomElement$
|
20
|
-
import { d as defineCustomElement$
|
21
|
-
import { d as defineCustomElement$
|
22
|
-
import { d as defineCustomElement$
|
23
|
-
import { d as defineCustomElement$
|
24
|
-
import { d as defineCustomElement$7 } from './snk-field-config2.js';
|
25
|
-
import { d as defineCustomElement$6 } from './snk-form-config2.js';
|
19
|
+
import { d as defineCustomElement$a } from './snk-actions-button2.js';
|
20
|
+
import { d as defineCustomElement$9 } from './snk-configurator2.js';
|
21
|
+
import { d as defineCustomElement$8 } from './snk-data-exporter2.js';
|
22
|
+
import { d as defineCustomElement$7 } from './snk-data-unit2.js';
|
23
|
+
import { d as defineCustomElement$6 } from './snk-exporter-email-sender2.js';
|
26
24
|
import { d as defineCustomElement$5 } from './snk-grid-config2.js';
|
27
25
|
import { d as defineCustomElement$4 } from './snk-select-box2.js';
|
28
|
-
import { d as defineCustomElement$3 } from './snk-
|
26
|
+
import { d as defineCustomElement$3 } from './snk-simple-form-config2.js';
|
29
27
|
import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
|
30
28
|
|
31
29
|
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
@@ -41,7 +39,7 @@ class ClientSideExporterProvider extends CommonsExporter {
|
|
41
39
|
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
42
40
|
}
|
43
41
|
getSelectedIDs() {
|
44
|
-
return
|
42
|
+
return getSelectedRecordsIDsInfo(this.dataUnit);
|
45
43
|
}
|
46
44
|
getRecordID() {
|
47
45
|
var _a, _b, _c;
|
@@ -86,7 +84,7 @@ class ClientSideExporterProvider extends CommonsExporter {
|
|
86
84
|
}
|
87
85
|
}
|
88
86
|
|
89
|
-
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;
|
87
|
+
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
|
90
88
|
|
91
89
|
const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
92
90
|
constructor() {
|
@@ -104,14 +102,13 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
104
102
|
this._customEditors = new Map();
|
105
103
|
this._customRenders = new Map();
|
106
104
|
this._taskbarProcessor = new TaskbarProcessor({
|
107
|
-
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
|
105
|
+
"snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE], true),
|
108
106
|
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
109
|
-
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
|
107
|
+
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE], true),
|
110
108
|
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
|
111
|
-
"snkSimpleCrudTaskbar.finish_edition":
|
109
|
+
"snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
|
112
110
|
});
|
113
111
|
this._showPopUpGridConfig = false;
|
114
|
-
this._showFormConfig = false;
|
115
112
|
this._currentViewMode = VIEW_MODE.GRID;
|
116
113
|
this._config = undefined;
|
117
114
|
this._fieldToGetFocus = undefined;
|
@@ -122,12 +119,15 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
122
119
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
123
120
|
this.gridConfig = undefined;
|
124
121
|
this.formConfig = undefined;
|
122
|
+
this.enableLockManger = false;
|
125
123
|
this._formFields = [];
|
126
124
|
this._fieldsProps = new Map();
|
125
|
+
this._enableContinuousInsert = true;
|
127
126
|
this.multipleSelection = undefined;
|
128
127
|
this.useCancelConfirm = true;
|
129
128
|
this.pageSize = 150;
|
130
129
|
this.resourceID = undefined;
|
130
|
+
this.enableGridInsert = false;
|
131
131
|
this.taskbarManager = undefined;
|
132
132
|
this.messagesBuilder = undefined;
|
133
133
|
this.useEnterLikeTab = false;
|
@@ -138,7 +138,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
138
138
|
this.formLegacyConfigName = undefined;
|
139
139
|
this.ignoreReadOnlyFormFields = false;
|
140
140
|
this.autoFocus = true;
|
141
|
+
this.domainMessagesBuilder = undefined;
|
141
142
|
this.autoLoad = undefined;
|
143
|
+
this.outlineMode = false;
|
142
144
|
}
|
143
145
|
/**
|
144
146
|
* Registra um editor customizado para campos da grade e formulário.
|
@@ -196,8 +198,19 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
196
198
|
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
197
199
|
this._fieldsProps = newCustomFieldProps;
|
198
200
|
}
|
199
|
-
|
200
|
-
|
201
|
+
getFinishEditionButtonsCallback() {
|
202
|
+
const btns = ["CANCEL", "SAVE"];
|
203
|
+
if (this.enableGridInsert && this._currentViewMode !== VIEW_MODE.ATTACHMENT) {
|
204
|
+
btns.push(this._currentViewMode === VIEW_MODE.GRID ? TaskbarElement.FORM_MODE : TaskbarElement.GRID_MODE);
|
205
|
+
}
|
206
|
+
return btns;
|
207
|
+
}
|
208
|
+
getButtons(selected, extraButtons, removeRefresh) {
|
209
|
+
let btnList = selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS;
|
210
|
+
if (removeRefresh) {
|
211
|
+
btnList = btnList.filter(item => item !== TaskbarElement.REFRESH);
|
212
|
+
}
|
213
|
+
return this.addConfigButton(this.resolveInMemoryBtns(btnList)
|
201
214
|
.concat(extraButtons));
|
202
215
|
}
|
203
216
|
addConfigButton(buttons) {
|
@@ -316,15 +329,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
316
329
|
});
|
317
330
|
}
|
318
331
|
async openFormConfig() {
|
319
|
-
|
320
|
-
|
321
|
-
if (this.formLegacyConfigName) {
|
322
|
-
const title = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.formConfigUnavaliable.title", undefined);
|
323
|
-
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkSimpleCrud.formConfigUnavaliable.message", undefined);
|
324
|
-
await this.application.alert(title, message);
|
325
|
-
return;
|
332
|
+
if (this.formLegacyConfigName || this.configName) {
|
333
|
+
await this._snkSimpleFormConfig.show();
|
326
334
|
}
|
327
|
-
this._showFormConfig = true;
|
328
335
|
}
|
329
336
|
addGridLegacyConfigName() {
|
330
337
|
if (this.gridLegacyConfigName && this.configName) {
|
@@ -354,12 +361,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
354
361
|
formConfigIsLoaded() {
|
355
362
|
return this.formConfig != undefined || this._formConfigAlreadyLoaded;
|
356
363
|
}
|
357
|
-
async loadFormConfig(forceLoad = false) {
|
364
|
+
async loadFormConfig(forceLoad = false, forceSetNewConfig = false) {
|
358
365
|
if (this.configName === undefined) {
|
359
366
|
return;
|
360
367
|
}
|
361
368
|
if (this._formConfigManager == undefined) {
|
362
|
-
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
369
|
+
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
|
363
370
|
this._formConfigManager.setConfig(this.formConfig);
|
364
371
|
}
|
365
372
|
if (this.formConfigIsLoaded() && !forceLoad) {
|
@@ -369,7 +376,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
369
376
|
let loadedLegacyConfig = await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);
|
370
377
|
if (loadedLegacyConfig != undefined) {
|
371
378
|
this._formConfigManager.setConfig(loadedLegacyConfig);
|
372
|
-
this.setFormConfig(loadedLegacyConfig);
|
379
|
+
this.setFormConfig(loadedLegacyConfig, forceSetNewConfig);
|
373
380
|
return;
|
374
381
|
}
|
375
382
|
this.setFormConfig(await this._formConfigManager.loadConfig());
|
@@ -400,9 +407,14 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
400
407
|
this.onModeChange();
|
401
408
|
this.configDatasource();
|
402
409
|
this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
|
410
|
+
this._continuousInsertUtils = new ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
|
411
|
+
if (this.enableGridInsert) {
|
412
|
+
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
413
|
+
}
|
403
414
|
}
|
404
415
|
componentDidLoad() {
|
405
416
|
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
417
|
+
this.initKeyboardManager();
|
406
418
|
}
|
407
419
|
setCustomRenders() {
|
408
420
|
if (!this._grid) {
|
@@ -634,6 +646,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
634
646
|
const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
|
635
647
|
return Promise.resolve(options);
|
636
648
|
}
|
649
|
+
isGridInsertActive() {
|
650
|
+
return this.enableGridInsert && this.dataUnit.hasNewRecord();
|
651
|
+
}
|
637
652
|
getActionsList() {
|
638
653
|
var _a, _b;
|
639
654
|
const hardList = [{
|
@@ -645,11 +660,21 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
645
660
|
? this.getColumnSearch(actionButton, item)
|
646
661
|
: this.getFieldSearch(actionButton, item)
|
647
662
|
}];
|
663
|
+
if (this.enableGridInsert) {
|
664
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
665
|
+
this._enableContinuousInsert = !this._enableContinuousInsert;
|
666
|
+
this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
|
667
|
+
}));
|
668
|
+
}
|
669
|
+
if (this.isGridInsertActive())
|
670
|
+
return hardList;
|
648
671
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
649
672
|
const taskbarID = this.getTopTaskBarId();
|
650
673
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
651
674
|
}
|
652
|
-
|
675
|
+
if (this.actionsList)
|
676
|
+
return hardList.concat(this.actionsList);
|
677
|
+
return hardList;
|
653
678
|
}
|
654
679
|
getTopTaskBarId() {
|
655
680
|
var _a;
|
@@ -694,9 +719,11 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
694
719
|
window.removeEventListener("keydown", this._keyDownHandler);
|
695
720
|
}
|
696
721
|
gridConfigChangeHandler(evt) {
|
722
|
+
evt.stopPropagation();
|
723
|
+
if (!this.configName)
|
724
|
+
return;
|
697
725
|
const config = evt.detail;
|
698
726
|
ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
699
|
-
evt.stopPropagation();
|
700
727
|
}
|
701
728
|
modalConfigChangeHandler(evt) {
|
702
729
|
const config = evt.detail;
|
@@ -733,9 +760,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
733
760
|
closeGridConfig() {
|
734
761
|
this._showPopUpGridConfig = false;
|
735
762
|
}
|
736
|
-
closeFormConfig() {
|
737
|
-
this._showFormConfig = false;
|
738
|
-
}
|
739
763
|
getPageSize() {
|
740
764
|
if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
|
741
765
|
return 0;
|
@@ -745,10 +769,6 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
745
769
|
}
|
746
770
|
return this.pageSize;
|
747
771
|
}
|
748
|
-
//No momento não daremos suporte para configuração de formulário quando houver formLegacyConfigName
|
749
|
-
handleShowFormConfig() {
|
750
|
-
return this._showFormConfig && !this.formLegacyConfigName;
|
751
|
-
}
|
752
772
|
resolveResourceID() {
|
753
773
|
return StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
754
774
|
}
|
@@ -761,22 +781,53 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
761
781
|
return configFromManager;
|
762
782
|
}
|
763
783
|
updateFormConfig() {
|
764
|
-
|
784
|
+
let newConfig = this.formConfig;
|
785
|
+
if (this.formLegacyConfigName == undefined) {
|
786
|
+
newConfig = Object.assign(Object.assign({}, this.formConfig), { fields: this.dataUnit.metadata.fields });
|
787
|
+
}
|
765
788
|
this.setFormConfig(newConfig, true);
|
766
789
|
if (this._formConfigManager == undefined) {
|
767
790
|
this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
|
768
791
|
}
|
769
792
|
this._formConfigManager.setConfig(this.formConfig);
|
770
793
|
}
|
794
|
+
handleDataUnitOnInsertionMode() {
|
795
|
+
if (this.enableGridInsert)
|
796
|
+
return;
|
797
|
+
this.goToView(VIEW_MODE.FORM);
|
798
|
+
}
|
799
|
+
async initKeyboardManager() {
|
800
|
+
const keyboardManager = new KeyboardManager();
|
801
|
+
const dataUnit = this.dataUnit || await this._snkDataUnit.getDataUnit();
|
802
|
+
keyboardManager
|
803
|
+
.bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
|
804
|
+
.bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
|
805
|
+
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
806
|
+
.bind("Escape", () => {
|
807
|
+
if (dataUnit.isDirty()) {
|
808
|
+
dataUnit.cancelEdition();
|
809
|
+
}
|
810
|
+
}, {
|
811
|
+
debounceTime: 1000,
|
812
|
+
description: "Cancela uma ação.", element: this._element
|
813
|
+
});
|
814
|
+
}
|
815
|
+
async handleFormConfigSaved() {
|
816
|
+
await this.loadFormConfig(true, true);
|
817
|
+
}
|
818
|
+
renderTaskbarContent() {
|
819
|
+
var _a;
|
820
|
+
return (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow-xsmall'} ez-padding--small`, dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
821
|
+
}
|
771
822
|
/* istanbul ignore next */
|
772
823
|
render() {
|
773
824
|
var _a;
|
774
825
|
if (this.dataUnit == undefined) {
|
775
826
|
return;
|
776
827
|
}
|
777
|
-
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode:
|
828
|
+
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
778
829
|
? undefined
|
779
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large
|
830
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
780
831
|
}
|
781
832
|
get _element() { return this; }
|
782
833
|
static get watchers() { return {
|
@@ -795,10 +846,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
795
846
|
"mode": [2],
|
796
847
|
"gridConfig": [1040],
|
797
848
|
"formConfig": [1040],
|
849
|
+
"enableLockManger": [4, "enable-lock-manger"],
|
798
850
|
"multipleSelection": [4, "multiple-selection"],
|
799
851
|
"useCancelConfirm": [4, "use-cancel-confirm"],
|
800
852
|
"pageSize": [2, "page-size"],
|
801
853
|
"resourceID": [1, "resource-i-d"],
|
854
|
+
"enableGridInsert": [4, "enable-grid-insert"],
|
802
855
|
"taskbarManager": [16],
|
803
856
|
"messagesBuilder": [1040],
|
804
857
|
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
@@ -809,15 +862,17 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
809
862
|
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
810
863
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
811
864
|
"autoFocus": [4, "auto-focus"],
|
865
|
+
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
812
866
|
"autoLoad": [4, "auto-load"],
|
867
|
+
"outlineMode": [4, "outline-mode"],
|
813
868
|
"_showPopUpGridConfig": [32],
|
814
|
-
"_showFormConfig": [32],
|
815
869
|
"_currentViewMode": [32],
|
816
870
|
"_config": [32],
|
817
871
|
"_fieldToGetFocus": [32],
|
818
872
|
"_customContainerId": [32],
|
819
873
|
"_formFields": [32],
|
820
874
|
"_fieldsProps": [32],
|
875
|
+
"_enableContinuousInsert": [32],
|
821
876
|
"addCustomEditor": [64],
|
822
877
|
"addGridCustomRender": [64],
|
823
878
|
"addCustomValueFormatter": [64],
|
@@ -835,7 +890,7 @@ function defineCustomElement() {
|
|
835
890
|
if (typeof customElements === "undefined") {
|
836
891
|
return;
|
837
892
|
}
|
838
|
-
const components = ["snk-simple-crud", "snk-actions-button", "snk-
|
893
|
+
const components = ["snk-simple-crud", "snk-actions-button", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-grid-config", "snk-select-box", "snk-simple-form-config", "snk-taskbar", "taskbar-actions-button"];
|
839
894
|
components.forEach(tagName => { switch (tagName) {
|
840
895
|
case "snk-simple-crud":
|
841
896
|
if (!customElements.get(tagName)) {
|
@@ -843,41 +898,26 @@ function defineCustomElement() {
|
|
843
898
|
}
|
844
899
|
break;
|
845
900
|
case "snk-actions-button":
|
846
|
-
if (!customElements.get(tagName)) {
|
847
|
-
defineCustomElement$d();
|
848
|
-
}
|
849
|
-
break;
|
850
|
-
case "snk-config-options":
|
851
|
-
if (!customElements.get(tagName)) {
|
852
|
-
defineCustomElement$c();
|
853
|
-
}
|
854
|
-
break;
|
855
|
-
case "snk-configurator":
|
856
|
-
if (!customElements.get(tagName)) {
|
857
|
-
defineCustomElement$b();
|
858
|
-
}
|
859
|
-
break;
|
860
|
-
case "snk-data-exporter":
|
861
901
|
if (!customElements.get(tagName)) {
|
862
902
|
defineCustomElement$a();
|
863
903
|
}
|
864
904
|
break;
|
865
|
-
case "snk-
|
905
|
+
case "snk-configurator":
|
866
906
|
if (!customElements.get(tagName)) {
|
867
907
|
defineCustomElement$9();
|
868
908
|
}
|
869
909
|
break;
|
870
|
-
case "snk-exporter
|
910
|
+
case "snk-data-exporter":
|
871
911
|
if (!customElements.get(tagName)) {
|
872
912
|
defineCustomElement$8();
|
873
913
|
}
|
874
914
|
break;
|
875
|
-
case "snk-
|
915
|
+
case "snk-data-unit":
|
876
916
|
if (!customElements.get(tagName)) {
|
877
917
|
defineCustomElement$7();
|
878
918
|
}
|
879
919
|
break;
|
880
|
-
case "snk-
|
920
|
+
case "snk-exporter-email-sender":
|
881
921
|
if (!customElements.get(tagName)) {
|
882
922
|
defineCustomElement$6();
|
883
923
|
}
|
@@ -892,7 +932,7 @@ function defineCustomElement() {
|
|
892
932
|
defineCustomElement$4();
|
893
933
|
}
|
894
934
|
break;
|
895
|
-
case "snk-
|
935
|
+
case "snk-simple-form-config":
|
896
936
|
if (!customElements.get(tagName)) {
|
897
937
|
defineCustomElement$3();
|
898
938
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface SnkSimpleFormConfig extends Components.SnkSimpleFormConfig, HTMLElement {}
|
4
|
+
export const SnkSimpleFormConfig: {
|
5
|
+
prototype: SnkSimpleFormConfig;
|
6
|
+
new (): SnkSimpleFormConfig;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
+
import './DataFetcher.js';
|
3
|
+
import './pesquisa-fetcher.js';
|
4
|
+
import '@sankhyalabs/core';
|
5
|
+
import './ISave.js';
|
6
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
7
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
8
|
+
import './dataunit-fetcher.js';
|
9
|
+
import './filter-item-type.enum.js';
|
10
|
+
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
11
|
+
|
12
|
+
const snkSimpleFormConfigCss = ":host{display:block}.config-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between}.config-lists{margin-bottom:12px}.config-actions{display:flex;flex-direction:row;justify-content:flex-end;width:100%;gap:12px}";
|
13
|
+
|
14
|
+
const SnkSimpleFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
15
|
+
constructor() {
|
16
|
+
super();
|
17
|
+
this.__registerHost();
|
18
|
+
this.snkConfigSaved = createEvent(this, "snkConfigSaved", 7);
|
19
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
20
|
+
this.fieldsToSave = [];
|
21
|
+
this.dataUnit = undefined;
|
22
|
+
this.configName = undefined;
|
23
|
+
this.avaliableFields = [];
|
24
|
+
this.selectedFields = [];
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Responsável por abrir o configurador.
|
28
|
+
*/
|
29
|
+
async show() {
|
30
|
+
await this.initializeFormConfig();
|
31
|
+
this.ezPopupRef.opened = true;
|
32
|
+
}
|
33
|
+
;
|
34
|
+
async initializeFormConfig() {
|
35
|
+
if (!this.configName)
|
36
|
+
return;
|
37
|
+
const allFields = this.getAllVisibleFieldsFromDataUnit();
|
38
|
+
const displayedFieldNameList = await this.getConfig();
|
39
|
+
//Quando não retorna dados, é por quê não existe configuração do usuário salva.
|
40
|
+
if (displayedFieldNameList.length === 0) {
|
41
|
+
this.avaliableFields = [];
|
42
|
+
this.selectedFields = [...allFields];
|
43
|
+
this.fieldsToSave = [...this.selectedFields];
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
const selectedFieldsAux = this.sortDisplayedFields(displayedFieldNameList, allFields);
|
47
|
+
const avaliableFieldsAux = allFields.filter(field => !displayedFieldNameList.includes(field.id));
|
48
|
+
this.avaliableFields = [...avaliableFieldsAux];
|
49
|
+
this.selectedFields = [...selectedFieldsAux];
|
50
|
+
this.fieldsToSave = [...this.selectedFields];
|
51
|
+
}
|
52
|
+
async getConfig() {
|
53
|
+
const fieldList = await this._formConfigFetcher.fetchSimpleFormConfig(this.configName);
|
54
|
+
return [...this.removeDuplicates(fieldList)];
|
55
|
+
}
|
56
|
+
removeDuplicates(strings) {
|
57
|
+
return strings.filter((item, index) => strings.indexOf(item) === index);
|
58
|
+
}
|
59
|
+
sortDisplayedFields(displayedFieldNameList, allFields) {
|
60
|
+
const selectedFieldsAux = [];
|
61
|
+
//É preciso garantir a ordem na qual os campos vieram na resposta do fetchSimpleFormConfig.
|
62
|
+
displayedFieldNameList.forEach(fieldName => {
|
63
|
+
const field = allFields.find(field => field.id === fieldName);
|
64
|
+
if (!field)
|
65
|
+
return;
|
66
|
+
selectedFieldsAux.push(field);
|
67
|
+
});
|
68
|
+
return selectedFieldsAux;
|
69
|
+
}
|
70
|
+
getAllVisibleFieldsFromDataUnit() {
|
71
|
+
var _a, _b, _c;
|
72
|
+
const visibleFields = ((_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) !== null && _c !== void 0 ? _c : []).filter(field => field.visible);
|
73
|
+
return visibleFields.map(field => {
|
74
|
+
return { id: field.name, label: field.label };
|
75
|
+
});
|
76
|
+
}
|
77
|
+
close() {
|
78
|
+
this.ezPopupRef.opened = false;
|
79
|
+
}
|
80
|
+
async handleResetConfigs() {
|
81
|
+
await this._formConfigFetcher.restoreFormConfig(this.configName);
|
82
|
+
await this.initializeFormConfig();
|
83
|
+
await this.handleSave();
|
84
|
+
}
|
85
|
+
handleCancel() {
|
86
|
+
this.close();
|
87
|
+
}
|
88
|
+
async handleSave() {
|
89
|
+
const saveList = this.fieldsToSave.map(field => field.id);
|
90
|
+
await this._formConfigFetcher.saveSimpleFormConfig(this.configName, saveList);
|
91
|
+
this.close();
|
92
|
+
this.snkConfigSaved.emit();
|
93
|
+
}
|
94
|
+
render() {
|
95
|
+
return (h("ez-popup", { ref: (ref) => this.ezPopupRef = ref, heightMode: 'auto', size: 'auto', ezTitle: 'Configurar formul\u00E1rio' }, h("div", { class: 'config-container' }, h("div", { class: 'config-lists' }, h("ez-double-list", { leftList: this.avaliableFields, leftTitle: 'Campos disponíveis', rightList: this.selectedFields, rightTitle: 'Campos selecionados', onEzRightListChanged: ({ detail }) => this.fieldsToSave = [...detail], entityLabel: 'campo', entityLabelPlural: 'campos' })), h("div", { class: 'config-actions' }, h("ez-button", { label: 'Restaurar', onClick: this.handleResetConfigs.bind(this), size: 'small' }), h("ez-button", { label: 'Cancelar', onClick: this.handleCancel.bind(this), size: 'small' }), h("ez-button", { label: 'Salvar', class: 'ez-button--primary', onClick: this.handleSave.bind(this), size: 'small' })))));
|
96
|
+
}
|
97
|
+
static get style() { return snkSimpleFormConfigCss; }
|
98
|
+
}, [0, "snk-simple-form-config", {
|
99
|
+
"dataUnit": [16],
|
100
|
+
"configName": [1, "config-name"],
|
101
|
+
"avaliableFields": [32],
|
102
|
+
"selectedFields": [32],
|
103
|
+
"show": [64]
|
104
|
+
}]);
|
105
|
+
function defineCustomElement() {
|
106
|
+
if (typeof customElements === "undefined") {
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
const components = ["snk-simple-form-config"];
|
110
|
+
components.forEach(tagName => { switch (tagName) {
|
111
|
+
case "snk-simple-form-config":
|
112
|
+
if (!customElements.get(tagName)) {
|
113
|
+
customElements.define(tagName, SnkSimpleFormConfig);
|
114
|
+
}
|
115
|
+
break;
|
116
|
+
} });
|
117
|
+
}
|
118
|
+
|
119
|
+
export { SnkSimpleFormConfig as S, defineCustomElement as d };
|