@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,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../cpe/additional-change-info/add-xml-additional-info"], function (___cpe_additional_change_info_add_xml_additional_info) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getAddXMLAdditionalInfo = ___cpe_additional_change_info_add_xml_additional_info["getAddXMLAdditionalInfo"];
|
|
7
|
+
const additionalChangeInfoMap = new Map();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This function is used to set additional change information for a given change.
|
|
11
|
+
*
|
|
12
|
+
* @param change - The change object for which additional information is to be set.
|
|
13
|
+
* @param appComponent - The app component (optional), used to resolve controls in projects with local IDs.
|
|
14
|
+
*/
|
|
15
|
+
function setAdditionalChangeInfo(change, appComponent) {
|
|
16
|
+
if (!change) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let additionalChangeInfo;
|
|
20
|
+
const key = change.getDefinition().fileName;
|
|
21
|
+
if (change?.getChangeType?.() === 'addXML') {
|
|
22
|
+
additionalChangeInfo = getAddXMLAdditionalInfo(change, appComponent);
|
|
23
|
+
}
|
|
24
|
+
if (additionalChangeInfo) {
|
|
25
|
+
const existingInfo = additionalChangeInfoMap.get(key);
|
|
26
|
+
if (existingInfo) {
|
|
27
|
+
// Merge new info with existing info, keeping existing values and only adding new ones
|
|
28
|
+
const mergedInfo = {
|
|
29
|
+
...additionalChangeInfo,
|
|
30
|
+
...existingInfo
|
|
31
|
+
};
|
|
32
|
+
additionalChangeInfoMap.set(key, mergedInfo);
|
|
33
|
+
} else {
|
|
34
|
+
// No existing info, set the new info
|
|
35
|
+
additionalChangeInfoMap.set(key, additionalChangeInfo);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function setAdditionalChangeInfoForChangeFile(fileName, additionalChangeInfo) {
|
|
40
|
+
additionalChangeInfoMap.set(fileName, additionalChangeInfo);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves additional change information for a given change.
|
|
45
|
+
*
|
|
46
|
+
* @param change - The change object containing details about a file modification.
|
|
47
|
+
* @returns The additional change information associated with the file name of the change,
|
|
48
|
+
* or `undefined` if no additional information is available.
|
|
49
|
+
*/
|
|
50
|
+
function getAdditionalChangeInfo(change) {
|
|
51
|
+
return additionalChangeInfoMap.get(change.fileName);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Should only be used in tests.
|
|
56
|
+
*/
|
|
57
|
+
function clearAdditionalChangeInfo() {
|
|
58
|
+
additionalChangeInfoMap.clear();
|
|
59
|
+
}
|
|
60
|
+
var __exports = {
|
|
61
|
+
__esModule: true
|
|
62
|
+
};
|
|
63
|
+
__exports.setAdditionalChangeInfo = setAdditionalChangeInfo;
|
|
64
|
+
__exports.setAdditionalChangeInfoForChangeFile = setAdditionalChangeInfoForChangeFile;
|
|
65
|
+
__exports.getAdditionalChangeInfo = getAdditionalChangeInfo;
|
|
66
|
+
__exports.clearAdditionalChangeInfo = clearAdditionalChangeInfo;
|
|
67
|
+
return __exports;
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=additional-change-info.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import FlexChange from 'sap/ui/fl/Change';
|
|
2
|
+
import {
|
|
3
|
+
getAddXMLAdditionalInfo,
|
|
4
|
+
type AddXMLAdditionalInfo,
|
|
5
|
+
type AddXMLChangeContent
|
|
6
|
+
} from '../cpe/additional-change-info/add-xml-additional-info';
|
|
7
|
+
import { FlexChange as Change } from '../flp/common';
|
|
8
|
+
import type Component from 'sap/ui/core/Component';
|
|
9
|
+
|
|
10
|
+
export type AdditionalChangeInfo = AddXMLAdditionalInfo | undefined;
|
|
11
|
+
|
|
12
|
+
const additionalChangeInfoMap = new Map<string, AdditionalChangeInfo>();
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This function is used to set additional change information for a given change.
|
|
16
|
+
*
|
|
17
|
+
* @param change - The change object for which additional information is to be set.
|
|
18
|
+
* @param appComponent - The app component (optional), used to resolve controls in projects with local IDs.
|
|
19
|
+
*/
|
|
20
|
+
export function setAdditionalChangeInfo(
|
|
21
|
+
change: FlexChange<AddXMLChangeContent> | undefined,
|
|
22
|
+
appComponent?: Component
|
|
23
|
+
): void {
|
|
24
|
+
if (!change) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let additionalChangeInfo;
|
|
29
|
+
const key = change.getDefinition().fileName;
|
|
30
|
+
if (change?.getChangeType?.() === 'addXML') {
|
|
31
|
+
additionalChangeInfo = getAddXMLAdditionalInfo(change, appComponent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (additionalChangeInfo) {
|
|
35
|
+
const existingInfo = additionalChangeInfoMap.get(key);
|
|
36
|
+
if (existingInfo) {
|
|
37
|
+
// Merge new info with existing info, keeping existing values and only adding new ones
|
|
38
|
+
const mergedInfo = {
|
|
39
|
+
...additionalChangeInfo,
|
|
40
|
+
...existingInfo
|
|
41
|
+
};
|
|
42
|
+
additionalChangeInfoMap.set(key, mergedInfo);
|
|
43
|
+
} else {
|
|
44
|
+
// No existing info, set the new info
|
|
45
|
+
additionalChangeInfoMap.set(key, additionalChangeInfo);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function setAdditionalChangeInfoForChangeFile(
|
|
51
|
+
fileName: string,
|
|
52
|
+
additionalChangeInfo: AdditionalChangeInfo
|
|
53
|
+
): void {
|
|
54
|
+
additionalChangeInfoMap.set(fileName, additionalChangeInfo);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves additional change information for a given change.
|
|
59
|
+
*
|
|
60
|
+
* @param change - The change object containing details about a file modification.
|
|
61
|
+
* @returns The additional change information associated with the file name of the change,
|
|
62
|
+
* or `undefined` if no additional information is available.
|
|
63
|
+
*/
|
|
64
|
+
export function getAdditionalChangeInfo(change: Change): AdditionalChangeInfo {
|
|
65
|
+
return additionalChangeInfoMap.get(change.fileName);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Should only be used in tests.
|
|
70
|
+
*/
|
|
71
|
+
export function clearAdditionalChangeInfo(): void {
|
|
72
|
+
additionalChangeInfoMap.clear();
|
|
73
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Determines application type based on the manifest.json.
|
|
8
|
+
*
|
|
9
|
+
* @param manifest - Application Manifest.
|
|
10
|
+
* @returns Application type.
|
|
11
|
+
*/
|
|
12
|
+
function getApplicationType(manifest) {
|
|
13
|
+
if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
|
|
14
|
+
return 'fe-v2';
|
|
15
|
+
} else if (manifest['sap.ui5']?.routing?.targets) {
|
|
16
|
+
let hasV4pPages = false;
|
|
17
|
+
Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
|
|
18
|
+
if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
|
|
19
|
+
hasV4pPages = true;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
if (hasV4pPages) {
|
|
23
|
+
return 'fe-v4';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return 'freestyle';
|
|
27
|
+
}
|
|
28
|
+
var __exports = {
|
|
29
|
+
__esModule: true
|
|
30
|
+
};
|
|
31
|
+
__exports.getApplicationType = getApplicationType;
|
|
32
|
+
return __exports;
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=application.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
|
|
2
|
+
|
|
3
|
+
export type ApplicationType = 'fe-v2' | 'fe-v4' | 'freestyle';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Determines application type based on the manifest.json.
|
|
7
|
+
*
|
|
8
|
+
* @param manifest - Application Manifest.
|
|
9
|
+
* @returns Application type.
|
|
10
|
+
*/
|
|
11
|
+
export function getApplicationType(manifest: Manifest): ApplicationType {
|
|
12
|
+
if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
|
|
13
|
+
return 'fe-v2';
|
|
14
|
+
} else if (manifest['sap.ui5']?.routing?.targets) {
|
|
15
|
+
let hasV4pPages = false;
|
|
16
|
+
Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach((target) => {
|
|
17
|
+
if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
|
|
18
|
+
hasV4pPages = true;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
if (hasV4pPages) {
|
|
22
|
+
return 'fe-v4';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return 'freestyle';
|
|
27
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element", "sap/ui/core/util/reflection/JsControlTreeModifier", "sap/base/Log", "./error"], function (Component, Element, JsControlTreeModifier, Log, ___error) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getError = ___error["getError"];
|
|
7
|
+
/**
|
|
8
|
+
* Gets Component by id.
|
|
9
|
+
*
|
|
10
|
+
* @param id - unique identifier for control
|
|
11
|
+
* @returns Component | undefined
|
|
12
|
+
*/
|
|
13
|
+
function getComponent(id) {
|
|
14
|
+
if (Component?.getComponentById) {
|
|
15
|
+
return Component.getComponentById(id);
|
|
16
|
+
} else if (Component?.get) {
|
|
17
|
+
// Older version must be still supported until maintenance period.
|
|
18
|
+
return Component.get(id); // NOSONAR
|
|
19
|
+
} else {
|
|
20
|
+
// Older version must be still supported until maintenance period.
|
|
21
|
+
return sap.ui.getCore().getComponent(id); // NOSONAR
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Returns control by its global ID.
|
|
27
|
+
*
|
|
28
|
+
* @param id Id of the control.
|
|
29
|
+
* @returns Control instance if it exists.
|
|
30
|
+
*/
|
|
31
|
+
function getControlById(id) {
|
|
32
|
+
if (typeof Element.getElementById === 'function') {
|
|
33
|
+
return Element.getElementById(id);
|
|
34
|
+
} else {
|
|
35
|
+
return sap.ui.getCore().byId(id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Gets target control by trying getControlById first, then falling back to JsControlTreeModifier.bySelector
|
|
41
|
+
* for projects where the control may not be found by global ID.
|
|
42
|
+
*
|
|
43
|
+
* @param selector - The selector object from the change.
|
|
44
|
+
* @param appComponent - The app component (optional).
|
|
45
|
+
* @returns The target control element or undefined.
|
|
46
|
+
*/
|
|
47
|
+
function getControlBySelector(selector, appComponent) {
|
|
48
|
+
if (!selector?.id) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
let control = getControlById(selector.id);
|
|
52
|
+
if (!control && appComponent && selector) {
|
|
53
|
+
try {
|
|
54
|
+
control = JsControlTreeModifier.bySelector(selector, appComponent);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
Log.warning('Failed to get control by selector:', getError(error));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return control;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Checks wether this object is an instance of a ManagedObject.
|
|
64
|
+
*
|
|
65
|
+
* @param element An object.
|
|
66
|
+
* @returns True if element is an instance of a ManagedObject.
|
|
67
|
+
*/
|
|
68
|
+
function isManagedObject(element) {
|
|
69
|
+
if (typeof element?.isA === 'function') {
|
|
70
|
+
return element.isA('sap.ui.base.ManagedObject');
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Checks whether this object is an instance of the named type.
|
|
77
|
+
*
|
|
78
|
+
* @param type - Type to check for.
|
|
79
|
+
* @param element - Object to check
|
|
80
|
+
* @returns Whether this object is an instance of the given type.
|
|
81
|
+
*/
|
|
82
|
+
function isA(type, element) {
|
|
83
|
+
return !!element?.isA(type);
|
|
84
|
+
}
|
|
85
|
+
function hasParent(component, parentIdToFind) {
|
|
86
|
+
const parent = component.getParent();
|
|
87
|
+
if (!parent) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (parent.getId() === parentIdToFind) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return hasParent(parent, parentIdToFind);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Utility function to safely call getParent on UI5 elements
|
|
98
|
+
* @param element UI5 element
|
|
99
|
+
* @returns parent element or null
|
|
100
|
+
*/
|
|
101
|
+
function getElementParent(element) {
|
|
102
|
+
if (typeof element.getParent === 'function') {
|
|
103
|
+
return element.getParent();
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Finds the view that contains the given control.
|
|
110
|
+
*
|
|
111
|
+
* @param control - Control instance
|
|
112
|
+
* @returns View instance if found, undefined otherwise
|
|
113
|
+
*/
|
|
114
|
+
function findViewByControl(control) {
|
|
115
|
+
if (!control) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
if (isA('sap.ui.core.mvc.View', control)) {
|
|
119
|
+
return control;
|
|
120
|
+
}
|
|
121
|
+
const parent = getElementParent(control);
|
|
122
|
+
if (!parent) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
return findViewByControl(parent);
|
|
126
|
+
}
|
|
127
|
+
function findNestedElements(ownerElement, candidates) {
|
|
128
|
+
const ownerId = ownerElement.getId();
|
|
129
|
+
return candidates.filter(item => hasParent(item, ownerId));
|
|
130
|
+
}
|
|
131
|
+
var __exports = {
|
|
132
|
+
__esModule: true
|
|
133
|
+
};
|
|
134
|
+
__exports.getComponent = getComponent;
|
|
135
|
+
__exports.getControlById = getControlById;
|
|
136
|
+
__exports.getControlBySelector = getControlBySelector;
|
|
137
|
+
__exports.isManagedObject = isManagedObject;
|
|
138
|
+
__exports.isA = isA;
|
|
139
|
+
__exports.hasParent = hasParent;
|
|
140
|
+
__exports.findViewByControl = findViewByControl;
|
|
141
|
+
__exports.findNestedElements = findNestedElements;
|
|
142
|
+
return __exports;
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import Component from 'sap/ui/core/Component';
|
|
2
|
+
import type { ID } from 'sap/ui/core/library';
|
|
3
|
+
import type ManagedObject from 'sap/ui/base/ManagedObject';
|
|
4
|
+
import Element from 'sap/ui/core/Element';
|
|
5
|
+
import View from 'sap/ui/core/mvc/View';
|
|
6
|
+
import type Selector from 'sap/ui/fl/Selector';
|
|
7
|
+
import JsControlTreeModifier from 'sap/ui/core/util/reflection/JsControlTreeModifier';
|
|
8
|
+
import Log from 'sap/base/Log';
|
|
9
|
+
import { getError } from './error';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gets Component by id.
|
|
13
|
+
*
|
|
14
|
+
* @param id - unique identifier for control
|
|
15
|
+
* @returns Component | undefined
|
|
16
|
+
*/
|
|
17
|
+
export function getComponent<T extends Component = Component>(id: ID): T | undefined {
|
|
18
|
+
if (Component?.getComponentById) {
|
|
19
|
+
return Component.getComponentById(id) as T;
|
|
20
|
+
} else if (Component?.get) {
|
|
21
|
+
// Older version must be still supported until maintenance period.
|
|
22
|
+
return Component.get(id) as T; // NOSONAR
|
|
23
|
+
} else {
|
|
24
|
+
// Older version must be still supported until maintenance period.
|
|
25
|
+
return sap.ui.getCore().getComponent(id) as T; // NOSONAR
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns control by its global ID.
|
|
31
|
+
*
|
|
32
|
+
* @param id Id of the control.
|
|
33
|
+
* @returns Control instance if it exists.
|
|
34
|
+
*/
|
|
35
|
+
export function getControlById<T extends Element = Element>(id: string): T | undefined {
|
|
36
|
+
if (typeof Element.getElementById === 'function') {
|
|
37
|
+
return Element.getElementById(id) as T;
|
|
38
|
+
} else {
|
|
39
|
+
return sap.ui.getCore().byId(id) as T;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets target control by trying getControlById first, then falling back to JsControlTreeModifier.bySelector
|
|
45
|
+
* for projects where the control may not be found by global ID.
|
|
46
|
+
*
|
|
47
|
+
* @param selector - The selector object from the change.
|
|
48
|
+
* @param appComponent - The app component (optional).
|
|
49
|
+
* @returns The target control element or undefined.
|
|
50
|
+
*/
|
|
51
|
+
export function getControlBySelector<T extends Element = Element>(
|
|
52
|
+
selector: Selector | undefined,
|
|
53
|
+
appComponent?: Component
|
|
54
|
+
): T | undefined {
|
|
55
|
+
if (!selector?.id) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let control = getControlById<T>(selector.id);
|
|
60
|
+
if (!control && appComponent && selector) {
|
|
61
|
+
try {
|
|
62
|
+
control = JsControlTreeModifier.bySelector(selector, appComponent) as unknown as T | undefined;
|
|
63
|
+
} catch (error) {
|
|
64
|
+
Log.warning('Failed to get control by selector:', getError(error));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return control;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Checks wether this object is an instance of a ManagedObject.
|
|
73
|
+
*
|
|
74
|
+
* @param element An object.
|
|
75
|
+
* @returns True if element is an instance of a ManagedObject.
|
|
76
|
+
*/
|
|
77
|
+
export function isManagedObject(element: object | undefined): element is ManagedObject {
|
|
78
|
+
if (typeof (element as unknown as { isA?: (_type: string) => boolean })?.isA === 'function') {
|
|
79
|
+
return (element as unknown as { isA: (_type: string) => boolean }).isA('sap.ui.base.ManagedObject');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Checks whether this object is an instance of the named type.
|
|
87
|
+
*
|
|
88
|
+
* @param type - Type to check for.
|
|
89
|
+
* @param element - Object to check
|
|
90
|
+
* @returns Whether this object is an instance of the given type.
|
|
91
|
+
*/
|
|
92
|
+
export function isA<T extends ManagedObject>(type: string, element: ManagedObject | undefined): element is T {
|
|
93
|
+
return !!element?.isA(type);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function hasParent(component: ManagedObject, parentIdToFind: string): boolean {
|
|
97
|
+
const parent = component.getParent();
|
|
98
|
+
if (!parent) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (parent.getId() === parentIdToFind) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return hasParent(parent, parentIdToFind);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Utility function to safely call getParent on UI5 elements
|
|
109
|
+
* @param element UI5 element
|
|
110
|
+
* @returns parent element or null
|
|
111
|
+
*/
|
|
112
|
+
function getElementParent(element: Element | ManagedObject): ManagedObject | null {
|
|
113
|
+
if (typeof element.getParent === 'function') {
|
|
114
|
+
return element.getParent();
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Finds the view that contains the given control.
|
|
121
|
+
*
|
|
122
|
+
* @param control - Control instance
|
|
123
|
+
* @returns View instance if found, undefined otherwise
|
|
124
|
+
*/
|
|
125
|
+
export function findViewByControl(control: Element | ManagedObject): View | undefined {
|
|
126
|
+
if (!control) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
if (isA<View>('sap.ui.core.mvc.View', control)) {
|
|
130
|
+
return control;
|
|
131
|
+
}
|
|
132
|
+
const parent = getElementParent(control);
|
|
133
|
+
if (!parent) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
return findViewByControl(parent);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function findNestedElements(
|
|
140
|
+
ownerElement: Element,
|
|
141
|
+
candidates: Element[]
|
|
142
|
+
): Element[] {
|
|
143
|
+
const ownerId = ownerElement.getId();
|
|
144
|
+
return candidates.filter((item) => hasParent(item, ownerId));
|
|
145
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
|
|
8
|
+
*
|
|
9
|
+
* @param error {unknown} - the error instance
|
|
10
|
+
* @returns {Error} the error
|
|
11
|
+
*/
|
|
12
|
+
function getError(error) {
|
|
13
|
+
return error instanceof Error ? error : new Error(JSON.stringify(error));
|
|
14
|
+
}
|
|
15
|
+
class FetchError extends Error {
|
|
16
|
+
constructor(response) {
|
|
17
|
+
super(`Fetch error: ${response.url}, ${response.status} - ${response.statusText}`);
|
|
18
|
+
this.status = response.status;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
var __exports = {
|
|
22
|
+
__esModule: true
|
|
23
|
+
};
|
|
24
|
+
__exports.getError = getError;
|
|
25
|
+
__exports.FetchError = FetchError;
|
|
26
|
+
return __exports;
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
|
|
3
|
+
*
|
|
4
|
+
* @param error {unknown} - the error instance
|
|
5
|
+
* @returns {Error} the error
|
|
6
|
+
*/
|
|
7
|
+
export function getError(error: unknown): Error {
|
|
8
|
+
return error instanceof Error ? error : new Error(JSON.stringify(error));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class FetchError extends Error {
|
|
12
|
+
readonly status: number;
|
|
13
|
+
|
|
14
|
+
constructor(response: Response) {
|
|
15
|
+
super(`Fetch error: ${response.url}, ${response.status} - ${response.statusText}`);
|
|
16
|
+
this.status = response.status;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns application object page definitions found in manifest
|
|
10
|
+
*
|
|
11
|
+
* @param manifest - manifest object
|
|
12
|
+
* @returns array with page descriptors
|
|
13
|
+
*/
|
|
14
|
+
function getV2ApplicationPages(manifest) {
|
|
15
|
+
// do we need to distinguish both navigation source and target entitySets to differentiate alternative routes?
|
|
16
|
+
const rootEntry = manifest['sap.ui.generic.app'] || manifest['sap.ovp'];
|
|
17
|
+
if (rootEntry) {
|
|
18
|
+
const result = [];
|
|
19
|
+
const collectPageData = (pagesDefinitions, idPrefix) => {
|
|
20
|
+
if (!pagesDefinitions) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (Array.isArray(pagesDefinitions)) {
|
|
24
|
+
pagesDefinitions.forEach((entry, idx) => {
|
|
25
|
+
const id = `${idPrefix}-${idx}`;
|
|
26
|
+
if (entry.component.name === OBJECT_PAGE_COMPONENT_NAME) {
|
|
27
|
+
result.push({
|
|
28
|
+
id,
|
|
29
|
+
entitySet: entry.entitySet
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
collectPageData(entry.pages, id);
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
const pageIds = Object.keys(pagesDefinitions);
|
|
36
|
+
for (const pageId of pageIds) {
|
|
37
|
+
if (pagesDefinitions[pageId].component.name === OBJECT_PAGE_COMPONENT_NAME) {
|
|
38
|
+
result.push({
|
|
39
|
+
id: pageId,
|
|
40
|
+
entitySet: pagesDefinitions[pageId].entitySet
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
collectPageData(pagesDefinitions[pageId].pages, idPrefix);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
collectPageData(rootEntry.pages, 'page');
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
var __exports = {
|
|
53
|
+
__esModule: true
|
|
54
|
+
};
|
|
55
|
+
__exports.getV2ApplicationPages = getV2ApplicationPages;
|
|
56
|
+
return __exports;
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=fe-v2.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
|
|
2
|
+
|
|
3
|
+
interface V2ManifestPageDefinition {
|
|
4
|
+
component: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
entitySet: string;
|
|
8
|
+
pages?: Record<string, V2ManifestPageDefinition> | Array<V2ManifestPageDefinition>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns application object page definitions found in manifest
|
|
15
|
+
*
|
|
16
|
+
* @param manifest - manifest object
|
|
17
|
+
* @returns array with page descriptors
|
|
18
|
+
*/
|
|
19
|
+
export function getV2ApplicationPages(manifest: Manifest): { id: string; entitySet: string | undefined }[] {
|
|
20
|
+
// do we need to distinguish both navigation source and target entitySets to differentiate alternative routes?
|
|
21
|
+
const rootEntry = manifest['sap.ui.generic.app'] || manifest['sap.ovp'];
|
|
22
|
+
if (rootEntry) {
|
|
23
|
+
const result: { id: string; entitySet: string | undefined }[] = [];
|
|
24
|
+
|
|
25
|
+
const collectPageData = <T extends Record<string, V2ManifestPageDefinition> | Array<V2ManifestPageDefinition>>(
|
|
26
|
+
pagesDefinitions: T | undefined,
|
|
27
|
+
idPrefix: string
|
|
28
|
+
) => {
|
|
29
|
+
if (!pagesDefinitions) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (Array.isArray(pagesDefinitions)) {
|
|
34
|
+
pagesDefinitions.forEach((entry, idx) => {
|
|
35
|
+
const id = `${idPrefix}-${idx}`;
|
|
36
|
+
if (entry.component.name === OBJECT_PAGE_COMPONENT_NAME) {
|
|
37
|
+
result.push({
|
|
38
|
+
id,
|
|
39
|
+
entitySet: entry.entitySet
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
collectPageData(entry.pages, id);
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
const pageIds = Object.keys(pagesDefinitions);
|
|
46
|
+
for (const pageId of pageIds) {
|
|
47
|
+
if (pagesDefinitions[pageId].component.name === OBJECT_PAGE_COMPONENT_NAME) {
|
|
48
|
+
result.push({
|
|
49
|
+
id: pageId,
|
|
50
|
+
entitySet: pagesDefinitions[pageId].entitySet
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
collectPageData(pagesDefinitions[pageId].pages, idPrefix);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
collectPageData(rootEntry.pages, 'page');
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
}
|