@sap/ux-ui5-tooling 1.20.4 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/adp-tooling/templates/cf/_gitignore +6 -0
- package/dist/adp-tooling/templates/cf/approuter/package.json +13 -0
- package/dist/adp-tooling/templates/cf/approuter/xs-app.json +15 -0
- package/dist/adp-tooling/templates/cf/i18n/i18n.properties +3 -0
- package/dist/adp-tooling/templates/cf/package.json +35 -0
- package/dist/adp-tooling/templates/cf/ui5.yaml +5 -0
- package/dist/adp-tooling/templates/cf/xs-security.json +7 -0
- package/dist/adp-tooling/templates/changes/annotation.xml +18 -0
- package/dist/adp-tooling/templates/project/gitignore.tmpl +5 -0
- package/dist/adp-tooling/templates/project/package.json +31 -0
- package/dist/adp-tooling/templates/project/ui5.yaml +6 -0
- package/dist/adp-tooling/templates/project/webapp/i18n/i18n.properties +6 -0
- package/dist/adp-tooling/templates/project/webapp/manifest.appdescr_variant +10 -0
- package/dist/adp-tooling/templates/rta/common/analytical-custom-column.xml +25 -0
- package/dist/adp-tooling/templates/rta/common/custom-action.xml +8 -0
- package/dist/adp-tooling/templates/rta/common/grid-tree-custom-column.xml +22 -0
- package/dist/adp-tooling/templates/rta/common/header-field.xml +13 -0
- package/dist/adp-tooling/templates/rta/common/op-custom-section.xml +20 -0
- package/dist/adp-tooling/templates/rta/common/v4-table-action.xml +8 -0
- package/dist/adp-tooling/templates/rta/controller.ejs +80 -0
- package/dist/adp-tooling/templates/rta/fragment.xml +7 -0
- package/dist/adp-tooling/templates/rta/ts-controller.ejs +18 -0
- package/dist/adp-tooling/templates/rta/v2/m-table-custom-column-cell.xml +7 -0
- package/dist/adp-tooling/templates/rta/v2/m-table-custom-column.xml +18 -0
- package/dist/adp-tooling/templates/rta/v4/custom-section.xml +12 -0
- package/dist/adp-tooling/templates/rta/v4/mdc-custom-column-config.xml +6 -0
- package/dist/adp-tooling/templates/rta/v4/mdc-custom-column.xml +11 -0
- package/dist/adp-tooling/templates/typescript/tsconfig.json +19 -0
- package/dist/cli/index.js +17761 -11603
- package/dist/control-property-editor/app.css +2 -0
- package/dist/control-property-editor/app.js +175 -0
- package/dist/livereload-js/livereload.js +3795 -0
- package/dist/middlewares/fiori-tools-appreload.js +44007 -41669
- package/dist/middlewares/fiori-tools-preview.js +66889 -4176
- package/dist/middlewares/fiori-tools-proxy.js +38049 -5767
- package/dist/middlewares/fiori-tools-servestatic.js +32893 -347
- package/dist/preview-middleware/dist/client/adp/add-fragment.js +48 -0
- package/dist/preview-middleware/dist/client/adp/add-fragment.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/api-handler.js +165 -0
- package/dist/preview-middleware/dist/client/adp/api-handler.ts +191 -0
- package/dist/preview-middleware/dist/client/adp/command-executor.js +100 -0
- package/dist/preview-middleware/dist/client/adp/command-executor.ts +105 -0
- package/dist/preview-middleware/dist/client/adp/control-utils.js +46 -0
- package/dist/preview-middleware/dist/client/adp/control-utils.ts +48 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.js +198 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.ts +232 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.js +223 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.ts +257 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.js +195 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.ts +264 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.js +146 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.ts +209 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.js +232 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +306 -0
- package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.js +187 -0
- package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.ts +254 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.js +330 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.ts +408 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.js +160 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.ts +195 -0
- package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.js +68 -0
- package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.ts +86 -0
- package/dist/preview-middleware/dist/client/adp/controllers/types.js +2 -0
- package/dist/preview-middleware/dist/client/adp/controllers/types.ts +10 -0
- package/dist/preview-middleware/dist/client/adp/dialog-factory.js +151 -0
- package/dist/preview-middleware/dist/client/adp/dialog-factory.ts +210 -0
- package/dist/preview-middleware/dist/client/adp/extend-controller.js +48 -0
- package/dist/preview-middleware/dist/client/adp/extend-controller.ts +49 -0
- package/dist/preview-middleware/dist/client/adp/extension-point.js +83 -0
- package/dist/preview-middleware/dist/client/adp/extension-point.ts +116 -0
- package/dist/preview-middleware/dist/client/adp/init-dialogs.js +142 -0
- package/dist/preview-middleware/dist/client/adp/init-dialogs.ts +178 -0
- package/dist/preview-middleware/dist/client/adp/init.js +111 -0
- package/dist/preview-middleware/dist/client/adp/init.ts +92 -0
- package/dist/preview-middleware/dist/client/adp/ovp-window-functions.js +130 -0
- package/dist/preview-middleware/dist/client/adp/ovp-window-functions.ts +171 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +97 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +140 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.ts +92 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.js +171 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +174 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.js +56 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.ts +56 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.js +41 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.js +69 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.ts +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.js +25 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.ts +7 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.js +2 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.ts +19 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +82 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +87 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +69 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +103 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +105 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.js +111 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +110 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +108 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +141 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +80 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +93 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +79 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +102 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +98 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +61 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +77 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +102 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +116 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.js +79 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.ts +121 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.js +138 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.ts +134 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +140 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +181 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +90 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +97 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.js +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +98 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +129 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +149 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +142 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +178 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +83 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +96 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +58 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +70 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +55 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +61 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +73 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +91 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +88 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.js +62 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.ts +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.js +158 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.ts +175 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/load.js +46 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/load.ts +23 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.js +64 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.ts +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/supported-ui5versions.md +40 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.js +372 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.ts +433 -0
- package/dist/preview-middleware/dist/client/adp/sync-views-utils.js +123 -0
- package/dist/preview-middleware/dist/client/adp/sync-views-utils.ts +90 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddAction.fragment.xml +49 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddCustomFragment.fragment.xml +48 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddFragment.fragment.xml +83 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddSubpage.fragment.xml +73 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddTableColumnFragments.fragment.xml +63 -0
- package/dist/preview-middleware/dist/client/adp/ui/ControllerExtension.fragment.xml +63 -0
- package/dist/preview-middleware/dist/client/adp/ui/ExtensionPoint.fragment.xml +61 -0
- package/dist/preview-middleware/dist/client/adp/ui/FileExistsDialog.fragment.xml +43 -0
- package/dist/preview-middleware/dist/client/adp/utils.js +199 -0
- package/dist/preview-middleware/dist/client/adp/utils.ts +200 -0
- package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.js +85 -0
- package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +107 -0
- package/dist/preview-middleware/dist/client/cpe/changes/flex-change.js +66 -0
- package/dist/preview-middleware/dist/client/cpe/changes/flex-change.ts +66 -0
- package/dist/preview-middleware/dist/client/cpe/changes/generic-change.js +321 -0
- package/dist/preview-middleware/dist/client/cpe/changes/generic-change.ts +462 -0
- package/dist/preview-middleware/dist/client/cpe/changes/index.js +12 -0
- package/dist/preview-middleware/dist/client/cpe/changes/index.ts +1 -0
- package/dist/preview-middleware/dist/client/cpe/changes/service.js +527 -0
- package/dist/preview-middleware/dist/client/cpe/changes/service.ts +595 -0
- package/dist/preview-middleware/dist/client/cpe/changes/validator.js +41 -0
- package/dist/preview-middleware/dist/client/cpe/changes/validator.ts +35 -0
- package/dist/preview-middleware/dist/client/cpe/communication-service.js +44 -0
- package/dist/preview-middleware/dist/client/cpe/communication-service.ts +41 -0
- package/dist/preview-middleware/dist/client/cpe/connector-service.js +88 -0
- package/dist/preview-middleware/dist/client/cpe/connector-service.ts +74 -0
- package/dist/preview-middleware/dist/client/cpe/context-menu-service.js +90 -0
- package/dist/preview-middleware/dist/client/cpe/context-menu-service.ts +77 -0
- package/dist/preview-middleware/dist/client/cpe/control-data.js +366 -0
- package/dist/preview-middleware/dist/client/cpe/control-data.ts +400 -0
- package/dist/preview-middleware/dist/client/cpe/documentation.js +191 -0
- package/dist/preview-middleware/dist/client/cpe/documentation.ts +187 -0
- package/dist/preview-middleware/dist/client/cpe/feature-service.js +39 -0
- package/dist/preview-middleware/dist/client/cpe/feature-service.ts +25 -0
- package/dist/preview-middleware/dist/client/cpe/init.js +92 -0
- package/dist/preview-middleware/dist/client/cpe/init.ts +114 -0
- package/dist/preview-middleware/dist/client/cpe/logger.js +32 -0
- package/dist/preview-middleware/dist/client/cpe/logger.ts +24 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.js +136 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.ts +160 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.js +63 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.ts +52 -0
- package/dist/preview-middleware/dist/client/cpe/outline/editable.js +38 -0
- package/dist/preview-middleware/dist/client/cpe/outline/editable.ts +30 -0
- package/dist/preview-middleware/dist/client/cpe/outline/nodes.js +212 -0
- package/dist/preview-middleware/dist/client/cpe/outline/nodes.ts +236 -0
- package/dist/preview-middleware/dist/client/cpe/outline/service.js +62 -0
- package/dist/preview-middleware/dist/client/cpe/outline/service.ts +66 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.js +161 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.ts +184 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.js +145 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.ts +157 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.js +94 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.ts +113 -0
- package/dist/preview-middleware/dist/client/cpe/rta-service.js +94 -0
- package/dist/preview-middleware/dist/client/cpe/rta-service.ts +86 -0
- package/dist/preview-middleware/dist/client/cpe/selection.js +249 -0
- package/dist/preview-middleware/dist/client/cpe/selection.ts +267 -0
- package/dist/preview-middleware/dist/client/cpe/ui5-utils.js +35 -0
- package/dist/preview-middleware/dist/client/cpe/ui5-utils.ts +28 -0
- package/dist/preview-middleware/dist/client/cpe/utils.js +113 -0
- package/dist/preview-middleware/dist/client/cpe/utils.ts +162 -0
- package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.js +97 -0
- package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.ts +101 -0
- package/dist/preview-middleware/dist/client/flp/common.js +30 -0
- package/dist/preview-middleware/dist/client/flp/common.ts +28 -0
- package/dist/preview-middleware/dist/client/flp/enableFakeConnector.js +92 -0
- package/dist/preview-middleware/dist/client/flp/enableFakeConnector.ts +113 -0
- package/dist/preview-middleware/dist/client/flp/homepage/Component.js +16 -0
- package/dist/preview-middleware/dist/client/flp/homepage/Component.ts +10 -0
- package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.js +54 -0
- package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.ts +41 -0
- package/dist/preview-middleware/dist/client/flp/homepage/css/style.css +3 -0
- package/dist/preview-middleware/dist/client/flp/homepage/manifest.json +41 -0
- package/dist/preview-middleware/dist/client/flp/homepage/view/MyHome.view.xml +18 -0
- package/dist/preview-middleware/dist/client/flp/init.js +418 -0
- package/dist/preview-middleware/dist/client/flp/init.ts +448 -0
- package/dist/preview-middleware/dist/client/flp/initCdm.js +117 -0
- package/dist/preview-middleware/dist/client/flp/initCdm.ts +111 -0
- package/dist/preview-middleware/dist/client/flp/initConnectors.js +31 -0
- package/dist/preview-middleware/dist/client/flp/initConnectors.ts +20 -0
- package/dist/preview-middleware/dist/client/flp/initRta.js +180 -0
- package/dist/preview-middleware/dist/client/flp/initRta.ts +194 -0
- package/dist/preview-middleware/dist/client/i18n.js +56 -0
- package/dist/preview-middleware/dist/client/i18n.ts +49 -0
- package/dist/preview-middleware/dist/client/manifest.json +8 -0
- package/dist/preview-middleware/dist/client/messagebundle.properties +143 -0
- package/dist/preview-middleware/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +486 -0
- package/dist/preview-middleware/dist/client/utils/additional-change-info.js +69 -0
- package/dist/preview-middleware/dist/client/utils/additional-change-info.ts +73 -0
- package/dist/preview-middleware/dist/client/utils/application.js +34 -0
- package/dist/preview-middleware/dist/client/utils/application.ts +27 -0
- package/dist/preview-middleware/dist/client/utils/core.js +144 -0
- package/dist/preview-middleware/dist/client/utils/core.ts +145 -0
- package/dist/preview-middleware/dist/client/utils/error.js +28 -0
- package/dist/preview-middleware/dist/client/utils/error.ts +18 -0
- package/dist/preview-middleware/dist/client/utils/fe-v2.js +58 -0
- package/dist/preview-middleware/dist/client/utils/fe-v2.ts +61 -0
- package/dist/preview-middleware/dist/client/utils/fe-v4.js +168 -0
- package/dist/preview-middleware/dist/client/utils/fe-v4.ts +186 -0
- package/dist/preview-middleware/dist/client/utils/info-center-message.js +60 -0
- package/dist/preview-middleware/dist/client/utils/info-center-message.ts +60 -0
- package/dist/preview-middleware/dist/client/utils/version.js +126 -0
- package/dist/preview-middleware/dist/client/utils/version.ts +138 -0
- package/dist/preview-middleware/templates/flp/cdm.base.json +47 -0
- package/dist/preview-middleware/templates/flp/cdm.ejs +72 -0
- package/dist/preview-middleware/templates/flp/editor.ejs +28 -0
- package/dist/preview-middleware/templates/flp/sandbox.ejs +88 -0
- package/dist/preview-middleware/templates/flp/sandbox2.ejs +86 -0
- package/dist/preview-middleware/templates/test/qunit.ejs +26 -0
- package/dist/preview-middleware/templates/test/qunit.js +29 -0
- package/dist/preview-middleware/templates/test/testsuite.qunit.ejs +10 -0
- package/dist/preview-middleware/templates/test/testsuite.qunit.js +8 -0
- package/dist/tasks/cf-deploy/index.js +3916 -3521
- package/dist/tasks/deploy/index.js +17204 -11133
- package/package.json +36 -39
- package/prebuilds/keyring.darwin-arm64.node +0 -0
- package/prebuilds/keyring.darwin-x64.node +0 -0
- package/prebuilds/keyring.linux-arm-gnueabihf.node +0 -0
- package/prebuilds/keyring.linux-arm64-gnu.node +0 -0
- package/prebuilds/keyring.linux-arm64-musl.node +0 -0
- package/prebuilds/keyring.linux-ia32-gnu.node +0 -0
- package/prebuilds/keyring.linux-x64-gnu.node +0 -0
- package/prebuilds/keyring.linux-x64-musl.node +0 -0
- package/prebuilds/keyring.win32-arm64-msvc.node +0 -0
- package/prebuilds/keyring.win32-ia32-msvc.node +0 -0
- package/prebuilds/keyring.win32-x64-msvc.node +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
2
|
+
import type { ActionService } from 'sap/ui/rta/service/Action';
|
|
3
|
+
import Log from 'sap/base/Log';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ExternalAction,
|
|
7
|
+
QuickActionExecutionPayload,
|
|
8
|
+
QuickActionGroup
|
|
9
|
+
} from '@sap-ux-private/control-property-editor-common';
|
|
10
|
+
import {
|
|
11
|
+
executeQuickAction,
|
|
12
|
+
quickActionListChanged,
|
|
13
|
+
SIMPLE_QUICK_ACTION_KIND,
|
|
14
|
+
NESTED_QUICK_ACTION_KIND,
|
|
15
|
+
updateQuickAction,
|
|
16
|
+
externalFileChange,
|
|
17
|
+
reportTelemetry
|
|
18
|
+
} from '@sap-ux-private/control-property-editor-common';
|
|
19
|
+
|
|
20
|
+
import type { ActionSenderFunction, ControlTreeIndex, Service, SubscribeFunction } from '../types';
|
|
21
|
+
|
|
22
|
+
import type {
|
|
23
|
+
QuickActionActivationContext,
|
|
24
|
+
QuickActionContext,
|
|
25
|
+
QuickActionDefinition
|
|
26
|
+
} from './quick-action-definition';
|
|
27
|
+
import type { QuickActionDefinitionRegistry } from './registry';
|
|
28
|
+
import type { OutlineService } from '../outline/service';
|
|
29
|
+
import type { TextBundle } from '../../i18n';
|
|
30
|
+
import { getTextBundle } from '../../i18n';
|
|
31
|
+
import type { ChangeService } from '../changes';
|
|
32
|
+
import { DialogFactory } from '../../adp/dialog-factory';
|
|
33
|
+
import { getApplicationType } from '../../utils/application';
|
|
34
|
+
import { getUi5Version } from '../../utils/version';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Service providing Quick Actions.
|
|
38
|
+
*/
|
|
39
|
+
export class QuickActionService implements Service {
|
|
40
|
+
private sendAction: ActionSenderFunction = () => {};
|
|
41
|
+
private readonly actions: QuickActionDefinition[] = [];
|
|
42
|
+
private controlTreeIndex: ControlTreeIndex;
|
|
43
|
+
|
|
44
|
+
private actionService: ActionService;
|
|
45
|
+
private texts: TextBundle;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Quick action service constructor.
|
|
49
|
+
*
|
|
50
|
+
* @param rta - RTA object.
|
|
51
|
+
* @param outlineService - Outline service instance.
|
|
52
|
+
* @param registries - Quick action registries.
|
|
53
|
+
* @param changeService
|
|
54
|
+
*/
|
|
55
|
+
constructor(
|
|
56
|
+
private readonly rta: RuntimeAuthoring,
|
|
57
|
+
private readonly outlineService: OutlineService,
|
|
58
|
+
private readonly registries: QuickActionDefinitionRegistry<string>[],
|
|
59
|
+
private readonly changeService: ChangeService
|
|
60
|
+
) {}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Initialize selection service.
|
|
64
|
+
*
|
|
65
|
+
* @param sendAction - Action sender function.
|
|
66
|
+
* @param subscribe - Subscriber function.
|
|
67
|
+
*/
|
|
68
|
+
public async init(sendAction: ActionSenderFunction, subscribe: SubscribeFunction): Promise<void> {
|
|
69
|
+
this.sendAction = sendAction;
|
|
70
|
+
this.actionService = await this.rta.getService('action');
|
|
71
|
+
this.texts = await getTextBundle();
|
|
72
|
+
|
|
73
|
+
subscribe(async (action: ExternalAction): Promise<void> => {
|
|
74
|
+
if (executeQuickAction.match(action)) {
|
|
75
|
+
const actionInstance = this.actions
|
|
76
|
+
.findLast((quickActionDefinition) => quickActionDefinition.id === action.payload.id);
|
|
77
|
+
if (!actionInstance) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const commands = await this.executeAction(actionInstance, action.payload);
|
|
81
|
+
|
|
82
|
+
for (const command of commands) {
|
|
83
|
+
await this.rta.getCommandStack().pushAndExecute(command);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (actionInstance.forceRefreshAfterExecution) {
|
|
87
|
+
this.sendAction(updateQuickAction(actionInstance.getActionObject()));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (externalFileChange.match(action)) {
|
|
91
|
+
await this.reloadQuickActions(this.controlTreeIndex);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
this.outlineService.onOutlineChange(async (event) => {
|
|
96
|
+
this.controlTreeIndex = event.detail.controlIndex;
|
|
97
|
+
await this.reloadQuickActions(event.detail.controlIndex);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
this.changeService.onStackChange(async () => {
|
|
101
|
+
await this.reloadQuickActions(this.controlTreeIndex);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
DialogFactory.onOpenDialogStatusChange(async () => {
|
|
105
|
+
await this.reloadQuickActions(this.controlTreeIndex);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Prepares a list of currently applicable Quick Actions and sends them to the UI.
|
|
111
|
+
*
|
|
112
|
+
* @param controlIndex - Control tree index.
|
|
113
|
+
*/
|
|
114
|
+
public async reloadQuickActions(controlIndex: ControlTreeIndex): Promise<void> {
|
|
115
|
+
const context: QuickActionActivationContext = {
|
|
116
|
+
controlIndex,
|
|
117
|
+
manifest: this.rta.getRootControlInstance().getManifest(),
|
|
118
|
+
actionService: this.actionService
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const groups: QuickActionGroup[] = [];
|
|
122
|
+
for (const registry of this.registries) {
|
|
123
|
+
for (const { title, definitions, view, key } of registry.getDefinitions(context)) {
|
|
124
|
+
const group: QuickActionGroup = {
|
|
125
|
+
title,
|
|
126
|
+
actions: []
|
|
127
|
+
};
|
|
128
|
+
const actionContext: QuickActionContext = {
|
|
129
|
+
...context,
|
|
130
|
+
view,
|
|
131
|
+
key,
|
|
132
|
+
rta: this.rta,
|
|
133
|
+
flexSettings: this.rta.getFlexSettings(),
|
|
134
|
+
resourceBundle: this.texts,
|
|
135
|
+
changeService: this.changeService
|
|
136
|
+
};
|
|
137
|
+
for (const Definition of definitions) {
|
|
138
|
+
try {
|
|
139
|
+
const instance = new Definition(actionContext);
|
|
140
|
+
await instance.initialize();
|
|
141
|
+
await this.addAction(group, instance);
|
|
142
|
+
} catch {
|
|
143
|
+
Log.warning(`Failed to initialize ${Definition.name} quick action.`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
groups.push(group);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.sendAction(quickActionListChanged(groups));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private async addAction(group: QuickActionGroup, instance: QuickActionDefinition): Promise<void> {
|
|
154
|
+
if (instance.isApplicable) {
|
|
155
|
+
await instance.runEnablementValidators();
|
|
156
|
+
const quickAction = instance.getActionObject();
|
|
157
|
+
group.actions.push(quickAction);
|
|
158
|
+
this.actions.push(instance);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private async executeAction(actionInstance: QuickActionDefinition, payload: QuickActionExecutionPayload) {
|
|
163
|
+
try {
|
|
164
|
+
const versionInfo = await getUi5Version();
|
|
165
|
+
await reportTelemetry({
|
|
166
|
+
category: 'QuickAction',
|
|
167
|
+
actionName: actionInstance.type,
|
|
168
|
+
telemetryEventIdentifier: actionInstance.getTelemetryIdentifier(true),
|
|
169
|
+
quickActionSteps: actionInstance.quickActionSteps,
|
|
170
|
+
appType: getApplicationType(this.rta.getRootControlInstance().getManifest()),
|
|
171
|
+
ui5Version: `${versionInfo.major}.${versionInfo.minor}.${versionInfo.patch}`
|
|
172
|
+
});
|
|
173
|
+
} catch (error) {
|
|
174
|
+
Log.error('Error in reporting Telemetry:', error);
|
|
175
|
+
}
|
|
176
|
+
if (payload.kind === SIMPLE_QUICK_ACTION_KIND && actionInstance.kind === SIMPLE_QUICK_ACTION_KIND) {
|
|
177
|
+
return actionInstance.execute();
|
|
178
|
+
}
|
|
179
|
+
if (payload.kind === NESTED_QUICK_ACTION_KIND && actionInstance.kind === NESTED_QUICK_ACTION_KIND) {
|
|
180
|
+
return actionInstance.execute(payload.path);
|
|
181
|
+
}
|
|
182
|
+
return [];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/library", "sap/base/Log", "sap/ui/core/ComponentContainer", "../../utils/core", "../utils"], function (NavContainer, FlexibleColumnLayout, sap_f_library, Log, ComponentContainer, ____utils_core, ___utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const LayoutType = sap_f_library["LayoutType"];
|
|
7
|
+
const getControlById = ____utils_core["getControlById"];
|
|
8
|
+
const getRootControlFromComponentContainer = ___utils["getRootControlFromComponentContainer"];
|
|
9
|
+
const NAV_CONTAINER_CONTROL_TYPE = 'sap.m.NavContainer';
|
|
10
|
+
const FLEXIBLE_COLUMN_LAYOUT_CONTROL_TYPE = 'sap.f.FlexibleColumnLayout';
|
|
11
|
+
/**
|
|
12
|
+
* Base class for Quick Action definition providers.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
class QuickActionDefinitionRegistry {
|
|
16
|
+
/**
|
|
17
|
+
* Mapping of page view name to page type name.
|
|
18
|
+
*/
|
|
19
|
+
PAGE_NAME_MAP = {};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Provides a list of Quick Action definitions that are applicable for the given context.
|
|
23
|
+
*
|
|
24
|
+
* @param _context - Activation context.
|
|
25
|
+
*/
|
|
26
|
+
getDefinitions(_context) {
|
|
27
|
+
throw new Error('Not implemented!');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Finds component container from the page control.
|
|
32
|
+
*
|
|
33
|
+
* @param page - Page control provided by containers.
|
|
34
|
+
* @returns ComponentContainer control.
|
|
35
|
+
*/
|
|
36
|
+
getComponentContainerFromPage(page) {
|
|
37
|
+
if (page instanceof ComponentContainer) {
|
|
38
|
+
return page;
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns a list of Active pages based on the provided control index.
|
|
45
|
+
*
|
|
46
|
+
* @param controlIndex - Control tree index.
|
|
47
|
+
* @returns A list of Active pages.
|
|
48
|
+
*/
|
|
49
|
+
getActivePageContent(controlIndex) {
|
|
50
|
+
const views = this.getActiveViews(controlIndex);
|
|
51
|
+
const pages = [];
|
|
52
|
+
for (const view of views) {
|
|
53
|
+
const name = view.getViewName();
|
|
54
|
+
const pageName = this.PAGE_NAME_MAP[name];
|
|
55
|
+
if (pageName) {
|
|
56
|
+
pages.push({
|
|
57
|
+
name: pageName,
|
|
58
|
+
view
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
Log.warning(`Could not find matching page for view of type "${name}".`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return pages;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get all the root views of currently active pages.
|
|
69
|
+
*
|
|
70
|
+
* @param controlIndex - Control index.
|
|
71
|
+
* @returns List of page root views.
|
|
72
|
+
*/
|
|
73
|
+
getActiveViews(controlIndex) {
|
|
74
|
+
const pages = this.getActivePages(controlIndex);
|
|
75
|
+
const views = [];
|
|
76
|
+
for (const page of pages) {
|
|
77
|
+
if (page) {
|
|
78
|
+
const container = this.getComponentContainerFromPage(page);
|
|
79
|
+
const rootControl = getRootControlFromComponentContainer(container);
|
|
80
|
+
if (rootControl) {
|
|
81
|
+
views.push(rootControl);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return views;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Finds active page controls from the control tree index.
|
|
90
|
+
*
|
|
91
|
+
* @param controlIndex - Control tree index.
|
|
92
|
+
* @returns A list of page controls.
|
|
93
|
+
*/
|
|
94
|
+
getActivePages(controlIndex) {
|
|
95
|
+
const navContainerNode = controlIndex[NAV_CONTAINER_CONTROL_TYPE]?.[0];
|
|
96
|
+
if (navContainerNode) {
|
|
97
|
+
const control = getControlById(navContainerNode.controlId);
|
|
98
|
+
if (control instanceof NavContainer) {
|
|
99
|
+
return [control.getCurrentPage()];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const flexibleLayoutNode = controlIndex[FLEXIBLE_COLUMN_LAYOUT_CONTROL_TYPE]?.[0];
|
|
103
|
+
if (flexibleLayoutNode) {
|
|
104
|
+
const control = getControlById(flexibleLayoutNode.controlId);
|
|
105
|
+
if (control instanceof FlexibleColumnLayout) {
|
|
106
|
+
return this.getVisibleFlexibleColumnLayoutPages(control);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Finds the visible Flexible Column Layout pages.
|
|
114
|
+
*
|
|
115
|
+
* @param control - Flexible Column Layout control.
|
|
116
|
+
* @returns A list of visible pages.
|
|
117
|
+
*/
|
|
118
|
+
getVisibleFlexibleColumnLayoutPages(control) {
|
|
119
|
+
const layout = control.getLayout();
|
|
120
|
+
switch (layout) {
|
|
121
|
+
case LayoutType.OneColumn:
|
|
122
|
+
return [control.getCurrentBeginColumnPage()];
|
|
123
|
+
case LayoutType.MidColumnFullScreen:
|
|
124
|
+
return [control.getCurrentMidColumnPage()];
|
|
125
|
+
case LayoutType.EndColumnFullScreen:
|
|
126
|
+
return [control.getCurrentEndColumnPage()];
|
|
127
|
+
case LayoutType.ThreeColumnsBeginExpandedEndHidden:
|
|
128
|
+
case LayoutType.ThreeColumnsMidExpanded:
|
|
129
|
+
case LayoutType.ThreeColumnsMidExpandedEndHidden:
|
|
130
|
+
case LayoutType.ThreeColumnsEndExpanded:
|
|
131
|
+
return [control.getCurrentBeginColumnPage(), control.getCurrentMidColumnPage(), control.getCurrentEndColumnPage()];
|
|
132
|
+
case LayoutType.TwoColumnsMidExpanded:
|
|
133
|
+
case LayoutType.TwoColumnsBeginExpanded:
|
|
134
|
+
return [control.getCurrentBeginColumnPage(), control.getCurrentMidColumnPage()];
|
|
135
|
+
}
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
var __exports = {
|
|
140
|
+
__esModule: true
|
|
141
|
+
};
|
|
142
|
+
__exports.QuickActionDefinitionRegistry = QuickActionDefinitionRegistry;
|
|
143
|
+
return __exports;
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import NavContainer from 'sap/m/NavContainer';
|
|
2
|
+
import FlexibleColumnLayout from 'sap/f/FlexibleColumnLayout';
|
|
3
|
+
import { LayoutType } from 'sap/f/library';
|
|
4
|
+
import type Control from 'sap/ui/core/Control';
|
|
5
|
+
import type XMLView from 'sap/ui/core/mvc/XMLView';
|
|
6
|
+
import Log from 'sap/base/Log';
|
|
7
|
+
import ComponentContainer from 'sap/ui/core/ComponentContainer';
|
|
8
|
+
|
|
9
|
+
import type { QuickActionActivationContext, QuickActionDefinitionGroup } from './quick-action-definition';
|
|
10
|
+
|
|
11
|
+
import type { ControlTreeIndex } from '../types';
|
|
12
|
+
import { getControlById } from '../../utils/core';
|
|
13
|
+
import { getRootControlFromComponentContainer } from '../utils';
|
|
14
|
+
|
|
15
|
+
const NAV_CONTAINER_CONTROL_TYPE = 'sap.m.NavContainer';
|
|
16
|
+
const FLEXIBLE_COLUMN_LAYOUT_CONTROL_TYPE = 'sap.f.FlexibleColumnLayout';
|
|
17
|
+
|
|
18
|
+
export interface ActivePage<T extends string> {
|
|
19
|
+
name: T;
|
|
20
|
+
view: XMLView;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Base class for Quick Action definition providers.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export abstract class QuickActionDefinitionRegistry<T extends string> {
|
|
28
|
+
/**
|
|
29
|
+
* Mapping of page view name to page type name.
|
|
30
|
+
*/
|
|
31
|
+
PAGE_NAME_MAP: Record<string, T> = {};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Provides a list of Quick Action definitions that are applicable for the given context.
|
|
35
|
+
*
|
|
36
|
+
* @param _context - Activation context.
|
|
37
|
+
*/
|
|
38
|
+
getDefinitions(_context: QuickActionActivationContext): QuickActionDefinitionGroup[] {
|
|
39
|
+
throw new Error('Not implemented!');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Finds component container from the page control.
|
|
44
|
+
*
|
|
45
|
+
* @param page - Page control provided by containers.
|
|
46
|
+
* @returns ComponentContainer control.
|
|
47
|
+
*/
|
|
48
|
+
protected getComponentContainerFromPage(page: Control): ComponentContainer | undefined {
|
|
49
|
+
if (page instanceof ComponentContainer) {
|
|
50
|
+
return page;
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Returns a list of Active pages based on the provided control index.
|
|
57
|
+
*
|
|
58
|
+
* @param controlIndex - Control tree index.
|
|
59
|
+
* @returns A list of Active pages.
|
|
60
|
+
*/
|
|
61
|
+
protected getActivePageContent(controlIndex: ControlTreeIndex): ActivePage<T>[] {
|
|
62
|
+
const views = this.getActiveViews(controlIndex);
|
|
63
|
+
const pages: ActivePage<T>[] = [];
|
|
64
|
+
for (const view of views) {
|
|
65
|
+
const name = view.getViewName();
|
|
66
|
+
const pageName = this.PAGE_NAME_MAP[name];
|
|
67
|
+
if (pageName) {
|
|
68
|
+
pages.push({
|
|
69
|
+
name: pageName,
|
|
70
|
+
view
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
Log.warning(`Could not find matching page for view of type "${name}".`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return pages;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get all the root views of currently active pages.
|
|
81
|
+
*
|
|
82
|
+
* @param controlIndex - Control index.
|
|
83
|
+
* @returns List of page root views.
|
|
84
|
+
*/
|
|
85
|
+
private getActiveViews(controlIndex: ControlTreeIndex): XMLView[] {
|
|
86
|
+
const pages = this.getActivePages(controlIndex);
|
|
87
|
+
const views: XMLView[] = [];
|
|
88
|
+
|
|
89
|
+
for (const page of pages) {
|
|
90
|
+
if (page) {
|
|
91
|
+
const container = this.getComponentContainerFromPage(page);
|
|
92
|
+
const rootControl = getRootControlFromComponentContainer(container);
|
|
93
|
+
if (rootControl) {
|
|
94
|
+
views.push(rootControl);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return views;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Finds active page controls from the control tree index.
|
|
103
|
+
*
|
|
104
|
+
* @param controlIndex - Control tree index.
|
|
105
|
+
* @returns A list of page controls.
|
|
106
|
+
*/
|
|
107
|
+
private getActivePages(controlIndex: ControlTreeIndex): (Control | undefined)[] {
|
|
108
|
+
const navContainerNode = controlIndex[NAV_CONTAINER_CONTROL_TYPE]?.[0];
|
|
109
|
+
if (navContainerNode) {
|
|
110
|
+
const control = getControlById(navContainerNode.controlId);
|
|
111
|
+
if (control instanceof NavContainer) {
|
|
112
|
+
return [control.getCurrentPage()];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const flexibleLayoutNode = controlIndex[FLEXIBLE_COLUMN_LAYOUT_CONTROL_TYPE]?.[0];
|
|
117
|
+
if (flexibleLayoutNode) {
|
|
118
|
+
const control = getControlById(flexibleLayoutNode.controlId);
|
|
119
|
+
if (control instanceof FlexibleColumnLayout) {
|
|
120
|
+
return this.getVisibleFlexibleColumnLayoutPages(control);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Finds the visible Flexible Column Layout pages.
|
|
129
|
+
*
|
|
130
|
+
* @param control - Flexible Column Layout control.
|
|
131
|
+
* @returns A list of visible pages.
|
|
132
|
+
*/
|
|
133
|
+
private getVisibleFlexibleColumnLayoutPages(control: FlexibleColumnLayout): (Control | undefined)[] {
|
|
134
|
+
const layout = control.getLayout();
|
|
135
|
+
switch (layout) {
|
|
136
|
+
case LayoutType.OneColumn:
|
|
137
|
+
return [control.getCurrentBeginColumnPage()];
|
|
138
|
+
case LayoutType.MidColumnFullScreen:
|
|
139
|
+
return [control.getCurrentMidColumnPage()];
|
|
140
|
+
case LayoutType.EndColumnFullScreen:
|
|
141
|
+
return [control.getCurrentEndColumnPage()];
|
|
142
|
+
case LayoutType.ThreeColumnsBeginExpandedEndHidden:
|
|
143
|
+
case LayoutType.ThreeColumnsMidExpanded:
|
|
144
|
+
case LayoutType.ThreeColumnsMidExpandedEndHidden:
|
|
145
|
+
case LayoutType.ThreeColumnsEndExpanded:
|
|
146
|
+
return [
|
|
147
|
+
control.getCurrentBeginColumnPage(),
|
|
148
|
+
control.getCurrentMidColumnPage(),
|
|
149
|
+
control.getCurrentEndColumnPage()
|
|
150
|
+
];
|
|
151
|
+
case LayoutType.TwoColumnsMidExpanded:
|
|
152
|
+
case LayoutType.TwoColumnsBeginExpanded:
|
|
153
|
+
return [control.getCurrentBeginColumnPage(), control.getCurrentMidColumnPage()];
|
|
154
|
+
}
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../utils/core"], function (____utils_core) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = ____utils_core["getControlById"];
|
|
7
|
+
const isA = ____utils_core["isA"];
|
|
8
|
+
/**
|
|
9
|
+
* Checks if control is visible in the page.
|
|
10
|
+
*
|
|
11
|
+
* @param page - Page control.
|
|
12
|
+
* @param controlId - UI5 control id.
|
|
13
|
+
* @returns True if control is visible in the page.
|
|
14
|
+
*/
|
|
15
|
+
function pageHasControlId(page, controlId) {
|
|
16
|
+
const controlDomElement = getControlById(controlId)?.getDomRef();
|
|
17
|
+
return !!controlDomElement && !!page?.getDomRef()?.contains(controlDomElement);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Checks if control is a child element of the rootControl.
|
|
22
|
+
*
|
|
23
|
+
* @param control - UI5 Control to be tested.
|
|
24
|
+
* @param rootControl - UI5 root control.
|
|
25
|
+
* @returns True if control is the child of the specified rootControl.
|
|
26
|
+
*/
|
|
27
|
+
function isDescendantOfPage(control, rootControl) {
|
|
28
|
+
let currentControl = control;
|
|
29
|
+
while (currentControl) {
|
|
30
|
+
if (currentControl === rootControl) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
// if parent is a reusable component, use oContainer to find the parent
|
|
34
|
+
if (isA('sap.ui.core.Component', currentControl) && currentControl?.oContainer) {
|
|
35
|
+
currentControl = currentControl.oContainer.getParent();
|
|
36
|
+
} else {
|
|
37
|
+
currentControl = currentControl.getParent();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Find all controls in page that match the provided types.
|
|
45
|
+
*
|
|
46
|
+
* @param controlIndex - Control tree index.
|
|
47
|
+
* @param activePage - Active page control.
|
|
48
|
+
* @param controlTypes - Relevant control types.
|
|
49
|
+
* @returns A list of UI5 controls.
|
|
50
|
+
*/
|
|
51
|
+
function getRelevantControlFromActivePage(controlIndex, activePage, controlTypes) {
|
|
52
|
+
const relevantControls = [];
|
|
53
|
+
for (const type of controlTypes) {
|
|
54
|
+
const controls = controlIndex[type] ?? [];
|
|
55
|
+
for (const control of controls) {
|
|
56
|
+
const ui5Control = getControlById(control.controlId);
|
|
57
|
+
const parent = ui5Control?.getParent();
|
|
58
|
+
const isActionApplicable = isDescendantOfPage(parent, activePage);
|
|
59
|
+
if (isActionApplicable && ui5Control) {
|
|
60
|
+
// if parent control added, discard adding child control.
|
|
61
|
+
// Relevant for cases where wrapper exists eg: sap.m.Table exist in sap.ui.comp.smarttable.SmartTable
|
|
62
|
+
const parentFound = relevantControls.findIndex(relevantControl => relevantControl.getId() === ui5Control.getParent()?.getId());
|
|
63
|
+
if (parentFound === -1) {
|
|
64
|
+
relevantControls.push(ui5Control);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return relevantControls;
|
|
70
|
+
}
|
|
71
|
+
function getParentContainer(control, type) {
|
|
72
|
+
let currentControl = control;
|
|
73
|
+
while (currentControl) {
|
|
74
|
+
if (isA(type, currentControl)) {
|
|
75
|
+
return currentControl;
|
|
76
|
+
}
|
|
77
|
+
// if parent is a reusable component, use oContainer to find the parent
|
|
78
|
+
if (isA('sap.ui.core.Component', currentControl) && currentControl?.oContainer) {
|
|
79
|
+
currentControl = currentControl.oContainer.getParent();
|
|
80
|
+
} else {
|
|
81
|
+
currentControl = currentControl.getParent();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
var __exports = {
|
|
87
|
+
__esModule: true
|
|
88
|
+
};
|
|
89
|
+
__exports.pageHasControlId = pageHasControlId;
|
|
90
|
+
__exports.getRelevantControlFromActivePage = getRelevantControlFromActivePage;
|
|
91
|
+
__exports.getParentContainer = getParentContainer;
|
|
92
|
+
return __exports;
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type UI5Element from 'sap/ui/core/Element';
|
|
2
|
+
import type Control from 'sap/ui/core/Control';
|
|
3
|
+
import type ManagedObject from 'sap/ui/base/ManagedObject';
|
|
4
|
+
import type { FEAppPage } from 'sap/ui/rta/RuntimeAuthoring';
|
|
5
|
+
|
|
6
|
+
import { getControlById, isA } from '../../utils/core';
|
|
7
|
+
|
|
8
|
+
import type { ControlTreeIndex } from '../types';
|
|
9
|
+
import type Component from 'sap/ui/core/Component';
|
|
10
|
+
|
|
11
|
+
export interface FEAppPageInfo {
|
|
12
|
+
page: FEAppPage;
|
|
13
|
+
isInvisible: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FEAppPagesMap {
|
|
16
|
+
[key: string]: FEAppPageInfo[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Checks if control is visible in the page.
|
|
21
|
+
*
|
|
22
|
+
* @param page - Page control.
|
|
23
|
+
* @param controlId - UI5 control id.
|
|
24
|
+
* @returns True if control is visible in the page.
|
|
25
|
+
*/
|
|
26
|
+
export function pageHasControlId(page: Control, controlId: string): boolean {
|
|
27
|
+
const controlDomElement = getControlById(controlId)?.getDomRef();
|
|
28
|
+
return !!controlDomElement && !!page?.getDomRef()?.contains(controlDomElement);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Checks if control is a child element of the rootControl.
|
|
33
|
+
*
|
|
34
|
+
* @param control - UI5 Control to be tested.
|
|
35
|
+
* @param rootControl - UI5 root control.
|
|
36
|
+
* @returns True if control is the child of the specified rootControl.
|
|
37
|
+
*/
|
|
38
|
+
function isDescendantOfPage(control: ManagedObject | null | undefined, rootControl: ManagedObject) {
|
|
39
|
+
let currentControl = control;
|
|
40
|
+
while (currentControl) {
|
|
41
|
+
if (currentControl === rootControl) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
// if parent is a reusable component, use oContainer to find the parent
|
|
45
|
+
if (
|
|
46
|
+
isA<Component>('sap.ui.core.Component', currentControl) &&
|
|
47
|
+
(currentControl as unknown as { oContainer: Control })?.oContainer
|
|
48
|
+
) {
|
|
49
|
+
currentControl = (currentControl as unknown as { oContainer: Control }).oContainer.getParent();
|
|
50
|
+
} else {
|
|
51
|
+
currentControl = currentControl.getParent();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Find all controls in page that match the provided types.
|
|
59
|
+
*
|
|
60
|
+
* @param controlIndex - Control tree index.
|
|
61
|
+
* @param activePage - Active page control.
|
|
62
|
+
* @param controlTypes - Relevant control types.
|
|
63
|
+
* @returns A list of UI5 controls.
|
|
64
|
+
*/
|
|
65
|
+
export function getRelevantControlFromActivePage<T extends UI5Element = UI5Element>(
|
|
66
|
+
controlIndex: ControlTreeIndex,
|
|
67
|
+
activePage: Control,
|
|
68
|
+
controlTypes: string[]
|
|
69
|
+
): T[] {
|
|
70
|
+
const relevantControls: T[] = [];
|
|
71
|
+
for (const type of controlTypes) {
|
|
72
|
+
const controls = controlIndex[type] ?? [];
|
|
73
|
+
for (const control of controls) {
|
|
74
|
+
const ui5Control = getControlById<T>(control.controlId);
|
|
75
|
+
const parent = ui5Control?.getParent();
|
|
76
|
+
const isActionApplicable = isDescendantOfPage(parent, activePage);
|
|
77
|
+
|
|
78
|
+
if (isActionApplicable && ui5Control) {
|
|
79
|
+
// if parent control added, discard adding child control.
|
|
80
|
+
// Relevant for cases where wrapper exists eg: sap.m.Table exist in sap.ui.comp.smarttable.SmartTable
|
|
81
|
+
const parentFound = relevantControls.findIndex(
|
|
82
|
+
(relevantControl) => relevantControl.getId() === ui5Control.getParent()?.getId()
|
|
83
|
+
);
|
|
84
|
+
if (parentFound === -1) {
|
|
85
|
+
relevantControls.push(ui5Control);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return relevantControls;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function getParentContainer<T extends ManagedObject>(
|
|
94
|
+
control: ManagedObject | null | undefined,
|
|
95
|
+
type: string
|
|
96
|
+
): T | undefined {
|
|
97
|
+
let currentControl = control;
|
|
98
|
+
while (currentControl) {
|
|
99
|
+
if (isA<T>(type, currentControl)) {
|
|
100
|
+
return currentControl;
|
|
101
|
+
}
|
|
102
|
+
// if parent is a reusable component, use oContainer to find the parent
|
|
103
|
+
if (
|
|
104
|
+
isA<Component>('sap.ui.core.Component', currentControl) &&
|
|
105
|
+
(currentControl as unknown as { oContainer: Control })?.oContainer
|
|
106
|
+
) {
|
|
107
|
+
currentControl = (currentControl as unknown as { oContainer: Control }).oContainer.getParent();
|
|
108
|
+
} else {
|
|
109
|
+
currentControl = currentControl.getParent();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|