@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-131882.2 → 0.0.0-bugfix-dev-KB-174860.0
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/LICENSE +4 -1
- package/dist/cjs/{ConfigStorage-d9d24844.js → ConfigStorage-156bfcac.js} +19 -2
- package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
- package/dist/cjs/{DataFetcher-3a8ea521.js → DataFetcher-d13b4637.js} +2803 -2
- package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
- package/dist/cjs/{ISave-a66bb65e.js → ISave-55d9dcc3.js} +1 -1
- package/dist/cjs/{ImageUtils-5e3f406b.js → ImageUtils-d6139911.js} +5 -3
- package/dist/cjs/{PersonalizedFilterUtils-eccb267a.js → PersonalizedFilterUtils-263e4d24.js} +52 -5
- package/dist/cjs/{SnkFormConfigManager-c88cf1e9.js → SnkFormConfigManager-5cb9a39c.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-f53b60c4.js → SnkMultiSelectionListDataSource-5c5badfc.js} +146 -74
- package/dist/cjs/{auth-fetcher-faa61f64.js → auth-fetcher-d1715459.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-6febd6c4.js → dataunit-fetcher-fae710c5.js} +68 -110
- package/dist/cjs/fields-layout.cjs.entry.js +1 -1
- package/dist/cjs/fields-selector.cjs.entry.js +1 -1
- package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
- package/dist/cjs/{form-config-fetcher-72cf0e3d.js → form-config-fetcher-bbebdcb8.js} +41 -5
- package/dist/cjs/guides-configurator.cjs.entry.js +2 -2
- package/dist/cjs/index-1894343a.js +28 -40
- package/dist/cjs/{index-e3e39724.js → index-bc950921.js} +6 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -6
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_8.cjs.entry.js → snk-actions-button_9.cjs.entry.js} +151 -63
- package/dist/cjs/snk-application.cjs.entry.js +8 -9
- package/dist/cjs/snk-attach_11.cjs.entry.js +2958 -0
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -0
- package/dist/cjs/snk-crud.cjs.entry.js +140 -99
- package/dist/cjs/snk-data-exporter.cjs.entry.js +61 -16
- package/dist/cjs/{snk-data-unit-94757628.js → snk-data-unit-32237a2d.js} +11 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +28 -20
- package/dist/cjs/snk-dynaform-config-header_5.cjs.entry.js +739 -0
- package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +961 -0
- package/dist/cjs/snk-dynaform-field-config_2.cjs.entry.js +327 -0
- package/dist/cjs/snk-dynaform-guides-view-2c7c6ce4.js +1094 -0
- package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +23 -0
- package/dist/cjs/snk-dynaform.cjs.entry.js +679 -0
- package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +421 -18
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +137 -121
- package/dist/cjs/snk-filter-search.cjs.entry.js +10 -0
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -4
- package/dist/cjs/snk-form_2.cjs.entry.js +4 -5
- package/dist/cjs/snk-grid.cjs.entry.js +53 -21
- package/dist/cjs/{snk-guides-viewer-315f8580.js → snk-guides-viewer-67b9cca9.js} +38 -161
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -17
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +5 -6
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -6
- package/dist/cjs/snk-taskbar.cjs.entry.js +182 -125
- package/dist/cjs/{sortable.esm-9a110bb7.js → sortable.esm-b87669ab.js} +76 -90
- package/dist/cjs/taskbar-elements-25f800b3.js +152 -0
- package/dist/cjs/taskbarUtils-99aaa01f.js +236 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js +6 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +30 -6
- package/dist/collection/components/snk-attach/snk-attach.css +29 -7
- package/dist/collection/components/snk-attach/snk-attach.js +93 -18
- package/dist/collection/components/snk-configurator/snk-configurator.js +2 -0
- package/dist/collection/components/snk-crud/snk-crud.css +55 -0
- package/dist/collection/components/snk-crud/snk-crud.js +147 -94
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css +4 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +18 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +0 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +36 -152
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +163 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +2 -2
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +78 -23
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +28 -5
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +43 -2
- package/dist/collection/components/snk-dynaform/interfaces/PropsCustomEditor.js +1 -0
- package/dist/collection/components/snk-dynaform/interfaces/PropsCustomRender.js +1 -0
- package/dist/collection/components/snk-dynaform/snk-dynaform.css +69 -0
- package/dist/collection/components/snk-dynaform/snk-dynaform.js +1661 -0
- package/dist/collection/components/snk-dynaform/subcomponents/CardFormResizeObserver.js +26 -0
- package/dist/collection/components/snk-dynaform/subcomponents/GuideBuilder.js +51 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +182 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +1015 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +98 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +590 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +321 -0
- package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +1587 -0
- package/dist/collection/components/snk-dynaform-form-config/FormConfigHelper.js +325 -0
- package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +219 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.css +17 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.js +236 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.css +41 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.js +170 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.css +22 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.js +408 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.css +88 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.js +209 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.css +167 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.js +655 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.css +42 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.js +171 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.css +66 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.js +557 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.css +80 -0
- package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.js +326 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +30 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +9 -3
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +2 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +24 -4
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +6 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +8 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +148 -77
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +0 -1
- package/dist/collection/components/snk-grid/snk-grid.css +21 -5
- package/dist/collection/components/snk-grid/snk-grid.js +161 -7
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +111 -44
- package/dist/collection/components/snk-image-input/snk-image-input.js +15 -3
- package/dist/collection/components/snk-image-input/utils/ImageUtils.js +5 -3
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +51 -35
- package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
- package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +248 -132
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
- package/dist/collection/lib/@types/index.js +6 -0
- package/dist/collection/lib/configs/ConfigStorage.js +5 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +51 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js +15 -104
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +12 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +18 -0
- package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js +0 -13
- package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +12 -0
- package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js +0 -13
- package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +12 -0
- package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js +0 -13
- package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +12 -0
- package/dist/collection/lib/utils/CrudUtils.js +7 -4
- package/dist/components/ConfigStorage.js +17 -0
- package/dist/components/ContinuousInsertUtils.js +86 -28
- package/dist/components/ISave.js +6 -0
- package/dist/components/SnkMessageBuilder.js +36 -39
- package/dist/components/dataunit-fetcher.js +67 -109
- package/dist/components/form-config-fetcher.js +40 -4
- package/dist/components/guides-configurator2.js +1 -1
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +14 -0
- package/dist/components/snk-actions-button2.js +15 -9
- package/dist/components/snk-attach2.js +67 -26
- package/dist/components/snk-configurator2.js +2 -0
- package/dist/components/snk-crud.js +229 -175
- package/dist/components/snk-data-exporter2.js +56 -9
- package/dist/components/snk-detail-view2.js +174 -267
- package/dist/components/snk-dynaform-config-header.d.ts +11 -0
- package/dist/components/snk-dynaform-config-header.js +6 -0
- package/dist/components/snk-dynaform-config-header2.js +103 -0
- package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
- package/dist/components/snk-dynaform-configs-button.js +6 -0
- package/dist/components/snk-dynaform-configs-button2.js +76 -0
- package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
- package/dist/components/snk-dynaform-detail-view.js +6 -0
- package/dist/components/snk-dynaform-detail-view2.js +2213 -0
- package/dist/components/snk-dynaform-field-config.d.ts +11 -0
- package/dist/components/snk-dynaform-field-config.js +6 -0
- package/dist/components/snk-dynaform-field-config2.js +605 -0
- package/dist/components/snk-dynaform-field-item.d.ts +11 -0
- package/dist/components/snk-dynaform-field-item.js +6 -0
- package/dist/components/snk-dynaform-field-item2.js +96 -0
- package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
- package/dist/components/snk-dynaform-fields-layout.js +6 -0
- package/dist/components/snk-dynaform-fields-layout2.js +428 -0
- package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
- package/dist/components/snk-dynaform-fields-selector.js +6 -0
- package/dist/components/snk-dynaform-fields-selector2.js +104 -0
- package/dist/components/snk-dynaform-form-config.d.ts +11 -0
- package/dist/components/snk-dynaform-form-config.js +6 -0
- package/dist/components/snk-dynaform-form-config2.js +430 -0
- package/dist/components/snk-dynaform-form-view.d.ts +11 -0
- package/dist/components/snk-dynaform-form-view.js +6 -0
- package/dist/components/snk-dynaform-form-view2.js +272 -0
- package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
- package/dist/components/snk-dynaform-guides-configurator.js +6 -0
- package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
- package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
- package/dist/components/snk-dynaform-guides-view.js +6 -0
- package/dist/components/snk-dynaform.d.ts +11 -0
- package/dist/components/snk-dynaform.js +1007 -0
- package/dist/components/snk-entity-search.d.ts +11 -0
- package/dist/components/snk-entity-search.js +6 -0
- package/dist/components/snk-entity-search2.js +231 -0
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +98 -79
- package/dist/components/snk-filter-detail2.js +9 -3
- package/dist/components/snk-filter-item2.js +5 -5
- package/dist/components/snk-filter-modal2.js +8 -5
- package/dist/components/snk-filter-search.js +12 -1
- package/dist/components/snk-form-view2.js +0 -3
- package/dist/components/snk-grid-config2.js +92 -44
- package/dist/components/snk-grid2.js +95 -50
- package/dist/components/snk-image-input2.js +20 -6
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +29 -23
- package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
- package/dist/components/snk-taskbar-skeleton.js +6 -0
- package/dist/components/snk-taskbar-skeleton2.js +29 -0
- package/dist/components/snk-taskbar2.js +253 -174
- package/dist/components/sortable.esm.js +76 -90
- package/dist/components/taskbar-actions-button2.js +21 -2
- package/dist/components/taskbar-split-button2.js +10 -1
- package/dist/components/taskbarUtils.js +229 -0
- package/dist/esm/{ConfigStorage-d15d2014.js → ConfigStorage-0d1c0695.js} +19 -2
- package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
- package/dist/esm/{DataFetcher-1dd7e8c0.js → DataFetcher-70de9419.js} +2803 -3
- package/dist/esm/FormConfigHelper-efc29480.js +328 -0
- package/dist/esm/{ISave-498c4831.js → ISave-f5704813.js} +1 -1
- package/dist/esm/{ImageUtils-8fc8d905.js → ImageUtils-efbea0e4.js} +5 -3
- package/dist/esm/{PersonalizedFilterUtils-d2439a9a.js → PersonalizedFilterUtils-45b5803c.js} +49 -2
- package/dist/esm/{SnkFormConfigManager-86befa68.js → SnkFormConfigManager-e7f05f79.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-6e9496f0.js → SnkMultiSelectionListDataSource-6ac291a9.js} +141 -69
- package/dist/esm/{auth-fetcher-69cbda8d.js → auth-fetcher-e34880e5.js} +1 -1
- package/dist/esm/{dataunit-fetcher-21c43ec7.js → dataunit-fetcher-d26e4a08.js} +68 -110
- package/dist/esm/fields-layout.entry.js +1 -1
- package/dist/esm/fields-selector.entry.js +1 -1
- package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
- package/dist/esm/{form-config-fetcher-fcc7b62f.js → form-config-fetcher-98c42169.js} +41 -5
- package/dist/esm/guides-configurator.entry.js +2 -2
- package/dist/esm/index-04f73a26.js +28 -40
- package/dist/esm/{index-b40568ff.js → index-c6721886.js} +6 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -6
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_8.entry.js → snk-actions-button_9.entry.js} +152 -65
- package/dist/esm/snk-application.entry.js +7 -8
- package/dist/esm/snk-attach_11.entry.js +2944 -0
- package/dist/esm/snk-configurator.entry.js +2 -0
- package/dist/esm/snk-crud.entry.js +140 -99
- package/dist/esm/snk-data-exporter.entry.js +61 -16
- package/dist/esm/{snk-data-unit-3b06a0f3.js → snk-data-unit-ff57ac90.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -4
- package/dist/esm/snk-detail-view.entry.js +26 -18
- package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
- package/dist/esm/snk-dynaform-detail-view_2.entry.js +956 -0
- package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
- package/dist/esm/snk-dynaform-guides-view-0dfbefc1.js +1091 -0
- package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
- package/dist/esm/snk-dynaform.entry.js +675 -0
- package/dist/esm/snk-entity-search.entry.js +207 -0
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +405 -4
- package/dist/esm/snk-filter-bar_4.entry.js +112 -96
- package/dist/esm/snk-filter-search.entry.js +10 -0
- package/dist/esm/snk-form-view.entry.js +1 -4
- package/dist/esm/snk-form_2.entry.js +4 -5
- package/dist/esm/snk-grid.entry.js +50 -18
- package/dist/esm/{snk-guides-viewer-a4e31f63.js → snk-guides-viewer-31a0a23d.js} +39 -162
- package/dist/esm/snk-guides-viewer.entry.js +8 -17
- package/dist/esm/snk-layout-form-config.entry.js +5 -6
- package/dist/esm/snk-pesquisa.entry.js +5 -6
- package/dist/esm/snk-taskbar.entry.js +183 -126
- package/dist/esm/{sortable.esm-842f85a3.js → sortable.esm-bc277c12.js} +76 -90
- package/dist/esm/taskbar-elements-ba9d6889.js +149 -0
- package/dist/esm/taskbarUtils-cb9db0d9.js +230 -0
- package/dist/sankhyablocks/{p-32ad76cc.js → p-097d75b3.js} +2 -2
- package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
- package/dist/sankhyablocks/p-12579574.entry.js +1 -0
- package/dist/sankhyablocks/p-1d31aec3.entry.js +1 -0
- package/dist/sankhyablocks/{p-2cc2526e.entry.js → p-1d7d5814.entry.js} +1 -1
- package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
- package/dist/sankhyablocks/p-250b273e.entry.js +1 -0
- package/dist/sankhyablocks/p-26f1919e.entry.js +1 -0
- package/dist/sankhyablocks/p-2a83f20e.entry.js +1 -0
- package/dist/sankhyablocks/p-2c4f7fdd.entry.js +1 -0
- package/dist/sankhyablocks/p-2ec98523.js +1 -0
- package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
- package/dist/sankhyablocks/p-46d7e2de.js +1 -0
- package/dist/sankhyablocks/p-4dd574d6.js +1 -0
- package/dist/sankhyablocks/p-541c72ec.entry.js +1 -0
- package/dist/sankhyablocks/p-58709cf9.js +1 -0
- package/dist/sankhyablocks/p-5aeae67f.js +1 -0
- package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
- package/dist/sankhyablocks/p-5ef0e9a8.entry.js +1 -0
- package/dist/sankhyablocks/p-6d3bcabf.entry.js +1 -0
- package/dist/sankhyablocks/p-6f60df43.js +1 -0
- package/dist/sankhyablocks/p-846d8f79.entry.js +1 -0
- package/dist/sankhyablocks/{p-e30acdca.entry.js → p-855ccf64.entry.js} +1 -1
- package/dist/sankhyablocks/p-885262ce.entry.js +1 -0
- package/dist/sankhyablocks/p-8d1ef77a.js +60 -0
- package/dist/sankhyablocks/{p-9114e869.js → p-8d81c8d3.js} +2 -2
- package/dist/sankhyablocks/p-8f5dd87d.entry.js +1 -0
- package/dist/sankhyablocks/p-90037547.js +1 -0
- package/dist/sankhyablocks/{p-7150eacf.entry.js → p-9742ea0e.entry.js} +1 -1
- package/dist/sankhyablocks/p-9e02a785.js +1 -0
- package/dist/sankhyablocks/{p-6564180d.entry.js → p-9e7dc97d.entry.js} +1 -1
- package/dist/sankhyablocks/p-a25ab2ff.entry.js +1 -0
- package/dist/sankhyablocks/p-a696bbcd.entry.js +1 -0
- package/dist/sankhyablocks/{p-88b0797e.entry.js → p-a9012341.entry.js} +2 -2
- package/dist/sankhyablocks/p-abcb646d.js +1 -0
- package/dist/sankhyablocks/{p-4ff3b494.js → p-af673291.js} +1 -1
- package/dist/sankhyablocks/p-bd2a845c.js +1 -0
- package/dist/sankhyablocks/p-c4b34e2b.entry.js +1 -0
- package/dist/sankhyablocks/{p-7e9f8fa4.js → p-c9440c8a.js} +1 -1
- package/dist/sankhyablocks/p-ca3728c0.entry.js +1 -0
- package/dist/sankhyablocks/p-cbb8e351.js +7 -0
- package/dist/sankhyablocks/p-cd153f71.entry.js +1 -0
- package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
- package/dist/sankhyablocks/p-ddb160eb.entry.js +1 -0
- package/dist/sankhyablocks/p-e5a3711f.js +1 -0
- package/dist/sankhyablocks/{p-2b882835.entry.js → p-e737fd5a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-362e6e8c.js → p-eac48627.js} +1 -1
- package/dist/sankhyablocks/p-ec7c87bb.js +28 -0
- package/dist/sankhyablocks/p-fb6e3c65.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +22 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +28 -10
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +3 -2
- package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -18
- package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +8 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +16 -0
- package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
- package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
- package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
- package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +169 -0
- package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +108 -0
- package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
- package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
- package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +33 -16
- package/dist/types/components/snk-grid/snk-grid.d.ts +29 -1
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +7 -0
- package/dist/types/components/snk-image-input/snk-image-input.d.ts +1 -0
- package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +1 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
- package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +32 -21
- package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
- package/dist/types/components.d.ts +2503 -1188
- package/dist/types/lib/@types/index.d.ts +6 -0
- package/dist/types/lib/configs/ConfigStorage.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/helpers/DataUnitDataLoaderHelper.d.ts +3 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/package.json +11 -8
- package/react/components.d.ts +14 -0
- package/react/components.js +14 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/SnkMessageBuilder-d9558dba.js +0 -2809
- package/dist/cjs/default-filters-a09bf82b.js +0 -8
- package/dist/cjs/index-62760a9c.js +0 -49
- package/dist/cjs/index-8d94b7e0.js +0 -7
- package/dist/cjs/snk-attach.cjs.entry.js +0 -911
- package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
- package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +0 -61
- package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -109
- package/dist/cjs/snk-image-input.cjs.entry.js +0 -148
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -358
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
- package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -865
- package/dist/cjs/taskbar-elements-a94d4318.js +0 -133
- package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
- package/dist/esm/SnkMessageBuilder-c0bc4424.js +0 -2807
- package/dist/esm/default-filters-50105e43.js +0 -8
- package/dist/esm/index-620ac460.js +0 -7
- package/dist/esm/index-8acbae97.js +0 -49
- package/dist/esm/snk-attach.entry.js +0 -907
- package/dist/esm/snk-default-filter.entry.js +0 -73
- package/dist/esm/snk-filter-advanced-mode_2.entry.js +0 -56
- package/dist/esm/snk-filter-detail.entry.js +0 -194
- package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
- package/dist/esm/snk-filter-modal-item.entry.js +0 -105
- package/dist/esm/snk-image-input.entry.js +0 -144
- package/dist/esm/snk-personalized-filter.entry.js +0 -354
- package/dist/esm/snk-simple-bar.entry.js +0 -41
- package/dist/esm/snk-simple-crud.entry.js +0 -861
- package/dist/esm/taskbar-elements-97541bdd.js +0 -130
- package/dist/esm/taskbar-processor-3436124c.js +0 -51
- package/dist/sankhyablocks/p-07619e85.entry.js +0 -1
- package/dist/sankhyablocks/p-0d15b109.entry.js +0 -1
- package/dist/sankhyablocks/p-0f3698af.js +0 -1
- package/dist/sankhyablocks/p-10cad767.entry.js +0 -1
- package/dist/sankhyablocks/p-17653b22.entry.js +0 -1
- package/dist/sankhyablocks/p-1a0caadb.js +0 -1
- package/dist/sankhyablocks/p-25540da8.js +0 -1
- package/dist/sankhyablocks/p-27d6590e.js +0 -1
- package/dist/sankhyablocks/p-27e0cd68.entry.js +0 -1
- package/dist/sankhyablocks/p-2a356340.entry.js +0 -1
- package/dist/sankhyablocks/p-438a225f.entry.js +0 -1
- package/dist/sankhyablocks/p-45a830d9.js +0 -1
- package/dist/sankhyablocks/p-48c580b9.entry.js +0 -1
- package/dist/sankhyablocks/p-4a8d0917.entry.js +0 -1
- package/dist/sankhyablocks/p-4cdfa0e4.entry.js +0 -1
- package/dist/sankhyablocks/p-4fe8380b.entry.js +0 -1
- package/dist/sankhyablocks/p-51833248.js +0 -7
- package/dist/sankhyablocks/p-68c1a093.js +0 -1
- package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
- package/dist/sankhyablocks/p-72d62f22.js +0 -1
- package/dist/sankhyablocks/p-73b455e1.entry.js +0 -1
- package/dist/sankhyablocks/p-84345e7a.js +0 -1
- package/dist/sankhyablocks/p-8bb4e86b.entry.js +0 -1
- package/dist/sankhyablocks/p-9c1ff75e.entry.js +0 -1
- package/dist/sankhyablocks/p-a9839628.js +0 -26
- package/dist/sankhyablocks/p-b25777fa.entry.js +0 -1
- package/dist/sankhyablocks/p-b568c1d4.js +0 -1
- package/dist/sankhyablocks/p-b9970342.js +0 -60
- package/dist/sankhyablocks/p-bdf0077f.js +0 -1
- package/dist/sankhyablocks/p-c8043a53.entry.js +0 -1
- package/dist/sankhyablocks/p-c860552e.entry.js +0 -1
- package/dist/sankhyablocks/p-cc64239c.entry.js +0 -1
- package/dist/sankhyablocks/p-cd00a3d1.entry.js +0 -1
- package/dist/sankhyablocks/p-e0a6818c.js +0 -1
- package/dist/sankhyablocks/p-e0e3914e.entry.js +0 -1
- package/dist/sankhyablocks/p-ebce5394.entry.js +0 -1
- package/dist/sankhyablocks/p-ef9343c3.entry.js +0 -1
- package/dist/sankhyablocks/p-f1110b78.entry.js +0 -1
- package/dist/sankhyablocks/p-f1bf7248.entry.js +0 -1
- package/dist/sankhyablocks/p-f1d541e9.entry.js +0 -1
- package/dist/sankhyablocks/p-f2472d12.entry.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { h } from './index-04f73a26.js';
|
|
2
|
+
import { P as PresentationMode } from './index-c6721886.js';
|
|
3
|
+
import { s as store } from './index-ea250be6.js';
|
|
4
|
+
|
|
5
|
+
var TaskbarElement;
|
|
6
|
+
(function (TaskbarElement) {
|
|
7
|
+
TaskbarElement["PREVIOUS"] = "PREVIOUS";
|
|
8
|
+
TaskbarElement["NEXT"] = "NEXT";
|
|
9
|
+
TaskbarElement["REFRESH"] = "REFRESH";
|
|
10
|
+
TaskbarElement["UPDATE"] = "UPDATE";
|
|
11
|
+
TaskbarElement["CLONE"] = "CLONE";
|
|
12
|
+
TaskbarElement["REMOVE"] = "REMOVE";
|
|
13
|
+
TaskbarElement["INSERT"] = "INSERT";
|
|
14
|
+
TaskbarElement["CANCEL"] = "CANCEL";
|
|
15
|
+
TaskbarElement["SAVE"] = "SAVE";
|
|
16
|
+
TaskbarElement["GRID_MODE"] = "GRID_MODE";
|
|
17
|
+
TaskbarElement["FORM_MODE"] = "FORM_MODE";
|
|
18
|
+
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
19
|
+
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
20
|
+
TaskbarElement["SPACER"] = "SPACER";
|
|
21
|
+
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
22
|
+
TaskbarElement["DATA_EXPORTER"] = "DATA_EXPORTER";
|
|
23
|
+
TaskbarElement["ATTACH"] = "ATTACH";
|
|
24
|
+
TaskbarElement["ACTIONS_BUTTON"] = "ACTIONS_BUTTON";
|
|
25
|
+
TaskbarElement["UPDATE_MULTIPLE"] = "UPDATE_MULTIPLE";
|
|
26
|
+
})(TaskbarElement || (TaskbarElement = {}));
|
|
27
|
+
var AuthorizationElements;
|
|
28
|
+
(function (AuthorizationElements) {
|
|
29
|
+
AuthorizationElements["UPDATE"] = "UPDATE";
|
|
30
|
+
AuthorizationElements["CLONE"] = "CLONE";
|
|
31
|
+
AuthorizationElements["REMOVE"] = "REMOVE";
|
|
32
|
+
AuthorizationElements["INSERT"] = "INSERT";
|
|
33
|
+
AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
|
|
34
|
+
})(AuthorizationElements || (AuthorizationElements = {}));
|
|
35
|
+
var VisibleWhenForbidden;
|
|
36
|
+
(function (VisibleWhenForbidden) {
|
|
37
|
+
VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
|
|
38
|
+
})(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
|
|
39
|
+
const buildCustomButton = ({ def, className, dataElementId, action, isEnabled, size }) => {
|
|
40
|
+
const { hint, text, iconName } = def;
|
|
41
|
+
if (iconName) {
|
|
42
|
+
if (text) {
|
|
43
|
+
return iconTextButton({ iconName, element: def.name, className, dataElementId, title: hint, action, isEnabled, size });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return iconButton({ iconName, element: def.name, className, dataElementId, title: hint, action, isEnabled, size });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return textButton({ element: def.name, className, dataElementId, title: hint, action, isEnabled, size });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const buildElem = ({ element, className, dataElementId, getTitle, action, isEnabled, actions, dataExporterStoreKey, presentationMode, variant, size }) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const title = getTitle(element);
|
|
56
|
+
const propertiesItem = {
|
|
57
|
+
element, className, dataElementId, title, action, isEnabled, actions, variant, size
|
|
58
|
+
};
|
|
59
|
+
switch (element) {
|
|
60
|
+
case TaskbarElement.PREVIOUS:
|
|
61
|
+
return iconButton(Object.assign({ iconName: "chevron-left" }, propertiesItem));
|
|
62
|
+
case TaskbarElement.NEXT:
|
|
63
|
+
return iconButton(Object.assign({ iconName: "chevron-right" }, propertiesItem));
|
|
64
|
+
case TaskbarElement.REFRESH:
|
|
65
|
+
return iconButton(Object.assign({ iconName: "sync" }, propertiesItem));
|
|
66
|
+
case TaskbarElement.UPDATE:
|
|
67
|
+
return iconButton(Object.assign({ iconName: "edit" }, propertiesItem));
|
|
68
|
+
case TaskbarElement.UPDATE_MULTIPLE:
|
|
69
|
+
return iconButton(Object.assign({ iconName: "edit-table" }, propertiesItem));
|
|
70
|
+
case TaskbarElement.CLONE:
|
|
71
|
+
return iconButton(Object.assign({ iconName: "copy" }, propertiesItem));
|
|
72
|
+
case TaskbarElement.REMOVE:
|
|
73
|
+
return iconButton(Object.assign({ iconName: "delete" }, propertiesItem));
|
|
74
|
+
case TaskbarElement.INSERT:
|
|
75
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
76
|
+
return textButton(Object.assign({}, propertiesItem));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return iconButton(Object.assign({ iconName: "plus" }, propertiesItem));
|
|
80
|
+
}
|
|
81
|
+
case TaskbarElement.CANCEL:
|
|
82
|
+
return textButton(Object.assign({}, propertiesItem));
|
|
83
|
+
case TaskbarElement.SAVE:
|
|
84
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
85
|
+
return iconTextButton(Object.assign(Object.assign({ iconName: "save" }, propertiesItem), { variant: "primary" }));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return iconButton(Object.assign(Object.assign({ iconName: "save" }, propertiesItem), { variant: "primary" }));
|
|
89
|
+
}
|
|
90
|
+
case TaskbarElement.GRID_MODE:
|
|
91
|
+
return iconButton(Object.assign({ iconName: "table" }, propertiesItem));
|
|
92
|
+
case TaskbarElement.FORM_MODE:
|
|
93
|
+
return iconButton(Object.assign({ iconName: "list" }, propertiesItem));
|
|
94
|
+
case TaskbarElement.CONFIGURATOR:
|
|
95
|
+
if ((actions === null || actions === void 0 ? void 0 : actions.length) > 0) {
|
|
96
|
+
return splitButton(Object.assign({ iconName: "settings-inverted" }, propertiesItem));
|
|
97
|
+
}
|
|
98
|
+
return iconButton(Object.assign({ iconName: "settings-inverted" }, propertiesItem));
|
|
99
|
+
case TaskbarElement.MORE_OPTIONS:
|
|
100
|
+
const definedActions = (_a = actions === null || actions === void 0 ? void 0 : actions.filter(a => a !== undefined)) !== null && _a !== void 0 ? _a : [];
|
|
101
|
+
return actionButton(Object.assign(Object.assign({}, propertiesItem), { actions: definedActions }));
|
|
102
|
+
case TaskbarElement.DIVIDER:
|
|
103
|
+
return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium", "data-taskbar-divider": true });
|
|
104
|
+
case TaskbarElement.DATA_EXPORTER:
|
|
105
|
+
const provider = (_b = store.get("exporterProviders")) === null || _b === void 0 ? void 0 : _b[dataExporterStoreKey];
|
|
106
|
+
return h("snk-data-exporter", { class: className, provider: provider, "data-element-id": dataElementId, "data-taskbar-element": element, size: size });
|
|
107
|
+
case TaskbarElement.ATTACH:
|
|
108
|
+
return iconButton(Object.assign({ iconName: "anexo" }, propertiesItem));
|
|
109
|
+
case TaskbarElement.ACTIONS_BUTTON:
|
|
110
|
+
return h("snk-actions-button", { "data-element-id": dataElementId, "data-taskbar-element": element, class: className, size: size });
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
function textButton({ action, className, dataElementId, title, element, isEnabled, variant, size }) {
|
|
114
|
+
return (h("ez-tooltip", { key: dataElementId, message: title, class: className },
|
|
115
|
+
h("ez-button", { label: title, "data-taskbar-label": title, "data-taskbar-element": element, "data-element-id": dataElementId, isDisabled: !isEnabled(element), onClick: () => action(element), variant: variant, size: size })));
|
|
116
|
+
}
|
|
117
|
+
function concatClass(className) {
|
|
118
|
+
if (typeof className === "string") {
|
|
119
|
+
return className;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return Object.keys(className).filter(key => className[key]).join(" ");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function iconButton({ iconName, element, className, dataElementId, title, action, isEnabled, variant, size }) {
|
|
126
|
+
return (h("ez-tooltip", { key: dataElementId, message: title, class: {
|
|
127
|
+
[concatClass(className)]: true,
|
|
128
|
+
[`icon-button--${size}`]: true
|
|
129
|
+
} },
|
|
130
|
+
h("ez-button", { mode: "icon", "data-taskbar-label": title, "data-taskbar-element": element, "data-taskbar-icon": iconName, "data-element-id": dataElementId, iconName: iconName, isDisabled: !isEnabled(element), onClick: () => action(element), variant: variant, size: size })));
|
|
131
|
+
}
|
|
132
|
+
function iconTextButton({ iconName, element, className, dataElementId, title, action, isEnabled, variant, size }) {
|
|
133
|
+
return (h("ez-tooltip", { key: dataElementId, message: title, class: className },
|
|
134
|
+
h("ez-button", { label: title, "data-taskbar-label": title, "data-taskbar-icon": iconName, "data-taskbar-element": element, "data-element-id": dataElementId, isDisabled: !isEnabled(element), onClick: () => action(element), variant: variant, size: size },
|
|
135
|
+
h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }))));
|
|
136
|
+
}
|
|
137
|
+
function splitButton({ iconName, element, className, title, dataElementId, isEnabled, actions, action, size }) {
|
|
138
|
+
return actions && actions.length > 0
|
|
139
|
+
?
|
|
140
|
+
h("taskbar-split-button", { key: dataElementId, class: className, iconName: iconName, "data-taskbar-icon": iconName, "data-taskbar-label": title, title: title, "data-taskbar-element": element, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, action: () => action(element), size: size })
|
|
141
|
+
: undefined;
|
|
142
|
+
}
|
|
143
|
+
function actionButton({ element, className, dataElementId, title, isEnabled, actions, action, size }) {
|
|
144
|
+
return actions && actions.length > 0
|
|
145
|
+
? h("taskbar-actions-button", { class: className, key: dataElementId, title: title, "data-taskbar-element": element, "data-element-id": dataElementId, enabled: isEnabled(element), actions: actions, onTaskbarActionSelected: (evt) => action(evt.detail.value), size: size })
|
|
146
|
+
: undefined;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { AuthorizationElements as A, TaskbarElement as T, VisibleWhenForbidden as V, buildCustomButton as a, buildElem as b };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import './DataFetcher-70de9419.js';
|
|
2
|
+
import './ISave-f5704813.js';
|
|
3
|
+
import '@sankhyalabs/core';
|
|
4
|
+
import { P as PresentationMode } from './index-c6721886.js';
|
|
5
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
6
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
7
|
+
import './dataunit-fetcher-d26e4a08.js';
|
|
8
|
+
import './filter-item-type.enum-d45e026f.js';
|
|
9
|
+
import './form-config-fetcher-98c42169.js';
|
|
10
|
+
import { V as VIEW_MODE } from './constants-7b422de0.js';
|
|
11
|
+
import { T as TaskbarElement } from './taskbar-elements-ba9d6889.js';
|
|
12
|
+
|
|
13
|
+
class SimpleTaskbarProcessor {
|
|
14
|
+
/**
|
|
15
|
+
* Cria uma nova instância do processador de taskbar.
|
|
16
|
+
* @param defaultButtons - Array com os botões padrão a serem exibidos
|
|
17
|
+
*/
|
|
18
|
+
constructor(defaultButtons) {
|
|
19
|
+
this._defaultButtons = [];
|
|
20
|
+
this._defaultButtons = [...defaultButtons];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Processa a taskbar aplicando regras de visibilidade e habilitação.
|
|
24
|
+
* @param taskbarID - Identificador único da taskbar
|
|
25
|
+
* @param taskbarManager - Gerenciador de taskbar com regras customizadas
|
|
26
|
+
* @param dataState - Estado atual dos dados
|
|
27
|
+
* @param disabledButtons - Array de botões desabilitados
|
|
28
|
+
* @param invisibleButtons - Array de botões invisíveis
|
|
29
|
+
*/
|
|
30
|
+
process(taskbarID, taskbarManager, dataState, disabledButtons = [], invisibleButtons = []) {
|
|
31
|
+
var _a;
|
|
32
|
+
this.taskbarID = taskbarID;
|
|
33
|
+
this.customButtons = new Map();
|
|
34
|
+
this.buttonsArray = [];
|
|
35
|
+
this.disabledButtons = [...disabledButtons];
|
|
36
|
+
(_a = this.getButtonsArray(taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach((btnDef) => {
|
|
37
|
+
let buttonName;
|
|
38
|
+
if (typeof btnDef === "string") {
|
|
39
|
+
buttonName = btnDef;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.customButtons.set(btnDef.name, btnDef);
|
|
43
|
+
buttonName = btnDef.name;
|
|
44
|
+
}
|
|
45
|
+
if (!invisibleButtons.includes(buttonName)) {
|
|
46
|
+
if (!this.isEnabled(taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
47
|
+
this.disabledButtons.push(buttonName);
|
|
48
|
+
}
|
|
49
|
+
this.buttonsArray.push(buttonName);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
this.buttons = this.buttonsArray.join(",");
|
|
53
|
+
}
|
|
54
|
+
getButtonsArray(taskbarManager, dataState) {
|
|
55
|
+
if (taskbarManager) {
|
|
56
|
+
return taskbarManager.getButtons(this.taskbarID, dataState, [...this._defaultButtons]);
|
|
57
|
+
}
|
|
58
|
+
return this._defaultButtons;
|
|
59
|
+
}
|
|
60
|
+
isEnabled(taskbarManager, buttonName, dataState, disabled) {
|
|
61
|
+
const originalValue = !disabled.includes(buttonName);
|
|
62
|
+
if (taskbarManager && taskbarManager.isEnabled) {
|
|
63
|
+
return taskbarManager.isEnabled(this.taskbarID, dataState, buttonName, originalValue);
|
|
64
|
+
}
|
|
65
|
+
return originalValue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const DEFAULT_TASKBAR_BUTTONS = [
|
|
70
|
+
TaskbarElement.FORM_MODE,
|
|
71
|
+
TaskbarElement.PREVIOUS,
|
|
72
|
+
TaskbarElement.NEXT,
|
|
73
|
+
TaskbarElement.REFRESH,
|
|
74
|
+
TaskbarElement.SPACER,
|
|
75
|
+
TaskbarElement.ACTIONS_BUTTON,
|
|
76
|
+
TaskbarElement.DATA_EXPORTER,
|
|
77
|
+
TaskbarElement.ATTACH,
|
|
78
|
+
TaskbarElement.CLONE,
|
|
79
|
+
TaskbarElement.UPDATE,
|
|
80
|
+
TaskbarElement.REMOVE,
|
|
81
|
+
TaskbarElement.INSERT,
|
|
82
|
+
TaskbarElement.CONFIGURATOR,
|
|
83
|
+
TaskbarElement.MORE_OPTIONS,
|
|
84
|
+
];
|
|
85
|
+
var CustomTaskbarButton;
|
|
86
|
+
(function (CustomTaskbarButton) {
|
|
87
|
+
CustomTaskbarButton["FILTER"] = "FILTER";
|
|
88
|
+
CustomTaskbarButton["ENTITY_SEARCH"] = "ENTITY_SEARCH";
|
|
89
|
+
})(CustomTaskbarButton || (CustomTaskbarButton = {}));
|
|
90
|
+
/**
|
|
91
|
+
* Insere os botões customizados à esquerda do elemento SPACER na lista de botões.
|
|
92
|
+
* Caso o SPACER não seja encontrado, os botões são inseridos no início da lista.
|
|
93
|
+
*/
|
|
94
|
+
function insertCustomButtonsBeforeSpacer(buttons, customButtons) {
|
|
95
|
+
const spacerIndex = buttons.findIndex(btn => btn === TaskbarElement.SPACER || (typeof btn === 'string' && btn === 'SPACER'));
|
|
96
|
+
if (spacerIndex > -1) {
|
|
97
|
+
return [
|
|
98
|
+
...buttons.slice(0, spacerIndex),
|
|
99
|
+
...customButtons,
|
|
100
|
+
...buttons.slice(spacerIndex),
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
return [...customButtons, ...buttons];
|
|
104
|
+
}
|
|
105
|
+
function buildNavigationDisabledBtns(dataState) {
|
|
106
|
+
const navigationDisabled = [];
|
|
107
|
+
if (!(dataState === null || dataState === void 0 ? void 0 : dataState.hasPrevious)) {
|
|
108
|
+
navigationDisabled.push(TaskbarElement.PREVIOUS);
|
|
109
|
+
}
|
|
110
|
+
if (!(dataState === null || dataState === void 0 ? void 0 : dataState.hasNext)) {
|
|
111
|
+
navigationDisabled.push(TaskbarElement.NEXT);
|
|
112
|
+
}
|
|
113
|
+
return navigationDisabled;
|
|
114
|
+
}
|
|
115
|
+
function buildNativeTaskbarManager(currentViewMode, mergeTaskbarManager, messagesBuilder) {
|
|
116
|
+
var _a, _b;
|
|
117
|
+
const CUSTOM_BUTTONS = [
|
|
118
|
+
{
|
|
119
|
+
name: CustomTaskbarButton.FILTER,
|
|
120
|
+
hint: (_a = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.filter")) !== null && _a !== void 0 ? _a : "Abre o painel de filtros",
|
|
121
|
+
iconName: "filter",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: CustomTaskbarButton.ENTITY_SEARCH,
|
|
125
|
+
hint: (_b = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.entitySearch")) !== null && _b !== void 0 ? _b : "Busca na entidade",
|
|
126
|
+
iconName: "search",
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
const EDITION_MODE_BUTTONS = [
|
|
130
|
+
TaskbarElement.CANCEL,
|
|
131
|
+
TaskbarElement.SAVE,
|
|
132
|
+
];
|
|
133
|
+
return {
|
|
134
|
+
getButtons: (taskbarID, dataState, defaultButtons) => {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
if (!taskbarID) {
|
|
137
|
+
console.warn('taskbarID não fornecido');
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
const isInEditionMode = (dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty);
|
|
141
|
+
if (isInEditionMode) {
|
|
142
|
+
return EDITION_MODE_BUTTONS;
|
|
143
|
+
}
|
|
144
|
+
if (currentViewMode === VIEW_MODE.FORM) {
|
|
145
|
+
const indexFormMode = defaultButtons.indexOf(TaskbarElement.FORM_MODE);
|
|
146
|
+
if (indexFormMode > -1) {
|
|
147
|
+
defaultButtons = [
|
|
148
|
+
...defaultButtons.slice(0, indexFormMode),
|
|
149
|
+
TaskbarElement.GRID_MODE,
|
|
150
|
+
...defaultButtons.slice(indexFormMode + 1)
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (((_b = (_a = dataState === null || dataState === void 0 ? void 0 : dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) > 1) {
|
|
155
|
+
const indexUpdate = defaultButtons.indexOf(TaskbarElement.UPDATE);
|
|
156
|
+
if (indexUpdate > -1) {
|
|
157
|
+
defaultButtons = [
|
|
158
|
+
...defaultButtons.slice(0, indexUpdate),
|
|
159
|
+
TaskbarElement.UPDATE_MULTIPLE,
|
|
160
|
+
...defaultButtons.slice(indexUpdate + 1)
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const defaultsWithCustomButtons = insertCustomButtonsBeforeSpacer(defaultButtons, CUSTOM_BUTTONS);
|
|
165
|
+
if (mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getButtons) {
|
|
166
|
+
return mergeTaskbarManager.getButtons(taskbarID, dataState, defaultsWithCustomButtons);
|
|
167
|
+
}
|
|
168
|
+
return defaultsWithCustomButtons;
|
|
169
|
+
},
|
|
170
|
+
isEnabled: (_, dataState, buttonName, originalValue) => {
|
|
171
|
+
var _a;
|
|
172
|
+
// Filtro só faz sentido no modo grade; a filter-bar fica oculta no
|
|
173
|
+
// form-view, então desabilita o botão que abre o painel de filtros.
|
|
174
|
+
if (currentViewMode === VIEW_MODE.FORM && buttonName === CustomTaskbarButton.FILTER) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (!dataState) {
|
|
178
|
+
return originalValue;
|
|
179
|
+
}
|
|
180
|
+
const hasSelectedRecord = dataState.selectedRecord !== undefined;
|
|
181
|
+
const buttonsRequiringSelection = [
|
|
182
|
+
TaskbarElement.UPDATE,
|
|
183
|
+
TaskbarElement.REMOVE,
|
|
184
|
+
TaskbarElement.ATTACH,
|
|
185
|
+
TaskbarElement.CLONE,
|
|
186
|
+
];
|
|
187
|
+
if (!hasSelectedRecord && buttonsRequiringSelection.includes(buttonName)) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
const navigationDisabled = buildNavigationDisabledBtns(dataState);
|
|
191
|
+
if (navigationDisabled.includes(buttonName)) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.isEnabled(_, dataState, buttonName, originalValue)) !== null && _a !== void 0 ? _a : originalValue;
|
|
195
|
+
},
|
|
196
|
+
getMoreOptions(taskbarId, configName, dataState, currentActions) {
|
|
197
|
+
var _a;
|
|
198
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getMoreOptions) === null || _a === void 0 ? void 0 : _a.call(mergeTaskbarManager, taskbarId, configName, dataState, currentActions);
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function getHeaderTaskbarId(dataState, presentationMode) {
|
|
203
|
+
var _a;
|
|
204
|
+
const hasSelectedRecord = dataState && !!((_a = dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
|
205
|
+
const taskbarIdPrefixLookup = {
|
|
206
|
+
primary: "snkGridHeaderTaskbar",
|
|
207
|
+
secondary: "snkGridHeaderTaskbar",
|
|
208
|
+
singleTaskbar: "snkGridHeaderTaskbar.singleTaskbar",
|
|
209
|
+
};
|
|
210
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[presentationMode];
|
|
211
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
|
212
|
+
if ((dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) && presentationMode === PresentationMode.SINGLE_TASKBAR) {
|
|
213
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
|
214
|
+
}
|
|
215
|
+
return headerTaskbarId;
|
|
216
|
+
}
|
|
217
|
+
function getTopTaskBarId(dataState, presentationMode) {
|
|
218
|
+
const suffixLookup = {
|
|
219
|
+
primary: '',
|
|
220
|
+
secondary: '.secondary',
|
|
221
|
+
singleTaskbar: '.singleTaskbar',
|
|
222
|
+
};
|
|
223
|
+
const sufix = suffixLookup[presentationMode];
|
|
224
|
+
if (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) {
|
|
225
|
+
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
|
226
|
+
}
|
|
227
|
+
return `snkGridTopTaskbar.regular${sufix}`;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { CustomTaskbarButton as C, DEFAULT_TASKBAR_BUTTONS as D, SimpleTaskbarProcessor as S, getHeaderTaskbarId as a, buildNativeTaskbarManager as b, getTopTaskBarId as g };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-
|
|
1
|
+
import{UserInterface as e,DataType as t,ApplicationContext as n,ErrorException as i}from"@sankhyalabs/core";import{d as o,D as r}from"./p-4dd574d6.js";function a(e){const t=(n=e.fieldsMetadata)&&n.length?n.map((e=>({name:e.fieldName,label:e.description,dataType:u(e.type),userInterface:l(e),properties:s(e)}))):[];var n;return{label:e.entityDescription,name:e.descriptionField,fields:t}}function s(e){const t={};return t.options=function(e){const t=e.options;if(!t)return;const n=[];return Object.keys(t).forEach((e=>{n.push({label:e,value:t[e]})})),n}(e),t.mask=function(e){const t=e.uiType;return t?String(t).toLowerCase():void 0}(e),t}function l(t){const n=t.options;return n&&Object.keys(n).length>0?e.OPTIONSELECTOR:"D"===t.type?e.DATE:"H"===t.type?e.DATETIME:"T"===t.type?e.TIME:"I"===t.type?e.INTEGERNUMBER:void 0}function u(e){switch(e){case"F":case"I":return t.NUMBER;case"D":case"H":return t.DATE;case"B":return t.OBJECT;default:return t.TEXT}}function c(e){return Object.assign({id:e.codigo,label:`${e.caminho} - ${e.descricao}`,bold:"N"===e.analitico,props:{analitico:"S"===e.analitico}},e.no&&{children:e.no.map(c)})}var d,v,f;!function(e){e[e.GRID=0]="GRID",e[e.CARDS=1]="CARDS",e[e.TREE=2]="TREE"}(d||(d={}));class m{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",o.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
2
2
|
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
3
3
|
value
|
|
4
4
|
label
|
|
5
5
|
}
|
|
6
|
-
}`)}loadSearchOptions(e,n,i,o){var a;const s=(null==n?void 0:n.toString().trim())||void 0;n=isNaN(Number(s))&&s?`%${s}`:s,null==i||i.params.forEach((e=>{e.dataType===t.OBJECT&&(e.value=JSON.stringify(e.value))}));const l=this.applySearchListener(v.beforeSearch,e,n,i,o),u={argument:(null==l?void 0:l.argument)||n,entityName:e,criteria:(null==l?void 0:l.criteria)||i,options:(null==l?void 0:l.searchOptions)||o};return u.options&&(null===(a=u.options)||void 0===a||delete a.dataUnitId),new Promise(((e,t)=>{r.get().callGraphQL({values:u,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}buildDescriptionCacheKey(e,t){return`${e}__${t}`}async loadByCode(e,t,n,i){const o=this.buildDescriptionCacheKey(e,t),r=m.DESCRIPTIONS_BY_CODE[o];if(r)return Promise.resolve(r);const a=await this.loadAdvancedSearch(e,void 0,n,i,t);return m.DESCRIPTIONS_BY_CODE[o]=a,a}loadAdvancedSearch(e,o,a,s,l){var u,c,d,f,m,p;const h=this.applySearchListener(v.beforeSearch,e,o,a,s),N={argument:(null==h?void 0:h.argument)||o,criteria:(null==h?void 0:h.criteria)||a,searchOptions:Object.assign(Object.assign({},s),null==h?void 0:h.searchOptions)},S={query:{$:null===(u=N.criteria)||void 0===u?void 0:u.expression}};(null===(d=null===(c=N.criteria)||void 0===c?void 0:c.params)||void 0===d?void 0:d.length)>0&&(S.params={param:N.criteria.params.map((e=>{let o=e.value;if("string"==typeof o){const e=/CTX\{([^}]+)\}/.exec(o);e&&(o=n.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${e[1]})__`))}if(e.dataType===t.NUMBER&&void 0===o)throw new i("Falha detectada",`O campo ${e.name} deve ser informado.`);let r=e.dataType;return r===t.OBJECT?(o=o.value,r="S"):r=g(e.dataType),{$:o,type:r}}))});const y=null!=s?Object.assign(Object.assign({},null==N?void 0:N.searchOptions),{pkFieldName:s.codeFieldName,label:s.descriptionFieldName,fieldName:s.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0,limit:s.limit}):void 0,O={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:e,compacted:!1,ignoreEntityCriteria:null!==(f=null==y?void 0:y.ignoreEntityCriteria)&&void 0!==f&&f,limit:null!==(m=null==y?void 0:y.limit)&&void 0!==m?m:this._defaultPageSize,orderByDesc:!1,externalCriteria:S,localEntityName:null===(p=N.searchOptions)||void 0===p?void 0:p.rootEntity},{options:y}),clientEventList:{clientEvent:[]}}};null==l?O.requestBody.criteria.query={$:o}:O.requestBody.criteria.pk={$:l};const
|
|
6
|
+
}`)}loadSearchOptions(e,n,i,o){var a;const s=(null==n?void 0:n.toString().trim())||void 0;n=isNaN(Number(s))&&s?`%${s}`:s,null==i||i.params.forEach((e=>{e.dataType===t.OBJECT&&(e.value=JSON.stringify(e.value))}));const l=this.applySearchListener(v.beforeSearch,e,n,i,o),u={argument:(null==l?void 0:l.argument)||n,entityName:e,criteria:(null==l?void 0:l.criteria)||i,options:(null==l?void 0:l.searchOptions)||o};return u.options&&(null===(a=u.options)||void 0===a||delete a.dataUnitId),new Promise(((e,t)=>{r.get().callGraphQL({values:u,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}buildDescriptionCacheKey(e,t){return`${e}__${t}`}async loadByCode(e,t,n,i){const o=this.buildDescriptionCacheKey(e,t),r=m.DESCRIPTIONS_BY_CODE[o];if(r)return Promise.resolve(r);const a=await this.loadAdvancedSearch(e,void 0,n,i,t);return m.DESCRIPTIONS_BY_CODE[o]=a,a}loadAdvancedSearch(e,o,a,s,l){var u,c,d,f,m,p;const h=this.applySearchListener(v.beforeSearch,e,o,a,s),N={argument:(null==h?void 0:h.argument)||o,criteria:(null==h?void 0:h.criteria)||a,searchOptions:Object.assign(Object.assign({},s),null==h?void 0:h.searchOptions)},S={query:{$:null===(u=N.criteria)||void 0===u?void 0:u.expression}};(null===(d=null===(c=N.criteria)||void 0===c?void 0:c.params)||void 0===d?void 0:d.length)>0&&(S.params={param:N.criteria.params.map((e=>{let o=e.value;if("string"==typeof o){const e=/CTX\{([^}]+)\}/.exec(o);e&&(o=n.getContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${e[1]})__`))}if(e.dataType===t.NUMBER&&void 0===o)throw new i("Falha detectada",`O campo ${e.name} deve ser informado.`);let r=e.dataType;return r===t.OBJECT?(o=o.value,r="S"):r=g(e.dataType),{$:o,type:r}}))});const y=null!=s?Object.assign(Object.assign({},null==N?void 0:N.searchOptions),{pkFieldName:s.codeFieldName,label:s.descriptionFieldName,fieldName:s.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0,limit:s.limit}):void 0,O={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:e,compacted:!1,ignoreEntityCriteria:null!==(f=null==y?void 0:y.ignoreEntityCriteria)&&void 0!==f&&f,limit:null!==(m=null==y?void 0:y.limit)&&void 0!==m?m:this._defaultPageSize,orderByDesc:!1,externalCriteria:S,localEntityName:null===(p=N.searchOptions)||void 0===p?void 0:p.rootEntity},{options:y}),clientEventList:{clientEvent:[]}}};null==l?O.requestBody.criteria.query={$:o}:O.requestBody.criteria.pk={$:l};const C={urlParams:{quietMode:!0}};return new Promise(((e,t)=>{r.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(O),C).then((t=>e(t))).catch((e=>t(e)))}))}addSearchListener(e,t,n){var i;const o=this._searchListenersByDataUnit.get(t)||[],r=o.find((t=>t.entity===e));if(r){for(const e of Object.keys(n))if(e in r.listener){if((null===(i=r.listener[e])||void 0===i?void 0:i.toString())===n[e].toString())continue;r.listener[e]=n[e]}}else this._searchListenersByDataUnit.set(t,[...o,{entity:e,listener:n}]);return()=>{const n=o.filter((t=>t.entity!==e));n.length?this._searchListenersByDataUnit.set(t,n):this._searchListenersByDataUnit.delete(t)}}applySearchListener(e,t,n,i,o){var r;const a=null==o?void 0:o.dataUnitId;if(!a)return;const s=null===(r=this._searchListenersByDataUnit.get(a))||void 0===r?void 0:r.find((({entity:e})=>e===t));if(!s)return;const{listener:l}=s;return e in l?l[e]({argument:n,criteria:i,searchOptions:o}):void 0}async loadPresentationConfig(e){var t,n;let i=function(e){return{config:{chave:`PesquisaContent:${e}`,tipo:"T"}}}(e);const o=await r.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(i));return null!==(n=null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.lastUsedMode)&&void 0!==n?n:"list"}async savePresentationConfig(e,t){let n=function(e,t){return{config:{lastUsedMode:t,chave:`PesquisaContent:${e}`,tipo:"T"}}}(e,t);await r.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n))}async loadPesquisaGridConfig(e){const t=function(e){return{gridConfig:{configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`}}}(e);return function(e){var t,n;const i=[],o=null!==(n=null===(t=null==e?void 0:e.gridConfig)||void 0===t?void 0:t.field)&&void 0!==n?n:{};if(Object.keys(o).forEach((e=>i.push(o[e]))),i.length)return{columns:i}}(await r.get().callServiceBroker("GridConfig.getGridConfigFromJson",JSON.stringify(t)))}async savePesquisaGridConfig(e,t){const n=function(e,t){const n={};return null==t||t.forEach(((e,t)=>n[`field${t}`]=e)),{gridConfig:{compactMode:!0,configName:`GrdCfgHtml5:grdcfg.dynaform.pesquisa.${e}`,field:n}}}(e,t);await r.get().callServiceBroker("GridConfig.saveGridConfigFromJSON",JSON.stringify(n))}async loadTree(e,t,n,i){const o=this.buildLoadTreeRequestBody(e,t,n,i);return(null!==(s=null===(a=(await r.get().callServiceBroker("Pesquisa.getStructuredData",JSON.stringify(o))).arvore)||void 0===a?void 0:a.no)&&void 0!==s?s:[]).map(c);var a,s}buildLoadTreeRequestBody(e,t,n,i){var o,r;const a=this.applySearchListener(v.beforeSearch,e,t,n,i),s=null!==(o=null==a?void 0:a.searchOptions)&&void 0!==o?o:i,l=null==s?void 0:s.rootEntity,u=null==s?void 0:s.codeFieldName,c=null===(r=null==a?void 0:a.criteria)||void 0===r?void 0:r.expression,d=this.buildParams(a),f={nome:e,nomeInstanciaLocal:l,codeFieldName:u};return c&&(f.criterioLiteral={expressao:{$:c},parametro:d}),{instancia:f}}buildParams(e){var t,n;let i=null!==(n=null===(t=null==e?void 0:e.criteria)||void 0===t?void 0:t.params)&&void 0!==n?n:[];return i=i.map((e=>Object.assign(Object.assign({},e),{tipo:g(e.dataType),$:e.value}))),i}}function g(e){switch(e){case t.NUMBER:return"I";case t.DATE:return"D";default:return"S"}}m.DESCRIPTIONS_BY_CODE={},function(e){e.beforeSearch="beforeSearch"}(v||(v={})),function(e){e.LINK_AND_FILE_AT_THE_SAME_TIME="LINK_AND_FILE_AT_THE_SAME_TIME",e.ANY_LINK_OR_FILE_FILLED="ANY_LINK_OR_FILE_FILLED",e.UNKNOWN="UNKNOWN",e.DESCRIPTION_CANNOT_BE_CHANGED="DESCRIPTION_CANNOT_BE_CHANGED"}(f||(f={}));export{m as P,f as S,d as a,a as b}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T,e;!function(T){T.EDIT="edit",T.REMOVE="remove",T.CREATE="create"}(T||(T={})),function(T){T.QUICK_FILTER="QUICK_FILTER",T.CUSTOM_FILTER="CUSTOM_FILTER",T.OTHER_FILTERS="OTHER_FILTERS",T.DEFAULT_FILTER="DEFAULT_FILTER"}(e||(e={}));const t=e;export{T as A,t as F}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{S as snk_data_unit}from"./p-eac48627.js";import"./p-2c9d0870.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-4dd574d6.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d1ef77a.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as t}from"./p-2c9d0870.js";import"./p-4dd574d6.js";import"./p-097d75b3.js";import{ApplicationContext as i}from"@sankhyalabs/core";import"./p-abcb646d.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d1ef77a.js";import"./p-ff1990ad.js";import{F as a}from"./p-ec7c87bb.js";import"./p-9019a32f.js";import{FormLayout as e}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const o=class{constructor(t){s(this,t),this._formConfigFetcher=new a,this.messagesBuilder=void 0,this.layoutType=e.SIDE_BY_SIDE}async save(){this._LayoutFormConfigSingleton.setConfig(this.layoutType),this._formConfigFetcher.saveLayoutFormConfig("formColCfg."+this._resourceID,{config:this.layoutType,newConfig:!0})}async componentWillLoad(){const s=i.getContextValue("__SNK__APPLICATION__");this._LayoutFormConfigSingleton=await(null==s?void 0:s.getLayoutFormConfig()),this._resourceID=await(null==s?void 0:s.getResourceID()),this.setLayoutInit()}setLayoutInit(){if(!this._LayoutFormConfigSingleton)return;const{config:s}=this._LayoutFormConfigSingleton;if(null==s)return void(this.layoutType=e.SIDE_BY_SIDE);const t=Number(s);this.layoutType=Object.values(e).includes(t)?t:e.SIDE_BY_SIDE}toggleLayout(s){this.layoutType=s}getMessage(s,t){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(s,t)}render(){return t("div",{class:"ez-flex ez-flex--column"},t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.cascadeLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CASCADE),value:this.layoutType===e.CASCADE}),t("snk-view-representation",{mode:e.CASCADE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.cascadeLayout.description"))),t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.classicCascadeLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CLASSIC_CASCADE),value:this.layoutType===e.CLASSIC_CASCADE}),t("snk-view-representation",{mode:e.CLASSIC_CASCADE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.classicCascadeLayout.description"))),t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.sideBySideLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.SIDE_BY_SIDE),value:this.layoutType===e.SIDE_BY_SIDE}),t("snk-view-representation",{mode:e.SIDE_BY_SIDE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.sideBySideLayout.description"))),t("div",null,t("ez-check",{label:this.getMessage("snkLayoutFormConfig.classicSideBySideLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CLASSIC_SIDE_BY_SIDE),value:this.layoutType===e.CLASSIC_SIDE_BY_SIDE}),t("snk-view-representation",{mode:e.CLASSIC_SIDE_BY_SIDE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.classicSideBySideLayout.description"))))}};o.style=".sc-snk-layout-form-config-h{display:block}";export{o as snk_layout_form_config}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,e as s,h as i,g as e}from"./p-2c9d0870.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
|
|
1
|
+
import{r as t,e as s,h as i,g as e}from"./p-2c9d0870.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}async getValueAsync(){return this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.value}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,e,h as t,f as s,i as n,g as o}from"./p-2c9d0870.js";import{ApplicationUtils as a}from"@sankhyalabs/ezui/dist/collection/utils";import{ObjectUtils as r,StringUtils as d,ArrayUtils as l}from"@sankhyalabs/core";import{S as c}from"./p-cbb8e351.js";import{a as h,G as u}from"./p-9019a32f.js";import{S as f,f as g,I as m}from"./p-46d7e2de.js";const p=class{constructor(t){i(this,t),this.configClose=e(this,"configClose",7),this.saveConfig=e(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");a.alert(i,e)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage("snkFormConfig.confirm.cancel");if(!await a.confirm(i,e))return}this.configClose.emit()}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}openConfirmDialog(i="",e=this.getMessage("snkFormConfig.confirm.title")){return a.confirm(e,i)}async applyOptionConfig(){var i,e;const t=null!==(e=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==e?e:this.getMessage("snkFormConfig.configs.selectedConfig"),s=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",t);await this.openConfirmDialog(s)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return t("div",{class:"right-group"},t("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),t("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return t(s,null,t("div",{class:"left-group"},t("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),t("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),t("snk-dynaform-configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};p.style=".sc-snk-dynaform-config-header-h{display:flex;padding-top:var(--space--12, 12px);align-items:center;width:100%;justify-content:space-between}.left-group.sc-snk-dynaform-config-header{display:flex;gap:var(--space--8, 8px);align-items:center}.right-group.sc-snk-dynaform-config-header{display:flex}";const b=class{constructor(t){i(this,t),this.formConfigOptionSelected=e(this,"formConfigOptionSelected",7),this.configOptions=[],this.selectedConfig=void 0,this.hasChanges=!1,this.messagesBuilder=void 0}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}async showShareConfigOptions(){this._refOptionsPopover&&this._refShareConfigBtn&&await this._refOptionsPopover.showUnder(this._refShareConfigBtn)}async handleSelectOption(i){if(!r.equals(i,this.selectedConfig)){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage("snkFormConfig.confirm.cancel");if(!await a.confirm(i,e))return}this.selectedConfig=i,this.formConfigOptionSelected.emit(i),await this._refOptionsPopover.hide()}}getButtonLabel(){var i,e;return null!==(e=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==e?e:this.getMessage("snkFormConfig.configs.buttonLabel")}renderConfigOptions(){return this.configOptions.map((i=>t("div",{class:"main-item",onClick:async()=>await this.handleSelectOption(i)},t("span",{class:"item-label"}," ",i.name),this.renderCheckIcon(i))))}renderCheckIcon(i){if(this.selectedConfig&&this.selectedConfig.origin===i.origin)return t("ez-icon",{iconName:"check"})}render(){return t(s,null,t("ez-button",{ref:i=>this._refShareConfigBtn=i,label:this.getButtonLabel(),onClick:async()=>await this.showShareConfigOptions()},t("ez-icon",{slot:"rightIcon",iconName:"chevron-down"})),t("ez-popover-plus",{ref:i=>this._refOptionsPopover=i,autoClose:!0,overlayType:"none"},t("div",{class:"dropdown-container"},this.renderConfigOptions())))}};b.style=".dropdown-container.sc-snk-dynaform-configs-button{font-family:'Roboto';font-size:12px;font-weight:400;display:flex;flex-direction:column;color:#2b3a54;width:200px}.main-item.sc-snk-dynaform-configs-button{padding:12px;font-size:14px;cursor:pointer;transition:all .2s ease-in-out;display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:start}.main-item.sc-snk-dynaform-configs-button ez-icon.sc-snk-dynaform-configs-button{--ez-icon--color:#008561}.main-item.sc-snk-dynaform-configs-button:nth-of-type(1){padding-bottom:6px}.main-item.sc-snk-dynaform-configs-button:nth-of-type(2){padding-top:6px}.main-item.sc-snk-dynaform-configs-button:hover{background-color:#FAFCFF}.item-label.sc-snk-dynaform-configs-button{display:flex}";const v=class{constructor(t){i(this,t),this.isEditingGuideName=e(this,"isEditingGuideName",7),this.isEditingGroupName=e(this,"isEditingGroupName",7),this.layoutChanged=e(this,"layoutChanged",7),this.setFieldListAsAvailable=e(this,"setFieldListAsAvailable",7),this.guideRenamed=e(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[h.main.toLowerCase(),h.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.sortableInstances=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.isMainSection=!1,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:i}){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)&&i.tab&&i.tab!==this.selectedGuide.name)return;const t=this.groupsListMemory.find((e=>e.name===i.group));if(!t)return;const s=t.fields.map((e=>e.name===i.name?i:e)),n=this.groupsListMemory.map((i=>i.name===t.name?{name:i.name,fields:s}:i));this.applyGroupUpdate(n)}observeSelectedGuide(){this.isEditGuideNameActive=!1,n(this),this.isEditingGroupName.emit(!1)}observeGroupList(i){this.groupsListMemory=[...i]}observeIsEditGuideNameActive(i){this.isEditingGuideName.emit(i)}async addFieldToLayout(i){i.group=u.noGroup,i.tab=this.selectedGuide.name;const e=this.getFixedFieldsGroup(),t={name:u.noGroup,fields:e?[...e.fields,i]:[i]},s=e?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((i=>i.name===u.noGroup))}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}handleAddGroup(){const i={name:this.buildNewGroupName(),fields:[]},e=[...this.groupsListMemory,i];this.applyGroupUpdate(e)}buildNewGroupName(){var i,e;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(e=null===(i=this.groupsListMemory.filter((i=>i.name.includes(t))))||void 0===i?void 0:i.length)&&void 0!==e?e:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((i=>i.name!==u.noGroup)).forEach((i=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(i.name))}))}getInstanceSuffix(){var i,e;return d.replaceBlankCharacters(null!==(e=null===(i=this.selectedGuide)||void 0===i?void 0:i.name)&&void 0!==e?e:"")}getGroupsContainerId(){return`${this.ID_GROUPS}-${this.getInstanceSuffix()}`}getNoGroupContainerId(){return`${u.noGroup}-${this.getInstanceSuffix()}`}getFieldsContainerId(i){return`${this.ID_FIELDS}-${this.getInstanceSuffix()}-${d.replaceBlankCharacters(i)}`}handleSortGroups(i){var e;const t=null===(e=i.to)||void 0===e?void 0:e.children;if(!t)return;const s=Array.from(t).map((i=>i.getAttribute("data-group-name"))),n=[],o=this.getFixedFieldsGroup();o&&n.push(o),s.forEach((i=>{const e=this.groupsListMemory.find((e=>e.name===i));e&&n.push(e)})),this.applyGroupUpdate(n)}handleFieldsChanged(i){let e=[...this.groupsListMemory];e=[...this.handleFieldsOnGroupUpdate(e,i,f.FROM)],e=[...this.handleFieldsOnGroupUpdate(e,i,f.TO)],this.applyGroupUpdate(e)}applyGroupUpdate(i){var e;return null===(e=this.groupsRefList)||void 0===e||e.forEach((i=>null==i?void 0:i.cancelEdition())),!r.equals(i,this.groupsListMemory)&&(this.groupsListMemory=[...i],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(i,e,t){const s=e[t];return this.el.contains(s)?s.id===m?i:this.updateGroupList(i,s,t,e):i}updateGroupList(i,e,t,s){const n=e.getAttribute("data-group-name"),o={name:n,fields:g(s,t,n,this.selectedGuide.name)};return this.upsertGroup(i,o)}upsertGroup(i,e){return i.some((i=>i.name===e.name))?this.replaceGroup(i,e):e.name===u.noGroup?[e,...i]:[...i,e]}replaceGroup(i,e){return i.map((i=>i.name===e.name?e:i))}destroySortableInstances(){this.sortableInstances.forEach((i=>{var e;try{null===(e=null==i?void 0:i.destroy)||void 0===e||e.call(i)}catch(i){}})),this.sortableInstances=[]}makeGroupsDraggable(){try{const i=this.getContainerElement(this.getGroupsContainerId());if(!i)return;this.sortableInstances.push(new c(i,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:i=>this.handleSortGroups(i)}))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.getGroupsContainerId())}}makeFieldContainerDraggable(i){try{const e=this.getContainerElement(i);if(!e)return;this.sortableInstances.push(new c(e,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:i=>this.handleFieldsChanged(i),onRemove:i=>this.handleFieldsChanged(i),onSort:i=>this.handleFieldsChanged(i)}))}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),i)}}getContainerElement(i){return this.el.querySelector(`[id="${i}"]`)}handleSetFieldAsAvailable(i){var e;const t=null!==(e=i.group)&&void 0!==e?e:u.noGroup,s=this.groupsListMemory.find((i=>i.name===t)).fields.filter((e=>e.name!==i.name)),n=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(n)}removeGroup(i){var e,t;const s=null!==(t=null===(e=this.groupsListMemory.find((e=>e.name===i.name)))||void 0===e?void 0:e.fields)&&void 0!==t?t:[],n=[...this.groupsListMemory.filter((e=>e.name!==i.name))];this.applyGroupUpdate(n)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(i){const{value:e,newValue:t}=i.detail,s=this.groupsListMemory.map((i=>{if(i.name!==e)return Object.assign({},i);const s=i.fields.map((i=>Object.assign(Object.assign({},i),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(i,e){if(!this.groupsList.some((e=>{var t;return(null!==(t=e.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=i?i:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(i);return a.alert(t,s).then((()=>{var i;return null===(i=this.groupsRefList[e])||void 0===i?void 0:i.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(i){const e=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${i}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${e===h.main?this.getMessage("snkFormConfig.form.mainArea"):e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(i){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(i){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(i){if(0!==i.length)return i.map((i=>t("snk-dynaform-field-item",{key:i.name,fieldConfig:i,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:i=>this.handleSetFieldAsAvailable(i.detail)})))}renderDraggableGroups(){return this.groupsList.filter((i=>i.name!==u.noGroup)).map(((i,e)=>{var s;return t("div",{key:i.name,class:"group-config","data-group-name":i.name},t("ez-collapsible-box",{ref:i=>this.groupsRefList[e]=i,label:i.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(i),onEzSaveEditLabel:i=>this.handleRenameGroup(i),onEzEditLabelMode:({detail:i})=>this.isEditingGroupName.emit(i),conditionalSave:i=>this.canSaveGroup(i,e)},t("div",{id:this.getFieldsContainerId(i.name),class:"group-content "+((null===(s=i.fields)||void 0===s?void 0:s.length)?"":"empty-content"),"data-group-name":i.name},this.renderFields(i.fields))))}))}renderFixedFields(){var i,e;const t=null!==(e=null===(i=this.groupsList.find((i=>i.name===u.noGroup)))||void 0===i?void 0:i.fields)&&void 0!==e?e:[];return this.renderFields(t)}handleRenameGuide(i){const{value:e,newValue:t}=i.detail;if(this.isEditGuideNameActive=!1,t===e)return;const s=this.guideNames.includes(t.toLowerCase()),n=this.reservedGuideNames.includes(t.toLowerCase());if(n||s){const i=this.getMessage("snkFormConfig.confirm.title"),e=n?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);a.alert(i,e).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var i,e;return this.isEditGuideNameActive?t("div",{class:"guide-header"},t("ez-text-edit",{class:"collapsible-box__text-edit",ref:i=>this._refTextEdit=i,value:null===(i=this.selectedGuide)||void 0===i?void 0:i.label,styled:this.getTextEditStyle(),onSaveEdition:i=>this.handleRenameGuide(i),onCancelEdition:()=>this.cancelEditGuideName()})):t("div",{class:"guide-header"},t("span",{class:"guide-header-label"},null===(e=this.selectedGuide)||void 0===e?void 0:e.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var i;if(!this.isMainSection&&(null===(i=this.selectedGuide)||void 0===i?void 0:i.name)!==h.main)return t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentWillLoad(){var i;this.groupsListMemory=[...null!==(i=this.groupsList)&&void 0!==i?i:[]]}componentDidRender(){this.destroySortableInstances(),this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(this.getNoGroupContainerId()),this.setCustomCSSProperties()}disconnectedCallback(){this.destroySortableInstances()}render(){var i;if(!this.selectedGuide)return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},t("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")));if(this.selectedGuide.isCustom||this.selectedGuide.isDetail)return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},t("div",{class:"message-container"},t("h1",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.canNotEditCustomGuide")),t("span",{class:"message-config-detail"},this.getMessage("snkFormConfig.form.canNotEditDetailGuide"))));const e=this.isMainSection||(null===(i=this.selectedGuide)||void 0===i?void 0:i.name)===h.main;return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"+(e?" is-main-section":"")},this.renderGuideName(),t("div",{class:"layout-container"},t("ez-scroller",{direction:"vertical",activeShadow:!0},t("div",{class:"no-group-container"},t("div",{id:this.getNoGroupContainerId(),class:"group-content","data-group-name":u.noGroup},this.renderFixedFields())),t("hr",null),t("div",{id:this.getGroupsContainerId(),class:"groups-container"},this.renderDraggableGroups()))),t("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},t("ez-icon",{slot:"leftIcon",iconName:"plus"}),t("span",null,this.getMessage("snkFormConfig.form.createNewGroup"))))}get el(){return o(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};v.style='.sc-snk-dynaform-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:100%;min-height:0;flex-direction:column;box-sizing:border-box}.is-main-section.sc-snk-dynaform-fields-layout-h{height:100%;border:1px solid var(--color--gray-90, #EAEAEA);flex:1 1 auto;min-height:0;flex-direction:row;overflow:auto}.is-main-section.sc-snk-dynaform-fields-layout-h .layout-container.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout>ez-scroller.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.guide-header.sc-snk-dynaform-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-snk-dynaform-fields-layout ez-button.sc-snk-dynaform-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-snk-dynaform-fields-layout:hover ez-button.sc-snk-dynaform-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-snk-dynaform-fields-layout{display:block;padding:10px 0}.group-config.sc-snk-dynaform-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-snk-dynaform-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-snk-dynaform-fields-layout{position:relative}.group-content.empty-content.sc-snk-dynaform-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-snk-dynaform-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-snk-dynaform-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-snk-dynaform-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.message-container.sc-snk-dynaform-fields-layout{margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}.message-config-detail.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:var(--font-size--medium, 16px);color:#AFB6C0;font-weight:var(--font-weight--medium, 500)}.ghost.sc-snk-dynaform-fields-layout{opacity:.5;background:#c8fbe2}';const y=class{constructor(t){i(this,t),this.fieldListChanged=e(this,"fieldListChanged",7),this.availableFields=[],this.dataUnit=void 0,this.filterTerm="",this.messagesBuilder=void 0}onAddField(i){const e=this.addItemInPosition(i.newIndex,i.item.fieldConfig);this.fieldListChanged.emit(e)}addItemInPosition(i,e){return[...this.availableFields.slice(0,i),e,...this.availableFields.slice(i)]}onRemoveField(i){const e=i.item,t=e.fieldConfig.name,s=[...this.availableFields.filter((i=>i.name!==t))];this.fieldListChanged.emit(s),requestAnimationFrame((()=>e.remove()))}renderFields(){return l.applyStringFilter(this.filterTerm,this.availableFields).map((i=>t("snk-dynaform-field-item",{key:i.name,dataUnit:this.dataUnit,fieldConfig:i,messagesBuilder:this.messagesBuilder})))}getCountText(){return this.availableFields.length?1===this.availableFields.length?this.getMessage("snkFormConfig.availableFields.labelOneField"):`${this.availableFields.length} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:this.getMessage("snkFormConfig.availableFields.labelNoFields")}initializeDraggableContainer(){new c(this.el.querySelector(`#${m}`),{group:"fields",direction:"vertical",ghostClass:"ghost",animation:15,onAdd:i=>this.onAddField(i),onRemove:i=>this.onRemoveField(i)})}getMessage(i,e){var t;return null===(t=this.messagesBuilder)||void 0===t?void 0:t.getMessage(i,e)}componentDidRender(){this.initializeDraggableContainer()}render(){return t(s,{class:"ez-col ez-col--sd-4 ez-col--tb-4 ez-padding--medium"},t("span",{class:"fields-label ez-padding-bottom--small"},this.getMessage("snkFormConfig.availableFields.title")),t("ez-filter-input",{class:"filter-input",slot:"content",mode:"slim",label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.filterTerm=i.detail}),t("span",{class:"fields-count"},this.getCountText()),t("ez-scroller",{direction:"vertical",activeShadow:!0},t("div",{id:m,class:"fields-container"},this.renderFields())))}get el(){return o(this)}};y.style=".sc-snk-dynaform-fields-selector-h{width:33.33333%;display:flex;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);max-width:260px}.fields-label.sc-snk-dynaform-fields-selector{display:block;font-size:16px;font-weight:500;width:100%}.fields-count.sc-snk-dynaform-fields-selector{display:block;color:#AFB6C0;font-size:14px;padding:12px 0;font-weight:400;width:100%}.fields-container.sc-snk-dynaform-fields-selector{display:flex;flex-direction:column;gap:12px;height:calc(100vh - 220px);width:100%}.ghost.sc-snk-dynaform-fields-selector{opacity:.5;background:#c8fbe2}.filter-input.sc-snk-dynaform-fields-selector{padding-right:var(--space--2xs, 8px)}";const k=class{constructor(t){i(this,t),this.guideSelected=e(this,"guideSelected",7),this.guideListChanged=e(this,"guideListChanged",7),this.guideDeleted=e(this,"guideDeleted",7),this.createNewGuide=e(this,"createNewGuide",7),this.sortLogic=(i,e)=>{var t,s;return(null!==(t=i.order)&&void 0!==t?t:Number.MAX_VALUE)-(null!==(s=e.order)&&void 0!==s?s:Number.MAX_VALUE)},this.handleAddGuide=()=>{this.createNewGuide.emit()},this.mainGuide=void 0,this.visibleGuides=[],this.hiddenGuides=[],this.guidesList=[],this.selectedGuide=void 0,this.mainGuideName=void 0,this.messagesBuilder=void 0}observeGuidesList(i){this.initGuidesConfig(i)}observeMainGuideName(){this.initGuidesConfig(this.guidesList)}observeSelectedGuide(i){this.guideSelected.emit(i)}componentWillLoad(){this.initGuidesConfig(this.guidesList)}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}initGuidesConfig(i){const e=this.mainGuideName,t=i=>!!e&&i.name===e,s=i.filter((i=>i.visible&&!t(i))),n=i.filter((i=>!i.visible&&!t(i)));this.visibleGuides=[...s].sort(this.sortLogic),this.hiddenGuides=[...n].sort(this.sortLogic),this.mainGuide=i.find((i=>t(i)))}handleSelectGuide(i,e){e.stopPropagation(),this.selectedGuide=i}toggleGuideVisibility(i,e){e.stopPropagation();const t=Object.assign(Object.assign({},i),{visible:!i.visible});let s,n;i.visible?(s=this.visibleGuides.filter((e=>e.name!==i.name)),n=[...this.hiddenGuides,t]):(s=[...this.visibleGuides,t],n=this.hiddenGuides.filter((e=>e.name!==i.name))),this.applyGuidesUpdate([...s,...n])}adjustListOrder(i){return i.map(((i,e)=>Object.assign(Object.assign({},i),{order:e})))}applyGuidesUpdate(i){let e=this.adjustListOrder(i);this.mainGuide&&(e=[this.mainGuide,...e]),r.equals(e,this.guidesList)||this.guideListChanged.emit(e)}async handleDeleteGuide(i,e){e.stopPropagation();const t=this.getMessage("snkFormConfig.confirm.title"),s=this.getMessage("snkFormConfig.confirm.deleteGuide").replace("{0}",i.label);if(!await a.confirm(t,s))return;this.guideDeleted.emit(i);const n=this.getMessage("snkFormConfig.info.successfullyGuideDeleted").replace("{0}",i.label);a.info(n)}buildTabs(){return this.visibleGuides.map(((i,e)=>({tabKey:i.name,label:i.label,index:e})))}handleTabChange(i){var e;if(!i)return;const t=this.guidesList.find((e=>e.name===i.tabKey));t&&t.name!==(null===(e=this.selectedGuide)||void 0===e?void 0:e.name)&&(this.selectedGuide=t)}handleReorder(i){const e=i.map((i=>this.visibleGuides.find((e=>e.name===i.tabKey)))).filter(Boolean);this.applyGuidesUpdate([...e,...this.hiddenGuides])}renderTabActions(){return this.visibleGuides.map(((i,e)=>{const s=i.isCustom||i.isDetail;return t("div",{key:i.name,slot:`tab${e}`,class:"tab-actions",onClick:i=>i.stopPropagation()},t("ez-button",{mode:"icon",class:"ez-button--tertiary tab-action-btn",size:"small",iconName:"eye-off",title:this.getMessage("snkFormConfig.guidesConfigurator.actions.hide"),onClick:e=>this.toggleGuideVisibility(i,e)}),t("ez-button",{mode:"icon",class:"ez-button--tertiary tab-action-btn",size:"small",iconName:"delete",isDisabled:s,title:this.getMessage(s?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"snkFormConfig.guidesConfigurator.actions.delete"),onClick:e=>this.handleDeleteGuide(i,e)}))}))}renderHiddenGuidesBar(){return 0===this.hiddenGuides.length?null:t("div",{class:"hidden-guides-bar"},t("span",{class:"hidden-guides-label"},this.getMessage("snkFormConfig.guidesConfigurator.hiddenGuides"),":"),this.hiddenGuides.map((i=>{const e=i.isCustom||i.isDetail;return t("div",{key:i.name,class:"hidden-guide-chip",title:i.label},t("span",{class:"chip-label",onClick:e=>this.handleSelectGuide(i,e)},i.label),t("ez-button",{mode:"icon",class:"ez-button--tertiary",size:"small",iconName:"eye",title:this.getMessage("snkFormConfig.guidesConfigurator.actions.show"),onClick:e=>this.toggleGuideVisibility(i,e)}),t("ez-button",{mode:"icon",class:"ez-button--tertiary",size:"small",iconName:"delete",isDisabled:e,title:this.getMessage(e?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"snkFormConfig.guidesConfigurator.actions.delete"),onClick:e=>this.handleDeleteGuide(i,e)}))})))}render(){var i;const e=this.buildTabs();return t("div",{class:"guides-tab-configurator"},t("div",{class:"tab-bar-row"},t("ez-tabselector",{class:"guides-tabselector",tabs:e,selectedTab:null===(i=this.selectedGuide)||void 0===i?void 0:i.name,reorderable:!0,onEzChange:i=>this.handleTabChange(i.detail),onEzReorder:i=>this.handleReorder(i.detail)},this.renderTabActions()),t("ez-button",{label:this.getMessage("snkFormConfig.guidesConfigurator.createNewGuide"),variant:"secondary",size:"medium",leftIconName:"plus",onClick:this.handleAddGuide})),this.renderHiddenGuidesBar())}static get watchers(){return{guidesList:["observeGuidesList"],mainGuideName:["observeMainGuideName"],selectedGuide:["observeSelectedGuide"]}}};k.style=".guides-tab-configurator.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:column;width:100%;gap:var(--spece--8, 8px)}.tab-bar-row.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:row;align-items:center;gap:var(--space--12, 12px);width:100%}.guides-tabselector.sc-snk-dynaform-guides-configurator{flex:1;min-width:0}.tab-actions.sc-snk-dynaform-guides-configurator{display:inline-flex;align-items:center;gap:var(--space--2, 2px);margin-left:var(--space--6, 6px)}.tab-actions.sc-snk-dynaform-guides-configurator ez-button.sc-snk-dynaform-guides-configurator{width:var(--space--20, 20px);align-items:center;justify-content:center;display:flex}.hidden-guides-bar.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--space--8, 8px);padding:var(--space--8, 8px) 0;border-top:1px solid #dce0e8}.hidden-guides-label.sc-snk-dynaform-guides-configurator{font-size:var(--space--12, 12px);color:#afb6c0;white-space:nowrap}.hidden-guide-chip.sc-snk-dynaform-guides-configurator{display:flex;align-items:center;gap:4px;padding:2px var(--space--8, 8px);border:1px solid #dce0e8;border-radius:var(--space--12, 12px);background:#f5f7fa;transition:background 0.15s ease-in-out}.hidden-guide-chip.sc-snk-dynaform-guides-configurator:hover{background:#e2eaf4}.hidden-guide-chip.sc-snk-dynaform-guides-configurator ez-button.sc-snk-dynaform-guides-configurator{width:var(--space--20, 20px);align-items:center;justify-content:center;display:flex}.chip-label.sc-snk-dynaform-guides-configurator{font-size:13px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}";export{p as snk_dynaform_config_header,b as snk_dynaform_configs_button,v as snk_dynaform_fields_layout,y as snk_dynaform_fields_selector,k as snk_dynaform_guides_configurator}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,e as s,h as i,f as e,F as a}from"./p-2c9d0870.js";import{I as o}from"./p-8d1ef77a.js";import"./p-4dd574d6.js";import{P as r}from"./p-097d75b3.js";import"@sankhyalabs/core";import"./p-abcb646d.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-ec7c87bb.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,e as r,h as t,g as i}from"./p-2c9d0870.js";import{ApplicationContext as n}from"@sankhyalabs/core";import{V as s}from"./p-9019a32f.js";import{A as a}from"./p-dc36cfbf.js";const l=class{constructor(t){o(this,t),this.configSelected=r(this,"configSelected",7),this.openConfig=r(this,"openConfig",7),this.save=r(this,"save",7),this.cancel=r(this,"cancel",7),this._opened=!1,this._permissions=void 0,this.showActionButtons=!1,this.configName=void 0,this.resourceID=void 0,this.viewMode=s.GRID,this.customContainerId=void 0,this.layoutFormConfig=!0,this.entityName=void 0,this.disableNumberingConfig=!1,this.messagesBuilder=void 0}async open(){this._opened=!0,this.configSelected.emit(this.getViewModeValue()),this.modal.heightMode="full"}async close(){this.closeConfig()}closeConfig(){this._opened=!1}onViewModeChanged(o){this.viewMode=null==o?void 0:o.detail,this.configSelected.emit(this.viewMode)}onClickOpenConfig(){this.openConfig.emit(this.viewMode)}isAllowed(o){return!a[o]||!!this._permissions&&(this._permissions.isSup||this._permissions[o])}enableModeConfig(){return!(!this.isAllowed(a.CONFIG_GRID)||!this.isAllowed(a.CONFIG))}getViewModeValue(){return null!=this._permissions&&(this.isAllowed(a.CONFIG_GRID)?this.isAllowed(a.CONFIG)||(this.viewMode=s.GRID):this.viewMode=s.FORM),this.viewMode}getMessage(o){var r;return null===(r=this.messagesBuilder)||void 0===r?void 0:r.getMessage(o,{})}async handleSave(){var o;this.disableNumberingConfig||await(null===(o=this._snkNumberingConfig)||void 0===o?void 0:o.save())?(this.layoutFormConfig&&this._snkLayoutFormConfig.save(),this.save.emit(),this.closeConfig()):this.closeConfig()}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((o=>this._permissions=o)):this._permissions={}}componentDidRender(){if(!this.customContainerId)return;const o=document.querySelector(`#${this.customContainerId}`),r=null==o?void 0:o.querySelector("#SnkConfigContainerSlot");if(!r)return;const t=r.firstElementChild;if(!t)return;const i=this._element.querySelector("#slotContainer");null==i||i.appendChild(t)}render(){return t("ez-modal",{ref:o=>this.modal=o,opened:this._opened,"close-esc":!1,"close-outside-click":!1,"modal-size":"small",scrim:"light",onEzCloseModal:()=>this.closeConfig()},t("div",{class:"snk-configurator"},t("div",{class:"snk-configurator__header"},t("label",{class:"snk-configurator__title"},this.getMessage("snkConfigurator.titleConfigurations")),t("div",{class:"snk-configurator__button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"snk-configurator__main"},t("ez-collapsible-box",{boxBordered:!0,label:this.getMessage("snkConfigurator.subTitleModeConfig"),headerSize:"medium",class:"snk-configurator__collapsable-box"},t("ez-radio-button",{value:this.getViewModeValue().toString(),onEzChange:o=>this.onViewModeChanged(o),enabled:this.enableModeConfig()},t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelGrid"),value:s.GRID}),t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelForm"),value:s.FORM})),t("div",{class:"snk-configurator__collsable-box-action"},t("ez-button",{label:this.getMessage(this.viewMode===s.GRID?"snkConfigurator.labelConfigGrid":"snkConfigurator.labelConfigForm"),class:"snk-configurator__button-config ez-button--secondary",onClick:()=>this.onClickOpenConfig(),id:"openConfigurator"}))),this.layoutFormConfig&&t("ez-collapsible-box",{boxBordered:!0,value:!0,label:this.getMessage("snkConfigurator.labelLayoutForm"),headerSize:"medium",class:"snk-configurator__collapsable-box ez-margin-top--medium"},t("div",{class:"ez-flex ez-flex--column ez-size-width--full"},t("snk-layout-form-config",{ref:o=>this._snkLayoutFormConfig=o,messagesBuilder:this.messagesBuilder}))),!this.disableNumberingConfig&&t("ez-collapsible-box",{boxBordered:!0,value:!0,label:this.getMessage("snkConfigurator.labelNumberingConfig"),headerSize:"medium",class:"snk-configurator__collapsable-box ez-margin-top--medium"},t("div",{class:"ez-flex ez-flex--column ez-size-width--full"},t("snk-numbering-config",{ref:o=>this._snkNumberingConfig=o,messagesBuilder:this.messagesBuilder,entityName:this.entityName,resourceID:this.resourceID}))),t("div",{id:"slotContainer",class:"snk-configurator__outline"})),this.showActionButtons&&t("div",{class:"snk-configurator__action-buttons"},t("ez-button",{label:this.getMessage("snkConfigurator.buttons.cancel"),onClick:()=>this.cancel.emit()}),t("ez-button",{label:this.getMessage("snkConfigurator.buttons.save"),onClick:()=>this.handleSave(),class:"ez-button--primary"}))))}get _element(){return i(this)}};l.style='.sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, "Roboto");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, "Roboto");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--small, 6px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}';export{l as snk_configurator}
|