@sankhyalabs/sankhyablocks 10.1.0-dev.6 → 10.1.0-dev.60
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-72f34bd4.js → ConfigStorage-156bfcac.js} +19 -2
- package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
- package/dist/cjs/{DataFetcher-991b0349.js → DataFetcher-d13b4637.js} +121 -69
- package/dist/cjs/{FormConfigHelper-e253a418.js → FormConfigHelper-28fe4668.js} +3 -1
- package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
- package/dist/cjs/{ISave-ebf6b4ed.js → ISave-55d9dcc3.js} +1 -1
- package/dist/cjs/ImageUtils-d6139911.js +144 -0
- package/dist/cjs/{PersonalizedFilterUtils-7259cf65.js → PersonalizedFilterUtils-263e4d24.js} +65 -5
- package/dist/cjs/{SnkFormConfigManager-cdbb29d4.js → SnkFormConfigManager-5cb9a39c.js} +5 -5
- package/dist/cjs/{SnkMultiSelectionListDataSource-011bec79.js → SnkMultiSelectionListDataSource-5c5badfc.js} +146 -74
- package/dist/cjs/{auth-fetcher-c3cac878.js → auth-fetcher-d1715459.js} +1 -1
- package/dist/cjs/config-header.cjs.entry.js +1 -1
- package/dist/cjs/configs-button.cjs.entry.js +1 -1
- package/dist/cjs/css-shim-a27d231b.js +6 -0
- package/dist/cjs/{dataunit-fetcher-8bf469e7.js → dataunit-fetcher-fae710c5.js} +91 -110
- package/dist/cjs/dom-ff96a4bc.js +75 -0
- package/dist/cjs/field-config_2.cjs.entry.js +3 -3
- package/dist/cjs/fields-layout.cjs.entry.js +6 -6
- package/dist/cjs/fields-selector.cjs.entry.js +3 -3
- package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
- package/dist/cjs/{form-config-fetcher-c7af90d8.js → form-config-fetcher-bbebdcb8.js} +41 -5
- package/dist/cjs/guides-configurator.cjs.entry.js +3 -3
- package/dist/cjs/{index-1cf293c1.js → index-1894343a.js} +1547 -207
- package/dist/cjs/{index-e3e39724.js → index-bc950921.js} +6 -0
- package/dist/cjs/{index-13d05f03.js → index-f0fe7e6e.js} +90 -21
- package/dist/cjs/loader.cjs.js +16 -2
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +6 -6
- package/dist/cjs/sankhyablocks.cjs.js +132 -4
- package/dist/cjs/shadow-css-7e3e0ab1.js +389 -0
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +169 -120
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +28 -9
- package/dist/cjs/snk-attach_11.cjs.entry.js +2952 -0
- package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +3 -1
- package/dist/cjs/snk-crud.cjs.entry.js +149 -102
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
- package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
- package/dist/cjs/snk-data-exporter.cjs.entry.js +62 -16
- package/dist/cjs/{snk-data-unit-7d587ad5.js → snk-data-unit-32237a2d.js} +12 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +32 -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-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +2 -2
- package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +422 -19
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +170 -120
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +11 -7
- package/dist/cjs/snk-filter-period.cjs.entry.js +14 -7
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +70 -8
- package/dist/cjs/snk-form_2.cjs.entry.js +21 -11
- package/dist/cjs/snk-grid.cjs.entry.js +91 -36
- package/dist/cjs/{snk-guides-viewer-366d5c32.js → snk-guides-viewer-67b9cca9.js} +78 -214
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -18
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +71 -0
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
- package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -7
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +184 -127
- 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/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +26 -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-application/errorhandler/snk-error-handler.js +1 -0
- package/dist/collection/components/snk-application/snk-application.js +20 -2
- 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 +169 -98
- package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js +1 -1
- 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 +21 -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 +90 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +89 -204
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +163 -0
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -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-data-unit/snk-data-unit.js +9 -0
- 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-number.js +12 -8
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +14 -7
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +5 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +7 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +22 -8
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +166 -78
- package/dist/collection/components/snk-form-config/FormConfigHelper.js +3 -1
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
- package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +4 -4
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -4
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +2 -2
- package/dist/collection/components/snk-form-config/snk-form-config.js +15 -5
- package/dist/collection/components/snk-grid/snk-grid.css +33 -5
- package/dist/collection/components/snk-grid/snk-grid.js +199 -24
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +153 -51
- package/dist/collection/components/snk-image-input/snk-image-input.css +3 -0
- package/dist/collection/components/snk-image-input/snk-image-input.js +338 -0
- package/dist/collection/components/snk-image-input/utils/ImageUtils.js +135 -0
- package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +1 -1
- package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +1 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +0 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +34 -22
- 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 +54 -37
- 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/dataunit-fetcher.js +24 -2
- 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/SnkMessageBuilder.js +11 -2
- package/dist/collection/lib/message/messageResourceEnUSUtils.js +2 -0
- package/dist/collection/lib/message/messageResourceEsESUtils.js +2 -0
- package/dist/collection/lib/message/messageResourcePtBRUtils.js +2 -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 +13 -1
- package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/en-us/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js +10 -2
- 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 +13 -1
- package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/es-es/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js +8 -0
- package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js +0 -13
- package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js +1 -1
- package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +13 -1
- package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +1 -0
- package/dist/collection/lib/message/resources/pt-br/snk-image-input.msg.js +11 -0
- package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js +10 -2
- 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/DataFetcher.js +3 -2731
- package/dist/components/ISave.js +6 -0
- package/dist/components/PersonalizedFilterUtils.js +13 -0
- package/dist/components/SnkFormConfigManager.js +3 -3
- package/dist/components/SnkMessageBuilder.js +2804 -0
- package/dist/components/dataunit-fetcher.js +91 -110
- package/dist/components/field-config2.js +4 -2
- package/dist/components/fields-layout2.js +4 -4
- package/dist/components/form-config-fetcher.js +40 -4
- package/dist/components/guides-configurator2.js +2 -2
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +16 -0
- package/dist/components/index2.js +90 -21
- package/dist/components/snk-actions-button2.js +15 -9
- package/dist/components/snk-application2.js +22 -2
- package/dist/components/snk-attach2.js +69 -27
- package/dist/components/snk-configurator2.js +2 -0
- package/dist/components/snk-crud.js +240 -176
- package/dist/components/snk-custom-slot-guide.d.ts +11 -0
- package/dist/components/snk-custom-slot-guide.js +55 -0
- package/dist/components/snk-data-exporter2.js +56 -9
- package/dist/components/snk-data-unit2.js +10 -1
- package/dist/components/snk-detail-view2.js +227 -318
- 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 +116 -80
- package/dist/components/snk-filter-detail2.js +1 -1
- package/dist/components/snk-filter-item2.js +9 -3
- package/dist/components/snk-filter-modal2.js +22 -9
- package/dist/components/snk-filter-number.js +11 -7
- package/dist/components/snk-filter-period.js +13 -6
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/components/snk-form-config2.js +15 -5
- package/dist/components/snk-form-view2.js +79 -10
- package/dist/components/snk-grid-config2.js +109 -50
- package/dist/components/snk-grid2.js +132 -65
- package/dist/components/snk-image-input.d.ts +11 -0
- package/dist/components/snk-image-input.js +6 -0
- package/dist/components/snk-image-input2.js +316 -0
- package/dist/components/snk-layout-form-config2.js +1 -1
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-pesquisa2.js +0 -1
- package/dist/components/snk-simple-crud2.js +46 -45
- 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 +256 -176
- package/dist/components/snk-view-representation2.js +1 -1
- 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-22324b6b.js → ConfigStorage-0d1c0695.js} +19 -2
- package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
- package/dist/esm/{DataFetcher-450828a0.js → DataFetcher-70de9419.js} +121 -49
- package/dist/esm/{FormConfigHelper-e89ca25c.js → FormConfigHelper-d09669f3.js} +3 -1
- package/dist/esm/FormConfigHelper-efc29480.js +328 -0
- package/dist/esm/{ISave-61153166.js → ISave-f5704813.js} +1 -1
- package/dist/esm/ImageUtils-efbea0e4.js +138 -0
- package/dist/esm/{PersonalizedFilterUtils-2db38ff2.js → PersonalizedFilterUtils-45b5803c.js} +62 -2
- package/dist/esm/{SnkFormConfigManager-b5a92e12.js → SnkFormConfigManager-e7f05f79.js} +5 -5
- package/dist/esm/{SnkMultiSelectionListDataSource-d7ce2e54.js → SnkMultiSelectionListDataSource-6ac291a9.js} +141 -69
- package/dist/esm/{auth-fetcher-eef9d01e.js → auth-fetcher-e34880e5.js} +1 -1
- package/dist/esm/config-header.entry.js +1 -1
- package/dist/esm/configs-button.entry.js +1 -1
- package/dist/esm/css-shim-9f2d321e.js +4 -0
- package/dist/esm/{dataunit-fetcher-da9596f6.js → dataunit-fetcher-d26e4a08.js} +91 -110
- package/dist/esm/dom-64053c71.js +73 -0
- package/dist/esm/field-config_2.entry.js +3 -3
- package/dist/esm/fields-layout.entry.js +6 -6
- package/dist/esm/fields-selector.entry.js +3 -3
- package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
- package/dist/esm/{form-config-fetcher-8d0a5e1c.js → form-config-fetcher-98c42169.js} +41 -5
- package/dist/esm/guides-configurator.entry.js +3 -3
- package/dist/esm/{index-479e1293.js → index-04f73a26.js} +1539 -207
- package/dist/esm/{index-b40568ff.js → index-c6721886.js} +6 -0
- package/dist/esm/{index-446f9341.js → index-ea250be6.js} +90 -21
- package/dist/esm/loader.js +17 -3
- package/dist/esm/pesquisa-grid_2.entry.js +6 -6
- package/dist/esm/sankhyablocks.js +133 -5
- package/dist/esm/shadow-css-98135883.js +387 -0
- package/dist/esm/snk-actions-button_9.entry.js +170 -121
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +28 -9
- package/dist/esm/snk-attach_11.entry.js +2938 -0
- package/dist/esm/snk-client-confirm.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +3 -1
- package/dist/esm/snk-crud.entry.js +149 -102
- package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
- package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
- package/dist/esm/snk-data-exporter.entry.js +62 -16
- package/dist/esm/{snk-data-unit-99616a07.js → snk-data-unit-ff57ac90.js} +12 -3
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +32 -20
- 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-list.entry.js +1 -1
- package/dist/esm/snk-entity-search.entry.js +207 -0
- package/dist/esm/snk-exporter-email-sender.entry.js +2 -2
- package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +407 -6
- package/dist/esm/snk-filter-bar_4.entry.js +148 -98
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +11 -7
- package/dist/esm/snk-filter-period.entry.js +14 -7
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +2 -2
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +71 -9
- package/dist/esm/snk-form_2.entry.js +21 -11
- package/dist/esm/snk-grid.entry.js +89 -34
- package/dist/esm/{snk-guides-viewer-240de636.js → snk-guides-viewer-31a0a23d.js} +79 -215
- package/dist/esm/snk-guides-viewer.entry.js +10 -18
- package/dist/esm/snk-layout-form-config.entry.js +67 -0
- package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
- package/dist/esm/snk-pesquisa.entry.js +6 -7
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +185 -128
- 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/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-840fb68c.js → p-097d75b3.js} +2 -2
- package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-0a160fb5.entry.js} +1 -1
- package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
- package/dist/sankhyablocks/p-12579574.entry.js +1 -0
- package/dist/sankhyablocks/p-129a4906.entry.js +1 -0
- package/dist/sankhyablocks/{p-162bddae.entry.js → p-175c9576.entry.js} +1 -1
- package/dist/sankhyablocks/p-1d31aec3.entry.js +1 -0
- package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
- package/dist/sankhyablocks/{p-f5e942b7.entry.js → p-250b273e.entry.js} +1 -1
- 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-2c9d0870.js +2 -0
- package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-2cc2526e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-75af335e.entry.js → p-2ebda226.entry.js} +1 -1
- package/dist/sankhyablocks/p-2ec98523.js +1 -0
- package/dist/sankhyablocks/p-3a35917e.entry.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-27482793.entry.js → p-5aae5c74.entry.js} +1 -1
- 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-6f60df43.js +1 -0
- package/dist/sankhyablocks/{p-825098c1.entry.js → p-752c57f4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e258de96.entry.js → p-76729994.entry.js} +1 -1
- package/dist/sankhyablocks/{p-62e9b9b8.entry.js → p-846d8f79.entry.js} +1 -1
- package/dist/sankhyablocks/p-855ccf64.entry.js +1 -0
- package/dist/sankhyablocks/p-885262ce.entry.js +1 -0
- package/dist/sankhyablocks/{p-118c221e.js → p-8b4d6719.js} +1 -1
- package/dist/sankhyablocks/p-8d1ef77a.js +60 -0
- package/dist/sankhyablocks/{p-7d6f1285.js → p-8d81c8d3.js} +2 -2
- package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-8d946600.entry.js} +1 -1
- package/dist/sankhyablocks/p-8f5dd87d.entry.js +1 -0
- package/dist/sankhyablocks/p-90037547.js +1 -0
- package/dist/sankhyablocks/{p-96d45943.entry.js → p-90ae6c2e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0b9a42ad.entry.js → p-9742ea0e.entry.js} +1 -1
- package/dist/sankhyablocks/p-9e02a785.js +1 -0
- package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-9e109f5e.entry.js} +1 -1
- package/dist/sankhyablocks/p-9e7dc97d.entry.js +1 -0
- package/dist/sankhyablocks/p-a25ab2ff.entry.js +1 -0
- package/dist/sankhyablocks/p-a2a9f520.entry.js +1 -0
- package/dist/sankhyablocks/p-a46ac091.js +1 -0
- package/dist/sankhyablocks/p-a696bbcd.entry.js +1 -0
- package/dist/sankhyablocks/p-a73b6b00.js +1 -0
- package/dist/sankhyablocks/p-a9012341.entry.js +11 -0
- package/dist/sankhyablocks/p-abcb646d.js +1 -0
- package/dist/sankhyablocks/{p-180716b2.entry.js → p-ae326d06.entry.js} +1 -1
- package/dist/sankhyablocks/p-af673291.js +1 -0
- package/dist/sankhyablocks/p-b555ce38.entry.js +1 -0
- package/dist/sankhyablocks/p-bd2a845c.js +1 -0
- package/dist/sankhyablocks/p-bfce617e.entry.js +1 -0
- package/dist/sankhyablocks/p-c3ec6642.js +19 -0
- package/dist/sankhyablocks/p-c4b34e2b.entry.js +1 -0
- package/dist/sankhyablocks/{p-92cfc028.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-4c763b10.entry.js → p-d657f71f.entry.js} +1 -1
- package/dist/sankhyablocks/p-da455c82.js +12 -0
- package/dist/sankhyablocks/p-e5a3711f.js +1 -0
- package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-e737fd5a.entry.js} +1 -1
- package/dist/sankhyablocks/p-eac48627.js +1 -0
- package/dist/sankhyablocks/p-ec7c87bb.js +28 -0
- package/dist/sankhyablocks/p-ee56dda6.entry.js +1 -0
- package/dist/sankhyablocks/{p-667cab42.entry.js → p-f152ef98.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7e250432.entry.js → p-f7170e10.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7345782c.entry.js → p-f921270b.entry.js} +1 -1
- 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-application/snk-application.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +22 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +33 -11
- 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-form-view.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -25
- package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
- package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -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-data-unit/snk-data-unit.d.ts +1 -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-number.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +33 -16
- package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +1 -1
- package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
- package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +2 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +37 -1
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +11 -0
- package/dist/types/components/snk-image-input/snk-image-input.d.ts +57 -0
- package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +15 -0
- package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +1 -0
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +0 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -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 +2638 -1183
- 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/dataunit-fetcher.d.ts +2 -1
- 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/dist/types/lib/message/resources/en-us/snk-image-input.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-image-input.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-image-input.msg.d.ts +1 -0
- package/package.json +11 -8
- package/react/components.d.ts +16 -0
- package/react/components.js +16 -0
- package/react/components.js.map +1 -1
- 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 -910
- 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 -108
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -357
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
- package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -870
- package/dist/cjs/taskbar-elements-fb5d1e08.js +0 -132
- package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
- 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 -906
- 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 -104
- package/dist/esm/snk-personalized-filter.entry.js +0 -353
- package/dist/esm/snk-simple-bar.entry.js +0 -41
- package/dist/esm/snk-simple-crud.entry.js +0 -866
- package/dist/esm/taskbar-elements-faaf5d8f.js +0 -129
- package/dist/esm/taskbar-processor-3436124c.js +0 -51
- package/dist/sankhyablocks/p-002d4d2b.js +0 -1
- package/dist/sankhyablocks/p-093f58fa.entry.js +0 -1
- package/dist/sankhyablocks/p-0948dc0a.entry.js +0 -11
- package/dist/sankhyablocks/p-0f3698af.js +0 -1
- package/dist/sankhyablocks/p-1a0caadb.js +0 -1
- package/dist/sankhyablocks/p-1a9c5684.entry.js +0 -1
- package/dist/sankhyablocks/p-1d589380.entry.js +0 -1
- package/dist/sankhyablocks/p-21107f0d.entry.js +0 -1
- package/dist/sankhyablocks/p-28f50632.js +0 -1
- package/dist/sankhyablocks/p-39be771c.js +0 -1
- package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
- package/dist/sankhyablocks/p-471b34f4.entry.js +0 -1
- package/dist/sankhyablocks/p-4963dd2a.entry.js +0 -1
- package/dist/sankhyablocks/p-49ddc27a.entry.js +0 -1
- package/dist/sankhyablocks/p-51833248.js +0 -7
- package/dist/sankhyablocks/p-55798617.js +0 -1
- package/dist/sankhyablocks/p-55f6fef2.entry.js +0 -1
- package/dist/sankhyablocks/p-56f16390.entry.js +0 -1
- package/dist/sankhyablocks/p-58683e28.js +0 -60
- package/dist/sankhyablocks/p-5ea893c5.entry.js +0 -1
- package/dist/sankhyablocks/p-60dd1d27.entry.js +0 -1
- package/dist/sankhyablocks/p-62aef37a.js +0 -1
- package/dist/sankhyablocks/p-669bb869.entry.js +0 -1
- package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
- package/dist/sankhyablocks/p-6ee2ca7a.entry.js +0 -1
- package/dist/sankhyablocks/p-7cac3870.entry.js +0 -1
- package/dist/sankhyablocks/p-84345e7a.js +0 -1
- package/dist/sankhyablocks/p-86e54841.entry.js +0 -1
- package/dist/sankhyablocks/p-88b337fe.entry.js +0 -1
- package/dist/sankhyablocks/p-91005a00.entry.js +0 -1
- package/dist/sankhyablocks/p-91a9abb6.entry.js +0 -1
- package/dist/sankhyablocks/p-988afe78.js +0 -1
- package/dist/sankhyablocks/p-ada013c0.entry.js +0 -1
- package/dist/sankhyablocks/p-b568c1d4.js +0 -1
- package/dist/sankhyablocks/p-b7e891cc.entry.js +0 -1
- package/dist/sankhyablocks/p-b987e15d.js +0 -1
- package/dist/sankhyablocks/p-c35fc941.js +0 -26
- package/dist/sankhyablocks/p-c3dbf441.entry.js +0 -1
- package/dist/sankhyablocks/p-c4fcf1fb.entry.js +0 -1
- package/dist/sankhyablocks/p-c98c79c3.entry.js +0 -1
- package/dist/sankhyablocks/p-cadf4846.entry.js +0 -1
- package/dist/sankhyablocks/p-d8d8169b.js +0 -2
- package/dist/sankhyablocks/p-e91c3c57.entry.js +0 -1
- package/dist/sankhyablocks/p-ea729922.entry.js +0 -1
- package/dist/sankhyablocks/p-ec5fbad8.js +0 -1
- package/dist/sankhyablocks/p-f4184ce7.js +0 -1
|
@@ -0,0 +1,2213 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, forceUpdate, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { ObjectUtils, StringUtils, ElementIDUtils, Action, KeyboardManager } from '@sankhyalabs/core';
|
|
3
|
+
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
4
|
+
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
|
5
|
+
import { T as TAB_NAMES, V as VIEW_MODE } from './constants.js';
|
|
6
|
+
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
7
|
+
import './DataFetcher.js';
|
|
8
|
+
import { P as PresentationMode } from './ISave.js';
|
|
9
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
10
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
11
|
+
import './dataunit-fetcher.js';
|
|
12
|
+
import './filter-item-type.enum.js';
|
|
13
|
+
import { T as TaskbarElement, d as defineCustomElement$6 } from './snk-taskbar2.js';
|
|
14
|
+
import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
15
|
+
import { d as defineCustomElement$H } from './snk-actions-button2.js';
|
|
16
|
+
import { d as defineCustomElement$G } from './snk-attach2.js';
|
|
17
|
+
import { d as defineCustomElement$F } from './snk-configurator2.js';
|
|
18
|
+
import { d as defineCustomElement$E } from './snk-data-exporter2.js';
|
|
19
|
+
import { d as defineCustomElement$D } from './snk-data-unit2.js';
|
|
20
|
+
import { d as defineCustomElement$C } from './snk-default-filter2.js';
|
|
21
|
+
import { d as defineCustomElement$B } from './snk-dynaform-config-header2.js';
|
|
22
|
+
import { d as defineCustomElement$A } from './snk-dynaform-configs-button2.js';
|
|
23
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
24
|
+
import { S as SimpleTaskbarProcessor, D as DEFAULT_TASKBAR_BUTTONS, g as getTopTaskBarId } from './taskbarUtils.js';
|
|
25
|
+
import { d as defineCustomElement$u } from './snk-dynaform-form-view2.js';
|
|
26
|
+
import { d as defineCustomElement$s } from './snk-exporter-email-sender2.js';
|
|
27
|
+
import { d as defineCustomElement$r } from './snk-expression-group2.js';
|
|
28
|
+
import { d as defineCustomElement$q } from './snk-expression-item2.js';
|
|
29
|
+
import { d as defineCustomElement$p } from './snk-filter-advanced-mode2.js';
|
|
30
|
+
import { d as defineCustomElement$o } from './snk-filter-assistent-mode2.js';
|
|
31
|
+
import { d as defineCustomElement$n } from './snk-filter-bar2.js';
|
|
32
|
+
import { d as defineCustomElement$m } from './snk-filter-detail2.js';
|
|
33
|
+
import { d as defineCustomElement$l } from './snk-filter-field-search2.js';
|
|
34
|
+
import { d as defineCustomElement$k } from './snk-filter-item2.js';
|
|
35
|
+
import { d as defineCustomElement$j } from './snk-filter-modal2.js';
|
|
36
|
+
import { d as defineCustomElement$i } from './snk-filter-modal-item2.js';
|
|
37
|
+
import { d as defineCustomElement$h } from './snk-filter-param-config2.js';
|
|
38
|
+
import { d as defineCustomElement$g } from './snk-grid2.js';
|
|
39
|
+
import { d as defineCustomElement$f } from './snk-grid-config2.js';
|
|
40
|
+
import { d as defineCustomElement$e } from './snk-image-input2.js';
|
|
41
|
+
import { d as defineCustomElement$d } from './snk-layout-form-config2.js';
|
|
42
|
+
import { d as defineCustomElement$c } from './snk-numbering-config2.js';
|
|
43
|
+
import { d as defineCustomElement$b } from './snk-personalized-filter2.js';
|
|
44
|
+
import { d as defineCustomElement$a } from './snk-select-box2.js';
|
|
45
|
+
import { d as defineCustomElement$9 } from './snk-simple-bar2.js';
|
|
46
|
+
import { d as defineCustomElement$8 } from './snk-simple-crud2.js';
|
|
47
|
+
import { d as defineCustomElement$7 } from './snk-simple-form-config2.js';
|
|
48
|
+
import { d as defineCustomElement$5 } from './snk-taskbar-skeleton2.js';
|
|
49
|
+
import { d as defineCustomElement$4 } from './snk-view-representation2.js';
|
|
50
|
+
import { d as defineCustomElement$3 } from './taskbar-actions-button2.js';
|
|
51
|
+
import { d as defineCustomElement$2 } from './taskbar-split-button2.js';
|
|
52
|
+
import { d as defineCustomElement$z } from './snk-dynaform-field-config2.js';
|
|
53
|
+
import { d as defineCustomElement$y } from './snk-dynaform-field-item2.js';
|
|
54
|
+
import { d as defineCustomElement$x } from './snk-dynaform-fields-layout2.js';
|
|
55
|
+
import { d as defineCustomElement$w } from './snk-dynaform-fields-selector2.js';
|
|
56
|
+
import { d as defineCustomElement$v } from './snk-dynaform-form-config2.js';
|
|
57
|
+
import { d as defineCustomElement$t } from './snk-dynaform-guides-configurator2.js';
|
|
58
|
+
|
|
59
|
+
class SnkFormConfigManager {
|
|
60
|
+
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
|
61
|
+
this._resourceID = resourceID;
|
|
62
|
+
this._configName = configName;
|
|
63
|
+
this._onConfigChange = onConfigChange;
|
|
64
|
+
this._dataUnit = dataUnit;
|
|
65
|
+
}
|
|
66
|
+
addFormLegacyConfig(legacyConfigName) {
|
|
67
|
+
if (this._configName) {
|
|
68
|
+
ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async loadConfig() {
|
|
72
|
+
return new Promise(resolve => {
|
|
73
|
+
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
|
74
|
+
.then((config) => {
|
|
75
|
+
config = this.buildFormMetadataUITabs(config);
|
|
76
|
+
this.setConfig(config);
|
|
77
|
+
resolve(config);
|
|
78
|
+
})
|
|
79
|
+
.catch((error) => {
|
|
80
|
+
console.warn(error);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
getEmptyConfig() {
|
|
85
|
+
return this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
|
|
86
|
+
}
|
|
87
|
+
saveConfig(config) {
|
|
88
|
+
const configToSave = ObjectUtils.copy(config);
|
|
89
|
+
return new Promise(accept => {
|
|
90
|
+
ConfigStorage.saveFormConfig(config, this._configName, this._resourceID)
|
|
91
|
+
.then((response) => {
|
|
92
|
+
this.setConfig(Object.assign(Object.assign({}, configToSave), response));
|
|
93
|
+
accept(Object.assign(Object.assign({}, configToSave), response));
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
saveCardState(cardId, cardConfig, propertyChanged) {
|
|
98
|
+
return new Promise(resolve => {
|
|
99
|
+
var _a;
|
|
100
|
+
const cardsState = ((_a = this._config) === null || _a === void 0 ? void 0 : _a.cardsState) || new Map;
|
|
101
|
+
const currentConfig = cardsState.get(cardId);
|
|
102
|
+
cardsState.set(cardId, propertyChanged === "fixed" ?
|
|
103
|
+
this.updateFixSequence(Object.assign(Object.assign({}, currentConfig), { fixed: cardConfig.fixed }), cardsState)
|
|
104
|
+
: Object.assign(Object.assign({}, currentConfig), { [propertyChanged]: cardConfig[propertyChanged] }));
|
|
105
|
+
ConfigStorage.saveCardState(cardsState, this._configName, this._resourceID)
|
|
106
|
+
.then(savedCardConfig => {
|
|
107
|
+
this._config = Object.assign(Object.assign({}, this._config), { cardsState });
|
|
108
|
+
resolve(savedCardConfig);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
updateFixSequence(updatingCardConfig, cardsState) {
|
|
113
|
+
let maxSequence = -1;
|
|
114
|
+
Array.from(cardsState.values()).forEach(cardConfig => {
|
|
115
|
+
if (!cardConfig.fixed) {
|
|
116
|
+
delete updatingCardConfig.fixSequence;
|
|
117
|
+
}
|
|
118
|
+
if (cardConfig.fixSequence != undefined) {
|
|
119
|
+
maxSequence = Math.max(maxSequence, cardConfig.fixSequence);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
if (updatingCardConfig.fixed) {
|
|
123
|
+
updatingCardConfig.fixSequence = maxSequence + 1;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
delete updatingCardConfig.fixSequence;
|
|
127
|
+
}
|
|
128
|
+
return updatingCardConfig;
|
|
129
|
+
}
|
|
130
|
+
hasConfig(config) {
|
|
131
|
+
var _a;
|
|
132
|
+
const currentConfig = config !== null && config !== void 0 ? config : this._config;
|
|
133
|
+
if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
getFieldsList(descriptionFilter, forceEmptyConfig = false) {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
|
141
|
+
const hasConfig = this.hasConfig();
|
|
142
|
+
if (hasConfig && !forceEmptyConfig) {
|
|
143
|
+
return fields.map(({ label, name, readOnly, visible, required, tab, group }) => {
|
|
144
|
+
var _a;
|
|
145
|
+
if (label == undefined) {
|
|
146
|
+
const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
|
|
147
|
+
if (!currentField)
|
|
148
|
+
return;
|
|
149
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab, group: group });
|
|
150
|
+
}
|
|
151
|
+
return { name, label, readOnly, visible, required, tab, group };
|
|
152
|
+
})
|
|
153
|
+
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
|
154
|
+
}
|
|
155
|
+
if (!this._dataUnit || !((_b = this._dataUnit.metadata) === null || _b === void 0 ? void 0 : _b.fields)) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
const filteredFields = this._dataUnit.metadata.fields
|
|
159
|
+
.filter(field => this.isFieldVisible(field, descriptionFilter))
|
|
160
|
+
.map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
|
|
161
|
+
return filteredFields;
|
|
162
|
+
}
|
|
163
|
+
isFieldVisible(field, descriptionFilter) {
|
|
164
|
+
if (field === undefined || field.visible === false) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
if (descriptionFilter == undefined) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
const normalizedText = StringUtils.replaceAccentuatedCharsLower((field.label || field.name).toLocaleLowerCase());
|
|
171
|
+
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
172
|
+
return normalizedText.includes(normalizedFilter);
|
|
173
|
+
}
|
|
174
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
|
|
175
|
+
let fields = this.getFieldsList(undefined, forceEmptyConfig);
|
|
176
|
+
if (ignoreReadOnlyFormFields) {
|
|
177
|
+
fields = fields.filter(field => {
|
|
178
|
+
if (dataUnit) {
|
|
179
|
+
const def = dataUnit.getField(field.name);
|
|
180
|
+
if (def && def.readOnly) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return !field.readOnly;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return Object.assign(Object.assign({}, this._config), { fields });
|
|
188
|
+
}
|
|
189
|
+
setConfig(config) {
|
|
190
|
+
this.isLoaded = true;
|
|
191
|
+
const { cardsState, summary, defaultVars } = this._config || {};
|
|
192
|
+
this._config = Object.assign({}, config);
|
|
193
|
+
if (cardsState) {
|
|
194
|
+
this._config.cardsState = cardsState;
|
|
195
|
+
}
|
|
196
|
+
if (summary) {
|
|
197
|
+
this._config.summary = summary;
|
|
198
|
+
}
|
|
199
|
+
if (defaultVars) {
|
|
200
|
+
this._config.defaultVars = defaultVars;
|
|
201
|
+
}
|
|
202
|
+
if (this._onConfigChange) {
|
|
203
|
+
this._onConfigChange(Object.assign({}, this._config));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
207
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields);
|
|
208
|
+
}
|
|
209
|
+
getFormConfigFetcher() {
|
|
210
|
+
if (this._formConfigFetcher == undefined) {
|
|
211
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
|
212
|
+
}
|
|
213
|
+
return this._formConfigFetcher;
|
|
214
|
+
}
|
|
215
|
+
async fetchUserAvailableConfigs() {
|
|
216
|
+
if (this._configName != undefined) {
|
|
217
|
+
//FIXME: Precisamos preparar o backend para retornar as configurações disponíveis para details;
|
|
218
|
+
return Promise.resolve(undefined);
|
|
219
|
+
}
|
|
220
|
+
return this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName, this._resourceID);
|
|
221
|
+
}
|
|
222
|
+
async fetchLegacyConfig() {
|
|
223
|
+
return this.getFormConfigFetcher().fetchLegacyConfig(this._configName, this._resourceID);
|
|
224
|
+
}
|
|
225
|
+
async fetchDefaultConfig() {
|
|
226
|
+
return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
|
|
227
|
+
}
|
|
228
|
+
parseObjectList(object) {
|
|
229
|
+
if (!object) {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
return Array.isArray(object) ? object : [object];
|
|
233
|
+
}
|
|
234
|
+
buildFormMetadataUITabs(config, forceEmptyConfig = false) {
|
|
235
|
+
var _a, _b, _c;
|
|
236
|
+
const hasConfig = this.hasConfig(config);
|
|
237
|
+
if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
|
|
238
|
+
return config;
|
|
239
|
+
}
|
|
240
|
+
config = this.getFormConfig(this._dataUnit, false, true);
|
|
241
|
+
const previousTabs = this.parseObjectList(config.tabs)
|
|
242
|
+
.map(tab => (Object.assign(Object.assign({}, tab), { visible: true })));
|
|
243
|
+
config.tabs = [];
|
|
244
|
+
config.emptyConfig = false;
|
|
245
|
+
config.defaultConfiguration = true;
|
|
246
|
+
const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
|
|
247
|
+
for (const currentField of fields) {
|
|
248
|
+
const field = config.fields.find(field => field.name === currentField.name);
|
|
249
|
+
const uiTabName = (_c = currentField.properties) === null || _c === void 0 ? void 0 : _c.UITabName;
|
|
250
|
+
if (!uiTabName || uiTabName === TAB_NAMES.main) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
|
|
254
|
+
if (!haveTab) {
|
|
255
|
+
config.tabs.push({
|
|
256
|
+
label: uiTabName,
|
|
257
|
+
name: uiTabName,
|
|
258
|
+
order: 0,
|
|
259
|
+
visible: true,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (field) {
|
|
263
|
+
field.tab = uiTabName;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
for (const prevTab of previousTabs) {
|
|
267
|
+
if (!config.tabs.some(t => t.name === prevTab.name)) {
|
|
268
|
+
config.tabs.push(prevTab);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return config;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const snkDynaformGuidesViewCss = ".sc-snk-dynaform-guides-view-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);display:block;height:100%;min-width:0;overflow-x:hidden}snk-dynaform-form-view.sc-snk-dynaform-guides-view{width:100%}.snk-guides-viewer.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;height:100%;overflow:hidden;padding:0px;padding:var(--space--8, 8px);padding-top:0}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view{display:flex;row-gap:24px;flex-direction:column;flex:1;max-height:none;min-height:0;overflow:hidden}.snk-guides-viewer__master.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;min-height:0;height:100%}.snk-guides-viewer__split.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__split-master.sc-snk-dynaform-guides-view,.snk-guides-viewer__split-content.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;min-height:0;overflow:hidden}.snk-guides-viewer__split-master.sc-snk-dynaform-guides-view{border-radius:0}.snk-guides-viewer__split-content.snk-guides-viewer__split-content.sc-snk-dynaform-guides-view{box-sizing:border-box;padding-top:var(--space--4, 4px)}.snk-guides-viewer__panel.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;overflow:hidden}.snk-guides-viewer__master.sc-snk-dynaform-guides-view .snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__master--collapsed.sc-snk-dynaform-guides-view .snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{display:flex}.snk-guides-viewer__master--collapsed.sc-snk-dynaform-guides-view .snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view{position:relative;display:flex;flex-direction:column;min-height:0;flex:1;overflow:visible;margin-top:var(--space--6, 6px)}.snk-guides-viewer__master-expanded.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view,.snk-guides-viewer__detail-container.sc-snk-dynaform-guides-view>snk-dynaform-detail-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.snk-guides-viewer__guide-content--hidden.sc-snk-dynaform-guides-view{display:none}.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view>snk-dynaform-form-view.sc-snk-dynaform-guides-view,.snk-guides-viewer__guide-content.sc-snk-dynaform-guides-view>snk-dynaform-detail-view.sc-snk-dynaform-guides-view{flex:1;min-height:0}.snk-guides-viewer__header.sc-snk-dynaform-guides-view{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);padding-inline:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-dynaform-guides-view{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-dynaform-guides-view{width:75%}.snk-guides-viewer__container.sc-snk-dynaform-guides-view{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden}.snk-guides-viewer__tabselector.sc-snk-dynaform-guides-view{width:100%;min-width:0;box-sizing:border-box;padding:0 var(--space--12, 12px);flex-shrink:0}.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--space--12, 12px);box-sizing:border-box;margin:var(--space--2xs, 8px) var(--space--12, 12px);padding:var(--space--2xs, 8px) var(--space--12, 12px);border:1px solid var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-medium, 12px);background:var(--background--medium, #f0f3f7);box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));cursor:pointer;text-align:left;flex-shrink:0;overflow:hidden;transition:background 0.15s ease, border-color 0.15s ease}.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view:hover,.snk-guides-viewer__master-summary.sc-snk-dynaform-guides-view:focus-visible{background:var(--background--xlight, #fff);border-color:var(--color--primary, #4e4e4e)}.snk-guides-viewer__master-summary-fields.sc-snk-dynaform-guides-view{display:flex;gap:var(--space--large, 24px);flex:1;min-width:0;overflow:hidden;white-space:nowrap;padding:var(--space--4, 4px);margin:calc(-1 * var(--space--4, 4px))}.snk-guides-viewer__master-summary-measure.sc-snk-dynaform-guides-view{position:absolute;top:0;left:0;display:flex;gap:var(--space--large, 24px);white-space:nowrap;visibility:hidden;pointer-events:none;z-index:-1}.snk-guides-viewer__master-summary-item.sc-snk-dynaform-guides-view{display:inline-flex;flex-direction:column;gap:2px;min-width:0;padding:var(--space--4, 4px)}.snk-guides-viewer__master-summary-label.sc-snk-dynaform-guides-view{display:flex;align-items:center;gap:2px;max-width:240px;color:var(--text--primary, #626e82);font-size:var(--title--small, 12px);font-weight:var(--text-weight--medium, 400)}.snk-guides-viewer__master-summary-label-text.sc-snk-dynaform-guides-view{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.snk-guides-viewer__master-summary-required.sc-snk-dynaform-guides-view{flex-shrink:0;color:var(--color--red-600, #BD0025);font-weight:700}.snk-guides-viewer__master-summary-item--invalid.sc-snk-dynaform-guides-view{box-shadow:0 0 0 1px var(--color--red-600, #BD0025);border-radius:var(--border--radius-4, 4px)}.snk-guides-viewer__master-summary-value.sc-snk-dynaform-guides-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large, 14px);font-weight:700;max-width:240px;overflow:hidden;text-overflow:ellipsis}.snk-guides-viewer__master-summary-chevron.sc-snk-dynaform-guides-view{flex-shrink:0;color:var(--title--primary, #2b3a54)}.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view{position:absolute;top:calc(-1 * var(--space--6, 6px));left:50%;transform:translate(-50%, 0);z-index:1;opacity:0;visibility:hidden;transition:opacity 0.2s ease, visibility 0.2s ease}.snk-guides-viewer__master.sc-snk-dynaform-guides-view:hover .snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view,.snk-guides-viewer__master.sc-snk-dynaform-guides-view:focus-within .snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view,.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view:hover{opacity:1;visibility:visible}.snk-guides-viewer__master-collapse-btn.sc-snk-dynaform-guides-view ez-button.sc-snk-dynaform-guides-view{--ez-button--border:1px solid var(--color--petroleum-100, #C8CCD3);--ez-button--hover--border:1px solid var(--color--petroleum-100, #C8CCD3)}";
|
|
276
|
+
|
|
277
|
+
/** Tamanho inicial (px) do painel master no split; ajustável arrastando o divisor. */
|
|
278
|
+
const MASTER_INITIAL_SIZE = "300px";
|
|
279
|
+
const SnkDynaformGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
280
|
+
constructor() {
|
|
281
|
+
super();
|
|
282
|
+
this.__registerHost();
|
|
283
|
+
this.snkMasterFormConfigChange = createEvent(this, "snkMasterFormConfigChange", 7);
|
|
284
|
+
this.formConfigVisibilityChanged = createEvent(this, "formConfigVisibilityChanged", 7);
|
|
285
|
+
this.exit = createEvent(this, "exit", 7);
|
|
286
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
287
|
+
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
|
288
|
+
/** Refs das abas de detalhe já montadas, por id de guia. */
|
|
289
|
+
this._detailRefs = new Map();
|
|
290
|
+
this.dataUnit = undefined;
|
|
291
|
+
this.dataState = undefined;
|
|
292
|
+
this.configName = undefined;
|
|
293
|
+
this.entityPath = undefined;
|
|
294
|
+
this.actionsList = undefined;
|
|
295
|
+
this.recordsValidator = undefined;
|
|
296
|
+
this.masterFormConfig = undefined;
|
|
297
|
+
this.selectedGuide = undefined;
|
|
298
|
+
this.taskbarManager = undefined;
|
|
299
|
+
this.messagesBuilder = undefined;
|
|
300
|
+
this.canEdit = true;
|
|
301
|
+
this.presentationMode = undefined;
|
|
302
|
+
this.resourceID = undefined;
|
|
303
|
+
this.detailTaskbarCustomContainerId = undefined;
|
|
304
|
+
this.formLegacyConfigName = undefined;
|
|
305
|
+
this.enableGridInsert = false;
|
|
306
|
+
this.ignoreReadOnlyFormFields = undefined;
|
|
307
|
+
this.getCustomTitle = undefined;
|
|
308
|
+
this.customGuidesConfig = [];
|
|
309
|
+
this._guides = [];
|
|
310
|
+
this._formEditorConfigManager = undefined;
|
|
311
|
+
this._formEditorDataUnit = undefined;
|
|
312
|
+
this._fieldToGetFocus = undefined;
|
|
313
|
+
this._customEditors = {};
|
|
314
|
+
this._customRenders = {};
|
|
315
|
+
this._fieldsProps = {};
|
|
316
|
+
this._mainForm = undefined;
|
|
317
|
+
this._mainFormName = undefined;
|
|
318
|
+
this._errorTabs = new Set();
|
|
319
|
+
this._hasToCreateFieldSearch = true;
|
|
320
|
+
this.collapsibleMaster = true;
|
|
321
|
+
this.masterSummaryFieldCount = 12;
|
|
322
|
+
this.masterCollapseThreshold = 700;
|
|
323
|
+
this.maxOpenedGuides = 4;
|
|
324
|
+
this._masterCollapsed = false;
|
|
325
|
+
this._hostTight = false;
|
|
326
|
+
this._visibleSummaryCount = Number.MAX_SAFE_INTEGER;
|
|
327
|
+
this._openedGuideIds = [];
|
|
328
|
+
}
|
|
329
|
+
/** Aba de detalhe atualmente selecionada (derivada do mapa de refs). */
|
|
330
|
+
get _currentDetail() {
|
|
331
|
+
var _a;
|
|
332
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
333
|
+
return id ? this._detailRefs.get(id) : undefined;
|
|
334
|
+
}
|
|
335
|
+
observeDataUnit() {
|
|
336
|
+
this.loadGuides(true);
|
|
337
|
+
}
|
|
338
|
+
observeSelectedGuide(newGuide) {
|
|
339
|
+
const id = newGuide === null || newGuide === void 0 ? void 0 : newGuide.id;
|
|
340
|
+
if (!id) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (!this._openedGuideIds.includes(id)) {
|
|
344
|
+
this._openedGuideIds = [...this._openedGuideIds, id];
|
|
345
|
+
}
|
|
346
|
+
this.enforceOpenedGuidesCap(id);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Aplica o teto `maxOpenedGuides` mantendo a ordem de inserção (não reordena
|
|
350
|
+
* — reordenar moveria os nós no DOM e remontaria as abas sobreviventes,
|
|
351
|
+
* anulando o cache). Retém a aba ativa + as inseridas mais recentemente;
|
|
352
|
+
* desmonta as mais antigas e limpa seus refs. `<= 0` desliga o teto.
|
|
353
|
+
*/
|
|
354
|
+
enforceOpenedGuidesCap(activeId) {
|
|
355
|
+
const cap = this.maxOpenedGuides;
|
|
356
|
+
if (cap <= 0 || this._openedGuideIds.length <= cap) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
// Marca p/ manter: a ativa + as mais recentes (varrendo do fim), até o teto.
|
|
360
|
+
const keep = new Set([activeId]);
|
|
361
|
+
for (let i = this._openedGuideIds.length - 1; i >= 0 && keep.size < cap; i--) {
|
|
362
|
+
keep.add(this._openedGuideIds[i]);
|
|
363
|
+
}
|
|
364
|
+
this._openedGuideIds.forEach(gid => {
|
|
365
|
+
if (!keep.has(gid)) {
|
|
366
|
+
this._detailRefs.delete(gid);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
this._openedGuideIds = this._openedGuideIds.filter(gid => keep.has(gid));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Ao recolher/expandir, o master permanece montado; só muda o tamanho do
|
|
373
|
+
* seu painel (auto quando recolhido, {@link MASTER_INITIAL_SIZE} quando
|
|
374
|
+
* expandido). Reconstrói o split para aplicar o novo template.
|
|
375
|
+
*/
|
|
376
|
+
observeMasterCollapsed() {
|
|
377
|
+
if (typeof requestAnimationFrame !== 'undefined') {
|
|
378
|
+
requestAnimationFrame(() => { var _a; return (_a = this._splitPanel) === null || _a === void 0 ? void 0 : _a.rebuildLayout(); });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
observeFormConfigManager(value) {
|
|
382
|
+
var _a;
|
|
383
|
+
(_a = this.formConfigVisibilityChanged) === null || _a === void 0 ? void 0 : _a.emit(!!value);
|
|
384
|
+
}
|
|
385
|
+
observeDataState(newValue, oldValue) {
|
|
386
|
+
var _a, _b, _c, _d, _e, _f;
|
|
387
|
+
const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
|
|
388
|
+
const oldRecordsIds = (_e = (_d = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectionInfo) === null || _d === void 0 ? void 0 : _d.recordIds) !== null && _e !== void 0 ? _e : (_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.selectedRecord) === null || _f === void 0 ? void 0 : _f['__record__id__'];
|
|
389
|
+
if (!ObjectUtils.equals(newRecordsIds, oldRecordsIds)) {
|
|
390
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) && !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode)) {
|
|
391
|
+
this._manualOverride = undefined;
|
|
392
|
+
}
|
|
393
|
+
this.loadGuides((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) != (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode));
|
|
394
|
+
}
|
|
395
|
+
else if ((oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) !== (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode)) {
|
|
396
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode) {
|
|
397
|
+
this._manualOverride = undefined;
|
|
398
|
+
}
|
|
399
|
+
this.recomputeMasterCollapse();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
observeMasterFormConfig() {
|
|
403
|
+
var _a;
|
|
404
|
+
this.loadGuides(this.noGuideSelected());
|
|
405
|
+
(_a = this.snkMasterFormConfigChange) === null || _a === void 0 ? void 0 : _a.emit(this.masterFormConfig);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Abre o configurador do formulário
|
|
409
|
+
* @param detail - Define se a configuração que está sendo carregada é
|
|
410
|
+
* referente a um form detail.
|
|
411
|
+
*/
|
|
412
|
+
async showFormConfig(detail = false) {
|
|
413
|
+
var _a, _b;
|
|
414
|
+
const masterConfig = !detail || this._currentDetail == undefined;
|
|
415
|
+
this._formEditorConfigManager = masterConfig ? this._configManager : (_a = this._currentDetail) === null || _a === void 0 ? void 0 : _a.formConfigManager;
|
|
416
|
+
this._formEditorDataUnit = masterConfig ? this.dataUnit : (_b = this._currentDetail) === null || _b === void 0 ? void 0 : _b.dataUnit;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Registra um editor customizado para campos da grade e formulário
|
|
420
|
+
*/
|
|
421
|
+
async addCustomEditor(fieldName, customEditor) {
|
|
422
|
+
this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Registra um render customizado para colunas da grid.
|
|
426
|
+
*/
|
|
427
|
+
async addGridCustomRender(fieldName, customRender) {
|
|
428
|
+
this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
|
|
429
|
+
}
|
|
430
|
+
;
|
|
431
|
+
/**
|
|
432
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
433
|
+
*/
|
|
434
|
+
async setFieldProp(fieldName, propName, value) {
|
|
435
|
+
const newFieldsProps = {
|
|
436
|
+
[fieldName]: Object.assign(Object.assign({}, this._fieldsProps[fieldName]), { [propName]: value })
|
|
437
|
+
};
|
|
438
|
+
this._fieldsProps = Object.assign(Object.assign({}, this._fieldsProps), newFieldsProps);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Atribui o foco para o componente.
|
|
442
|
+
*/
|
|
443
|
+
async setFocus() {
|
|
444
|
+
var _a;
|
|
445
|
+
(_a = this._container) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Recarrega os guias baseada nos metadados atuais.
|
|
449
|
+
*/
|
|
450
|
+
async reloadGuides() {
|
|
451
|
+
this._manualOverride = undefined;
|
|
452
|
+
this.loadGuides(false);
|
|
453
|
+
}
|
|
454
|
+
exitViewer() {
|
|
455
|
+
var _a, _b;
|
|
456
|
+
if (!this.enableGridInsert && ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isDirty())) {
|
|
457
|
+
this.dataUnit.cancelEdition({ after: () => { var _a; return (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit(); } });
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
(_b = this.exit) === null || _b === void 0 ? void 0 : _b.emit();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
onActionClick(evt) {
|
|
464
|
+
var _a;
|
|
465
|
+
if (evt.detail === TaskbarElement.CONFIGURATOR) {
|
|
466
|
+
if (evt.target.dataset.taskbarOwner != "master") {
|
|
467
|
+
(_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.open();
|
|
468
|
+
evt.stopImmediatePropagation();
|
|
469
|
+
evt.stopPropagation();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
onContentCardChanged(evt) {
|
|
474
|
+
if (!this._configManager || !this.dataUnit) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
SnkDynaformGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
478
|
+
.then(() => { var _a; return this.masterFormConfig = (_a = this._configManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit); });
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
482
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
483
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
484
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-crud.msg.ts"
|
|
485
|
+
*/
|
|
486
|
+
getMessage(key) {
|
|
487
|
+
var _a, _b, _c, _d, _e, _f;
|
|
488
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
|
|
489
|
+
const selectedRecords = (_c = (_b = this.dataUnit.getSelectionInfo()) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [];
|
|
490
|
+
return (_d = this.messagesBuilder) === null || _d === void 0 ? void 0 : _d.getMessage("snkCrud.multipleEdition.editing", { COUNT: selectedRecords.length });
|
|
491
|
+
}
|
|
492
|
+
return (_e = this.messagesBuilder) === null || _e === void 0 ? void 0 : _e.getMessage(key, (_f = this.dataUnit) === null || _f === void 0 ? void 0 : _f.getSelectedRecord());
|
|
493
|
+
}
|
|
494
|
+
loadGuides(changeSelection) {
|
|
495
|
+
var _a;
|
|
496
|
+
if (!this.dataUnit || !this._configManager) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (!this._configManager.isLoaded) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
this._masterFormMetadata = buildFormMetadata(this.masterFormConfig, this.dataUnit, true, this.customGuidesConfig);
|
|
503
|
+
const allSheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
504
|
+
if (!allSheets) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const currentRecord = this.dataUnit.getSelectedRecord();
|
|
508
|
+
const disableDetails = this.hasToDisableDetails(currentRecord);
|
|
509
|
+
const guides = [];
|
|
510
|
+
let mainFormName;
|
|
511
|
+
const listSheetsValues = Array.from(allSheets.values());
|
|
512
|
+
listSheetsValues.forEach((sheet) => {
|
|
513
|
+
if ((sheet === null || sheet === void 0 ? void 0 : sheet.name) === TAB_NAMES.main) {
|
|
514
|
+
mainFormName = sheet === null || sheet === void 0 ? void 0 : sheet.name;
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
const item = { id: sheet === null || sheet === void 0 ? void 0 : sheet.name, label: sheet === null || sheet === void 0 ? void 0 : sheet.label };
|
|
518
|
+
if (this.isDetail(sheet === null || sheet === void 0 ? void 0 : sheet.name) && disableDetails) {
|
|
519
|
+
item.tooltip = this.getMessage("snkCrud.detail.tooltip.needSingleSelection");
|
|
520
|
+
item.disabled = true;
|
|
521
|
+
}
|
|
522
|
+
if (sheet.isCustom && sheet.ctxProps) {
|
|
523
|
+
Object.entries(sheet.ctxProps).forEach(([key, value]) => {
|
|
524
|
+
if (value !== undefined) {
|
|
525
|
+
item[key] = value;
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
if (!item.props) {
|
|
530
|
+
item.props = {};
|
|
531
|
+
}
|
|
532
|
+
item.props.isAdditional = sheet.name.includes("AD_");
|
|
533
|
+
item.props.isCustom = !!sheet.isCustom;
|
|
534
|
+
guides.push(item);
|
|
535
|
+
});
|
|
536
|
+
this._mainFormName = mainFormName;
|
|
537
|
+
this._guides = guides;
|
|
538
|
+
this.pruneOpenedGuides();
|
|
539
|
+
const currentStillExists = this.selectedGuide
|
|
540
|
+
&& this._guides.some(g => g.id === this.selectedGuide.id);
|
|
541
|
+
if (changeSelection || !currentStillExists) {
|
|
542
|
+
this.selectedGuide = this._guides && this._guides.length > 0 ? this._guides[0] : undefined;
|
|
543
|
+
}
|
|
544
|
+
this.recomputeMasterCollapse();
|
|
545
|
+
}
|
|
546
|
+
/** Remove das guias abertas (e dos refs) ids que não existem mais. */
|
|
547
|
+
pruneOpenedGuides() {
|
|
548
|
+
const validIds = new Set(this._guides.map(g => g.id));
|
|
549
|
+
const filtered = this._openedGuideIds.filter(id => validIds.has(id));
|
|
550
|
+
if (filtered.length !== this._openedGuideIds.length) {
|
|
551
|
+
this._openedGuideIds = filtered;
|
|
552
|
+
}
|
|
553
|
+
Array.from(this._detailRefs.keys())
|
|
554
|
+
.filter(id => !validIds.has(id))
|
|
555
|
+
.forEach(id => this._detailRefs.delete(id));
|
|
556
|
+
}
|
|
557
|
+
hasToDisableDetails(currentRecord) {
|
|
558
|
+
return !currentRecord
|
|
559
|
+
|| !this.dataUnit
|
|
560
|
+
|| this.dataUnit.isNewRecord(currentRecord.__record__id__)
|
|
561
|
+
|| this.dataUnit.isMultipleEdition;
|
|
562
|
+
}
|
|
563
|
+
isDetail(formId) {
|
|
564
|
+
return FormMetadata.getDetailName(formId) != undefined;
|
|
565
|
+
}
|
|
566
|
+
buildTabItems() {
|
|
567
|
+
return this._guides.map((guide, index) => {
|
|
568
|
+
const hasError = this._errorTabs.has(guide.id);
|
|
569
|
+
return {
|
|
570
|
+
tabKey: guide.id,
|
|
571
|
+
label: guide.label,
|
|
572
|
+
index,
|
|
573
|
+
disabled: guide.disabled,
|
|
574
|
+
rightIcon: hasError ? 'alert-circle-inverted' : undefined,
|
|
575
|
+
rightIconError: hasError,
|
|
576
|
+
leftIcon: this.getTabLeftIcon(guide),
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
getTabLeftIcon(guide) {
|
|
581
|
+
var _a, _b;
|
|
582
|
+
if (guide.icon) {
|
|
583
|
+
return guide.icon;
|
|
584
|
+
}
|
|
585
|
+
if ((_a = guide.props) === null || _a === void 0 ? void 0 : _a.isCustom) {
|
|
586
|
+
return 'puzzle-piece';
|
|
587
|
+
}
|
|
588
|
+
if ((_b = guide.props) === null || _b === void 0 ? void 0 : _b.isAdditional) {
|
|
589
|
+
return 'puzzle-piece';
|
|
590
|
+
}
|
|
591
|
+
return undefined;
|
|
592
|
+
}
|
|
593
|
+
isCustomGuide(guideId) {
|
|
594
|
+
var _a;
|
|
595
|
+
if (!guideId) {
|
|
596
|
+
return false;
|
|
597
|
+
}
|
|
598
|
+
return !!((_a = this.customGuidesConfig) === null || _a === void 0 ? void 0 : _a.some(g => g.id === guideId));
|
|
599
|
+
}
|
|
600
|
+
onTabChange(tab) {
|
|
601
|
+
const targetGuide = this._guides.find(g => g.id === tab.tabKey);
|
|
602
|
+
if (!targetGuide || targetGuide.disabled) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
this.selectedGuide = targetGuide;
|
|
606
|
+
this.recomputeMasterCollapse();
|
|
607
|
+
}
|
|
608
|
+
static updateContentCard(formName, cardConfig, propertyChanged, configManager) {
|
|
609
|
+
return configManager.saveCardState(formName, cardConfig, propertyChanged);
|
|
610
|
+
}
|
|
611
|
+
static buildMainForm(params) {
|
|
612
|
+
if (params.formMetadata == undefined || params.mainFormName == undefined) {
|
|
613
|
+
return undefined;
|
|
614
|
+
}
|
|
615
|
+
const mainSheet = params.formMetadata.getSheet(params.mainFormName);
|
|
616
|
+
if (mainSheet == undefined) {
|
|
617
|
+
return undefined;
|
|
618
|
+
}
|
|
619
|
+
return (h("snk-dynaform-form-view", { ref: (ref) => { var _a; return (_a = params.onMainFormRef) === null || _a === void 0 ? void 0 : _a.call(params, ref); }, label: mainSheet.label, name: params.mainFormName, fields: mainSheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, fieldToFocus: params.fieldToFocus, key: params.mainFormName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath, fieldSearch: params.fieldSearch }));
|
|
620
|
+
}
|
|
621
|
+
static buildFixedForms(params) {
|
|
622
|
+
var _a;
|
|
623
|
+
const cardsState = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.cardsState;
|
|
624
|
+
if (cardsState == undefined || params.formMetadata == undefined) {
|
|
625
|
+
return undefined;
|
|
626
|
+
}
|
|
627
|
+
const fixedEntries = Array.from(cardsState.entries())
|
|
628
|
+
.filter(([formName, cardConfig]) => (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed) && formName != params.selectedForm && formName != params.mainFormName)
|
|
629
|
+
.sort(([, cardConfigA], [, cardConfigB]) => {
|
|
630
|
+
const indexA = (cardConfigA === null || cardConfigA === void 0 ? void 0 : cardConfigA.fixSequence) || 0;
|
|
631
|
+
const indexB = (cardConfigB === null || cardConfigB === void 0 ? void 0 : cardConfigB.fixSequence) || 0;
|
|
632
|
+
return indexA - indexB;
|
|
633
|
+
});
|
|
634
|
+
if (fixedEntries.length === 0) {
|
|
635
|
+
return undefined;
|
|
636
|
+
}
|
|
637
|
+
return (h(Fragment, null, fixedEntries.map(([formName]) => {
|
|
638
|
+
const sheet = params.formMetadata.getSheet(formName);
|
|
639
|
+
if (sheet == undefined) {
|
|
640
|
+
return undefined;
|
|
641
|
+
}
|
|
642
|
+
return h("snk-dynaform-form-view", { label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath });
|
|
643
|
+
})));
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Renderiza o conteúdo de TODAS as guias já abertas, mantendo-as montadas.
|
|
647
|
+
* Apenas a guia ativa fica visível (as demais recebem `--hidden` via CSS),
|
|
648
|
+
* então voltar a uma aba já visitada não a recarrega.
|
|
649
|
+
*/
|
|
650
|
+
buildGuidesContent() {
|
|
651
|
+
if (!this.selectedGuide) {
|
|
652
|
+
return undefined;
|
|
653
|
+
}
|
|
654
|
+
const activeId = this.selectedGuide.id;
|
|
655
|
+
// Garante que a aba ativa sempre renderiza, mesmo se o watch não a registrou ainda.
|
|
656
|
+
const ids = this._openedGuideIds.includes(activeId)
|
|
657
|
+
? this._openedGuideIds
|
|
658
|
+
: [...this._openedGuideIds, activeId];
|
|
659
|
+
return (h(Fragment, null, ids.map((guideId) => {
|
|
660
|
+
const guide = this._guides.find(g => g.id === guideId);
|
|
661
|
+
if (!guide) {
|
|
662
|
+
return undefined;
|
|
663
|
+
}
|
|
664
|
+
const content = this.renderGuideContent(guide);
|
|
665
|
+
if (content == undefined) {
|
|
666
|
+
return undefined;
|
|
667
|
+
}
|
|
668
|
+
return (h("div", { key: `guide_${guideId}`, class: {
|
|
669
|
+
"snk-guides-viewer__guide-content": true,
|
|
670
|
+
"snk-guides-viewer__guide-content--hidden": guideId !== activeId
|
|
671
|
+
} }, content));
|
|
672
|
+
})));
|
|
673
|
+
}
|
|
674
|
+
renderGuideContent(guide) {
|
|
675
|
+
var _a;
|
|
676
|
+
const guideId = guide.id;
|
|
677
|
+
if (this.isCustomGuide(guideId)) {
|
|
678
|
+
return h("slot", { name: guideId });
|
|
679
|
+
}
|
|
680
|
+
const childEntityName = FormMetadata.getDetailName(guideId);
|
|
681
|
+
if (childEntityName) {
|
|
682
|
+
return (h("snk-dynaform-detail-view", { ref: (ref) => {
|
|
683
|
+
if (ref)
|
|
684
|
+
this._detailRefs.set(guideId, ref);
|
|
685
|
+
}, dataUnitName: `${this.entityPath}/${childEntityName}`, entityName: childEntityName, label: guide.label, key: `detail_${guideId}`, canEdit: this.canEdit, resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode, messagesBuilder: this.messagesBuilder }));
|
|
686
|
+
}
|
|
687
|
+
if (guideId === this._mainFormName) {
|
|
688
|
+
return undefined;
|
|
689
|
+
}
|
|
690
|
+
const sheet = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getSheet(guideId);
|
|
691
|
+
if (!sheet) {
|
|
692
|
+
return undefined;
|
|
693
|
+
}
|
|
694
|
+
return (h("snk-dynaform-form-view", { name: guideId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch, entityPath: this.entityPath }));
|
|
695
|
+
}
|
|
696
|
+
clearFieldToFocusHandler() {
|
|
697
|
+
this._fieldToGetFocus = undefined;
|
|
698
|
+
}
|
|
699
|
+
getConfigViewMode() {
|
|
700
|
+
return VIEW_MODE.GRID;
|
|
701
|
+
}
|
|
702
|
+
changeConfigViewMode(mode) {
|
|
703
|
+
var _a, _b;
|
|
704
|
+
if (this._currentDetail) {
|
|
705
|
+
(_b = (_a = this._currentDetail).changeViewMode) === null || _b === void 0 ? void 0 : _b.call(_a, mode);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
openConfig(mode) {
|
|
709
|
+
var _a, _b, _c, _d;
|
|
710
|
+
(_b = (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
711
|
+
if (this._currentDetail) {
|
|
712
|
+
if (mode === VIEW_MODE.FORM) {
|
|
713
|
+
this.showFormConfig(true);
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
(_d = (_c = this._currentDetail).configGrid) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
noGuideSelected() {
|
|
721
|
+
var _a;
|
|
722
|
+
return this.selectedGuide === undefined || TAB_NAMES.main === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Indica se a aba ativa disputa espaço vertical com o formulário principal.
|
|
726
|
+
* Vale para qualquer aba diferente da principal: detalhes E abas nomeadas
|
|
727
|
+
* (ex.: "Identificação"). Nesses casos o master pode ser recolhido.
|
|
728
|
+
*/
|
|
729
|
+
isCollapsibleGuideActive() {
|
|
730
|
+
var _a;
|
|
731
|
+
const id = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
|
|
732
|
+
if (!id) {
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
return id !== this._mainFormName;
|
|
736
|
+
}
|
|
737
|
+
hasRecordToSummarize() {
|
|
738
|
+
var _a;
|
|
739
|
+
return ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) != undefined;
|
|
740
|
+
}
|
|
741
|
+
hasMainFormFields() {
|
|
742
|
+
var _a, _b;
|
|
743
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
747
|
+
return ((_b = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
|
748
|
+
}
|
|
749
|
+
recomputeMasterCollapse() {
|
|
750
|
+
var _a;
|
|
751
|
+
if (!this.collapsibleMaster || !this.isCollapsibleGuideActive() || !this.hasRecordToSummarize()) {
|
|
752
|
+
this._masterCollapsed = false;
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
if (this._manualOverride != undefined) {
|
|
756
|
+
this._masterCollapsed = this._manualOverride;
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
this._masterCollapsed = ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) ? false : this._hostTight;
|
|
760
|
+
}
|
|
761
|
+
/** Pool de campos candidatos (todos do form principal, até o limite máximo). */
|
|
762
|
+
getSummaryFields() {
|
|
763
|
+
var _a;
|
|
764
|
+
if (!this._masterFormMetadata || !this._mainFormName) {
|
|
765
|
+
return [];
|
|
766
|
+
}
|
|
767
|
+
const sheet = this._masterFormMetadata.getSheet(this._mainFormName);
|
|
768
|
+
const fields = (_a = sheet === null || sheet === void 0 ? void 0 : sheet.fields) !== null && _a !== void 0 ? _a : [];
|
|
769
|
+
return fields.slice(0, this.masterSummaryFieldCount);
|
|
770
|
+
}
|
|
771
|
+
/** Record atual (para consultar campos inválidos no DataUnit). */
|
|
772
|
+
getCurrentRecordId() {
|
|
773
|
+
var _a, _b;
|
|
774
|
+
return (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord()) === null || _b === void 0 ? void 0 : _b["__record__id__"];
|
|
775
|
+
}
|
|
776
|
+
/** Mensagem de invalidez do campo no registro atual, se houver. */
|
|
777
|
+
getFieldInvalidMessage(fieldName) {
|
|
778
|
+
var _a;
|
|
779
|
+
const recordId = this.getCurrentRecordId();
|
|
780
|
+
return recordId == undefined ? undefined : (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getInvalidMessage(recordId, fieldName);
|
|
781
|
+
}
|
|
782
|
+
renderSummaryItem(field) {
|
|
783
|
+
var _a;
|
|
784
|
+
const invalidMessage = this.getFieldInvalidMessage(field.name);
|
|
785
|
+
return (h("span", { class: {
|
|
786
|
+
"snk-guides-viewer__master-summary-item": true,
|
|
787
|
+
"snk-guides-viewer__master-summary-item--invalid": invalidMessage != undefined
|
|
788
|
+
}, key: field.name, title: invalidMessage }, h("span", { class: "snk-guides-viewer__master-summary-label" }, h("span", { class: "snk-guides-viewer__master-summary-label-text" }, (_a = field.label) !== null && _a !== void 0 ? _a : field.name), field.required &&
|
|
789
|
+
h("span", { class: "snk-guides-viewer__master-summary-required", "aria-hidden": "true" }, "*")), h("span", { class: "snk-guides-viewer__master-summary-value" }, this.formatSummaryValue(field.name))));
|
|
790
|
+
}
|
|
791
|
+
buildMasterSummary() {
|
|
792
|
+
var _a;
|
|
793
|
+
const fields = this.getSummaryFields();
|
|
794
|
+
const visible = fields.slice(0, this._visibleSummaryCount);
|
|
795
|
+
return (h("button", { type: "button", class: "snk-guides-viewer__master-summary", "aria-expanded": "false", "aria-label": (_a = this.getMessage("snkCrud.master.expand")) !== null && _a !== void 0 ? _a : "Expandir formulário principal", onClick: () => this.toggleMasterCollapse() }, h("div", { class: "snk-guides-viewer__master-summary-fields", ref: (el) => this.bindSummaryFields(el) }, visible.map((field) => this.renderSummaryItem(field))), h("div", { class: "snk-guides-viewer__master-summary-measure", "aria-hidden": "true", ref: (el) => { this._summaryMeasureEl = el; } }, fields.map((field) => this.renderSummaryItem(field))), h("ez-icon", { iconName: "chevron-down", class: "snk-guides-viewer__master-summary-chevron" })));
|
|
796
|
+
}
|
|
797
|
+
bindSummaryFields(el) {
|
|
798
|
+
var _a;
|
|
799
|
+
if (!el || el === this._summaryFieldsEl) {
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
this._summaryFieldsEl = el;
|
|
803
|
+
(_a = this._summaryResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
804
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
this._summaryResizeObserver = new ResizeObserver(() => this.recomputeVisibleSummary());
|
|
808
|
+
this._summaryResizeObserver.observe(el);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Mede as larguras naturais (via row-fantasma) e calcula quantos campos
|
|
812
|
+
* cabem na largura visível. Só grava no estado quando o número muda, então
|
|
813
|
+
* não há loop de renderização.
|
|
814
|
+
*/
|
|
815
|
+
recomputeVisibleSummary() {
|
|
816
|
+
const wrap = this._summaryFieldsEl;
|
|
817
|
+
const ghost = this._summaryMeasureEl;
|
|
818
|
+
if (!wrap || !ghost) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
const avail = wrap.clientWidth;
|
|
822
|
+
if (avail <= 0) {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
const items = Array.from(ghost.children);
|
|
826
|
+
if (items.length === 0) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
const gapStr = getComputedStyle(ghost).columnGap || getComputedStyle(ghost).gap || "0";
|
|
830
|
+
const gap = parseFloat(gapStr) || 0;
|
|
831
|
+
let used = 0;
|
|
832
|
+
let count = 0;
|
|
833
|
+
for (let i = 0; i < items.length; i++) {
|
|
834
|
+
const add = items[i].offsetWidth + (i > 0 ? gap : 0);
|
|
835
|
+
if (used + add > avail && count >= 1) {
|
|
836
|
+
break;
|
|
837
|
+
}
|
|
838
|
+
used += add;
|
|
839
|
+
count++;
|
|
840
|
+
}
|
|
841
|
+
count = Math.max(1, Math.min(count, items.length));
|
|
842
|
+
if (count !== this._visibleSummaryCount) {
|
|
843
|
+
this._visibleSummaryCount = count;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
formatSummaryValue(fieldName) {
|
|
847
|
+
var _a;
|
|
848
|
+
const formatted = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getFormattedValue(fieldName);
|
|
849
|
+
return (formatted == undefined || formatted === "") ? "-" : formatted;
|
|
850
|
+
}
|
|
851
|
+
toggleMasterCollapse() {
|
|
852
|
+
this._masterCollapsed = !this._masterCollapsed;
|
|
853
|
+
this._manualOverride = this._masterCollapsed;
|
|
854
|
+
}
|
|
855
|
+
buildCollapseControl() {
|
|
856
|
+
var _a;
|
|
857
|
+
const label = (_a = this.getMessage("snkCrud.master.collapse")) !== null && _a !== void 0 ? _a : "Recolher";
|
|
858
|
+
return (h("div", { class: "snk-guides-viewer__master-collapse-btn" }, h("ez-tooltip", { message: label }, h("ez-button", { mode: "icon", iconName: "chevron-up", size: "x-small", variant: "secondary", "aria-label": label, onClick: () => this.toggleMasterCollapse() }))));
|
|
859
|
+
}
|
|
860
|
+
/** Bloco master (resumo + form), sempre montado; recolhe só via CSS. */
|
|
861
|
+
renderMaster(params, canCollapseMaster) {
|
|
862
|
+
return (h("div", { class: {
|
|
863
|
+
"snk-guides-viewer__master": true,
|
|
864
|
+
"snk-guides-viewer__master--collapsed": canCollapseMaster && this._masterCollapsed
|
|
865
|
+
} }, canCollapseMaster && this.buildMasterSummary(), h("div", { class: "snk-guides-viewer__master-expanded" }, SnkDynaformGuidesViewer.buildMainForm(params), canCollapseMaster && this.buildCollapseControl())));
|
|
866
|
+
}
|
|
867
|
+
/** Abas (quando houver) + container de detalhe. */
|
|
868
|
+
renderTabsAndDetail(params, showTabs) {
|
|
869
|
+
var _a;
|
|
870
|
+
return (h("div", { class: "snk-guides-viewer__panel" }, showTabs &&
|
|
871
|
+
h("ez-tabselector", Object.assign({ class: "snk-guides-viewer__tabselector", tabs: this.buildTabItems(), selectedTab: (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id, onEzChange: (evt) => this.onTabChange(evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("tabselector")}` })), h("div", { class: "snk-guides-viewer__detail-container" }, SnkDynaformGuidesViewer.buildFixedForms(params), this.buildGuidesContent())));
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Vincula o container e (re)inicia o observador de tamanho. Chamado pelo
|
|
875
|
+
* `ref` da section — o `componentDidLoad` não serve porque o config carrega
|
|
876
|
+
* de forma assíncrona e a section só monta depois de `isLoaded`.
|
|
877
|
+
*/
|
|
878
|
+
bindContainer(el) {
|
|
879
|
+
if (!el || el === this._container) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
this._container = el;
|
|
883
|
+
this.setupResizeObserver();
|
|
884
|
+
}
|
|
885
|
+
setupResizeObserver() {
|
|
886
|
+
var _a;
|
|
887
|
+
if (!this._container || typeof ResizeObserver === 'undefined') {
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
891
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
892
|
+
var _a, _b, _c;
|
|
893
|
+
const height = (_c = (_b = (_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 0;
|
|
894
|
+
const tight = height > 0 && height < this.masterCollapseThreshold;
|
|
895
|
+
if (tight !== this._hostTight) {
|
|
896
|
+
this._hostTight = tight;
|
|
897
|
+
this.recomputeMasterCollapse();
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
this._resizeObserver.observe(this._container);
|
|
901
|
+
}
|
|
902
|
+
addFormLegacyConfigName() {
|
|
903
|
+
var _a;
|
|
904
|
+
if (this.formLegacyConfigName) {
|
|
905
|
+
(_a = this._configManager) === null || _a === void 0 ? void 0 : _a.addFormLegacyConfig(this.formLegacyConfigName);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
setMasterFormConfig(config) {
|
|
909
|
+
this.masterFormConfig = config;
|
|
910
|
+
}
|
|
911
|
+
componentWillLoad() {
|
|
912
|
+
var _a;
|
|
913
|
+
if (this.resourceID == undefined) {
|
|
914
|
+
throw new Error((_a = this.getMessage("snkCrud.errors.resourceIDNotProvided")) !== null && _a !== void 0 ? _a : "");
|
|
915
|
+
}
|
|
916
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
|
|
917
|
+
this.addFormLegacyConfigName();
|
|
918
|
+
this._configManager.loadConfig();
|
|
919
|
+
}
|
|
920
|
+
async dataUnitActionHandler(action) {
|
|
921
|
+
var _a;
|
|
922
|
+
switch (action.type) {
|
|
923
|
+
case Action.EDITION_CANCELED:
|
|
924
|
+
case Action.DATA_SAVED:
|
|
925
|
+
this.refreshValidationState();
|
|
926
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition) {
|
|
927
|
+
this.exitViewer();
|
|
928
|
+
if (this.dataUnit) {
|
|
929
|
+
this.dataUnit.isMultipleEdition = false;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
break;
|
|
933
|
+
case Action.FIELD_INVALIDATED:
|
|
934
|
+
case Action.INVALIDATE_CLEAN:
|
|
935
|
+
case Action.SAVING_CANCELED:
|
|
936
|
+
this.refreshValidationState();
|
|
937
|
+
break;
|
|
938
|
+
case Action.METADATA_LOADED:
|
|
939
|
+
case Action.MULTIPLE_EDITION_CHANGED:
|
|
940
|
+
this.loadGuides(this.noGuideSelected());
|
|
941
|
+
break;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Reavalia abas com erro e o realce da tira-resumo a partir do estado atual
|
|
946
|
+
* de campos inválidos do DataUnit. Marca abas cujos campos ainda estão
|
|
947
|
+
* inválidos e DESMARCA as que foram preenchidas/limpas ou canceladas.
|
|
948
|
+
*/
|
|
949
|
+
refreshValidationState() {
|
|
950
|
+
var _a, _b, _c;
|
|
951
|
+
const recordId = this.getCurrentRecordId();
|
|
952
|
+
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
953
|
+
const errored = new Set();
|
|
954
|
+
if (recordId != undefined && sheets) {
|
|
955
|
+
for (const sheet of sheets) {
|
|
956
|
+
const guideName = sheet[0];
|
|
957
|
+
const fields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
|
|
958
|
+
if (!fields) {
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
for (const field of fields) {
|
|
962
|
+
if (((_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.getInvalidMessage(recordId, field.name)) != undefined) {
|
|
963
|
+
errored.add(guideName);
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
const prev = this._errorTabs;
|
|
970
|
+
if (prev.size === errored.size && [...errored].every(id => prev.has(id))) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
this._errorTabs = errored;
|
|
974
|
+
}
|
|
975
|
+
getGuideName(fieldName) {
|
|
976
|
+
var _a, _b;
|
|
977
|
+
const sheets = (_a = this._masterFormMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets();
|
|
978
|
+
if (!sheets) {
|
|
979
|
+
return "";
|
|
980
|
+
}
|
|
981
|
+
for (const sheet of sheets) {
|
|
982
|
+
const formFields = (_b = sheet[1]) === null || _b === void 0 ? void 0 : _b.fields;
|
|
983
|
+
if (!formFields)
|
|
984
|
+
continue;
|
|
985
|
+
for (const field of formFields) {
|
|
986
|
+
if (field.name === fieldName) {
|
|
987
|
+
return sheet[0];
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return "";
|
|
992
|
+
}
|
|
993
|
+
getTitle() {
|
|
994
|
+
var _a, _b, _c;
|
|
995
|
+
return (_c = (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title")) !== null && _c !== void 0 ? _c : "";
|
|
996
|
+
}
|
|
997
|
+
getTitleTooltip() {
|
|
998
|
+
var _a;
|
|
999
|
+
if (!((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.isMultipleEdition))
|
|
1000
|
+
return undefined;
|
|
1001
|
+
return this.buildRecordIdsArray();
|
|
1002
|
+
}
|
|
1003
|
+
buildRecordIdsArray() {
|
|
1004
|
+
var _a, _b, _c;
|
|
1005
|
+
const selectedRecords = (_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo()) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [];
|
|
1006
|
+
if (selectedRecords.length === 0) {
|
|
1007
|
+
return "[]";
|
|
1008
|
+
}
|
|
1009
|
+
const labels = selectedRecords.map(record => { var _a; return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkCrud.title", record); });
|
|
1010
|
+
return `[${labels.join(", ")}]`;
|
|
1011
|
+
}
|
|
1012
|
+
getFieldsSearch() {
|
|
1013
|
+
var _a;
|
|
1014
|
+
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
|
1015
|
+
this._hasToCreateFieldSearch = false;
|
|
1016
|
+
const item = {
|
|
1017
|
+
label: (_a = this.getMessage("snkSimpleCrud.findFields")) !== null && _a !== void 0 ? _a : "Busca de campos",
|
|
1018
|
+
value: "findFields",
|
|
1019
|
+
};
|
|
1020
|
+
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
|
1021
|
+
}
|
|
1022
|
+
return this._fieldSearch;
|
|
1023
|
+
}
|
|
1024
|
+
fieldsOptionLoader(argument) {
|
|
1025
|
+
var _a, _b;
|
|
1026
|
+
return Promise.resolve((_b = (_a = this._configManager) === null || _a === void 0 ? void 0 : _a.getFieldsList(argument).map(field => ({ value: field.name, label: field.label }))) !== null && _b !== void 0 ? _b : []);
|
|
1027
|
+
}
|
|
1028
|
+
onSelectField(option) {
|
|
1029
|
+
var _a, _b, _c;
|
|
1030
|
+
if (option == undefined) {
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
this._fieldToGetFocus = option.value;
|
|
1034
|
+
const fieldGuideName = this.getGuideName(option.value);
|
|
1035
|
+
if (!fieldGuideName) {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
if (fieldGuideName === this._mainFormName) {
|
|
1039
|
+
(_b = (_a = this._mainForm) === null || _a === void 0 ? void 0 : _a.showUp) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
if (fieldGuideName !== ((_c = this.selectedGuide) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
1043
|
+
const targetGuide = this._guides.find(g => g.id === fieldGuideName);
|
|
1044
|
+
if (targetGuide && !targetGuide.disabled) {
|
|
1045
|
+
this.selectedGuide = targetGuide;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
componentDidLoad() {
|
|
1050
|
+
var _a;
|
|
1051
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.subscribe(this.dataUnitActionHandler.bind(this));
|
|
1052
|
+
this.initKeyboardManager();
|
|
1053
|
+
this.getFieldsSearch();
|
|
1054
|
+
}
|
|
1055
|
+
componentDidRender() {
|
|
1056
|
+
if (this._masterCollapsed) {
|
|
1057
|
+
this.recomputeVisibleSummary();
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
disconnectedCallback() {
|
|
1061
|
+
var _a, _b, _c;
|
|
1062
|
+
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
1063
|
+
(_b = this._resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1064
|
+
this._resizeObserver = undefined;
|
|
1065
|
+
(_c = this._summaryResizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
1066
|
+
this._summaryResizeObserver = undefined;
|
|
1067
|
+
}
|
|
1068
|
+
async initKeyboardManager() {
|
|
1069
|
+
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
|
1070
|
+
if (this._keyboardManager) {
|
|
1071
|
+
this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
|
|
1072
|
+
var _a, _b;
|
|
1073
|
+
if (!this._mainForm)
|
|
1074
|
+
return;
|
|
1075
|
+
await ((_b = (_a = this._mainForm).showSearchField) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
1076
|
+
}, { description: this.getMessage("snkSimpleCrud.findFields"), element: this._element });
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
render() {
|
|
1080
|
+
var _a, _b;
|
|
1081
|
+
if (this._formEditorConfigManager != undefined) {
|
|
1082
|
+
return (h("snk-dynaform-form-config", { ref: (ref) => {
|
|
1083
|
+
if (ref)
|
|
1084
|
+
this._container = ref;
|
|
1085
|
+
}, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = undefined }));
|
|
1086
|
+
}
|
|
1087
|
+
if (!this.dataUnit || !((_a = this._configManager) === null || _a === void 0 ? void 0 : _a.isLoaded)) {
|
|
1088
|
+
return undefined;
|
|
1089
|
+
}
|
|
1090
|
+
const showTabs = this._guides && this._guides.length > 0;
|
|
1091
|
+
const showMaster = this.hasMainFormFields();
|
|
1092
|
+
const canCollapseMaster = showMaster && this.collapsibleMaster
|
|
1093
|
+
&& this.isCollapsibleGuideActive()
|
|
1094
|
+
&& this.hasRecordToSummarize();
|
|
1095
|
+
const masterExpandedVisible = !(canCollapseMaster && this._masterCollapsed);
|
|
1096
|
+
const fixedFormsParams = {
|
|
1097
|
+
formConfig: this.masterFormConfig,
|
|
1098
|
+
formMetadata: this._masterFormMetadata,
|
|
1099
|
+
selectedForm: (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id,
|
|
1100
|
+
mainFormName: this._mainFormName,
|
|
1101
|
+
dataUnit: this.dataUnit,
|
|
1102
|
+
recordsValidator: this.recordsValidator,
|
|
1103
|
+
fieldToFocus: this._fieldToGetFocus,
|
|
1104
|
+
onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
|
|
1105
|
+
propsCustomEditor: this._customEditors,
|
|
1106
|
+
fieldsProps: this._fieldsProps,
|
|
1107
|
+
entityPath: this.entityPath,
|
|
1108
|
+
fieldSearch: this._fieldSearch,
|
|
1109
|
+
onMainFormRef: (ref) => { this._mainForm = ref; }
|
|
1110
|
+
};
|
|
1111
|
+
return (h("section", { class: "snk-guides-viewer", ref: (ref) => this.bindContainer(ref), tabindex: -1 }, this.getTitle() && (h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center", key: "header" }, h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge", title: this.getTitleTooltip() }, this.getTitle()))))), h("div", { class: "snk-guides-viewer__container" }, showTabs && showMaster ? (
|
|
1112
|
+
/* Master e abas: split redimensionável. Master alterna resumo/expandido via CSS
|
|
1113
|
+
sem remontar o snk-dynaform-form-view (evita recarga/lentidão). */
|
|
1114
|
+
h("ez-split-panel", { direction: "row", structural: true, showGutter: masterExpandedVisible, class: {
|
|
1115
|
+
"snk-guides-viewer__split": true,
|
|
1116
|
+
"snk-guides-viewer__split--collapsed": !masterExpandedVisible
|
|
1117
|
+
}, ref: (ref) => {
|
|
1118
|
+
if (ref)
|
|
1119
|
+
this._splitPanel = ref;
|
|
1120
|
+
} }, h("ez-split-item", { class: "snk-guides-viewer__split-master", structural: true, enableExpand: false, size: masterExpandedVisible ? MASTER_INITIAL_SIZE : "auto" }, this.renderMaster(fixedFormsParams, canCollapseMaster)), h("ez-split-item", { class: "snk-guides-viewer__split-content", structural: true, outline: true, enableExpand: false }, this.renderTabsAndDetail(fixedFormsParams, true)))) : showTabs ? (
|
|
1121
|
+
/* Sem campos no master: abas ocupam toda a área. */
|
|
1122
|
+
this.renderTabsAndDetail(fixedFormsParams, true)) : (
|
|
1123
|
+
/* Sem abas: master ocupa toda a área. */
|
|
1124
|
+
this.renderMaster(fixedFormsParams, canCollapseMaster))), h("snk-configurator", { ref: (ref) => {
|
|
1125
|
+
if (ref)
|
|
1126
|
+
this._snkConfigurator = ref;
|
|
1127
|
+
}, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID, layoutFormConfig: false, showActionButtons: true })));
|
|
1128
|
+
}
|
|
1129
|
+
get _element() { return this; }
|
|
1130
|
+
static get watchers() { return {
|
|
1131
|
+
"dataUnit": ["observeDataUnit"],
|
|
1132
|
+
"selectedGuide": ["observeSelectedGuide"],
|
|
1133
|
+
"_masterCollapsed": ["observeMasterCollapsed"],
|
|
1134
|
+
"_formEditorConfigManager": ["observeFormConfigManager"],
|
|
1135
|
+
"dataState": ["observeDataState"],
|
|
1136
|
+
"masterFormConfig": ["observeMasterFormConfig"]
|
|
1137
|
+
}; }
|
|
1138
|
+
static get style() { return snkDynaformGuidesViewCss; }
|
|
1139
|
+
}, [6, "snk-dynaform-guides-view", {
|
|
1140
|
+
"dataUnit": [16],
|
|
1141
|
+
"dataState": [16],
|
|
1142
|
+
"configName": [1, "config-name"],
|
|
1143
|
+
"entityPath": [1, "entity-path"],
|
|
1144
|
+
"actionsList": [16],
|
|
1145
|
+
"recordsValidator": [16],
|
|
1146
|
+
"masterFormConfig": [1040],
|
|
1147
|
+
"selectedGuide": [1040],
|
|
1148
|
+
"taskbarManager": [16],
|
|
1149
|
+
"messagesBuilder": [1040],
|
|
1150
|
+
"canEdit": [4, "can-edit"],
|
|
1151
|
+
"presentationMode": [1, "presentation-mode"],
|
|
1152
|
+
"resourceID": [1, "resource-i-d"],
|
|
1153
|
+
"detailTaskbarCustomContainerId": [1, "detail-taskbar-custom-container-id"],
|
|
1154
|
+
"formLegacyConfigName": [1, "form-legacy-config-name"],
|
|
1155
|
+
"enableGridInsert": [4, "enable-grid-insert"],
|
|
1156
|
+
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
1157
|
+
"getCustomTitle": [16],
|
|
1158
|
+
"customGuidesConfig": [16],
|
|
1159
|
+
"collapsibleMaster": [4, "collapsible-master"],
|
|
1160
|
+
"masterSummaryFieldCount": [2, "master-summary-field-count"],
|
|
1161
|
+
"masterCollapseThreshold": [2, "master-collapse-threshold"],
|
|
1162
|
+
"maxOpenedGuides": [2, "max-opened-guides"],
|
|
1163
|
+
"_guides": [32],
|
|
1164
|
+
"_formEditorConfigManager": [32],
|
|
1165
|
+
"_formEditorDataUnit": [32],
|
|
1166
|
+
"_fieldToGetFocus": [32],
|
|
1167
|
+
"_customEditors": [32],
|
|
1168
|
+
"_customRenders": [32],
|
|
1169
|
+
"_fieldsProps": [32],
|
|
1170
|
+
"_mainForm": [32],
|
|
1171
|
+
"_mainFormName": [32],
|
|
1172
|
+
"_errorTabs": [32],
|
|
1173
|
+
"_hasToCreateFieldSearch": [32],
|
|
1174
|
+
"_masterCollapsed": [32],
|
|
1175
|
+
"_hostTight": [32],
|
|
1176
|
+
"_visibleSummaryCount": [32],
|
|
1177
|
+
"_openedGuideIds": [32],
|
|
1178
|
+
"showFormConfig": [64],
|
|
1179
|
+
"addCustomEditor": [64],
|
|
1180
|
+
"addGridCustomRender": [64],
|
|
1181
|
+
"setFieldProp": [64],
|
|
1182
|
+
"setFocus": [64],
|
|
1183
|
+
"reloadGuides": [64]
|
|
1184
|
+
}, [[2, "actionClick", "onActionClick"], [0, "snkContentCardChanged", "onContentCardChanged"]]]);
|
|
1185
|
+
function defineCustomElement$1() {
|
|
1186
|
+
if (typeof customElements === "undefined") {
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
const components = ["snk-dynaform-guides-view", "snk-actions-button", "snk-attach", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-default-filter", "snk-dynaform-config-header", "snk-dynaform-configs-button", "snk-dynaform-detail-view", "snk-dynaform-field-config", "snk-dynaform-field-item", "snk-dynaform-fields-layout", "snk-dynaform-fields-selector", "snk-dynaform-form-config", "snk-dynaform-form-view", "snk-dynaform-guides-configurator", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-modal", "snk-filter-modal-item", "snk-filter-param-config", "snk-grid", "snk-grid-config", "snk-image-input", "snk-layout-form-config", "snk-numbering-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-simple-form-config", "snk-taskbar", "snk-taskbar-skeleton", "snk-view-representation", "taskbar-actions-button", "taskbar-split-button"];
|
|
1190
|
+
components.forEach(tagName => { switch (tagName) {
|
|
1191
|
+
case "snk-dynaform-guides-view":
|
|
1192
|
+
if (!customElements.get(tagName)) {
|
|
1193
|
+
customElements.define(tagName, SnkDynaformGuidesViewer);
|
|
1194
|
+
}
|
|
1195
|
+
break;
|
|
1196
|
+
case "snk-actions-button":
|
|
1197
|
+
if (!customElements.get(tagName)) {
|
|
1198
|
+
defineCustomElement$H();
|
|
1199
|
+
}
|
|
1200
|
+
break;
|
|
1201
|
+
case "snk-attach":
|
|
1202
|
+
if (!customElements.get(tagName)) {
|
|
1203
|
+
defineCustomElement$G();
|
|
1204
|
+
}
|
|
1205
|
+
break;
|
|
1206
|
+
case "snk-configurator":
|
|
1207
|
+
if (!customElements.get(tagName)) {
|
|
1208
|
+
defineCustomElement$F();
|
|
1209
|
+
}
|
|
1210
|
+
break;
|
|
1211
|
+
case "snk-data-exporter":
|
|
1212
|
+
if (!customElements.get(tagName)) {
|
|
1213
|
+
defineCustomElement$E();
|
|
1214
|
+
}
|
|
1215
|
+
break;
|
|
1216
|
+
case "snk-data-unit":
|
|
1217
|
+
if (!customElements.get(tagName)) {
|
|
1218
|
+
defineCustomElement$D();
|
|
1219
|
+
}
|
|
1220
|
+
break;
|
|
1221
|
+
case "snk-default-filter":
|
|
1222
|
+
if (!customElements.get(tagName)) {
|
|
1223
|
+
defineCustomElement$C();
|
|
1224
|
+
}
|
|
1225
|
+
break;
|
|
1226
|
+
case "snk-dynaform-config-header":
|
|
1227
|
+
if (!customElements.get(tagName)) {
|
|
1228
|
+
defineCustomElement$B();
|
|
1229
|
+
}
|
|
1230
|
+
break;
|
|
1231
|
+
case "snk-dynaform-configs-button":
|
|
1232
|
+
if (!customElements.get(tagName)) {
|
|
1233
|
+
defineCustomElement$A();
|
|
1234
|
+
}
|
|
1235
|
+
break;
|
|
1236
|
+
case "snk-dynaform-detail-view":
|
|
1237
|
+
if (!customElements.get(tagName)) {
|
|
1238
|
+
defineCustomElement();
|
|
1239
|
+
}
|
|
1240
|
+
break;
|
|
1241
|
+
case "snk-dynaform-field-config":
|
|
1242
|
+
if (!customElements.get(tagName)) {
|
|
1243
|
+
defineCustomElement$z();
|
|
1244
|
+
}
|
|
1245
|
+
break;
|
|
1246
|
+
case "snk-dynaform-field-item":
|
|
1247
|
+
if (!customElements.get(tagName)) {
|
|
1248
|
+
defineCustomElement$y();
|
|
1249
|
+
}
|
|
1250
|
+
break;
|
|
1251
|
+
case "snk-dynaform-fields-layout":
|
|
1252
|
+
if (!customElements.get(tagName)) {
|
|
1253
|
+
defineCustomElement$x();
|
|
1254
|
+
}
|
|
1255
|
+
break;
|
|
1256
|
+
case "snk-dynaform-fields-selector":
|
|
1257
|
+
if (!customElements.get(tagName)) {
|
|
1258
|
+
defineCustomElement$w();
|
|
1259
|
+
}
|
|
1260
|
+
break;
|
|
1261
|
+
case "snk-dynaform-form-config":
|
|
1262
|
+
if (!customElements.get(tagName)) {
|
|
1263
|
+
defineCustomElement$v();
|
|
1264
|
+
}
|
|
1265
|
+
break;
|
|
1266
|
+
case "snk-dynaform-form-view":
|
|
1267
|
+
if (!customElements.get(tagName)) {
|
|
1268
|
+
defineCustomElement$u();
|
|
1269
|
+
}
|
|
1270
|
+
break;
|
|
1271
|
+
case "snk-dynaform-guides-configurator":
|
|
1272
|
+
if (!customElements.get(tagName)) {
|
|
1273
|
+
defineCustomElement$t();
|
|
1274
|
+
}
|
|
1275
|
+
break;
|
|
1276
|
+
case "snk-exporter-email-sender":
|
|
1277
|
+
if (!customElements.get(tagName)) {
|
|
1278
|
+
defineCustomElement$s();
|
|
1279
|
+
}
|
|
1280
|
+
break;
|
|
1281
|
+
case "snk-expression-group":
|
|
1282
|
+
if (!customElements.get(tagName)) {
|
|
1283
|
+
defineCustomElement$r();
|
|
1284
|
+
}
|
|
1285
|
+
break;
|
|
1286
|
+
case "snk-expression-item":
|
|
1287
|
+
if (!customElements.get(tagName)) {
|
|
1288
|
+
defineCustomElement$q();
|
|
1289
|
+
}
|
|
1290
|
+
break;
|
|
1291
|
+
case "snk-filter-advanced-mode":
|
|
1292
|
+
if (!customElements.get(tagName)) {
|
|
1293
|
+
defineCustomElement$p();
|
|
1294
|
+
}
|
|
1295
|
+
break;
|
|
1296
|
+
case "snk-filter-assistent-mode":
|
|
1297
|
+
if (!customElements.get(tagName)) {
|
|
1298
|
+
defineCustomElement$o();
|
|
1299
|
+
}
|
|
1300
|
+
break;
|
|
1301
|
+
case "snk-filter-bar":
|
|
1302
|
+
if (!customElements.get(tagName)) {
|
|
1303
|
+
defineCustomElement$n();
|
|
1304
|
+
}
|
|
1305
|
+
break;
|
|
1306
|
+
case "snk-filter-detail":
|
|
1307
|
+
if (!customElements.get(tagName)) {
|
|
1308
|
+
defineCustomElement$m();
|
|
1309
|
+
}
|
|
1310
|
+
break;
|
|
1311
|
+
case "snk-filter-field-search":
|
|
1312
|
+
if (!customElements.get(tagName)) {
|
|
1313
|
+
defineCustomElement$l();
|
|
1314
|
+
}
|
|
1315
|
+
break;
|
|
1316
|
+
case "snk-filter-item":
|
|
1317
|
+
if (!customElements.get(tagName)) {
|
|
1318
|
+
defineCustomElement$k();
|
|
1319
|
+
}
|
|
1320
|
+
break;
|
|
1321
|
+
case "snk-filter-modal":
|
|
1322
|
+
if (!customElements.get(tagName)) {
|
|
1323
|
+
defineCustomElement$j();
|
|
1324
|
+
}
|
|
1325
|
+
break;
|
|
1326
|
+
case "snk-filter-modal-item":
|
|
1327
|
+
if (!customElements.get(tagName)) {
|
|
1328
|
+
defineCustomElement$i();
|
|
1329
|
+
}
|
|
1330
|
+
break;
|
|
1331
|
+
case "snk-filter-param-config":
|
|
1332
|
+
if (!customElements.get(tagName)) {
|
|
1333
|
+
defineCustomElement$h();
|
|
1334
|
+
}
|
|
1335
|
+
break;
|
|
1336
|
+
case "snk-grid":
|
|
1337
|
+
if (!customElements.get(tagName)) {
|
|
1338
|
+
defineCustomElement$g();
|
|
1339
|
+
}
|
|
1340
|
+
break;
|
|
1341
|
+
case "snk-grid-config":
|
|
1342
|
+
if (!customElements.get(tagName)) {
|
|
1343
|
+
defineCustomElement$f();
|
|
1344
|
+
}
|
|
1345
|
+
break;
|
|
1346
|
+
case "snk-image-input":
|
|
1347
|
+
if (!customElements.get(tagName)) {
|
|
1348
|
+
defineCustomElement$e();
|
|
1349
|
+
}
|
|
1350
|
+
break;
|
|
1351
|
+
case "snk-layout-form-config":
|
|
1352
|
+
if (!customElements.get(tagName)) {
|
|
1353
|
+
defineCustomElement$d();
|
|
1354
|
+
}
|
|
1355
|
+
break;
|
|
1356
|
+
case "snk-numbering-config":
|
|
1357
|
+
if (!customElements.get(tagName)) {
|
|
1358
|
+
defineCustomElement$c();
|
|
1359
|
+
}
|
|
1360
|
+
break;
|
|
1361
|
+
case "snk-personalized-filter":
|
|
1362
|
+
if (!customElements.get(tagName)) {
|
|
1363
|
+
defineCustomElement$b();
|
|
1364
|
+
}
|
|
1365
|
+
break;
|
|
1366
|
+
case "snk-select-box":
|
|
1367
|
+
if (!customElements.get(tagName)) {
|
|
1368
|
+
defineCustomElement$a();
|
|
1369
|
+
}
|
|
1370
|
+
break;
|
|
1371
|
+
case "snk-simple-bar":
|
|
1372
|
+
if (!customElements.get(tagName)) {
|
|
1373
|
+
defineCustomElement$9();
|
|
1374
|
+
}
|
|
1375
|
+
break;
|
|
1376
|
+
case "snk-simple-crud":
|
|
1377
|
+
if (!customElements.get(tagName)) {
|
|
1378
|
+
defineCustomElement$8();
|
|
1379
|
+
}
|
|
1380
|
+
break;
|
|
1381
|
+
case "snk-simple-form-config":
|
|
1382
|
+
if (!customElements.get(tagName)) {
|
|
1383
|
+
defineCustomElement$7();
|
|
1384
|
+
}
|
|
1385
|
+
break;
|
|
1386
|
+
case "snk-taskbar":
|
|
1387
|
+
if (!customElements.get(tagName)) {
|
|
1388
|
+
defineCustomElement$6();
|
|
1389
|
+
}
|
|
1390
|
+
break;
|
|
1391
|
+
case "snk-taskbar-skeleton":
|
|
1392
|
+
if (!customElements.get(tagName)) {
|
|
1393
|
+
defineCustomElement$5();
|
|
1394
|
+
}
|
|
1395
|
+
break;
|
|
1396
|
+
case "snk-view-representation":
|
|
1397
|
+
if (!customElements.get(tagName)) {
|
|
1398
|
+
defineCustomElement$4();
|
|
1399
|
+
}
|
|
1400
|
+
break;
|
|
1401
|
+
case "taskbar-actions-button":
|
|
1402
|
+
if (!customElements.get(tagName)) {
|
|
1403
|
+
defineCustomElement$3();
|
|
1404
|
+
}
|
|
1405
|
+
break;
|
|
1406
|
+
case "taskbar-split-button":
|
|
1407
|
+
if (!customElements.get(tagName)) {
|
|
1408
|
+
defineCustomElement$2();
|
|
1409
|
+
}
|
|
1410
|
+
break;
|
|
1411
|
+
} });
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
const snkDynaformDetailViewCss = ".sc-snk-dynaform-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;padding:var(--space--4, 4px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-track{background:transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-corner{background:transparent}.level-path.sc-snk-dynaform-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.grid-container.sc-snk-dynaform-detail-view{min-height:100px;height:100%;width:100%;display:flex;flex-wrap:wrap;text-decoration:none;border-radius:var(--border--radius-medium);background-color:var(--color--gray-70, #FFFFFF);border:1px solid var(--color--petroleum-100, #C8CCD3)}.detail-header.sc-snk-dynaform-detail-view{padding-bottom:0}snk-data-unit.sc-snk-dynaform-detail-view{flex:1;min-height:0;gap:var(--space--12, 12px);display:flex;flex-direction:column}snk-data-unit.sc-snk-dynaform-detail-view ez-view-stack.sc-snk-dynaform-detail-view{flex:1;min-height:0}snk-grid.sc-snk-dynaform-detail-view{height:100%;--snk-grid-margin:0px;--snk-grid-box-shadow:none;--snk-grid-min-height:135px}.form-and-detail-container.sc-snk-dynaform-detail-view>ez-tabselector.sc-snk-dynaform-detail-view{flex-shrink:0}.form-and-detail-container.sc-snk-dynaform-detail-view{display:flex;flex-direction:column;height:100%;width:100%;overflow:auto;padding:var(--space--12, 12px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-track{background:transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-corner{background:transparent}.ez-tabselector-internal.sc-snk-dynaform-detail-view{margin:var(--space--8, 8px) 0}.selected-record-header.sc-snk-dynaform-detail-view{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space--8, 8px) var(--space--12, 12px);padding:var(--space--12, 12px) var(--space--16, 16px);margin-bottom:var(--space--12, 12px);background:var(--color--gray-80, #F9F9F9);border-radius:var(--border--radius-12, 12px);font-family:var(--font--pattern);border:1px solid var(--color--petroleum-100, #C8CCD3);border-left:4px solid var(--color--ocean-green-500, #00B07E)}.selected-record-header--message.sc-snk-dynaform-detail-view{border-left-color:var(--color--primary, #007EFF)}.selected-record-header__message.sc-snk-dynaform-detail-view{font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--medium, 500);color:var(--color--title-primary, #2B3A54)}.selected-record-header__chip.sc-snk-dynaform-detail-view{display:inline-flex;flex-direction:row;align-items:center;gap:var(--space--4, 4px);min-width:0}.selected-record-header__label.sc-snk-dynaform-detail-view{font-size:var(--font-size--xs, 11px);font-weight:var(--font-weight--medium, 500);text-transform:uppercase;letter-spacing:0.04em;color:var(--color--text-secondary, #6E7A8A)}.selected-record-header__value.sc-snk-dynaform-detail-view{font-size:var(--font-size--md, 15px);font-weight:var(--font-weight--semibold, 600);color:var(--color--ocean-green-1000, #00281D);line-height:1.2;word-break:break-word}.selected-record-header__separator.sc-snk-dynaform-detail-view{display:inline-block;align-self:stretch;width:1px;background:var(--color--petroleum-100, #C8CCD3);margin:0 var(--space--4, 4px)}";
|
|
1415
|
+
|
|
1416
|
+
const SnkDynaformDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
1417
|
+
constructor() {
|
|
1418
|
+
super();
|
|
1419
|
+
this.__registerHost();
|
|
1420
|
+
this._taskbarProcessor = new SimpleTaskbarProcessor(DEFAULT_TASKBAR_BUTTONS);
|
|
1421
|
+
/** Evita repetir a carga inicial da grade no mesmo mount da aba. */
|
|
1422
|
+
this._didInitialLoad = false;
|
|
1423
|
+
this._currentView = 0;
|
|
1424
|
+
this.attachmentRegisterKey = undefined;
|
|
1425
|
+
this._fieldToGetFocus = undefined;
|
|
1426
|
+
this._hasToCreateFieldSearch = true;
|
|
1427
|
+
this._selectedSheet = undefined;
|
|
1428
|
+
this._internalErrorTabs = new Set();
|
|
1429
|
+
this._selectedRecordPKDisplay = undefined;
|
|
1430
|
+
this.formConfigManager = undefined;
|
|
1431
|
+
this.dataUnitName = undefined;
|
|
1432
|
+
this.resourceID = undefined;
|
|
1433
|
+
this.entityName = undefined;
|
|
1434
|
+
this.label = undefined;
|
|
1435
|
+
this.dataUnit = undefined;
|
|
1436
|
+
this.selectedForm = undefined;
|
|
1437
|
+
this.dataState = undefined;
|
|
1438
|
+
this.messagesBuilder = undefined;
|
|
1439
|
+
this.canEdit = true;
|
|
1440
|
+
this.taskbarCustomContainerId = undefined;
|
|
1441
|
+
this.customEditors = undefined;
|
|
1442
|
+
this.customRenders = undefined;
|
|
1443
|
+
this.presentationMode = PresentationMode.SECONDARY;
|
|
1444
|
+
}
|
|
1445
|
+
observeDataUnit(newDataUnit, oldDataUnit) {
|
|
1446
|
+
newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
|
1447
|
+
oldDataUnit === null || oldDataUnit === void 0 ? void 0 : oldDataUnit.unsubscribe(this.dataUnitActionHandler);
|
|
1448
|
+
}
|
|
1449
|
+
observerDataState(newValue, oldValue) {
|
|
1450
|
+
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
|
1451
|
+
const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
|
1452
|
+
if (openInsertion || closeInsertion) {
|
|
1453
|
+
this.loadMetadata();
|
|
1454
|
+
}
|
|
1455
|
+
if (this._formMetadata == undefined) {
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
if (!this.selectedSheetIsDetail()) {
|
|
1459
|
+
if (openInsertion) {
|
|
1460
|
+
setTimeout(() => {
|
|
1461
|
+
this.changeViewMode(VIEW_MODE.FORM);
|
|
1462
|
+
}, 0);
|
|
1463
|
+
}
|
|
1464
|
+
if (closeInsertion) {
|
|
1465
|
+
this.changeViewMode(VIEW_MODE.GRID);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Muda o modo de visualização do componente entre VIEW_MODE.GRID e VIEW_MODE.FORM
|
|
1471
|
+
* @param mode - Novo modo que o componente deve ser apresentado.
|
|
1472
|
+
*/
|
|
1473
|
+
async changeViewMode(mode) {
|
|
1474
|
+
if (!this._viewStack) {
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
this._viewStack.show(mode);
|
|
1478
|
+
this._currentView = mode;
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Abre o configurador de grid.
|
|
1482
|
+
*/
|
|
1483
|
+
async configGrid() {
|
|
1484
|
+
if (this._snkGrid) {
|
|
1485
|
+
this._snkGrid.showConfig();
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
async showUp() {
|
|
1489
|
+
if (this._snkFormView) {
|
|
1490
|
+
this._snkFormView.showUp();
|
|
1491
|
+
}
|
|
1492
|
+
if (this._snkGrid) {
|
|
1493
|
+
this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
1498
|
+
*/
|
|
1499
|
+
async addCustomEditor(fieldName, customEditor) {
|
|
1500
|
+
var _a, _b;
|
|
1501
|
+
const detailContext = this.normalizeDataUnitName();
|
|
1502
|
+
(_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.addCustomEditor(fieldName, customEditor, detailContext);
|
|
1503
|
+
(_b = this._snkFormView) === null || _b === void 0 ? void 0 : _b.addCustomEditor(fieldName, customEditor, detailContext);
|
|
1504
|
+
}
|
|
1505
|
+
async observerPropsCustomEditor(newValue) {
|
|
1506
|
+
for (const fieldName in newValue) {
|
|
1507
|
+
await this.addCustomEditor(fieldName, newValue[fieldName]);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Registra um render customizado para colunas da grid.
|
|
1512
|
+
*/
|
|
1513
|
+
async addGridCustomRender(fieldName, customRender) {
|
|
1514
|
+
var _a;
|
|
1515
|
+
const detailContext = this.normalizeDataUnitName();
|
|
1516
|
+
await ((_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.addGridCustomRender(fieldName, customRender, detailContext));
|
|
1517
|
+
}
|
|
1518
|
+
onContentCardChanged(evt) {
|
|
1519
|
+
SnkDynaformGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => forceUpdate(this));
|
|
1520
|
+
evt.stopPropagation();
|
|
1521
|
+
}
|
|
1522
|
+
async observeCustomRenders(newValue) {
|
|
1523
|
+
for (const field in newValue) {
|
|
1524
|
+
const customRender = newValue[field];
|
|
1525
|
+
await this.addGridCustomRender(field, customRender);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
loadMetadata() {
|
|
1529
|
+
if (!this.dataUnit || !this.formConfigManager) {
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1532
|
+
if (!this.formConfigManager.isLoaded) {
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
1536
|
+
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
1537
|
+
this.initSelectedSheet();
|
|
1538
|
+
}
|
|
1539
|
+
initSelectedSheet() {
|
|
1540
|
+
if (!this._formMetadata) {
|
|
1541
|
+
this._selectedSheet = undefined;
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
const sheets = this._formMetadata.getAllSheets();
|
|
1545
|
+
if (!sheets || sheets.size === 0) {
|
|
1546
|
+
this._selectedSheet = undefined;
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
// Mantém a aba atual caso ela ainda exista e não seja a área principal.
|
|
1550
|
+
if (this._selectedSheet && this._selectedSheet.name !== SnkDynaformDetailView.MAIN_TAB) {
|
|
1551
|
+
const current = sheets.get(this._selectedSheet.name);
|
|
1552
|
+
if (current) {
|
|
1553
|
+
this._selectedSheet = current;
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
// Caso contrário, seleciona o primeiro sheet que não seja a área principal (primeira aba).
|
|
1558
|
+
this._selectedSheet = this.getFirstNonMainSheet(sheets);
|
|
1559
|
+
}
|
|
1560
|
+
getFirstNonMainSheet(sheets) {
|
|
1561
|
+
for (const [name, sheet] of sheets) {
|
|
1562
|
+
if (name !== SnkDynaformDetailView.MAIN_TAB) {
|
|
1563
|
+
return sheet;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
return undefined;
|
|
1567
|
+
}
|
|
1568
|
+
dataUnitReadyHandler(evt) {
|
|
1569
|
+
this.dataUnit = evt.detail;
|
|
1570
|
+
this.loadMetadata();
|
|
1571
|
+
this.ensureInitialLoad();
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* Dispara a carga inicial da grade quando a aba é montada com o master já
|
|
1575
|
+
* selecionado. A carga do filho normalmente é disparada pelo evento de troca
|
|
1576
|
+
* de seleção do master; uma aba montada tardiamente (aberta depois que o
|
|
1577
|
+
* registro master já estava selecionado) não recebe esse evento e ficaria
|
|
1578
|
+
* vazia até um refresh manual. Navegações seguintes do master continuam
|
|
1579
|
+
* recarregando pela assinatura existente do DataUnit.
|
|
1580
|
+
*/
|
|
1581
|
+
ensureInitialLoad() {
|
|
1582
|
+
var _a, _b, _c, _d, _e;
|
|
1583
|
+
if (this._didInitialLoad) {
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
const dataUnit = this.dataUnit;
|
|
1587
|
+
const parentDataUnit = (_a = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getParentDataUnit) === null || _a === void 0 ? void 0 : _a.call(dataUnit);
|
|
1588
|
+
if (((_b = parentDataUnit === null || parentDataUnit === void 0 ? void 0 : parentDataUnit.getSelectedRecord) === null || _b === void 0 ? void 0 : _b.call(parentDataUnit)) && ((_d = (_c = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.records) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) === 0) {
|
|
1589
|
+
this._didInitialLoad = true;
|
|
1590
|
+
(_e = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.loadData) === null || _e === void 0 ? void 0 : _e.call(dataUnit);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
getFormFields() {
|
|
1594
|
+
var _a, _b, _c;
|
|
1595
|
+
const mainSheet = (_b = (_a = this._formMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets()) === null || _b === void 0 ? void 0 : _b.get(SnkDynaformDetailView.MAIN_TAB);
|
|
1596
|
+
return (_c = mainSheet === null || mainSheet === void 0 ? void 0 : mainSheet.fields) !== null && _c !== void 0 ? _c : [];
|
|
1597
|
+
}
|
|
1598
|
+
hasNonMainSheets() {
|
|
1599
|
+
if (!this._formMetadata) {
|
|
1600
|
+
return false;
|
|
1601
|
+
}
|
|
1602
|
+
for (const name of this._formMetadata.getAllSheets().keys()) {
|
|
1603
|
+
if (name !== SnkDynaformDetailView.MAIN_TAB) {
|
|
1604
|
+
return true;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
return false;
|
|
1608
|
+
}
|
|
1609
|
+
selectedSheetIsDetail() {
|
|
1610
|
+
return !!this._selectedSheet && FormMetadata.getDetailName(this._selectedSheet.name) != undefined;
|
|
1611
|
+
}
|
|
1612
|
+
isSheetDisabled(sheet) {
|
|
1613
|
+
var _a;
|
|
1614
|
+
if (FormMetadata.getDetailName(sheet.name) == undefined) {
|
|
1615
|
+
return false;
|
|
1616
|
+
}
|
|
1617
|
+
const currentRecord = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecord();
|
|
1618
|
+
if (!currentRecord || !this.dataUnit) {
|
|
1619
|
+
return true;
|
|
1620
|
+
}
|
|
1621
|
+
return this.dataUnit.isNewRecord(currentRecord.__record__id__) || this.dataUnit.isMultipleEdition;
|
|
1622
|
+
}
|
|
1623
|
+
buildInternalTabItems() {
|
|
1624
|
+
if (!this._formMetadata) {
|
|
1625
|
+
return [];
|
|
1626
|
+
}
|
|
1627
|
+
const sheets = Array.from(this._formMetadata.getAllSheets().values());
|
|
1628
|
+
const nonMainSheets = sheets.filter((sheet) => sheet.name !== SnkDynaformDetailView.MAIN_TAB);
|
|
1629
|
+
return nonMainSheets.map((sheet, index) => ({
|
|
1630
|
+
tabKey: sheet.name,
|
|
1631
|
+
label: sheet.label,
|
|
1632
|
+
index,
|
|
1633
|
+
disabled: this.isSheetDisabled(sheet),
|
|
1634
|
+
rightIcon: this._internalErrorTabs.has(sheet.name) ? 'alert-circle-inverted' : undefined,
|
|
1635
|
+
}));
|
|
1636
|
+
}
|
|
1637
|
+
onInternalTabChange(tab) {
|
|
1638
|
+
var _a, _b;
|
|
1639
|
+
// A área principal (__main) é sempre visível e não é uma aba selecionável.
|
|
1640
|
+
if (tab.tabKey === SnkDynaformDetailView.MAIN_TAB) {
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
const matchedSheet = (_b = (_a = this._formMetadata) === null || _a === void 0 ? void 0 : _a.getAllSheets()) === null || _b === void 0 ? void 0 : _b.get(tab.tabKey);
|
|
1644
|
+
if (!matchedSheet || this.isSheetDisabled(matchedSheet)) {
|
|
1645
|
+
return;
|
|
1646
|
+
}
|
|
1647
|
+
this._selectedSheet = matchedSheet;
|
|
1648
|
+
}
|
|
1649
|
+
executeActionHandler(evt) {
|
|
1650
|
+
var _a;
|
|
1651
|
+
if (evt.detail === TaskbarElement.GRID_MODE) {
|
|
1652
|
+
this.changeViewMode(VIEW_MODE.GRID);
|
|
1653
|
+
evt.stopPropagation();
|
|
1654
|
+
}
|
|
1655
|
+
if (evt.detail === TaskbarElement.UPDATE_MULTIPLE && this.dataUnit) {
|
|
1656
|
+
this.dataUnit.isMultipleEdition = true;
|
|
1657
|
+
this.changeViewMode(VIEW_MODE.FORM);
|
|
1658
|
+
evt.stopPropagation();
|
|
1659
|
+
}
|
|
1660
|
+
if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE || evt.detail === TaskbarElement.INSERT) {
|
|
1661
|
+
this.changeViewMode(VIEW_MODE.FORM);
|
|
1662
|
+
evt.stopPropagation();
|
|
1663
|
+
}
|
|
1664
|
+
if (evt.detail === TaskbarElement.ATTACH) {
|
|
1665
|
+
(_a = this._snkAttach) === null || _a === void 0 ? void 0 : _a.open();
|
|
1666
|
+
evt.stopPropagation();
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
async getAttachmentRegisterKey() {
|
|
1670
|
+
if (!this._snkDataUnit) {
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
const recordCriteria = await this._snkDataUnit.getSelectedRecordsIDsInfo();
|
|
1674
|
+
const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
|
|
1675
|
+
return joinedPrimaryKeys;
|
|
1676
|
+
}
|
|
1677
|
+
async handleDataStateChange({ detail: dataState }) {
|
|
1678
|
+
var _a;
|
|
1679
|
+
this.dataState = dataState;
|
|
1680
|
+
if (dataState.selectedRecord !== undefined && this._snkDataUnit) {
|
|
1681
|
+
this.attachmentRegisterKey = (_a = await this.getAttachmentRegisterKey()) !== null && _a !== void 0 ? _a : undefined;
|
|
1682
|
+
}
|
|
1683
|
+
this._selectedRecordPKDisplay = this.buildSelectedRecordPKDisplay();
|
|
1684
|
+
}
|
|
1685
|
+
buildSelectedRecordPKDisplay() {
|
|
1686
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1687
|
+
if (!this.dataUnit) {
|
|
1688
|
+
return undefined;
|
|
1689
|
+
}
|
|
1690
|
+
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) {
|
|
1691
|
+
const message = (_b = this.messagesBuilder) === null || _b === void 0 ? void 0 : _b.getMessage("snkCrud.newRecord");
|
|
1692
|
+
return message ? { message } : undefined;
|
|
1693
|
+
}
|
|
1694
|
+
const selectedRecord = this.dataUnit.getSelectedRecord();
|
|
1695
|
+
if (!selectedRecord) {
|
|
1696
|
+
return undefined;
|
|
1697
|
+
}
|
|
1698
|
+
const items = [];
|
|
1699
|
+
const fields = (_d = (_c = this.dataUnit.metadata) === null || _c === void 0 ? void 0 : _c.fields) !== null && _d !== void 0 ? _d : [];
|
|
1700
|
+
for (const field of fields) {
|
|
1701
|
+
if (((_e = field.properties) === null || _e === void 0 ? void 0 : _e.isPrimaryKey) !== "true") {
|
|
1702
|
+
continue;
|
|
1703
|
+
}
|
|
1704
|
+
const rawValue = selectedRecord[field.name];
|
|
1705
|
+
const value = (_f = rawValue === null || rawValue === void 0 ? void 0 : rawValue.value) !== null && _f !== void 0 ? _f : rawValue;
|
|
1706
|
+
if (value === undefined || value === null || value === "") {
|
|
1707
|
+
continue;
|
|
1708
|
+
}
|
|
1709
|
+
items.push({ label: (_g = field.label) !== null && _g !== void 0 ? _g : field.name, value: String(value) });
|
|
1710
|
+
}
|
|
1711
|
+
return items.length ? { items } : undefined;
|
|
1712
|
+
}
|
|
1713
|
+
renderSelectedRecordHeader() {
|
|
1714
|
+
var _a;
|
|
1715
|
+
if (!this.label && !this._selectedRecordPKDisplay) {
|
|
1716
|
+
return undefined;
|
|
1717
|
+
}
|
|
1718
|
+
const display = this._selectedRecordPKDisplay;
|
|
1719
|
+
if (!display) {
|
|
1720
|
+
return undefined;
|
|
1721
|
+
}
|
|
1722
|
+
if (display.message) {
|
|
1723
|
+
return (h("div", { class: "selected-record-header selected-record-header--message" }, h("span", { class: "selected-record-header__message" }, display.message)));
|
|
1724
|
+
}
|
|
1725
|
+
if (!((_a = display.items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1726
|
+
return undefined;
|
|
1727
|
+
}
|
|
1728
|
+
return (h("div", { class: "selected-record-header", role: "group" }, display.items.map((item, index) => [
|
|
1729
|
+
index > 0 && h("span", { class: "selected-record-header__separator", "aria-hidden": "true" }),
|
|
1730
|
+
h("div", { class: "selected-record-header__chip" }, h("span", { class: "selected-record-header__label" }, item.label, ":"), h("span", { class: "selected-record-header__value" }, item.value))
|
|
1731
|
+
])));
|
|
1732
|
+
}
|
|
1733
|
+
componentWillLoad() {
|
|
1734
|
+
var _a;
|
|
1735
|
+
this._configName = `dynaform.${this.entityName}`;
|
|
1736
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, (_a = this.resourceID) !== null && _a !== void 0 ? _a : '', () => this.loadMetadata(), this.dataUnit);
|
|
1737
|
+
this.formConfigManager.loadConfig();
|
|
1738
|
+
if (this.messagesBuilder == undefined) {
|
|
1739
|
+
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
componentWillRender() {
|
|
1743
|
+
this.initializeTaskbarProcessor();
|
|
1744
|
+
}
|
|
1745
|
+
initializeTaskbarProcessor() {
|
|
1746
|
+
if (!this.dataState) {
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
const detailTaskbarManager = this.buildDetailTaskbarManager();
|
|
1750
|
+
const topTaskbarId = getTopTaskBarId(this.dataState, this.presentationMode);
|
|
1751
|
+
this._taskbarProcessor.process(topTaskbarId, detailTaskbarManager, this.dataState, [], []);
|
|
1752
|
+
}
|
|
1753
|
+
buildDetailTaskbarManager() {
|
|
1754
|
+
const EDITION_MODE_BUTTONS = [
|
|
1755
|
+
TaskbarElement.CANCEL,
|
|
1756
|
+
TaskbarElement.SAVE,
|
|
1757
|
+
];
|
|
1758
|
+
const currentView = this._currentView;
|
|
1759
|
+
return {
|
|
1760
|
+
getButtons: (taskbarID, dataState, defaultButtons) => {
|
|
1761
|
+
var _a, _b, _c;
|
|
1762
|
+
if (!taskbarID) {
|
|
1763
|
+
return [];
|
|
1764
|
+
}
|
|
1765
|
+
const isInEditionMode = (dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty);
|
|
1766
|
+
if (isInEditionMode) {
|
|
1767
|
+
return EDITION_MODE_BUTTONS;
|
|
1768
|
+
}
|
|
1769
|
+
let buttons = [...defaultButtons];
|
|
1770
|
+
if (currentView === VIEW_MODE.FORM) {
|
|
1771
|
+
const indexFormMode = buttons.indexOf(TaskbarElement.FORM_MODE);
|
|
1772
|
+
if (indexFormMode > -1) {
|
|
1773
|
+
buttons = [
|
|
1774
|
+
...buttons.slice(0, indexFormMode),
|
|
1775
|
+
TaskbarElement.GRID_MODE,
|
|
1776
|
+
...buttons.slice(indexFormMode + 1),
|
|
1777
|
+
];
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
if (((_c = (_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) !== null && _c !== void 0 ? _c : 0) > 1) {
|
|
1781
|
+
const indexUpdate = buttons.indexOf(TaskbarElement.UPDATE);
|
|
1782
|
+
if (indexUpdate > -1) {
|
|
1783
|
+
buttons = [
|
|
1784
|
+
...buttons.slice(0, indexUpdate),
|
|
1785
|
+
TaskbarElement.UPDATE_MULTIPLE,
|
|
1786
|
+
...buttons.slice(indexUpdate + 1),
|
|
1787
|
+
];
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
return buttons;
|
|
1791
|
+
},
|
|
1792
|
+
isEnabled: (_, dataState, buttonName, originalValue) => {
|
|
1793
|
+
if (!dataState) {
|
|
1794
|
+
return originalValue;
|
|
1795
|
+
}
|
|
1796
|
+
const hasSelectedRecord = dataState.selectedRecord !== undefined;
|
|
1797
|
+
const buttonsRequiringSelection = [
|
|
1798
|
+
TaskbarElement.UPDATE,
|
|
1799
|
+
TaskbarElement.REMOVE,
|
|
1800
|
+
TaskbarElement.ATTACH,
|
|
1801
|
+
TaskbarElement.CLONE,
|
|
1802
|
+
];
|
|
1803
|
+
if (!hasSelectedRecord && buttonsRequiringSelection.includes(buttonName)) {
|
|
1804
|
+
return false;
|
|
1805
|
+
}
|
|
1806
|
+
if (buttonName === TaskbarElement.PREVIOUS && !dataState.hasPrevious) {
|
|
1807
|
+
return false;
|
|
1808
|
+
}
|
|
1809
|
+
if (buttonName === TaskbarElement.NEXT && !dataState.hasNext) {
|
|
1810
|
+
return false;
|
|
1811
|
+
}
|
|
1812
|
+
if (buttonName === TaskbarElement.INSERT && dataState.insertionMode) {
|
|
1813
|
+
return false;
|
|
1814
|
+
}
|
|
1815
|
+
return originalValue;
|
|
1816
|
+
},
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
async componentDidLoad() {
|
|
1820
|
+
if (this.customEditors) {
|
|
1821
|
+
await this.observerPropsCustomEditor(this.customEditors);
|
|
1822
|
+
}
|
|
1823
|
+
if (this.customRenders) {
|
|
1824
|
+
await this.observeCustomRenders(this.customRenders);
|
|
1825
|
+
}
|
|
1826
|
+
this.initKeyboardManager();
|
|
1827
|
+
}
|
|
1828
|
+
disconnectedCallback() {
|
|
1829
|
+
var _a;
|
|
1830
|
+
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
1831
|
+
}
|
|
1832
|
+
async dataUnitActionHandler(action) {
|
|
1833
|
+
var _a;
|
|
1834
|
+
if (action.type === Action.FIELD_INVALIDATED) {
|
|
1835
|
+
const sheetName = this.findSheetOfField((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fieldName);
|
|
1836
|
+
if (sheetName) {
|
|
1837
|
+
this._internalErrorTabs = new Set([...this._internalErrorTabs, sheetName]);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
findSheetOfField(fieldName) {
|
|
1842
|
+
var _a;
|
|
1843
|
+
if (!fieldName || !this._formMetadata) {
|
|
1844
|
+
return undefined;
|
|
1845
|
+
}
|
|
1846
|
+
const sheets = this._formMetadata.getAllSheets();
|
|
1847
|
+
for (const [sheetName, sheet] of sheets) {
|
|
1848
|
+
if ((_a = sheet.fields) === null || _a === void 0 ? void 0 : _a.some((f) => f.name === fieldName)) {
|
|
1849
|
+
return sheetName;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
return undefined;
|
|
1853
|
+
}
|
|
1854
|
+
normalizeDataUnitName() {
|
|
1855
|
+
var _a, _b;
|
|
1856
|
+
return (_b = (_a = this.dataUnitName) === null || _a === void 0 ? void 0 : _a.replace(/\//g, '>')) !== null && _b !== void 0 ? _b : '';
|
|
1857
|
+
}
|
|
1858
|
+
getSettingsListForm() {
|
|
1859
|
+
var _a, _b;
|
|
1860
|
+
const hardList = [{
|
|
1861
|
+
value: StringUtils.generateUUID(),
|
|
1862
|
+
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "",
|
|
1863
|
+
disableCloseOnSelect: true,
|
|
1864
|
+
eagerInitialize: true,
|
|
1865
|
+
itemBuilder: (_, item) => this.getFieldsSearch(item)
|
|
1866
|
+
}];
|
|
1867
|
+
return hardList;
|
|
1868
|
+
}
|
|
1869
|
+
getFieldsSearch(item) {
|
|
1870
|
+
var _a;
|
|
1871
|
+
if (this._fieldSearch === undefined || this._hasToCreateFieldSearch) {
|
|
1872
|
+
this._hasToCreateFieldSearch = false;
|
|
1873
|
+
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
|
1874
|
+
}
|
|
1875
|
+
return (_a = this._fieldSearch) !== null && _a !== void 0 ? _a : document.createElement('div');
|
|
1876
|
+
}
|
|
1877
|
+
fieldsOptionLoader(argument) {
|
|
1878
|
+
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
|
1879
|
+
const allFields = this.getFormFields().map(field => { var _a; return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field.name); });
|
|
1880
|
+
const filteredFields = allFields.filter(field => {
|
|
1881
|
+
var _a, _b;
|
|
1882
|
+
if (!field) {
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
|
|
1886
|
+
((_b = field.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
|
|
1887
|
+
});
|
|
1888
|
+
const options = filteredFields.map((field) => {
|
|
1889
|
+
if (!field) {
|
|
1890
|
+
return;
|
|
1891
|
+
}
|
|
1892
|
+
return ({ value: field.name, label: field.label });
|
|
1893
|
+
});
|
|
1894
|
+
return Promise.resolve(options);
|
|
1895
|
+
}
|
|
1896
|
+
onSelectField(option) {
|
|
1897
|
+
if (option == undefined) {
|
|
1898
|
+
return;
|
|
1899
|
+
}
|
|
1900
|
+
this._fieldToGetFocus = option.value;
|
|
1901
|
+
}
|
|
1902
|
+
clearFieldToFocusHandler() {
|
|
1903
|
+
this._fieldToGetFocus = undefined;
|
|
1904
|
+
}
|
|
1905
|
+
getColumnSearch(item) {
|
|
1906
|
+
var _a;
|
|
1907
|
+
if (this._columnSearch !== undefined) {
|
|
1908
|
+
return this._columnSearch;
|
|
1909
|
+
}
|
|
1910
|
+
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
|
1911
|
+
var _a;
|
|
1912
|
+
(_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.filterColumns(argument).then((columns) => {
|
|
1913
|
+
accept(columns
|
|
1914
|
+
.filter(column => !column.hidden)
|
|
1915
|
+
.map(column => ({ label: column.label, value: column.name })));
|
|
1916
|
+
});
|
|
1917
|
+
}), (option) => {
|
|
1918
|
+
var _a;
|
|
1919
|
+
if (option != undefined) {
|
|
1920
|
+
(_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.locateColumn(option.value);
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
return (_a = this._columnSearch) !== null && _a !== void 0 ? _a : document.createElement('div');
|
|
1924
|
+
}
|
|
1925
|
+
buildTaskbarCustomActionsList() {
|
|
1926
|
+
return [this.buildSearchColumnTaskbarAction()];
|
|
1927
|
+
}
|
|
1928
|
+
buildSearchColumnTaskbarAction() {
|
|
1929
|
+
var _a, _b;
|
|
1930
|
+
return {
|
|
1931
|
+
value: StringUtils.generateUUID(),
|
|
1932
|
+
label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage('snkGrid.findColumn', {})) !== null && _b !== void 0 ? _b : "",
|
|
1933
|
+
disableCloseOnSelect: true,
|
|
1934
|
+
eagerInitialize: true,
|
|
1935
|
+
itemBuilder: (_, item) => { var _a; return (_a = this.getColumnSearch(item)) !== null && _a !== void 0 ? _a : document.createElement('div'); },
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
async initKeyboardManager() {
|
|
1939
|
+
var _a;
|
|
1940
|
+
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
|
1941
|
+
this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
|
|
1942
|
+
var _a;
|
|
1943
|
+
await ((_a = this._snkFormView) === null || _a === void 0 ? void 0 : _a.showSearchField());
|
|
1944
|
+
}, { description: (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findFields"), element: this._element });
|
|
1945
|
+
}
|
|
1946
|
+
renderTabSelector() {
|
|
1947
|
+
if (!this.hasNonMainSheets()) {
|
|
1948
|
+
return undefined;
|
|
1949
|
+
}
|
|
1950
|
+
const selectedKey = this._selectedSheet && this._selectedSheet.name !== SnkDynaformDetailView.MAIN_TAB
|
|
1951
|
+
? this._selectedSheet.name
|
|
1952
|
+
: undefined;
|
|
1953
|
+
return (h("ez-tabselector", { class: "ez-tabselector-internal", tabs: this.buildInternalTabItems(), selectedTab: selectedKey, onEzChange: (evt) => this.onInternalTabChange(evt.detail) }));
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Renderiza o conteúdo da aba selecionada, seguindo as mesmas regras do
|
|
1957
|
+
* formulário master (snk-dynaform-guides-view.getContent):
|
|
1958
|
+
* - Sheet de detalhe (child[...]) → snk-dynaform-detail-view aninhado.
|
|
1959
|
+
* - Sheet de formulário (ex.: "Geral") → snk-dynaform-form-view com os campos do sheet.
|
|
1960
|
+
*/
|
|
1961
|
+
renderSelectedSheetContent() {
|
|
1962
|
+
if (!this._selectedSheet || this._selectedSheet.name === SnkDynaformDetailView.MAIN_TAB) {
|
|
1963
|
+
return undefined;
|
|
1964
|
+
}
|
|
1965
|
+
const childEntityName = FormMetadata.getDetailName(this._selectedSheet.name);
|
|
1966
|
+
if (childEntityName) {
|
|
1967
|
+
return (h("snk-dynaform-detail-view", { key: `sub_${this.dataUnitName}_${this._selectedSheet.name}`, dataUnitName: `${this.dataUnitName}/${childEntityName}`, entityName: childEntityName, label: this._selectedSheet.label, resourceID: this.resourceID, canEdit: this.canEdit, messagesBuilder: this.messagesBuilder, customEditors: this.customEditors, customRenders: this.customRenders, presentationMode: this.presentationMode, taskbarCustomContainerId: this.taskbarCustomContainerId }));
|
|
1968
|
+
}
|
|
1969
|
+
return (h("snk-dynaform-form-view", { key: `sheet_${this._selectedSheet.name}`, name: this._selectedSheet.name, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this._selectedSheet.fields, fieldToFocus: this._fieldToGetFocus, label: this._selectedSheet.label, onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }));
|
|
1970
|
+
}
|
|
1971
|
+
renderViewStack() {
|
|
1972
|
+
var _a, _b;
|
|
1973
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", { class: "ez-size-width--full ez-size-height--full" }, h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => {
|
|
1974
|
+
if (ref)
|
|
1975
|
+
this._snkGrid = ref;
|
|
1976
|
+
}, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.changeViewMode(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: true, enableGridInsert: true, autoLoad: true, multipleEditionEnabled: true, multipleSelection: true, hideHeader: true, hideGridTaskbar: true })), h("stack-item", { class: "ez-size-width--full ez-size-height--full grid-container" }, h("div", { class: "form-and-detail-container" }, h("snk-dynaform-form-view", { ref: (ref) => {
|
|
1977
|
+
if (ref)
|
|
1978
|
+
this._snkFormView = ref;
|
|
1979
|
+
}, name: SnkDynaformDetailView.MAIN_TAB, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }, this.renderSelectedRecordHeader()), this.renderTabSelector(), this.renderSelectedSheetContent())), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: (_a = this.attachmentRegisterKey) !== null && _a !== void 0 ? _a : '', messagesBuilder: this.messagesBuilder, entityName: (_b = this.entityName) !== null && _b !== void 0 ? _b : '' })));
|
|
1980
|
+
}
|
|
1981
|
+
render() {
|
|
1982
|
+
return (h(Host, null, h("snk-data-unit", { ref: (el) => {
|
|
1983
|
+
if (el)
|
|
1984
|
+
this._snkDataUnit = el;
|
|
1985
|
+
}, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("snk-taskbar", { key: "detailViewTaskbar", class: "form-taskbar", "data-element-id": "detail_top", configName: this._configName, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, sizeButtons: 'small', presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm(), customActionsList: this.buildTaskbarCustomActionsList() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })), this.renderViewStack())));
|
|
1986
|
+
}
|
|
1987
|
+
get _element() { return this; }
|
|
1988
|
+
static get watchers() { return {
|
|
1989
|
+
"dataUnit": ["observeDataUnit"],
|
|
1990
|
+
"dataState": ["observerDataState"],
|
|
1991
|
+
"customEditors": ["observerPropsCustomEditor"],
|
|
1992
|
+
"customRenders": ["observeCustomRenders"]
|
|
1993
|
+
}; }
|
|
1994
|
+
static get style() { return snkDynaformDetailViewCss; }
|
|
1995
|
+
}, [6, "snk-dynaform-detail-view", {
|
|
1996
|
+
"formConfigManager": [1040],
|
|
1997
|
+
"dataUnitName": [1, "data-unit-name"],
|
|
1998
|
+
"resourceID": [1, "resource-i-d"],
|
|
1999
|
+
"entityName": [1, "entity-name"],
|
|
2000
|
+
"label": [1],
|
|
2001
|
+
"dataUnit": [1040],
|
|
2002
|
+
"selectedForm": [1025, "selected-form"],
|
|
2003
|
+
"dataState": [1040],
|
|
2004
|
+
"messagesBuilder": [1040],
|
|
2005
|
+
"canEdit": [4, "can-edit"],
|
|
2006
|
+
"taskbarCustomContainerId": [1, "taskbar-custom-container-id"],
|
|
2007
|
+
"customEditors": [16],
|
|
2008
|
+
"customRenders": [16],
|
|
2009
|
+
"presentationMode": [1, "presentation-mode"],
|
|
2010
|
+
"_currentView": [32],
|
|
2011
|
+
"attachmentRegisterKey": [32],
|
|
2012
|
+
"_fieldToGetFocus": [32],
|
|
2013
|
+
"_hasToCreateFieldSearch": [32],
|
|
2014
|
+
"_selectedSheet": [32],
|
|
2015
|
+
"_internalErrorTabs": [32],
|
|
2016
|
+
"_selectedRecordPKDisplay": [32],
|
|
2017
|
+
"changeViewMode": [64],
|
|
2018
|
+
"configGrid": [64],
|
|
2019
|
+
"showUp": [64],
|
|
2020
|
+
"addCustomEditor": [64],
|
|
2021
|
+
"addGridCustomRender": [64]
|
|
2022
|
+
}, [[0, "snkContentCardChanged", "onContentCardChanged"]]]);
|
|
2023
|
+
SnkDynaformDetailView.MAIN_TAB = "__main";
|
|
2024
|
+
function defineCustomElement() {
|
|
2025
|
+
if (typeof customElements === "undefined") {
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2028
|
+
const components = ["snk-dynaform-detail-view", "snk-actions-button", "snk-attach", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-default-filter", "snk-dynaform-detail-view", "snk-dynaform-form-view", "snk-exporter-email-sender", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-bar", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-modal", "snk-filter-modal-item", "snk-filter-param-config", "snk-grid", "snk-grid-config", "snk-image-input", "snk-layout-form-config", "snk-numbering-config", "snk-personalized-filter", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-simple-form-config", "snk-taskbar", "snk-taskbar-skeleton", "snk-view-representation", "taskbar-actions-button", "taskbar-split-button"];
|
|
2029
|
+
components.forEach(tagName => { switch (tagName) {
|
|
2030
|
+
case "snk-dynaform-detail-view":
|
|
2031
|
+
if (!customElements.get(tagName)) {
|
|
2032
|
+
customElements.define(tagName, SnkDynaformDetailView);
|
|
2033
|
+
}
|
|
2034
|
+
break;
|
|
2035
|
+
case "snk-actions-button":
|
|
2036
|
+
if (!customElements.get(tagName)) {
|
|
2037
|
+
defineCustomElement$H();
|
|
2038
|
+
}
|
|
2039
|
+
break;
|
|
2040
|
+
case "snk-attach":
|
|
2041
|
+
if (!customElements.get(tagName)) {
|
|
2042
|
+
defineCustomElement$G();
|
|
2043
|
+
}
|
|
2044
|
+
break;
|
|
2045
|
+
case "snk-configurator":
|
|
2046
|
+
if (!customElements.get(tagName)) {
|
|
2047
|
+
defineCustomElement$F();
|
|
2048
|
+
}
|
|
2049
|
+
break;
|
|
2050
|
+
case "snk-data-exporter":
|
|
2051
|
+
if (!customElements.get(tagName)) {
|
|
2052
|
+
defineCustomElement$E();
|
|
2053
|
+
}
|
|
2054
|
+
break;
|
|
2055
|
+
case "snk-data-unit":
|
|
2056
|
+
if (!customElements.get(tagName)) {
|
|
2057
|
+
defineCustomElement$D();
|
|
2058
|
+
}
|
|
2059
|
+
break;
|
|
2060
|
+
case "snk-default-filter":
|
|
2061
|
+
if (!customElements.get(tagName)) {
|
|
2062
|
+
defineCustomElement$C();
|
|
2063
|
+
}
|
|
2064
|
+
break;
|
|
2065
|
+
case "snk-dynaform-detail-view":
|
|
2066
|
+
if (!customElements.get(tagName)) {
|
|
2067
|
+
defineCustomElement();
|
|
2068
|
+
}
|
|
2069
|
+
break;
|
|
2070
|
+
case "snk-dynaform-form-view":
|
|
2071
|
+
if (!customElements.get(tagName)) {
|
|
2072
|
+
defineCustomElement$u();
|
|
2073
|
+
}
|
|
2074
|
+
break;
|
|
2075
|
+
case "snk-exporter-email-sender":
|
|
2076
|
+
if (!customElements.get(tagName)) {
|
|
2077
|
+
defineCustomElement$s();
|
|
2078
|
+
}
|
|
2079
|
+
break;
|
|
2080
|
+
case "snk-expression-group":
|
|
2081
|
+
if (!customElements.get(tagName)) {
|
|
2082
|
+
defineCustomElement$r();
|
|
2083
|
+
}
|
|
2084
|
+
break;
|
|
2085
|
+
case "snk-expression-item":
|
|
2086
|
+
if (!customElements.get(tagName)) {
|
|
2087
|
+
defineCustomElement$q();
|
|
2088
|
+
}
|
|
2089
|
+
break;
|
|
2090
|
+
case "snk-filter-advanced-mode":
|
|
2091
|
+
if (!customElements.get(tagName)) {
|
|
2092
|
+
defineCustomElement$p();
|
|
2093
|
+
}
|
|
2094
|
+
break;
|
|
2095
|
+
case "snk-filter-assistent-mode":
|
|
2096
|
+
if (!customElements.get(tagName)) {
|
|
2097
|
+
defineCustomElement$o();
|
|
2098
|
+
}
|
|
2099
|
+
break;
|
|
2100
|
+
case "snk-filter-bar":
|
|
2101
|
+
if (!customElements.get(tagName)) {
|
|
2102
|
+
defineCustomElement$n();
|
|
2103
|
+
}
|
|
2104
|
+
break;
|
|
2105
|
+
case "snk-filter-detail":
|
|
2106
|
+
if (!customElements.get(tagName)) {
|
|
2107
|
+
defineCustomElement$m();
|
|
2108
|
+
}
|
|
2109
|
+
break;
|
|
2110
|
+
case "snk-filter-field-search":
|
|
2111
|
+
if (!customElements.get(tagName)) {
|
|
2112
|
+
defineCustomElement$l();
|
|
2113
|
+
}
|
|
2114
|
+
break;
|
|
2115
|
+
case "snk-filter-item":
|
|
2116
|
+
if (!customElements.get(tagName)) {
|
|
2117
|
+
defineCustomElement$k();
|
|
2118
|
+
}
|
|
2119
|
+
break;
|
|
2120
|
+
case "snk-filter-modal":
|
|
2121
|
+
if (!customElements.get(tagName)) {
|
|
2122
|
+
defineCustomElement$j();
|
|
2123
|
+
}
|
|
2124
|
+
break;
|
|
2125
|
+
case "snk-filter-modal-item":
|
|
2126
|
+
if (!customElements.get(tagName)) {
|
|
2127
|
+
defineCustomElement$i();
|
|
2128
|
+
}
|
|
2129
|
+
break;
|
|
2130
|
+
case "snk-filter-param-config":
|
|
2131
|
+
if (!customElements.get(tagName)) {
|
|
2132
|
+
defineCustomElement$h();
|
|
2133
|
+
}
|
|
2134
|
+
break;
|
|
2135
|
+
case "snk-grid":
|
|
2136
|
+
if (!customElements.get(tagName)) {
|
|
2137
|
+
defineCustomElement$g();
|
|
2138
|
+
}
|
|
2139
|
+
break;
|
|
2140
|
+
case "snk-grid-config":
|
|
2141
|
+
if (!customElements.get(tagName)) {
|
|
2142
|
+
defineCustomElement$f();
|
|
2143
|
+
}
|
|
2144
|
+
break;
|
|
2145
|
+
case "snk-image-input":
|
|
2146
|
+
if (!customElements.get(tagName)) {
|
|
2147
|
+
defineCustomElement$e();
|
|
2148
|
+
}
|
|
2149
|
+
break;
|
|
2150
|
+
case "snk-layout-form-config":
|
|
2151
|
+
if (!customElements.get(tagName)) {
|
|
2152
|
+
defineCustomElement$d();
|
|
2153
|
+
}
|
|
2154
|
+
break;
|
|
2155
|
+
case "snk-numbering-config":
|
|
2156
|
+
if (!customElements.get(tagName)) {
|
|
2157
|
+
defineCustomElement$c();
|
|
2158
|
+
}
|
|
2159
|
+
break;
|
|
2160
|
+
case "snk-personalized-filter":
|
|
2161
|
+
if (!customElements.get(tagName)) {
|
|
2162
|
+
defineCustomElement$b();
|
|
2163
|
+
}
|
|
2164
|
+
break;
|
|
2165
|
+
case "snk-select-box":
|
|
2166
|
+
if (!customElements.get(tagName)) {
|
|
2167
|
+
defineCustomElement$a();
|
|
2168
|
+
}
|
|
2169
|
+
break;
|
|
2170
|
+
case "snk-simple-bar":
|
|
2171
|
+
if (!customElements.get(tagName)) {
|
|
2172
|
+
defineCustomElement$9();
|
|
2173
|
+
}
|
|
2174
|
+
break;
|
|
2175
|
+
case "snk-simple-crud":
|
|
2176
|
+
if (!customElements.get(tagName)) {
|
|
2177
|
+
defineCustomElement$8();
|
|
2178
|
+
}
|
|
2179
|
+
break;
|
|
2180
|
+
case "snk-simple-form-config":
|
|
2181
|
+
if (!customElements.get(tagName)) {
|
|
2182
|
+
defineCustomElement$7();
|
|
2183
|
+
}
|
|
2184
|
+
break;
|
|
2185
|
+
case "snk-taskbar":
|
|
2186
|
+
if (!customElements.get(tagName)) {
|
|
2187
|
+
defineCustomElement$6();
|
|
2188
|
+
}
|
|
2189
|
+
break;
|
|
2190
|
+
case "snk-taskbar-skeleton":
|
|
2191
|
+
if (!customElements.get(tagName)) {
|
|
2192
|
+
defineCustomElement$5();
|
|
2193
|
+
}
|
|
2194
|
+
break;
|
|
2195
|
+
case "snk-view-representation":
|
|
2196
|
+
if (!customElements.get(tagName)) {
|
|
2197
|
+
defineCustomElement$4();
|
|
2198
|
+
}
|
|
2199
|
+
break;
|
|
2200
|
+
case "taskbar-actions-button":
|
|
2201
|
+
if (!customElements.get(tagName)) {
|
|
2202
|
+
defineCustomElement$3();
|
|
2203
|
+
}
|
|
2204
|
+
break;
|
|
2205
|
+
case "taskbar-split-button":
|
|
2206
|
+
if (!customElements.get(tagName)) {
|
|
2207
|
+
defineCustomElement$2();
|
|
2208
|
+
}
|
|
2209
|
+
break;
|
|
2210
|
+
} });
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
export { SnkDynaformDetailView as S, defineCustomElement as a, SnkDynaformGuidesViewer as b, defineCustomElement$1 as d };
|