@sapui5/sap.cux.home 1.135.0 → 1.136.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/package.json +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel-dbg.js +23 -5
- package/src/sap/cux/home/AdvancedSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.d.ts +7 -0
- package/src/sap/cux/home/AdvancedSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.ts +24 -5
- package/src/sap/cux/home/AppsAdditionPanel-dbg.js +919 -0
- package/src/sap/cux/home/AppsAdditionPanel-dbg.js.map +1 -0
- package/src/sap/cux/home/AppsAdditionPanel.d.ts +293 -0
- package/src/sap/cux/home/AppsAdditionPanel.d.ts.map +1 -0
- package/src/sap/cux/home/AppsAdditionPanel.js +6 -0
- package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -0
- package/src/sap/cux/home/AppsAdditionPanel.ts +757 -0
- package/src/sap/cux/home/AppsContainer-dbg.js +42 -28
- package/src/sap/cux/home/AppsContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.d.ts +17 -1
- package/src/sap/cux/home/AppsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/AppsContainer.js +1 -1
- package/src/sap/cux/home/AppsContainer.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.ts +27 -6
- package/src/sap/cux/home/AppsContainerGenericPlaceholder-dbg.js +261 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder-dbg.js.map +1 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.d.ts +8 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.js +6 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.js.map +1 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.ts +251 -0
- package/src/sap/cux/home/BaseAppPanel-dbg.js +4 -5
- package/src/sap/cux/home/BaseAppPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.js +1 -1
- package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.ts +3 -5
- package/src/sap/cux/home/BaseAppPersPanel-dbg.js +2 -1
- package/src/sap/cux/home/BaseAppPersPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.js +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.ts +2 -1
- package/src/sap/cux/home/BaseContainer-dbg.js +24 -3
- package/src/sap/cux/home/BaseContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseContainer.d.ts +10 -0
- package/src/sap/cux/home/BaseContainer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainer.js +1 -1
- package/src/sap/cux/home/BaseContainer.js.map +1 -1
- package/src/sap/cux/home/BaseContainer.ts +24 -2
- package/src/sap/cux/home/BaseContainerRenderer-dbg.js +18 -1
- package/src/sap/cux/home/BaseContainerRenderer-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.d.ts +4 -4
- package/src/sap/cux/home/BaseContainerRenderer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.js +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.js.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.ts +25 -4
- package/src/sap/cux/home/BaseLayout-dbg.js +22 -2
- package/src/sap/cux/home/BaseLayout-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseLayout.d.ts +6 -0
- package/src/sap/cux/home/BaseLayout.d.ts.map +1 -1
- package/src/sap/cux/home/BaseLayout.js +1 -1
- package/src/sap/cux/home/BaseLayout.js.map +1 -1
- package/src/sap/cux/home/BaseLayout.ts +23 -2
- package/src/sap/cux/home/BaseNewsItem-dbg.js +3 -3
- package/src/sap/cux/home/BaseNewsItem-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseNewsItem.js +1 -1
- package/src/sap/cux/home/BaseNewsItem.js.map +1 -1
- package/src/sap/cux/home/BaseNewsItem.ts +3 -3
- package/src/sap/cux/home/BaseNewsPanel-dbg.js +4 -5
- package/src/sap/cux/home/BaseNewsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseNewsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseNewsPanel.ts +5 -4
- package/src/sap/cux/home/BasePanel-dbg.js +1 -1
- package/src/sap/cux/home/BasePanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BasePanel.js +1 -1
- package/src/sap/cux/home/BasePanel.js.map +1 -1
- package/src/sap/cux/home/BasePanel.ts +1 -1
- package/src/sap/cux/home/BaseSettingsDialog-dbg.js +11 -0
- package/src/sap/cux/home/BaseSettingsDialog-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsDialog.d.ts.map +1 -1
- package/src/sap/cux/home/BaseSettingsDialog.js +1 -1
- package/src/sap/cux/home/BaseSettingsDialog.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsDialog.ts +12 -0
- package/src/sap/cux/home/BaseSettingsPanel-dbg.js +67 -2
- package/src/sap/cux/home/BaseSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.d.ts +42 -0
- package/src/sap/cux/home/BaseSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.gen.d.ts +75 -0
- package/src/sap/cux/home/BaseSettingsPanel.js +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.ts +70 -2
- package/src/sap/cux/home/CardsPanel-dbg.js +548 -168
- package/src/sap/cux/home/CardsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.d.ts +121 -15
- package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/CardsPanel.gen.d.ts +78 -0
- package/src/sap/cux/home/CardsPanel.js +1 -1
- package/src/sap/cux/home/CardsPanel.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.ts +450 -97
- package/src/sap/cux/home/ContentAdditionDialog-dbg.js +353 -0
- package/src/sap/cux/home/ContentAdditionDialog-dbg.js.map +1 -0
- package/src/sap/cux/home/ContentAdditionDialog.d.ts +82 -0
- package/src/sap/cux/home/ContentAdditionDialog.d.ts.map +1 -0
- package/src/sap/cux/home/ContentAdditionDialog.js +6 -0
- package/src/sap/cux/home/ContentAdditionDialog.js.map +1 -0
- package/src/sap/cux/home/ContentAdditionDialog.ts +214 -0
- package/src/sap/cux/home/ErrorPanel-dbg.js +3 -3
- package/src/sap/cux/home/ErrorPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/ErrorPanel.d.ts.map +1 -1
- package/src/sap/cux/home/ErrorPanel.js +1 -1
- package/src/sap/cux/home/ErrorPanel.js.map +1 -1
- package/src/sap/cux/home/ErrorPanel.ts +4 -2
- package/src/sap/cux/home/FavAppPanel-dbg.js +352 -333
- package/src/sap/cux/home/FavAppPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FavAppPanel.js +1 -1
- package/src/sap/cux/home/FavAppPanel.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.ts +63 -54
- package/src/sap/cux/home/InsightsAdditionPanel-dbg.js +97 -0
- package/src/sap/cux/home/InsightsAdditionPanel-dbg.js.map +1 -0
- package/src/sap/cux/home/InsightsAdditionPanel.d.ts +57 -0
- package/src/sap/cux/home/InsightsAdditionPanel.d.ts.map +1 -0
- package/src/sap/cux/home/InsightsAdditionPanel.js +6 -0
- package/src/sap/cux/home/InsightsAdditionPanel.js.map +1 -0
- package/src/sap/cux/home/InsightsAdditionPanel.ts +94 -0
- package/src/sap/cux/home/InsightsContainer-dbg.js +22 -2
- package/src/sap/cux/home/InsightsContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/InsightsContainer.d.ts +14 -0
- package/src/sap/cux/home/InsightsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsContainer.js +1 -1
- package/src/sap/cux/home/InsightsContainer.js.map +1 -1
- package/src/sap/cux/home/InsightsContainer.ts +22 -1
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder-dbg.js +401 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder-dbg.js.map +1 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.d.ts +8 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.js +6 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.js.map +1 -0
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.ts +391 -0
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js +10 -9
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.ts +9 -8
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel-dbg.js +2 -2
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.ts +2 -2
- package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js +6 -6
- package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.ts +6 -6
- package/src/sap/cux/home/Layout-dbg.js +58 -33
- package/src/sap/cux/home/Layout-dbg.js.map +1 -1
- package/src/sap/cux/home/Layout.d.ts +13 -0
- package/src/sap/cux/home/Layout.d.ts.map +1 -1
- package/src/sap/cux/home/Layout.js +1 -1
- package/src/sap/cux/home/Layout.js.map +1 -1
- package/src/sap/cux/home/Layout.ts +48 -20
- package/src/sap/cux/home/LayoutSettingsPanel-dbg.js +1 -10
- package/src/sap/cux/home/LayoutSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.js +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.ts +2 -10
- package/src/sap/cux/home/NewsAndPagesContainer-dbg.js +35 -17
- package/src/sap/cux/home/NewsAndPagesContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts +7 -0
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.js +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.js.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.ts +40 -16
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder-dbg.js +164 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder-dbg.js.map +1 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts +8 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.js +6 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.js.map +1 -0
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.ts +154 -0
- package/src/sap/cux/home/NewsGroup-dbg.js +112 -79
- package/src/sap/cux/home/NewsGroup-dbg.js.map +1 -1
- package/src/sap/cux/home/NewsGroup.d.ts +1 -0
- package/src/sap/cux/home/NewsGroup.d.ts.map +1 -1
- package/src/sap/cux/home/NewsGroup.js +1 -1
- package/src/sap/cux/home/NewsGroup.js.map +1 -1
- package/src/sap/cux/home/NewsGroup.ts +136 -100
- package/src/sap/cux/home/NewsPanel-dbg.js +541 -173
- package/src/sap/cux/home/NewsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.d.ts +156 -16
- package/src/sap/cux/home/NewsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsPanel.js +1 -1
- package/src/sap/cux/home/NewsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.ts +452 -82
- package/src/sap/cux/home/NewsSettingsPanel-dbg.js +61 -20
- package/src/sap/cux/home/NewsSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.d.ts +14 -0
- package/src/sap/cux/home/NewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.js +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.ts +75 -21
- package/src/sap/cux/home/NoDataContainer-dbg.js +3 -3
- package/src/sap/cux/home/NoDataContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/NoDataContainer.d.ts +1 -0
- package/src/sap/cux/home/NoDataContainer.d.ts.map +1 -1
- package/src/sap/cux/home/NoDataContainer.js +1 -1
- package/src/sap/cux/home/NoDataContainer.js.map +1 -1
- package/src/sap/cux/home/NoDataContainer.ts +4 -2
- package/src/sap/cux/home/PagePanel-dbg.js +86 -75
- package/src/sap/cux/home/PagePanel-dbg.js.map +1 -1
- package/src/sap/cux/home/PagePanel.d.ts +25 -3
- package/src/sap/cux/home/PagePanel.d.ts.map +1 -1
- package/src/sap/cux/home/PagePanel.js +1 -1
- package/src/sap/cux/home/PagePanel.js.map +1 -1
- package/src/sap/cux/home/PagePanel.ts +91 -76
- package/src/sap/cux/home/PageSettingsPanel-dbg.js +16 -15
- package/src/sap/cux/home/PageSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.js +1 -1
- package/src/sap/cux/home/PageSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.ts +15 -14
- package/src/sap/cux/home/RecentAppPanel-dbg.js +2 -2
- package/src/sap/cux/home/RecentAppPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.js +1 -1
- package/src/sap/cux/home/RecentAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.ts +2 -2
- package/src/sap/cux/home/RecommendedAppPanel-dbg.js +4 -3
- package/src/sap/cux/home/RecommendedAppPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.js +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.ts +4 -2
- package/src/sap/cux/home/SettingsDialog-dbg.js +4 -3
- package/src/sap/cux/home/SettingsDialog-dbg.js.map +1 -1
- package/src/sap/cux/home/SettingsDialog.d.ts.map +1 -1
- package/src/sap/cux/home/SettingsDialog.js +1 -1
- package/src/sap/cux/home/SettingsDialog.js.map +1 -1
- package/src/sap/cux/home/SettingsDialog.ts +4 -2
- package/src/sap/cux/home/TaskPanel-dbg.js +16 -12
- package/src/sap/cux/home/TaskPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/TaskPanel.d.ts +1 -2
- package/src/sap/cux/home/TaskPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TaskPanel.js +1 -1
- package/src/sap/cux/home/TaskPanel.js.map +1 -1
- package/src/sap/cux/home/TaskPanel.ts +19 -12
- package/src/sap/cux/home/TilesPanel-dbg.js +9 -8
- package/src/sap/cux/home/TilesPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TilesPanel.js +1 -1
- package/src/sap/cux/home/TilesPanel.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.ts +15 -8
- package/src/sap/cux/home/ToDoPanel-dbg.js +34 -25
- package/src/sap/cux/home/ToDoPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/ToDoPanel.d.ts +0 -7
- package/src/sap/cux/home/ToDoPanel.d.ts.map +1 -1
- package/src/sap/cux/home/ToDoPanel.js +1 -1
- package/src/sap/cux/home/ToDoPanel.js.map +1 -1
- package/src/sap/cux/home/ToDoPanel.ts +27 -29
- package/src/sap/cux/home/ToDosContainer-dbg.js +27 -18
- package/src/sap/cux/home/ToDosContainer-dbg.js.map +1 -1
- package/src/sap/cux/home/ToDosContainer.d.ts +7 -0
- package/src/sap/cux/home/ToDosContainer.d.ts.map +1 -1
- package/src/sap/cux/home/ToDosContainer.js +1 -1
- package/src/sap/cux/home/ToDosContainer.js.map +1 -1
- package/src/sap/cux/home/ToDosContainer.ts +10 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder-dbg.js +84 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder-dbg.js.map +1 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.d.ts +8 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.js +6 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.js.map +1 -0
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.ts +74 -0
- package/src/sap/cux/home/i18n/messagebundle.properties +63 -1
- package/src/sap/cux/home/i18n/messagebundle_ar.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_bg.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ca.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_cnr.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_cs.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_cy.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_da.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_de.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_el.properties +44 -2
- package/src/sap/cux/home/i18n/messagebundle_en.properties +43 -246
- package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +31 -1
- package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_es.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_et.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_fi.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_fr.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_hi.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_hr.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_hu.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_id.properties +47 -5
- package/src/sap/cux/home/i18n/messagebundle_it.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_iw.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ja.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_kk.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ko.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_lt.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_lv.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_mk.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ms.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_nl.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_no.properties +44 -2
- package/src/sap/cux/home/i18n/messagebundle_pl.properties +44 -2
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ro.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_ru.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_sh.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_sk.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_sl.properties +44 -2
- package/src/sap/cux/home/i18n/messagebundle_sr.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_sv.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_th.properties +43 -2
- package/src/sap/cux/home/i18n/messagebundle_tr.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_uk.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_vi.properties +42 -1
- package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +43 -1
- package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +42 -1
- package/src/sap/cux/home/interface/AppsInterface-dbg.js.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.d.ts +5 -3
- package/src/sap/cux/home/interface/AppsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.ts +5 -3
- package/src/sap/cux/home/interface/CardsInterface-dbg.js +32 -0
- package/src/sap/cux/home/interface/CardsInterface-dbg.js.map +1 -1
- package/src/sap/cux/home/interface/CardsInterface.d.ts +320 -55
- package/src/sap/cux/home/interface/CardsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/CardsInterface.js +5 -1
- package/src/sap/cux/home/interface/CardsInterface.js.map +1 -1
- package/src/sap/cux/home/interface/CardsInterface.ts +359 -55
- package/src/sap/cux/home/library-preload.js +88 -45
- package/src/sap/cux/home/library-preload.js.map +1 -1
- package/src/sap/cux/home/manifest.json +4 -4
- package/src/sap/cux/home/themes/base/AppsContainer.less +12 -0
- package/src/sap/cux/home/themes/base/BaseLayout.less +1 -0
- package/src/sap/cux/home/themes/base/ContentAdditionDialog.less +69 -0
- package/src/sap/cux/home/themes/base/NewsAndPagesContainer.less +37 -12
- package/src/sap/cux/home/themes/base/PlaceHolder.less +1374 -0
- package/src/sap/cux/home/themes/base/ToDosContainer.less +1 -1
- package/src/sap/cux/home/themes/base/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/base/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/base/library.css +2 -2
- package/src/sap/cux/home/themes/base/library.source.less +2 -0
- package/src/sap/cux/home/themes/sap_fiori_3/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3/library.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_dark/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_dark/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_dark/library.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/AppsContainer.less +1 -0
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library.source.less +2 -0
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/AppsContainer.less +1 -0
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library.css +2 -2
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library.source.less +2 -0
- package/src/sap/cux/home/themes/sap_horizon/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_horizon/library.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_dark/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_dark/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_horizon_dark/library.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_hcb/AppsContainer.less +1 -0
- package/src/sap/cux/home/themes/sap_horizon_hcb/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_hcb/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcb/library.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_hcb/library.source.less +2 -0
- package/src/sap/cux/home/themes/sap_horizon_hcw/AppsContainer.less +1 -0
- package/src/sap/cux/home/themes/sap_horizon_hcw/library-RTL.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_hcw/library-parameters.json +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcw/library.css +2 -2
- package/src/sap/cux/home/themes/sap_horizon_hcw/library.source.less +2 -0
- package/src/sap/cux/home/utils/AppManager-dbg.js +405 -440
- package/src/sap/cux/home/utils/AppManager-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.d.ts +88 -124
- package/src/sap/cux/home/utils/AppManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/AppManager.js +1 -1
- package/src/sap/cux/home/utils/AppManager.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.ts +351 -542
- package/src/sap/cux/home/utils/Constants-dbg.js +25 -1
- package/src/sap/cux/home/utils/Constants-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/Constants.d.ts +17 -0
- package/src/sap/cux/home/utils/Constants.d.ts.map +1 -1
- package/src/sap/cux/home/utils/Constants.js +1 -1
- package/src/sap/cux/home/utils/Constants.js.map +1 -1
- package/src/sap/cux/home/utils/Constants.ts +20 -1
- package/src/sap/cux/home/utils/Device-dbg.js +49 -1
- package/src/sap/cux/home/utils/Device-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/Device.d.ts +13 -0
- package/src/sap/cux/home/utils/Device.d.ts.map +1 -1
- package/src/sap/cux/home/utils/Device.js +1 -1
- package/src/sap/cux/home/utils/Device.js.map +1 -1
- package/src/sap/cux/home/utils/Device.ts +58 -1
- package/src/sap/cux/home/utils/InsightsUtils-dbg.js +25 -0
- package/src/sap/cux/home/utils/InsightsUtils-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/InsightsUtils.d.ts +14 -0
- package/src/sap/cux/home/utils/InsightsUtils.d.ts.map +1 -1
- package/src/sap/cux/home/utils/InsightsUtils.js +1 -1
- package/src/sap/cux/home/utils/InsightsUtils.js.map +1 -1
- package/src/sap/cux/home/utils/InsightsUtils.ts +25 -0
- package/src/sap/cux/home/utils/PerformanceUtils-dbg.js +5 -2
- package/src/sap/cux/home/utils/PerformanceUtils-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/PerformanceUtils.d.ts +1 -0
- package/src/sap/cux/home/utils/PerformanceUtils.d.ts.map +1 -1
- package/src/sap/cux/home/utils/PerformanceUtils.js +1 -1
- package/src/sap/cux/home/utils/PerformanceUtils.js.map +1 -1
- package/src/sap/cux/home/utils/PerformanceUtils.ts +5 -1
- package/src/sap/cux/home/utils/RecommendedCardUtil-dbg.js +1599 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil-dbg.js.map +1 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil.d.ts +534 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil.d.ts.map +1 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil.js +6 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil.js.map +1 -0
- package/src/sap/cux/home/utils/RecommendedCardUtil.ts +1945 -0
- package/src/sap/cux/home/utils/SituationUtils-dbg.js +1 -1
- package/src/sap/cux/home/utils/SituationUtils-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/SituationUtils.js +1 -1
- package/src/sap/cux/home/utils/SituationUtils.js.map +1 -1
- package/src/sap/cux/home/utils/SituationUtils.ts +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.d.ts +4 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.d.ts.map +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.js.map +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.ts +2 -1
- package/src/sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml +126 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
4
4
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
5
5
|
*/
|
|
6
|
-
sap.ui.predefine("sap/cux/home/AdvancedSettingsPanel", ["sap/base/Log","sap/insights/CardHelper","sap/m/Button","sap/m/CheckBox","sap/m/CustomListItem","sap/m/HBox","sap/m/IconTabBar","sap/m/IconTabFilter","sap/m/Input","sap/m/Label","sap/m/library","sap/m/List","sap/m/MessageStrip","sap/m/MessageToast","sap/m/ObjectStatus","sap/m/OverflowToolbar","sap/m/Panel","sap/m/Text","sap/m/Title","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","sap/ui/core/library","sap/ui/layout/form/SimpleForm","sap/ui/model/json/JSONModel","sap/ui/unified/FileUploader","sap/ushell/Container","./BaseSettingsPanel","./utils/Accessibility","./utils/AppManager","./utils/Constants","./utils/FESRUtil","./utils/HttpHelper","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(t,e,s,n,o,i,r,a,l,c,p,d,u,h,g,m,f,P,I,x,S,v,T,E,b,C,y,B,M,_,w,z,U,A,R,L,F,N){"use strict";function O(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function D(t,e){try{var s=t()}catch(t){return e(t)}if(s&&s.then){return s.then(void 0,e)}return s}const $=p["FlexAlignItems"];const V=p["ToolbarStyle"];const H=b["ValueState"];const j=O(_);const k=w["checkPanelExists"];const X=O(z);const J=U["SETTINGS_PANELS_KEYS"];const G=A["addFESRSemanticStepName"];const K=A["FESR_EVENTS"];const q=O(R);const W=O(L);const Y=O(F);const Z=O(N);var Q=function(t){t["IMPORT"]="import";t["EXPORT"]="export";return t}(Q||{});const tt="/sap/opu/odata4/ui2/insights_srv/srvd/ui2/";const et=tt+"insights_cards_repo_srv/0001/";const st=et+"INSIGHTS_CARDS/com.sap.gateway.srvd.ui2.insights_cards_repo_srv.v0001.importExport?";const nt="AZHJGRIT78TG7Y65RF6EPFJ9U";const ot="sap.cux.home.NewsAndPagesContainer";const it="sap.cux.home.AppsContainer";const rt="sap.cux.home.InsightsContainer";const at="sap.cux.home.PagePanel";const lt="sap.cux.home.FavAppPanel";const ct="sap.cux.home.RecommendedAppPanel";const pt="sap.cux.home.TilesPanel";const dt="sap.cux.home.CardsPanel";const ut=j.extend("sap.cux.home.AdvancedSettingsPanel",{metadata:{events:{sectionsImported:{}}},constructor:function t(e,s){j.prototype.constructor.call(this,e,s)},init:function t(){j.prototype.init.call(this);this.setProperty("key",J.ADVANCED);this.setProperty("title",this._i18nBundle.getText("advancedSettings"));this.setProperty("icon","sap-icon://grid");this.oEventBus=E.getInstance();this.oAppManagerInstance=X.getInstance();this.oSectionsImported={};this.oUserPersonalization={export:{sections:[],fileName:"MY_HOME",sectionsSelected:false,error:false},import:{sections:[],sectionsSelected:false,error:false},selectedTab:"export",showNoImport:false};this.oControlModel=new y(this.oUserPersonalization);this.addAggregation("content",this.getContent());this.addInnerContent();this.attachPanelNavigated(()=>{const t=this;void function(){try{if(!t.oPageManagerInstance){t.oPageManagerInstance=W.getInstance(Y.getPersContainerId(t._getPanel()),Y.getOwnerComponent(t._getPanel()))}t.oEventBus.subscribe("importChannel","tilesImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("insightsTiles",!o)},t);t.oEventBus.subscribe("importChannel","appsImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("favApps",!o)},t);t.oEventBus.subscribe("importChannel","favPagesImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("pages",!o)},t);t.oEventBus.subscribe("importChannel","cardsImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("insightsCards",!o)},t);t.oDetailPage=T.getElementById(t.getProperty("key")+"-detail-page");const e=t._getPanel();if(k(e,it,ct)){void t._setRecommendationSettingsPanel()}return Promise.resolve(t.loadUserPersonalizationData()).then(function(){t.oImportBtn.setEnabled(t.oUserPersonalization.import.sectionsSelected);t.enableDisableActions(t.oUserPersonalization.selectedTab);t.setImportExportList();t.oExportMessage.setText(t.oUserPersonalization.export.errorMessage?String(t.oUserPersonalization.export.errorMessage):"");t.oExportMessage.setType(t.oUserPersonalization.export.errorType);t.oExportMessage.setProperty("visible",t.oUserPersonalization.export.error,true);t.oFileNameInput.setValue(String(t.oUserPersonalization.export.fileName));t.oImportMessage.setText(t.oUserPersonalization.import.errorMessage?String(t.oUserPersonalization.import.errorMessage):"");t.oImportMessage.setType(t.oUserPersonalization.import.errorType);t.oImportMessage.setVisible(t.oUserPersonalization.import.error)})}catch(t){return Promise.reject(t)}}()})},setImportExportList:function t(){if(!this.oExportList){this.oExportList=this.setExportSectionList();this._importExportPanel.addContent(this.oExportList)}else{this.oExportList.invalidate()}if(!this.oImportList){this.oImportList=this.setImportSectionList();this._importExportPanel.addContent(this.oImportList)}else{this.oImportList.invalidate()}},enableDisableActions:function t(e){this.oImportExportTab?.setSelectedKey(e);this.oImportBtn?.setVisible(e===Q.IMPORT);this.oExportBtn?.setVisible(e===Q.EXPORT);if(this.oUserPersonalization.import.sectionsSelected&&e===Q.IMPORT){this.oImportBtn.setEnabled(true)}else{this.oImportBtn.setEnabled(false)}if(e===Q.EXPORT&&this.oUserPersonalization.export.fileName&&this.oUserPersonalization.export.sections?.length&&this.oUserPersonalization.export.sectionsSelected){this.oExportBtn.setEnabled(true)}else{this.oExportBtn.setEnabled(false)}},setExportImportValues:function t(e){if(e===Q.EXPORT){this.oExportMessage.setText(this.oUserPersonalization.export.errorMessage?String(this.oUserPersonalization.export.errorMessage):"");this.oExportMessage.setType(this.oUserPersonalization.export.errorType);this.oExportMessage.setProperty("visible",this.oUserPersonalization.export.error,true)}else if(e===Q.IMPORT){this.oImportMessage.setText(this.oUserPersonalization.import.errorMessage?String(this.oUserPersonalization.import.errorMessage):"");this.oImportMessage.setType(this.oUserPersonalization.import.errorType);this.oImportMessage.setProperty("visible",this.oUserPersonalization.import.error)}},getContent:function t(){if(!this.oContentVBox){this.oContentVBox=new v(this.getId()+"--idAdvancedVBox",{items:[new P(this.getId()+"--idPersonalizationSubheader",{text:this._i18nBundle.getText("advancedSettingsSubheader")}).addStyleClass("sapUiSmallMarginBegin sapUiSmallMarginTop"),this._getImportExportPanel()]})}return this.oContentVBox},_getImportExportPanel:function t(){if(!this._importExportPanel){this._importExportPanel=new f(`${this.getId()}-importExportPanel`,{headerToolbar:new m(`${this.getId()}-importExportPanelToolbar`,{style:V.Clear,content:[new P(`${this.getId()}-importExportPanelToolbarText`,{text:this._i18nBundle.getText("importAndExportPanelHeader")}),new S(`${this.getId()}-importExportPanelToolbarSpacer`),this._getImportButton(),this._getExportButton()]}),headerText:this._i18nBundle.getText("importAndExportPanelHeader"),expanded:true,expandable:true,content:[]}).addStyleClass("sapUiSmallMarginTop")}return this._importExportPanel},_getImportButton:function t(){if(!this.oImportBtn){this.oImportBtn=new s({id:`${this.getId()}-importBtn`,text:this._i18nBundle.getText("import"),type:"Transparent",press:()=>{void this.onImportPress()},visible:false});G(this._getImportButton(),K.PRESS,"importBtn")}return this.oImportBtn},_getExportButton:function t(){if(!this.oExportBtn){this.oExportBtn=new s({id:`${this.getId()}-exportBtn`,text:this._i18nBundle.getText("export"),type:"Transparent",press:this.onExportPress.bind(this),visible:true});G(this.oExportBtn,K.PRESS,"exportBtn")}return this.oExportBtn},addInnerContent:function t(){if(!this.oImportExportTab){this.oImportExportTab=new r(this.getId()+"--idImportExportTab",{expandable:false,backgroundDesign:"Transparent",selectedKey:this.oSelectedTab?this.oSelectedTab:"export",select:this.onImportExportTabSelect.bind(this)});const t=new a(this.getId()+"--idExportTab",{key:"export",text:this._i18nBundle.getText("exportFile")});G(t,K.SELECT,"exportTab");this.oExportMessage=new u(this.getId()+"--idExportMessageStrip",{showIcon:true,visible:false}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom");const e=new P(this.getId()+"--idExportText",{text:this._i18nBundle.getText("exportText")}).addStyleClass("advancePadding");const n=new i(this.getId()+"--idFileInputContainer",{alignItems:"Center"}).addStyleClass("sapUiSmallMargin");const o=new c(this.getId()+"--idFilenameLabel",{text:this._i18nBundle.getText("exportFileNameLabel"),labelFor:"idTitleFilenameInput",required:true,showColon:true}).addStyleClass("sapUiSmallMarginEnd");this.oFileNameInput=new l(this.getId()+"--idFileNameInput",{ariaLabelledBy:[`${this.getId()}--idExportText`,`${this.getId()}--idFilenameLabel`],required:true,width:"13rem",liveChange:this.onFileNameInputChange.bind(this),value:""});n.addItem(o);n.addItem(this.oFileNameInput);t.addContent(this.oExportMessage);t.addContent(e);t.addContent(n);const p=new a(this.getId()+"--idImportTab",{key:"import",text:this._i18nBundle.getText("importFile")});G(p,K.SELECT,"importTab");this.oImportMessage=new u(this.getId()+"--idImportMessageStrip",{text:"{advsettings>/import/errorMessage}",type:"{advsettings>/import/errorType}",showIcon:true,visible:false}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom");const d=new P(this.getId()+"--idImportText",{text:this._i18nBundle.getText("importText")}).addStyleClass("advancePadding");const h=new C(this.getId()+"--idImportSimpleForm",{editable:true,layout:"ResponsiveGridLayout",labelSpanS:4,labelSpanM:4});const g=new B(this.getId()+"--idImportFileUploader",{tooltip:this._i18nBundle.getText("uploadImportFile"),fileType:["txt"],change:t=>{void this.onFileImport(t)},maximumFileSize:25,sameFilenameAllowed:true,width:"80%",ariaLabelledBy:[`${this.getId()}--idImportText`],buttonText:this._i18nBundle.getText("importFileUploaderButton")});h.addContent(g);p.addContent(this.oImportMessage);p.addContent(d);p.addContent(h);const m=new a(this.getId()+"--idClassicImportTab",{key:"classicImport",text:this._i18nBundle.getText("classicImport")});G(m,K.SELECT,"classicImportTab");const f=new P(this.getId()+"--idClassicImportText",{text:this._i18nBundle.getText("classicImportText")}).addStyleClass("sapUiSmallMarginBottom advancePadding");const I=new s(this.getId()+"--resetImportAppsNow",{text:this._i18nBundle.getText("resetButton"),press:this.onResetImportApps.bind(this),ariaLabelledBy:[`${this.getId()}--idClassicImportText`]}).addStyleClass("resetButtonPadding");G(I,K.PRESS,"resetImportApps");m.addContent(f);m.addContent(I);this.oImportExportTab.addItem(t);this.oImportExportTab.addItem(p);this.oImportExportTab.addItem(m);this._importExportPanel.addContent(this.oImportExportTab);this._importExportPanel.addContent(this.setExportSectionList())}},setExportSectionList:function t(){const e=new d(`${this.getId()}--exportSectionsList`,{width:"calc(100% - 2rem)",growingThreshold:50,includeItemInSelection:true,visible:"{= ${advsettings>/selectedTab} === 'export'}"}).addStyleClass("sapUiSmallMarginBegin");const s=new x(`${this.getId()}--exportSectionsListToolbar`,{content:[new I(this.getId()+"--idExportSectionsListHeaderText",{text:this._i18nBundle.getText("sectionExportListHeader")}).addStyleClass("sectionTitle")]});e.setHeaderToolbar(s);e.setModel(this.oControlModel,"advsettings");e.bindItems({path:"advsettings>/export/sections",template:new o(`${this.getId()}--exportCustomListItem`,{visible:{path:"advsettings>panelClass",formatter:this._isPanelAvailable.bind(this)},content:[new i(`${this.getId()}--exportContentBox`,{alignItems:"Center",items:[new n(`${this.getId()}--exportListItemCheck`,{select:this.onSectionsSelectionChange.bind(this,false),selected:"{advsettings>selected}",enabled:"{advsettings>enabled}"}),new P(`${this.getId()}--exportListItemText`,{text:"{advsettings>title}"})],width:"100%"})]})});this.oExportList=e;return e},_isPanelAvailable:function t(e){const s={[lt]:{containerName:it,panelName:lt},[at]:{containerName:ot,panelName:at},[pt]:{containerName:rt,panelName:pt},[dt]:{containerName:rt,panelName:dt}};const n=s[e];if(!n)return false;const o=this._getPanel();return k(o,n.containerName,n.panelName)},setImportSectionList:function t(){const e=new d(this.getId()+"--idImportSectionsList",{width:"calc(100% - 2rem)",growingThreshold:50,includeItemInSelection:true,visible:"{= ${advsettings>/selectedTab} === 'import' && (${advsettings>/import/sections/length} > 0 || ${advsettings>/showNoImport})}"}).addStyleClass("sapUiSmallMarginBegin");const s=new x(this.getId()+"--idImportSectionsListToolbar",{content:[new I(`${this.getId()}--importSectionsListHeaderText`,{text:this._i18nBundle.getText("sectionImportListHeader")}).addStyleClass("sectionTitle")]});e.setHeaderToolbar(s);e.setModel(this.oControlModel,"advsettings");e.bindItems({path:"advsettings>/import/sections",template:new o(`${this.getId()}--importCustomListItem`,{content:[new i({justifyContent:"SpaceBetween",items:[new i({items:[new n(`${this.getId()}--importListItemCheck`,{select:this.onSectionsSelectionChange.bind(this,true),selected:"{advsettings>selected}",enabled:"{advsettings>enabled}"}),new P(`${this.getId()}--importListItemText`,{text:"{advsettings>title}"}).addStyleClass("sapUiTinyMarginTop")]}),new i({items:[new g(`${this.getId()}--importItemStatus`,{icon:"{= ${advsettings>status} === 'Success' ? 'sap-icon://status-positive' : 'sap-icon://status-negative' }",state:"{advsettings>status}",visible:"{= ${advsettings>status} !== 'None'}"}).addStyleClass("sapUiSmallMarginEnd sapUiTinyMarginTop")]})],width:"100%"})]})});return e},onSectionsSelectionChange:function t(e){const s=e?this.oImportList.getItems():this.oExportList.getItems();let n=false;let o,i;const r=s.some(function(t){if(!e){o=t.getAggregation("content");i=o[0].getItems()[0];n=i.getSelected()}else{o=t.getAggregation("content");const e=o[0].getItems()[0];i=e.getItems()[0];n=i.getSelected()}return n});this.oControlModel.setProperty((e?"/import":"/export")+"/sectionsSelected",r);this.enableDisableActions(e?"import":"export")},onImportPress:function e(){try{const e=this;e.attachEvent("sectionsImported",()=>{e.oDetailPage.setBusy(false);e.oControlModel.setProperty("/import/sectionsSelected",false)});e.oImportBtn.setEnabled(false);e.oDetailPage.setBusy(true);e.handleUserPersonalizationError(Q.IMPORT,false,"","");const s=e.oUserPersonalization.import.data;const n=D(function(){return Promise.resolve(e.importSections(s)).then(function(t){const s=t.some(t=>t.status===H.Error);if(s){e.handleUserPersonalizationError(Q.IMPORT,true,String(e._i18nBundle.getText("userPersonalizationImportError")),"Warning")}e.oControlModel.setProperty("/import/sections",t)})},function(s){t.error("importpress",String(s));e.handleUserPersonalizationError(Q.IMPORT,true,String(e._i18nBundle.getText("userPersonalizationImportError")),"Error")});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},importSections:function e(s){const n=[];const o=[];const i=this.oControlModel.getProperty("/import/sections");n.push(()=>this.importApps(s));n.push(()=>this.importTiles(s));n.push(()=>this.importFavPages(s));o.push(n.reduce((t,e)=>t.then(()=>e()),Promise.resolve()));o.push(this.importCards(s));return Promise.all(o).then(()=>i).catch(e=>{t.error("import failed",String(e));return[]})},importApps:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.apps&&e?.apps.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("favApps")))){this.oSectionsImported[String(this._i18nBundle.getText("favApps"))]=false;this.oEventBus.publish("importChannel","appsImport",{apps:e.apps,groupInfo:e.groupInfo});t()}else{this.oSectionsImported[String(this._i18nBundle.getText("favApps"))]=true;this.updateImportStatus("favApps");t()}})},importTiles:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.tiles&&e.tiles.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("insightsTiles")))){this.oSectionsImported[String(this._i18nBundle.getText("insightsTiles"))]=false;this.oEventBus.publish("importChannel","tilesImport",e.tiles);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("insightsTiles"))]=true;this.updateImportStatus("insightsTiles");t()}})},importFavPages:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.favouritePages&&e.favouritePages.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("pages")))){this.oSectionsImported[String(this._i18nBundle.getText("pages"))]=false;this.oEventBus.publish("importChannel","favPagesImport",e.favouritePages);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("pages"))]=true;this.updateImportStatus("pages");t()}})},importCards:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.cards&&e.cards.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("insightsCards")))){this.oSectionsImported[String(this._i18nBundle.getText("insightsCards"))]=false;this.oEventBus.publish("importChannel","cardsImport",e.cards);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("insightsCards"))]=true;this.updateImportStatus("insightsCards");t()}})},updateImportStatus:function t(e,s){const n=String(this._i18nBundle.getText(e));const o=this.oControlModel.getProperty("/import/sections");const i=o.find(function(t){return t.title===n});if(i){if(s!==undefined){i.status=s?H.Error:H.Success}else{i.status=H.None}if(i.status===H.Success){i.enabled=false}}this.oSectionsImported[n]=true;const r=Object.keys(this.oSectionsImported);const a=r.every(t=>this.oSectionsImported[t]);if(a){this.fireEvent("sectionsImported")}},resetImportModel:function t(e){this.oControlModel.setProperty("/import/sections",[]);this.oControlModel.setProperty("/import/sectionsSelected",false);this.oControlModel.setProperty("/import/error",false);if(e){this.oControlModel.setProperty("/selectedTab","export");T.getElementById(this.getId()+"--idImportFileUploader")?.setValue("")}},getDeltaSectionViz:function e(s){try{const e=this;return Promise.resolve(D(function(){return Promise.resolve(e.oAppManagerInstance._getSections(true)).then(function(t){s.forEach(e=>{let s;if(e.default){s=t.find(t=>t.default)}else{s=t.find(t=>t.id===e.id)}if(s){const t=e.visualizations?.filter(t=>s.visualizations?.every(e=>e.isBookmark?e.targetURL!==t.targetURL:e.vizId!==t.vizId));e.visualizations=t}});return s})},function(e){t.error("Error occurred while fetching delta section visualizations:"+String(e));return[]}))}catch(t){return Promise.reject(t)}},getDeltaAuthSectionViz:function e(s){if(s&&s.length){return this.getDeltaSectionViz(s).then(t=>this.filterAuthSectionViz(t)).catch(e=>{t.error(String(e));return[]})}return Promise.resolve([])},filterAuthSectionViz:function t(e){try{const t=function(){return M.getServiceAsync("SearchableContent").then(function(t){return t.getApps({includeAppsWithoutVisualizations:false})})};const s=function(t,e){const s=[];e?.forEach(function(e){for(let n of t){const t=n;const o=t.visualizations.find(function(t){return t.vizId===e.vizId||e.isBookmark&&t.target&&e.target?.action===t.target.action&&e.target?.semanticObject===t.target.semanticObject});if(o){o.displayFormatHint=e.displayFormatHint!=="standard"?String(e.displayFormatHint):String(o.displayFormatHint);s.push(e.isBookmark?e:o);break}}});return s};return Promise.resolve(t().then(function(t){return e.map(function(e){e.visualizations=s(t,e.visualizations);return e})}))}catch(t){return Promise.reject(t)}},filterAuthFavPages:function t(e){try{let s=false;const n=this;function o(t){return s?t:Promise.resolve([])}const i=function(){if(e&&e.length>0){return Promise.resolve(n.oPageManagerInstance.fetchAllAvailablePages().then(function(t){return e.filter(function(e){return t.filter(function(t){return t.pageId===e.pageId&&t.spaceId===e.spaceId}).length})})).then(function(t){s=true;return t})}}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}},filterAuthCards:function t(e){try{let s=false;function n(t){return s?t:Promise.resolve([])}const o=function(t,e){return t.find(function(t){return t.resolutionResult&&t.resolutionResult.applicationDependencies&&e["sap.insights"]&&t.resolutionResult.applicationDependencies.name===e["sap.insights"].parentAppId})};const i=function(t,e){if(e){return t.isNavigationSupported([{target:{semanticObject:e.semanticObject,action:e.action}}]).then(function(t){return t[0].supported||false})}return Promise.resolve(false)};const r=function(){if(e&&e.length>0){return Promise.resolve(Promise.all([M.getServiceAsync("ClientSideTargetResolution"),M.getServiceAsync("Navigation")]).then(function(t){const s=t[0];const n=t[1];const r=s._oAdapter._aInbounds||[];return e.reduce(function(t,e){return Promise.resolve(t).then(function(t){const s=o(r,e);return Promise.resolve(i(n,s)).then(function(s){if(s){t.push(e)}return t})})},Promise.resolve([]))})).then(function(t){s=true;return t})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(a){return Promise.reject(a)}},onFileImport:function e(s){this.handleUserPersonalizationError(Q.IMPORT,false,"","");this.resetImportModel();this.oDetailPage.setBusy(true);const n=s.getParameter("files");const o=n&&n[0];return this.readFileContent(o).then(t=>{const e=window.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));return q.Post(st,{fileContent:e}).then(t=>{if(t&&t.error){throw new Error(t.error)}if(t&&t.value&&t.value.length){const e=t.value[0].fileContent;const s=JSON.parse(e);if(s.host===window.location.host){const t=s.sections||[];t.push({id:nt,visualizations:s.tiles||[]});return this.filterAuthorizedImportData(t,s)}else{this.handleUserPersonalizationError(Q.IMPORT,true,String(this._i18nBundle.getText("importSourceErrorMessage")),"");return Promise.resolve()}}})}).catch(e=>{t.error(String(e));this.handleUserPersonalizationError(Q.IMPORT,true,"","")}).finally(()=>{this.oDetailPage.setBusy(false);this.enableDisableActions(Q.IMPORT)})},filterAuthorizedImportData:function t(e,s){const n=this;return Promise.all([this.getDeltaAuthSectionViz(e),this.filterAuthFavPages(s.favouritePages),this.filterAuthCards(s.cards),this.getInsightCards()]).then(function(t){try{const e=t[0];const o=t[1];const i=t[2];const r=t[3].getProperty("/cardCount");s.apps=e.filter(function(t){return t.id!==nt});s.tiles=(e.find(function(t){return t.id===nt})||{}).visualizations||[];s.favouritePages=o;s.cards=i||[];const a=r+Number(i?.length);if(a>99){n.handleUserPersonalizationError(Q.IMPORT,true,String(n._i18nBundle.getText("importCardCountErrorMessage")),"")}return Promise.resolve(n.getImportedSections(s,Q.IMPORT,r)).then(function(t){t=t.map(function(t){t.status=H.None;return t});n.oUserPersonalization.import.data=s;n.oControlModel.setProperty("/import/sections",t);n.oControlModel.setProperty("/import/sectionsSelected",n.getSelectedSections(t).length>0);n.oControlModel.setProperty("/showNoImport",t.length===0)})}catch(t){return Promise.reject(t)}})},readFileContent:function t(e){return new Promise(function(t,s){if(e&&window.FileReader){const s=new FileReader;s.onload=function(e){const s=e.target;t(s?.result)};const n=e;s.readAsText(n)}else{s(new Error("Error"))}})},_getPersonalizationData:function t(){try{const e=this;function s(){return Promise.resolve(e.oPersonalizerInstance.read()).then(function(t){e.persData=t||{};return e.persData})}const n=function(){if(!e.oPersonalizerInstance){return Promise.resolve(Z.getInstance(Y.getPersContainerId(e._getPanel()),Y.getOwnerComponent(e._getPanel()))).then(function(t){e.oPersonalizerInstance=t})}}();return Promise.resolve(n&&n.then?n.then(s):s(n))}catch(o){return Promise.reject(o)}},loadUserPersonalizationData:function t(){try{const t=this;t.oExportList.setBusy(true);return Promise.resolve(t._getPersonalizationData()).then(function(e){return Promise.resolve(Promise.all([t.oAppManagerInstance._getSections(true),t.getInsightCards()])).then(function(s){let[n,o]=s;const i=n,r=i.filter(t=>t.id!==nt&&t.visualizations?.length);const a=i.find(t=>t.id===nt)?.visualizations||[];const l=o&&o.getProperty("/visibleCards")?o.getProperty("/visibleCards").map(t=>t.descriptorContent):[];const c={apps:r,tiles:a,favouritePages:e.favouritePages,cards:l,personalization:e};return Promise.resolve(t.getImportedSections(c,Q.EXPORT,0)).then(function(e){t.oUserPersonalization.export.data=c;t.oUserPersonalization.export.sections=e;t.oUserPersonalization.export.sectionsSelected=t.getSelectedSections(e).length>0;t.oControlModel.refresh();t.oExportList.setBusy(false)})})})}catch(t){return Promise.reject(t)}},getSelectedSections:function t(e){return e.filter(function(t){return t.selected&&t.enabled})||[]},isSectionSelected:function t(e,s){const n=e.find(function(t){return t.title===s});return!!(n&&n.selected&&n.enabled)},getImportedSections:function t(e,s,n){try{const o=this;function i(t){const s=e.apps&&e.apps.some(function(t){return t&&t.visualizations&&t.visualizations.length>0});return[{title:o._i18nBundle.getText("favApps"),selected:s,enabled:s,panelClass:lt},{title:o._i18nBundle.getText("pages"),selected:t.length>0,enabled:t.length>0,panelClass:at},{title:o._i18nBundle.getText("insightsTiles"),selected:e.tiles&&e.tiles.length>0,enabled:e.tiles&&e.tiles.length>0,panelClass:pt},{title:o._i18nBundle.getText("insightsCards"),selected:e.cards&&e.cards.length>0&&e.cards.length+n<=99,enabled:e.cards&&e.cards.length>0&&e.cards.length+n<=99,panelClass:dt}]}const r=s===Q.IMPORT;return Promise.resolve(r?Promise.resolve(o.getDeltaFavPages(e.favouritePages)).then(i):i(e.favouritePages))}catch(a){return Promise.reject(a)}},getDeltaFavPages:function t(e){try{const t=this;return Promise.resolve(t._getPersonalizationData()).then(function(t){const s=t.favouritePages||[];return s.length!==e.length?e:e.filter(function(t){return!s.find(function(e){return t.pageId===e.pageId&&t.spaceId===e.spaceId})})})}catch(t){return Promise.reject(t)}},getInsightCards:function t(){try{const t=this;return Promise.resolve(D(function(){return Promise.resolve(e.getServiceAsync()).then(function(e){t.cardHelperInstance=e;return Promise.resolve(t.cardHelperInstance._getUserAllCardModel()).then(function(t){const e=t.getProperty("/cards");const s=e.filter(function(t){return t.visibility});t.setProperty("/visibleCards",s);return t})})},function(t){throw t}))}catch(t){return Promise.reject(t)}},onExportPress:function e(){this.handleUserPersonalizationError(Q.EXPORT,false,"","");const s=this.oControlModel.getProperty("/export/fileName"),n=this.oControlModel.getProperty("/export/sections"),o=this.oUserPersonalization.export.data;const i=this.getExportFileContent(o,n);sap.ui.require(["sap/ui/core/util/File"],e=>{try{e.save(JSON.stringify(i),s,"txt","text/plain","utf-8");h.show(String(this._i18nBundle.getText("userPersonalizationExportSuccess")))}catch(e){t.error(e instanceof Error?e.message:String(e));if(e instanceof Error&&e?.name!==undefined&&e.name!=="AbortError"){this.handleUserPersonalizationError(Q.EXPORT,true,"","")}}})},getExportFileContent:function t(e,s){const n=e?.personalization,o={host:window.location.host,createdDate:new Date,sections:[],groupInfo:[],tiles:[],cards:[],favouritePages:[]};if(this.isSectionSelected(s,this._i18nBundle.getText("favApps"))){o.sections=e?.apps||[];o.groupInfo=n?.favoriteApps||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("pages"))){o.favouritePages=n?.favouritePages||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("insightsTiles"))){o.tiles=e?.tiles||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("insightsCards"))){o.cards=this.filterNonSensitiveCards(e?.cards||[])}return o},filterNonSensitiveCards:function t(e){const s=[];e.forEach(t=>{if(t["sap.card"]?.configuration?.parameters){const e=t["sap.card"].configuration.parameters;let n=[];n=n.concat(this.getSensitiveProps(e.headerState)).concat(this.getSensitiveProps(e.lineItemState)).concat(this.getSensitiveProps(e.state));if(n.length===0){s.push(t)}}else{s.push(t)}});if(e.length!==s.length){this.handleUserPersonalizationError(Q.EXPORT,true,String(this._i18nBundle.getText("exportSensitiveCardsErrorMessage")),"Warning")}return s},getSensitiveProps:function t(e){let s=[];if(e?.value){const t=JSON.parse(e.value);const n=t.sensitiveProps||Object.keys(t.parameters?.ibnParams?.sensitiveProps||{});if(n.length>0){s=s.concat(n)}}return s},handleUserPersonalizationError:function t(e,s,n,o){const i=this._i18nBundle.getText(e===Q.IMPORT?"importErrorMessage":"exportErrorMessage");this.oControlModel.setProperty("/"+e+"/error",s,undefined,true);this.oControlModel.setProperty("/"+e+"/errorMessage",n||i,undefined,true);this.oControlModel.setProperty("/"+e+"/errorType",o||"Error",undefined,true);this.setExportImportValues(e)},onImportExportTabSelect:function t(e){const s=e.getParameter("selectedKey");this.oSelectedTab=s;this.oControlModel.setProperty("/selectedTab",s);this.oExportList.setVisible(s==="export");this.oImportBtn.setVisible(s==="import");this.oExportBtn.setVisible(s==="export");this.oImportBtn.setEnabled(this.oUserPersonalization.import.sectionsSelected);this.oExportBtn.setEnabled(this.oUserPersonalization.export.sectionsSelected);this.oExportBtn.setEnabled(!!(this.oUserPersonalization.export.fileName&&this.oUserPersonalization.export.sections&&this.oUserPersonalization.export.sections.length>0&&this.oUserPersonalization.export.sectionsSelected))},onFileNameInputChange:function t(e){const s=e.getParameter("value")?.trim();const n=e.getSource();let o=H.None;let i="";if(!s||!s.length){o=H.Error;i=String(this._i18nBundle.getText("invalidExportFileName"))}n.setValueState(o);n.setValueStateText(i);this.oControlModel.setProperty("/export/fileName",s);this.enableDisableActions(Q.EXPORT)},onResetImportApps:function t(){this.oEventBus.publish("importChannel","resetImported");h.show(this._i18nBundle.getText("importAppsNowBtnEnabled"))},_getRecommendationSettingsPanel:function t(){try{const t=this;return Promise.resolve(t._getPersonalizationData()).then(function(e){if(!t._recommendationSettingsPanel){const s=t.getId()+"--recommendationSettingsPanel";t._recommendationSettingsPanel=new f(s,{headerText:t._i18nBundle.getText("recommendationSettingsHeader"),expanded:true,expandable:true,content:[new P({id:`${s}-container-subHeader`,text:t._i18nBundle.getText("recommendationSettingsSubHeader")}),new i({id:`${s}-container`,items:[new n({id:`${s}-container-checkBox`,selected:e.showRecommendation??true,select:e=>t.onRecommendationSettingChange(e),ariaLabelledBy:[`${s}-container-subHeader`,`${s}-container-label`]}),new P({id:`${s}-container-label`,text:t._i18nBundle.getText("recommendationSettingsCheckboxLabel")})],alignItems:$.Center}).addStyleClass("sapUiSmallMarginTop")]}).addStyleClass("sapUiSmallMarginTop")}return t._recommendationSettingsPanel})}catch(t){return Promise.reject(t)}},_setRecommendationSettingsPanel:function t(){try{const t=this;t.oDetailPage.setBusy(true);return Promise.resolve(t._getRecommendationSettingsPanel()).then(function(e){if(e){t.oContentVBox.addItem(e);t.oDetailPage.setBusy(false)}})}catch(t){return Promise.reject(t)}},onRecommendationSettingChange:function t(e){try{const t=this;const s=e.getParameter("selected");t.oEventBus.publish("importChannel","recommendationSettingChanged",{showRecommendation:s});return Promise.resolve(t._getPersonalizationData()).then(function(e){void t.oPersonalizerInstance.write({...e,showRecommendation:s})})}catch(t){return Promise.reject(t)}}});ut.ImportExportType=Q;return ut});
|
|
6
|
+
sap.ui.predefine("sap/cux/home/AdvancedSettingsPanel", ["sap/base/Log","sap/insights/CardHelper","sap/m/Button","sap/m/CheckBox","sap/m/CustomListItem","sap/m/HBox","sap/m/IconTabBar","sap/m/IconTabFilter","sap/m/Input","sap/m/Label","sap/m/library","sap/m/List","sap/m/MessageStrip","sap/m/MessageToast","sap/m/ObjectStatus","sap/m/OverflowToolbar","sap/m/Panel","sap/m/Text","sap/m/Title","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","sap/ui/core/library","sap/ui/layout/form/SimpleForm","sap/ui/model/json/JSONModel","sap/ui/unified/FileUploader","sap/ushell/Container","./BaseSettingsPanel","./utils/Accessibility","./utils/AppManager","./utils/Constants","./utils/FESRUtil","./utils/HttpHelper","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(t,e,s,n,o,i,r,a,l,c,p,d,u,h,g,m,f,P,I,x,S,v,T,E,b,C,y,B,M,_,w,z,U,A,L,R,F,N){"use strict";function D(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function O(t,e){try{var s=t()}catch(t){return e(t)}if(s&&s.then){return s.then(void 0,e)}return s}const $=p["FlexAlignItems"];const V=p["ToolbarStyle"];const H=b["ValueState"];const j=D(_);const k=w["checkPanelExists"];const X=D(z);const J=U["SETTINGS_PANELS_KEYS"];const G=A["addFESRSemanticStepName"];const K=A["FESR_EVENTS"];const q=D(L);const W=D(R);const Y=D(F);const Z=D(N);var Q=function(t){t["IMPORT"]="import";t["EXPORT"]="export";return t}(Q||{});const tt="/sap/opu/odata4/ui2/insights_srv/srvd/ui2/";const et=tt+"insights_cards_repo_srv/0001/";const st=et+"INSIGHTS_CARDS/com.sap.gateway.srvd.ui2.insights_cards_repo_srv.v0001.importExport?";const nt="AZHJGRIT78TG7Y65RF6EPFJ9U";const ot="sap.cux.home.NewsAndPagesContainer";const it="sap.cux.home.AppsContainer";const rt="sap.cux.home.InsightsContainer";const at="sap.cux.home.PagePanel";const lt="sap.cux.home.FavAppPanel";const ct="sap.cux.home.RecommendedAppPanel";const pt="sap.cux.home.TilesPanel";const dt="sap.cux.home.CardsPanel";const ut=j.extend("sap.cux.home.AdvancedSettingsPanel",{metadata:{events:{sectionsImported:{}}},constructor:function t(e,s){j.prototype.constructor.call(this,e,s)},init:function t(){j.prototype.init.call(this);this.setProperty("key",J.ADVANCED);this.setProperty("title",this._i18nBundle.getText("advancedSettings"));this.setProperty("icon","sap-icon://grid");this.oEventBus=E.getInstance();this.oAppManagerInstance=X.getInstance();this.oSectionsImported={};this.oUserPersonalization={export:{sections:[],fileName:"MY_HOME",sectionsSelected:false,error:false},import:{sections:[],sectionsSelected:false,error:false},selectedTab:"export",showNoImport:false};this.oControlModel=new y(this.oUserPersonalization);this.addAggregation("content",this.getContent());this.addInnerContent();this.attachPanelNavigated(()=>{const t=this;void function(){try{if(!t.oPageManagerInstance){t.oPageManagerInstance=W.getInstance(Y.getPersContainerId(t._getPanel()),Y.getOwnerComponent(t._getPanel()))}t.oEventBus.subscribe("importChannel","tilesImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("insightsTiles",!o)},t);t.oEventBus.subscribe("importChannel","appsImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("favApps",!o)},t);t.oEventBus.subscribe("importChannel","favPagesImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("pages",!o)},t);t.oEventBus.subscribe("importChannel","cardsImported",(e,s,n)=>{const o=n.status;t.updateImportStatus("insightsCards",!o)},t);t.oDetailPage=T.getElementById(t.getProperty("key")+"-detail-page");const e=t._getPanel();if(k(e,it,ct)){void t._setRecommendationSettingsPanel()}return Promise.resolve(t.loadUserPersonalizationData()).then(function(){t.oImportBtn.setEnabled(t.oUserPersonalization.import.sectionsSelected);t.enableDisableActions(t.oUserPersonalization.selectedTab);t.setImportExportList();t.oExportMessage.setText(t.oUserPersonalization.export.errorMessage?String(t.oUserPersonalization.export.errorMessage):"");t.oExportMessage.setType(t.oUserPersonalization.export.errorType);t.oExportMessage.setProperty("visible",t.oUserPersonalization.export.error,true);t.oFileNameInput.setValue(String(t.oUserPersonalization.export.fileName));t.oImportMessage.setText(t.oUserPersonalization.import.errorMessage?String(t.oUserPersonalization.import.errorMessage):"");t.oImportMessage.setType(t.oUserPersonalization.import.errorType);t.oImportMessage.setVisible(t.oUserPersonalization.import.error)})}catch(t){return Promise.reject(t)}}()})},setImportExportList:function t(){if(!this.oExportList){this.oExportList=this.setExportSectionList();this._importExportPanel.addContent(this.oExportList)}else{this.oExportList.invalidate()}if(!this.oImportList){this.oImportList=this.setImportSectionList();this._importExportPanel.addContent(this.oImportList)}else{this.oImportList.invalidate()}},enableDisableActions:function t(e){this.oImportExportTab?.setSelectedKey(e);this.oImportBtn?.setVisible(e===Q.IMPORT);this.oExportBtn?.setVisible(e===Q.EXPORT);if(this.oUserPersonalization.import.sectionsSelected&&e===Q.IMPORT){this.oImportBtn.setEnabled(true)}else{this.oImportBtn.setEnabled(false)}if(e===Q.EXPORT&&this.oUserPersonalization.export.fileName&&this.oUserPersonalization.export.sections?.length&&this.oUserPersonalization.export.sectionsSelected){this.oExportBtn.setEnabled(true)}else{this.oExportBtn.setEnabled(false)}},setExportImportValues:function t(e){if(e===Q.EXPORT){this.oExportMessage.setText(this.oUserPersonalization.export.errorMessage?String(this.oUserPersonalization.export.errorMessage):"");this.oExportMessage.setType(this.oUserPersonalization.export.errorType);this.oExportMessage.setProperty("visible",this.oUserPersonalization.export.error,true)}else if(e===Q.IMPORT){this.oImportMessage.setText(this.oUserPersonalization.import.errorMessage?String(this.oUserPersonalization.import.errorMessage):"");this.oImportMessage.setType(this.oUserPersonalization.import.errorType);this.oImportMessage.setProperty("visible",this.oUserPersonalization.import.error)}},getContent:function t(){if(!this.oContentVBox){this.oContentVBox=new v(this.getId()+"--idAdvancedVBox",{items:[new P(this.getId()+"--idPersonalizationSubheader",{text:this._i18nBundle.getText("advancedSettingsSubheader")}).addStyleClass("sapUiSmallMarginBegin sapUiSmallMarginTop"),this._getImportExportPanel()]})}return this.oContentVBox},_getImportExportPanel:function t(){if(!this._importExportPanel){this._importExportPanel=new f(`${this.getId()}-importExportPanel`,{headerToolbar:new m(`${this.getId()}-importExportPanelToolbar`,{style:V.Clear,content:[new P(`${this.getId()}-importExportPanelToolbarText`,{text:this._i18nBundle.getText("importAndExportPanelHeader")}),new S(`${this.getId()}-importExportPanelToolbarSpacer`),this._getImportButton(),this._getExportButton()]}),headerText:this._i18nBundle.getText("importAndExportPanelHeader"),expanded:true,expandable:true,content:[]}).addStyleClass("sapUiSmallMarginTop")}return this._importExportPanel},_getImportButton:function t(){if(!this.oImportBtn){this.oImportBtn=new s({id:`${this.getId()}-importBtn`,text:this._i18nBundle.getText("import"),type:"Transparent",press:()=>{void this.onImportPress()},visible:false});G(this._getImportButton(),K.PRESS,"importBtn")}return this.oImportBtn},_getExportButton:function t(){if(!this.oExportBtn){this.oExportBtn=new s({id:`${this.getId()}-exportBtn`,text:this._i18nBundle.getText("export"),type:"Transparent",press:this.onExportPress.bind(this),visible:true});G(this.oExportBtn,K.PRESS,"exportBtn")}return this.oExportBtn},addInnerContent:function t(){if(!this.oImportExportTab){this.oImportExportTab=new r(this.getId()+"--idImportExportTab",{expandable:false,backgroundDesign:"Transparent",selectedKey:this.oSelectedTab?this.oSelectedTab:"export",select:this.onImportExportTabSelect.bind(this)});const t=new a(this.getId()+"--idExportTab",{key:"export",text:this._i18nBundle.getText("exportFile")});G(t,K.SELECT,"exportTab");this.oExportMessage=new u(this.getId()+"--idExportMessageStrip",{showIcon:true,visible:false}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom");const e=new P(this.getId()+"--idExportText",{text:this._i18nBundle.getText("exportText")}).addStyleClass("advancePadding");const n=new i(this.getId()+"--idFileInputContainer",{alignItems:"Center"}).addStyleClass("sapUiSmallMargin");const o=new c(this.getId()+"--idFilenameLabel",{text:this._i18nBundle.getText("exportFileNameLabel"),labelFor:"idTitleFilenameInput",required:true,showColon:true}).addStyleClass("sapUiSmallMarginEnd");this.oFileNameInput=new l(this.getId()+"--idFileNameInput",{ariaLabelledBy:[`${this.getId()}--idExportText`,`${this.getId()}--idFilenameLabel`],required:true,width:"13rem",liveChange:this.onFileNameInputChange.bind(this),value:""});n.addItem(o);n.addItem(this.oFileNameInput);t.addContent(this.oExportMessage);t.addContent(e);t.addContent(n);const p=new a(this.getId()+"--idImportTab",{key:"import",text:this._i18nBundle.getText("importFile")});G(p,K.SELECT,"importTab");this.oImportMessage=new u(this.getId()+"--idImportMessageStrip",{text:"{advsettings>/import/errorMessage}",type:"{advsettings>/import/errorType}",showIcon:true,visible:false}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom");const d=new P(this.getId()+"--idImportText",{text:this._i18nBundle.getText("importText")}).addStyleClass("advancePadding");const h=new C(this.getId()+"--idImportSimpleForm",{editable:true,layout:"ResponsiveGridLayout",labelSpanS:4,labelSpanM:4});const g=new B(this.getId()+"--idImportFileUploader",{tooltip:this._i18nBundle.getText("uploadImportFile"),fileType:["txt"],change:t=>{void this.onFileImport(t)},maximumFileSize:25,sameFilenameAllowed:true,width:"80%",ariaLabelledBy:[`${this.getId()}--idImportText`],buttonText:this._i18nBundle.getText("importFileUploaderButton")});h.addContent(g);p.addContent(this.oImportMessage);p.addContent(d);p.addContent(h);const m=new a(this.getId()+"--idClassicImportTab",{key:"classicImport",text:this._i18nBundle.getText("classicImport")});G(m,K.SELECT,"classicImportTab");const f=new P(this.getId()+"--idClassicImportText",{text:this._i18nBundle.getText("classicImportText")}).addStyleClass("sapUiSmallMarginBottom advancePadding");const I=new s(this.getId()+"--resetImportAppsNow",{text:this._i18nBundle.getText("resetButton"),press:this.onResetImportApps.bind(this),ariaLabelledBy:[`${this.getId()}--idClassicImportText`]}).addStyleClass("resetButtonPadding");G(I,K.PRESS,"resetImportApps");m.addContent(f);m.addContent(I);this.oImportExportTab.addItem(t);this.oImportExportTab.addItem(p);this.oImportExportTab.addItem(m);this._importExportPanel.addContent(this.oImportExportTab);this._importExportPanel.addContent(this.setExportSectionList())}},setExportSectionList:function t(){const e=new d(`${this.getId()}--exportSectionsList`,{width:"calc(100% - 2rem)",growingThreshold:50,includeItemInSelection:true,visible:"{= ${advsettings>/selectedTab} === 'export'}"}).addStyleClass("sapUiSmallMarginBegin");const s=new x(`${this.getId()}--exportSectionsListToolbar`,{content:[new I(this.getId()+"--idExportSectionsListHeaderText",{text:this._i18nBundle.getText("sectionExportListHeader")}).addStyleClass("sectionTitle")]});e.setHeaderToolbar(s);e.setModel(this.oControlModel,"advsettings");e.bindItems({path:"advsettings>/export/sections",template:new o(`${this.getId()}--exportCustomListItem`,{visible:{path:"advsettings>panelClass",formatter:this._isPanelAvailable.bind(this)},accDescription:{path:"advsettings>title",formatter:this._formatAccDescription.bind(this)},content:[new i(`${this.getId()}--exportContentBox`,{alignItems:"Center",items:[new n(`${this.getId()}--exportListItemCheck`,{select:this.onSectionsSelectionChange.bind(this,false),selected:"{advsettings>selected}",enabled:"{advsettings>enabled}"}),new P(`${this.getId()}--exportListItemText`,{text:"{advsettings>title}"})],width:"100%"})]})});this.oExportList=e;return e},_formatAccDescription:function t(e){const s=this._i18nBundle.getText("checkboxInstructionText");return`${e}. ${s}`},_isPanelAvailable:function t(e){const s={[lt]:{containerName:it,panelName:lt},[at]:{containerName:ot,panelName:at},[pt]:{containerName:rt,panelName:pt},[dt]:{containerName:rt,panelName:dt}};const n=s[e];if(!n)return false;const o=this._getPanel();return k(o,n.containerName,n.panelName)},setImportSectionList:function t(){const e=new d(this.getId()+"--idImportSectionsList",{width:"calc(100% - 2rem)",growingThreshold:50,includeItemInSelection:true,visible:"{= ${advsettings>/selectedTab} === 'import' && (${advsettings>/import/sections/length} > 0 || ${advsettings>/showNoImport})}"}).addStyleClass("sapUiSmallMarginBegin");const s=new x(this.getId()+"--idImportSectionsListToolbar",{content:[new I(`${this.getId()}--importSectionsListHeaderText`,{text:this._i18nBundle.getText("sectionImportListHeader")}).addStyleClass("sectionTitle")]});e.setHeaderToolbar(s);e.setModel(this.oControlModel,"advsettings");e.bindItems({path:"advsettings>/import/sections",template:new o(`${this.getId()}--importCustomListItem`,{accDescription:{path:"advsettings>title",formatter:this._formatAccDescription.bind(this)},content:[new i(`${this.getId()}--importListCheckBox`,{justifyContent:"SpaceBetween",items:[new i(`${this.getId()}--importListItemCheckHBox`,{items:[new n(`${this.getId()}--importListItemCheck`,{select:this.onSectionsSelectionChange.bind(this,true),selected:"{advsettings>selected}",enabled:"{advsettings>enabled}"}),new P(`${this.getId()}--importListItemText`,{text:"{advsettings>title}"}).addStyleClass("sapUiTinyMarginTop")]}),new i(`${this.getId()}--importStatusHBox`,{items:[new g(`${this.getId()}--importItemStatus`,{icon:"{= ${advsettings>status} === 'Success' ? 'sap-icon://status-positive' : 'sap-icon://status-negative' }",state:"{advsettings>status}",visible:"{= ${advsettings>status} !== 'None'}"}).addStyleClass("sapUiSmallMarginEnd sapUiTinyMarginTop")]})],width:"100%"})]})});return e},onSectionsSelectionChange:function t(e){const s=e?this.oImportList.getItems():this.oExportList.getItems();let n=false;let o,i;const r=s.some(function(t){if(!e){o=t.getAggregation("content");i=o[0].getItems()[0];n=i.getSelected()}else{o=t.getAggregation("content");const e=o[0].getItems()[0];i=e.getItems()[0];n=i.getSelected()}return n});this.oControlModel.setProperty((e?"/import":"/export")+"/sectionsSelected",r);this.enableDisableActions(e?"import":"export")},onImportPress:function e(){try{const e=this;e.attachEvent("sectionsImported",()=>{e.oDetailPage.setBusy(false);e.oControlModel.setProperty("/import/sectionsSelected",false)});e.oImportBtn.setEnabled(false);e.oDetailPage.setBusy(true);e.handleUserPersonalizationError(Q.IMPORT,false,"","");const s=e.oUserPersonalization.import.data;const n=O(function(){return Promise.resolve(e.importSections(s)).then(function(t){const s=t.some(t=>t.status===H.Error);if(s){e.handleUserPersonalizationError(Q.IMPORT,true,String(e._i18nBundle.getText("userPersonalizationImportError")),"Warning")}e.oControlModel.setProperty("/import/sections",t)})},function(s){t.error("importpress",String(s));e.handleUserPersonalizationError(Q.IMPORT,true,String(e._i18nBundle.getText("userPersonalizationImportError")),"Error")});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},importSections:function e(s){const n=[];const o=[];const i=this.oControlModel.getProperty("/import/sections");n.push(()=>this.importApps(s));n.push(()=>this.importTiles(s));n.push(()=>this.importFavPages(s));o.push(n.reduce((t,e)=>t.then(()=>e()),Promise.resolve()));o.push(this.importCards(s));return Promise.all(o).then(()=>i).catch(e=>{t.error("import failed",String(e));return[]})},importApps:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.apps&&e?.apps.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("favApps")))){this.oSectionsImported[String(this._i18nBundle.getText("favApps"))]=false;this.oEventBus.publish("importChannel","appsImport",{apps:e.apps,groupInfo:e.groupInfo});t()}else{this.oSectionsImported[String(this._i18nBundle.getText("favApps"))]=true;this.updateImportStatus("favApps");t()}})},importTiles:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.tiles&&e.tiles.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("insightsTiles")))){this.oSectionsImported[String(this._i18nBundle.getText("insightsTiles"))]=false;this.oEventBus.publish("importChannel","tilesImport",e.tiles);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("insightsTiles"))]=true;this.updateImportStatus("insightsTiles");t()}})},importFavPages:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.favouritePages&&e.favouritePages.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("pages")))){this.oSectionsImported[String(this._i18nBundle.getText("pages"))]=false;this.oEventBus.publish("importChannel","favPagesImport",e.favouritePages);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("pages"))]=true;this.updateImportStatus("pages");t()}})},importCards:function t(e){return new Promise(t=>{const s=this.oControlModel.getProperty("/import/sections");if(e?.cards&&e.cards.length>0&&this.isSectionSelected(s,String(this._i18nBundle.getText("insightsCards")))){this.oSectionsImported[String(this._i18nBundle.getText("insightsCards"))]=false;this.oEventBus.publish("importChannel","cardsImport",e.cards);t()}else{this.oSectionsImported[String(this._i18nBundle.getText("insightsCards"))]=true;this.updateImportStatus("insightsCards");t()}})},updateImportStatus:function t(e,s){const n=String(this._i18nBundle.getText(e));const o=this.oControlModel.getProperty("/import/sections");const i=o.find(function(t){return t.title===n});if(i){if(s!==undefined){i.status=s?H.Error:H.Success}else{i.status=H.None}if(i.status===H.Success){i.enabled=false}}this.oSectionsImported[n]=true;const r=Object.keys(this.oSectionsImported);const a=r.every(t=>this.oSectionsImported[t]);if(a){this.fireEvent("sectionsImported")}},resetImportModel:function t(e){this.oControlModel.setProperty("/import/sections",[]);this.oControlModel.setProperty("/import/sectionsSelected",false);this.oControlModel.setProperty("/import/error",false);if(e){this.oControlModel.setProperty("/selectedTab","export");T.getElementById(this.getId()+"--idImportFileUploader")?.setValue("")}},getDeltaSectionViz:function e(s){try{const e=this;return Promise.resolve(O(function(){return Promise.resolve(e.oAppManagerInstance._getSections(true)).then(function(t){s.forEach(e=>{let s;if(e.default){s=t.find(t=>t.default)}else{s=t.find(t=>t.id===e.id)}if(s){const t=e.visualizations?.filter(t=>s.visualizations?.every(e=>e.isBookmark?e.targetURL!==t.targetURL:e.vizId!==t.vizId));e.visualizations=t}});return s})},function(e){t.error("Error occurred while fetching delta section visualizations:"+String(e));return[]}))}catch(t){return Promise.reject(t)}},getDeltaAuthSectionViz:function e(s){if(s&&s.length){return this.getDeltaSectionViz(s).then(t=>this.filterAuthSectionViz(t)).catch(e=>{t.error(String(e));return[]})}return Promise.resolve([])},filterAuthSectionViz:function t(e){try{const t=function(){return M.getServiceAsync("SearchableContent").then(function(t){return t.getApps({includeAppsWithoutVisualizations:false})})};const s=function(t,e){const s=[];e?.forEach(function(e){for(let n of t){const t=n;const o=t.visualizations.find(function(t){return t.vizId===e.vizId||e.isBookmark&&t.target&&e.target?.action===t.target.action&&e.target?.semanticObject===t.target.semanticObject});if(o){o.displayFormatHint=e.displayFormatHint!=="standard"?String(e.displayFormatHint):String(o.displayFormatHint);s.push(e.isBookmark?e:o);break}}});return s};return Promise.resolve(t().then(function(t){return e.map(function(e){e.visualizations=s(t,e.visualizations);return e})}))}catch(t){return Promise.reject(t)}},filterAuthFavPages:function t(e){try{let s=false;const n=this;function o(t){return s?t:Promise.resolve([])}const i=function(){if(e&&e.length>0){return Promise.resolve(n.oPageManagerInstance.fetchAllAvailablePages().then(function(t){return e.filter(function(e){return t.filter(function(t){return t.pageId===e.pageId&&t.spaceId===e.spaceId}).length})})).then(function(t){s=true;return t})}}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}},filterAuthCards:function t(e){try{let s=false;function n(t){return s?t:Promise.resolve([])}const o=function(t,e){return t.find(function(t){return t.resolutionResult&&t.resolutionResult.applicationDependencies&&e["sap.insights"]&&t.resolutionResult.applicationDependencies.name===e["sap.insights"].parentAppId})};const i=function(t,e){if(e){return t.isNavigationSupported([{target:{semanticObject:e.semanticObject,action:e.action}}]).then(function(t){return t[0].supported||false})}return Promise.resolve(false)};const r=function(){if(e&&e.length>0){return Promise.resolve(Promise.all([M.getServiceAsync("ClientSideTargetResolution"),M.getServiceAsync("Navigation")]).then(function(t){const s=t[0];const n=t[1];const r=s._oAdapter._aInbounds||[];return e.reduce(function(t,e){return Promise.resolve(t).then(function(t){const s=o(r,e);return Promise.resolve(i(n,s)).then(function(s){if(s){t.push(e)}return t})})},Promise.resolve([]))})).then(function(t){s=true;return t})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(a){return Promise.reject(a)}},onFileImport:function e(s){this.handleUserPersonalizationError(Q.IMPORT,false,"","");this.resetImportModel();this.oDetailPage.setBusy(true);const n=s.getParameter("files");const o=n&&n[0];return this.readFileContent(o).then(t=>{const e=window.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));return q.Post(st,{fileContent:e}).then(t=>{if(t&&t.error){throw new Error(t.error)}if(t&&t.value&&t.value.length){const e=t.value[0].fileContent;const s=JSON.parse(e);if(s.host===window.location.host){const t=s.sections||[];t.push({id:nt,visualizations:s.tiles||[]});return this.filterAuthorizedImportData(t,s)}else{this.handleUserPersonalizationError(Q.IMPORT,true,String(this._i18nBundle.getText("importSourceErrorMessage")),"");return Promise.resolve()}}})}).catch(e=>{t.error(String(e));this.handleUserPersonalizationError(Q.IMPORT,true,"","")}).finally(()=>{this.oDetailPage.setBusy(false);this.enableDisableActions(Q.IMPORT)})},filterAuthorizedImportData:function t(e,s){const n=this;return Promise.all([this.getDeltaAuthSectionViz(e),this.filterAuthFavPages(s.favouritePages),this.filterAuthCards(s.cards),this.getInsightCards()]).then(function(t){try{const e=t[0];const o=t[1];const i=t[2];const r=t[3].getProperty("/cardCount");s.apps=e.filter(function(t){return t.id!==nt});s.tiles=(e.find(function(t){return t.id===nt})||{}).visualizations||[];s.favouritePages=o;s.cards=i||[];const a=r+Number(i?.length);if(a>99){n.handleUserPersonalizationError(Q.IMPORT,true,String(n._i18nBundle.getText("importCardCountErrorMessage")),"")}return Promise.resolve(n.getImportedSections(s,Q.IMPORT,r)).then(function(t){t=t.map(function(t){t.status=H.None;return t});n.oUserPersonalization.import.data=s;n.oControlModel.setProperty("/import/sections",t);n.oControlModel.setProperty("/import/sectionsSelected",n.getSelectedSections(t).length>0);n.oControlModel.setProperty("/showNoImport",t.length===0)})}catch(t){return Promise.reject(t)}})},readFileContent:function t(e){return new Promise(function(t,s){if(e&&window.FileReader){const s=new FileReader;s.onload=function(e){const s=e.target;t(s?.result)};const n=e;s.readAsText(n)}else{s(new Error("Error"))}})},_getPersonalizationData:function t(){try{const e=this;function s(){return Promise.resolve(e.oPersonalizerInstance.read()).then(function(t){e.persData=t||{};return e.persData})}const n=function(){if(!e.oPersonalizerInstance){return Promise.resolve(Z.getInstance(Y.getPersContainerId(e._getPanel()),Y.getOwnerComponent(e._getPanel()))).then(function(t){e.oPersonalizerInstance=t})}}();return Promise.resolve(n&&n.then?n.then(s):s(n))}catch(o){return Promise.reject(o)}},loadUserPersonalizationData:function t(){try{const t=this;t.oExportList.setBusy(true);return Promise.resolve(t._getPersonalizationData()).then(function(e){return Promise.resolve(Promise.all([t.oAppManagerInstance._getSections(true),t.getInsightCards()])).then(function(s){let[n,o]=s;const i=n,r=i.filter(t=>t.id!==nt&&t.visualizations?.length);const a=i.find(t=>t.id===nt)?.visualizations||[];const l=o&&o.getProperty("/visibleCards")?o.getProperty("/visibleCards").map(t=>t.descriptorContent):[];const c={apps:r,tiles:a,favouritePages:e.favouritePages,cards:l,personalization:e};return Promise.resolve(t.getImportedSections(c,Q.EXPORT,0)).then(function(e){t.oUserPersonalization.export.data=c;t.oUserPersonalization.export.sections=e;t.oUserPersonalization.export.sectionsSelected=t.getSelectedSections(e).length>0;t.oControlModel.refresh();t.oExportList.setBusy(false)})})})}catch(t){return Promise.reject(t)}},getSelectedSections:function t(e){return e.filter(function(t){return t.selected&&t.enabled})||[]},isSectionSelected:function t(e,s){const n=e.find(function(t){return t.title===s});return!!(n&&n.selected&&n.enabled)},getImportedSections:function t(e,s,n){try{const o=this;function i(t){const s=e.apps&&e.apps.some(function(t){return t&&t.visualizations&&t.visualizations.length>0});return[{title:o._i18nBundle.getText("favApps"),selected:s,enabled:s,panelClass:lt},{title:o._i18nBundle.getText("pages"),selected:t?.length>0,enabled:t?.length>0,panelClass:at},{title:o._i18nBundle.getText("insightsTiles"),selected:e.tiles&&e.tiles.length>0,enabled:e.tiles&&e.tiles.length>0,panelClass:pt},{title:o._i18nBundle.getText("insightsCards"),selected:e.cards&&e.cards.length>0&&e.cards.length+n<=99,enabled:e.cards&&e.cards.length>0&&e.cards.length+n<=99,panelClass:dt}]}const r=s===Q.IMPORT;return Promise.resolve(r?Promise.resolve(o.getDeltaFavPages(e.favouritePages)).then(i):i(e.favouritePages))}catch(a){return Promise.reject(a)}},getDeltaFavPages:function t(e){try{const t=this;return Promise.resolve(t._getPersonalizationData()).then(function(t){const s=t.favouritePages||[];return s.length!==e.length?e:e.filter(function(t){return!s.find(function(e){return t.pageId===e.pageId&&t.spaceId===e.spaceId})})})}catch(t){return Promise.reject(t)}},getInsightCards:function t(){try{const t=this;return Promise.resolve(O(function(){return Promise.resolve(e.getServiceAsync()).then(function(e){t.cardHelperInstance=e;return Promise.resolve(t.cardHelperInstance._getUserAllCardModel()).then(function(t){const e=t.getProperty("/cards");const s=e.filter(function(t){return t.visibility});t.setProperty("/visibleCards",s);return t})})},function(t){throw t}))}catch(t){return Promise.reject(t)}},onExportPress:function e(){this.handleUserPersonalizationError(Q.EXPORT,false,"","");const s=this.oControlModel.getProperty("/export/fileName"),n=this.oControlModel.getProperty("/export/sections"),o=this.oUserPersonalization.export.data;const i=this.getExportFileContent(o,n);sap.ui.require(["sap/ui/core/util/File"],e=>{try{e.save(JSON.stringify(i),s,"txt","text/plain","utf-8");h.show(String(this._i18nBundle.getText("userPersonalizationExportSuccess")))}catch(e){t.error(e instanceof Error?e.message:String(e));if(e instanceof Error&&e?.name!==undefined&&e.name!=="AbortError"){this.handleUserPersonalizationError(Q.EXPORT,true,"","")}}})},getExportFileContent:function t(e,s){const n=e?.personalization,o={host:window.location.host,createdDate:new Date,sections:[],groupInfo:[],tiles:[],cards:[],favouritePages:[]};if(this.isSectionSelected(s,this._i18nBundle.getText("favApps"))){o.sections=e?.apps||[];o.groupInfo=n?.favoriteApps||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("pages"))){o.favouritePages=n?.favouritePages||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("insightsTiles"))){o.tiles=e?.tiles||[]}if(this.isSectionSelected(s,this._i18nBundle.getText("insightsCards"))){o.cards=this.filterNonSensitiveCards(e?.cards||[])}return o},filterNonSensitiveCards:function t(e){const s=[];e.forEach(t=>{if(t["sap.card"]?.configuration?.parameters){const e=t["sap.card"].configuration.parameters;let n=[];n=n.concat(this.getSensitiveProps(e.headerState)).concat(this.getSensitiveProps(e.lineItemState)).concat(this.getSensitiveProps(e.state));if(n.length===0){s.push(t)}}else{s.push(t)}});if(e.length!==s.length){this.handleUserPersonalizationError(Q.EXPORT,true,String(this._i18nBundle.getText("exportSensitiveCardsErrorMessage")),"Warning")}return s},getSensitiveProps:function t(e){let s=[];if(e?.value){const t=JSON.parse(e.value);const n=t.sensitiveProps||Object.keys(t.parameters?.ibnParams?.sensitiveProps||{});if(n.length>0){s=s.concat(n)}}return s},handleUserPersonalizationError:function t(e,s,n,o){const i=this._i18nBundle.getText(e===Q.IMPORT?"importErrorMessage":"exportErrorMessage");this.oControlModel.setProperty("/"+e+"/error",s,undefined,true);this.oControlModel.setProperty("/"+e+"/errorMessage",n||i,undefined,true);this.oControlModel.setProperty("/"+e+"/errorType",o||"Error",undefined,true);this.setExportImportValues(e)},onImportExportTabSelect:function t(e){const s=e.getParameter("selectedKey");this.oSelectedTab=s;this.oControlModel.setProperty("/selectedTab",s);this.oExportList.setVisible(s==="export");this.oImportBtn.setVisible(s==="import");this.oExportBtn.setVisible(s==="export");this.oImportBtn.setEnabled(this.oUserPersonalization.import.sectionsSelected);this.oExportBtn.setEnabled(this.oUserPersonalization.export.sectionsSelected);this.oExportBtn.setEnabled(!!(this.oUserPersonalization.export.fileName&&this.oUserPersonalization.export.sections&&this.oUserPersonalization.export.sections.length>0&&this.oUserPersonalization.export.sectionsSelected))},onFileNameInputChange:function t(e){const s=e.getParameter("value")?.trim();const n=e.getSource();let o=H.None;let i="";if(!s||!s.length){o=H.Error;i=String(this._i18nBundle.getText("invalidExportFileName"))}n.setValueState(o);n.setValueStateText(i);this.oControlModel.setProperty("/export/fileName",s);this.enableDisableActions(Q.EXPORT)},onResetImportApps:function t(){this.oEventBus.publish("importChannel","resetImported");h.show(this._i18nBundle.getText("importAppsNowBtnEnabled"))},_getRecommendationSettingsPanel:function t(){try{const t=this;return Promise.resolve(t._getPersonalizationData()).then(function(e){if(!t._recommendationSettingsPanel){const s=t.getId()+"--recommendationSettingsPanel";t._recommendationSettingsPanel=new f(s,{headerText:t._i18nBundle.getText("recommendationSettingsHeader"),expanded:true,expandable:true,content:[new P({id:`${s}-container-subHeader`,text:t._i18nBundle.getText("recommendationSettingsSubHeader")}),new i({id:`${s}-container`,items:[new n({id:`${s}-container-checkBox`,selected:e.showRecommendation??true,select:e=>t.onRecommendationSettingChange(e),ariaLabelledBy:[`${s}-container-subHeader`,`${s}-container-label`]}),new P({id:`${s}-container-label`,text:t._i18nBundle.getText("recommendationSettingsCheckboxLabel")})],alignItems:$.Center}).addStyleClass("sapUiSmallMarginTop")]}).addStyleClass("sapUiSmallMarginTop")}return t._recommendationSettingsPanel})}catch(t){return Promise.reject(t)}},_setRecommendationSettingsPanel:function t(){try{const t=this;t.oDetailPage.setBusy(true);return Promise.resolve(t._getRecommendationSettingsPanel()).then(function(e){if(e){t.oContentVBox.addItem(e);t.oDetailPage.setBusy(false)}})}catch(t){return Promise.reject(t)}},onRecommendationSettingChange:function t(e){try{const t=this;const s=e.getParameter("selected");t.oEventBus.publish("importChannel","recommendationSettingChanged",{showRecommendation:s});return Promise.resolve(t._getPersonalizationData()).then(function(e){void t.oPersonalizerInstance.write({...e,showRecommendation:s})})}catch(t){return Promise.reject(t)}}});ut.ImportExportType=Q;return ut});
|
|
7
7
|
/*!
|
|
8
8
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
9
9
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -13,7 +13,17 @@ sap.ui.predefine("sap/cux/home/App", ["sap/base/Log","sap/m/GenericTile","sap/m/
|
|
|
13
13
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
14
14
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
15
15
|
*/
|
|
16
|
-
sap.ui.predefine("sap/cux/home/AppsContainer", ["sap/base/Log","sap/m/GenericTile","sap/m/Panel","sap/m/library","sap/ui/core/EventBus","sap/ui/core/theming/Parameters","sap/ushell/api/S4MyHome","./BaseContainer","./RecommendedAppPanel","./library","./utils/DataFormatUtils","./utils/Device"],function(e,t,n,o,s,i,r,a,c,l,p,u){"use strict";function g(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function h(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const d=o["BackgroundDesign"];const f=o["FrameType"];const y=o["GenericTileMode"];const m=o["GenericTileScope"];const P=o["TileSizeBehavior"];const _=g(a);const b=g(c);const T=l["OrientationType"];const C=p["getLeanURL"];const v=u["DeviceType"];const A=()=>{const e="sapLegendColor9";return{key:e,value:i.get({name:e}),assigned:false}};const D={PLACEHOLDER_ITEMS_COUNT:5};const M=_.extend("sap.cux.home.AppsContainer",{metadata:{events:{appsLoaded:{parameters:{apps:{type:"sap.cux.home.App[]"},tiles:{type:"sap.m.GenericTile[]"}}}}},renderer:{..._.renderer,apiVersion:2},constructor:function e(t,n){_.prototype.constructor.call(this,t,n);this._isInitialRender=true},init:function e(){_.prototype.init.call(this);this.setProperty("title",this._i18nBundle?.getText("appsTitle"));if(this.getDeviceType()===v.Mobile){this.setProperty("orientation",T.Vertical)}const t=s.getInstance();t.subscribe("importChannel","recommendationSettingChanged",(e,t,n)=>{const o=n.showRecommendation;if(!o){const e=this.getContent()?.[0];this.setProperty("selectedKey",e?.getProperty("key"))}});this.setProperty("enableLazyLoad",false);this.addStyleClass("sapCuxAppsContainer");this.addCustomSetting("text",this._i18nBundle.getText("myAppMsg"));this._attachRouteChangeEvent()},_attachRouteChangeEvent:function t(){const n=this;const o=function(e){try{const t=e.getParameter("isMyHomeRoute");const o=function(){if(t){const e=function(){if(n._appSwitched){n.showPersistedDialog();return Promise.resolve(n.load()).then(function(){n._appSwitched=false})}}();if(e&&e.then)return e.then(function(){})}else{n._setPanelsDirty();n._appSwitched=true}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};try{r.attachRouteMatched({},o,this)}catch(t){e.warning("Unable to attach route change handler",t instanceof Error?t.message:String(t))}},onBeforeRendering:function e(){try{const t=this;function n(){t.adjustLayout();_.prototype.onBeforeRendering.call(t)}const o=function(){if(t._isInitialRender){t._isInitialRender=false;t._attachPanelSupportedEvent();t._removeUnsupportedPanels();return Promise.resolve(t._activateRecommendationTabPanel()).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(n):n(o))}catch(s){return Promise.reject(s)}},load:function e(){try{const e=this;const t=e.getPanels();return Promise.resolve(Promise.all(t.map(t=>e._setApps(t)))).then(function(){})}catch(e){return Promise.reject(e)}},getPanels:function e(){const t=this.getDeviceType()===v.Mobile;return t?this.getContent():[this._getSelectedPanel()]},showPersistedDialog:function e(){const t=this.getPanels();for(const e of t){e.firePersistDialog()}},_setPanelsDirty:function e(){const t=this.getContent();for(const e of t){e.setDesktopViewDirty(true);e.setMobileViewDirty(true)}},_generatePlaceholder:function e(t){if(!t.isLoaded()){t.destroyAggregation("apps",true);const e=t.generateApps(new Array(D.PLACEHOLDER_ITEMS_COUNT).fill({status:"Loading"}));t.setApps(e);this._updatePanelContent(t)}},_setApps:function t(n){try{const t=this;const o=h(function(){function e(){n.fireEvent("loaded")}const o=function(){if(n.isDirty()&&n.isMobileDirty()){t._generatePlaceholder(n);return Promise.resolve(n.loadApps?.()).then(function(){function e(){let e=[];let o=n.getApps();e=n.fetchTileVisualization(e);t.fireEvent("appsLoaded",{apps:o,tiles:e})}if(t.getDeviceType()===v.Mobile){n.setMobileViewDirty(false)}else{n.setDesktopViewDirty(false)}n.setLoaded(true);t._updatePanelContent(n);const o=function(){if(n.isA("sap.cux.home.BaseAppPersPanel")){return Promise.resolve(n.applyPersonalization()).then(function(){})}}();return o&&o.then?o.then(e):e(o)})}}();return o&&o.then?o.then(e):e(o)},function(o){t.showErrorCard(n);e.error(`Error setting apps for panel: ${n.getTitle()}`,o instanceof Error?o.message:String(o))});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_updatePanelContent:function e(t){const n=t.getApps()||[];const o=t.getAggregation("groups")||[];const s=this.getDeviceType()===v.Mobile;const i=s?t._generateMobileAppsWrapper():t._generateAppsWrapper();const r=s?"content":"items";i.destroyAggregation(r);let a=s?this._generateMobileCards([...o,...n]):this._generateTiles([...o,...n]);this._addWrapperContent(i,a,r);this._updatePanelContentVisibility(t)},_updatePanelContentVisibility:function e(t){const n=t.getApps()||[];const o=t.getAggregation("groups")||[];const s=this.getDeviceType()===v.Mobile;const i=t._generateDesktopAppsWrapper();const r=t._generateMobileAppsWrapper();const a=t._generateErrorMessage();const c=[...n,...o].length!==0;i.setVisible(c&&!s);r.setVisible(c&&s);r.getParent().setWidth(s&&c?"100%":"auto");a.setVisible(!c)},_getAppTile:function e(n){const o=this.getDeviceType()===v.Mobile;const s=n.getAggregation("menuItems")||[];const i=o?`${n.getId()}-mobile-tile`:`${n.getId()}-tile`;return new t(i,{scope:s.length&&!o?m.ActionMore:m.Display,state:n.getStatus(),mode:y.IconMode,sizeBehavior:P.Small,header:n.getTitle(),backgroundColor:n.getBgColor()||A()?.key,tileIcon:n.getIcon(),url:C(n.getUrl()),frameType:f.TwoByHalf,renderOnThemeChange:true,dropAreaOffset:4,subheader:n.getSubTitle(),press:e=>n._onPress(e),width:o?"15rem":"100%"}).addStyleClass("tileLayout sapMGTTwoByHalf")},_getGroupTile:function e(n){const o=this.getDeviceType()===v.Mobile;const s=n.getAggregation("menuItems")||[];const i=o?`${n.getId()}-mobile-tile`:`${n.getId()}-tile`;return new t(i,{scope:s.length&&!o?m.ActionMore:m.Display,state:n.getStatus(),mode:y.IconMode,sizeBehavior:P.Small,header:n.getTitle(),backgroundColor:n.getBgColor()||A()?.key,tileIcon:n.getIcon(),frameType:f.TwoByHalf,renderOnThemeChange:true,dropAreaOffset:4,tileBadge:n.getNumber(),press:e=>n._onPress(e),width:o?"15rem":"100%"}).addStyleClass("tileLayout sapMGTTwoByHalf").data("groupId",n.getGroupId())},_onPanelSelect:function e(t){try{const e=this;_.prototype._onPanelSelect.call(e,t);const n=e._getSelectedPanel();return Promise.resolve(e._setApps(n)).then(function(){})}catch(e){return Promise.reject(e)}},_refreshAllPanels:function e(){try{const e=this;e._setPanelsDirty();return Promise.resolve(e._setApps(e._getSelectedPanel())).then(function(){})}catch(e){return Promise.reject(e)}},refreshPanel:function e(t){try{const e=this;t.setMobileViewDirty(true);t.setDesktopViewDirty(true);return Promise.resolve(e._setApps(t)).then(function(){})}catch(e){return Promise.reject(e)}},_toggleTabView:function e(){if(this.getDeviceType()!==v.Mobile){const e=this.getContent();const t=e.filter(e=>e.isSupported());const n=this._getInnerControl();n?.toggleStyleClass("sapUiITBHide",t.length===1)}},_onPanelSupported:function e(t,n){const o=n.getParameter("isSupported");t.setSupported(o);this._togglePanelVisibility(t,o);this._toggleTabView()},_togglePanelVisibility:function e(t,n){if(this.getDeviceType()===v.Mobile){const e=this._getPanelContentWrapper(t);e.setVisible(n)}else{const e=this._getInnerControl();const o=e?.getItems()||[];const s=o.find(e=>e.getKey()===t.getKey());s?.setVisible(n)}},_removeUnsupportedPanels:function e(){const t=this.getContent();const n=t.filter(e=>!e.isSupported());for(const e of n){this._togglePanelVisibility(e,false)}this._toggleTabView()},_attachPanelSupportedEvent:function e(){const t=this.getContent();for(const e of t){if(!e.hasListeners("supported")){e.attachSupported(this._onPanelSupported.bind(this,e))}}},_activateRecommendationTabPanel:function e(){try{const e=this;const t=e.getContent();const n=e.getDeviceType()===v.Mobile;const o=t?t.find(e=>e instanceof b):null;const s=function(){if(o instanceof b&&!n){return Promise.resolve(o._enableRecommendationTab()).then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},adjustLayout:function e(){const t=this.getDeviceType()===v.Mobile;const n=this.getProperty("orientation");const o=t?T.Vertical:T.SideBySide;const s=n!==o;this.toggleActionButtons(!t);if(!s){return}this.setProperty("orientation",o);const i=this.getContent();i.forEach(e=>{if(!e.isDirty()&&!e.isMobileDirty()){this._updatePanelContentVisibility(e)}else if(e.isDirty()!==e.isMobileDirty()){e.setDesktopViewDirty(false);e.setMobileViewDirty(false);this._updatePanelContent(e)}});this._removeUnsupportedPanels()},_generateMobileCards:function e(t){const o=[];for(let e=0;e<t.length;e+=7){const s=t.slice(e,e+7);const i=new n({backgroundDesign:d.Solid,height:"23.5rem",width:"17rem",content:this._generateTiles(s)}).addStyleClass("sapUiMobileAppsCard appPanelBorder myAppMFBContent");o.push(i)}return o},_generateTiles:function e(t){return t.map(e=>e.isA("sap.cux.home.Group")?this._getGroupTile(e):this._getAppTile(e))},_addWrapperContent:function e(t,n,o){t.destroyAggregation(o);n.forEach(e=>{t.addAggregation(o,e)})},showErrorCard:function e(t){const n=t._generateErrorMessage();const o=t._generateDesktopAppsWrapper();const s=t._generateMobileAppsWrapper();o?.setVisible(false);s?.setVisible(false);n?.setVisible(true)}});return M});
|
|
16
|
+
sap.ui.predefine("sap/cux/home/AppsAdditionPanel", ["sap/base/Log","sap/m/Button","sap/m/CustomListItem","sap/m/ExpandableText","sap/m/FlexBox","sap/m/GenericTile","sap/m/HBox","sap/m/Label","sap/m/library","sap/m/MessageToast","sap/m/Text","sap/m/VBox","sap/ui/core/Fragment","sap/ui/model/json/JSONModel","sap/ui/model/resource/ResourceModel","sap/ushell/Container","./AppsContainer","./BaseSettingsPanel","./FavAppPanel","./utils/AppManager","./utils/Constants"],function(e,t,n,r,s,i,o,a,u,c,l,p,d,h,f,g,m,P,A,y,v){"use strict";function S(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function T(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const _=u["ButtonType"];function C(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const x=S(m);const I=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function b(e,t,n){if(!e.s){if(n instanceof w){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=b.bind(null,e,t);return}}if(n&&n.then){n.then(b.bind(null,e,t),b.bind(null,e,2));return}e.s=t;e.v=n;const r=e.o;if(r){r(e)}}}const w=function(){function e(){}e.prototype.then=function(t,n){const r=new e;const s=this.s;if(s){const e=s&1?t:n;if(e){try{b(r,1,e(this.v))}catch(e){b(r,2,e)}return r}else{return this}}this.o=function(e){try{const s=e.v;if(e.s&1){b(r,1,t?t(s):s)}else if(n){b(r,1,n(s))}else{b(r,2,s)}}catch(e){b(r,2,e)}};return r};return e}();function B(e){return e instanceof w&&e.s&1}function E(e,t,n){var r=-1,s,i;function o(a){try{while(++r<e.length&&(!n||!n())){a=t(r);if(a&&a.then){if(B(a)){a=a.v}else{a.then(o,i||(i=b.bind(null,s=new w,2)));return}}}if(s){b(s,1,a)}else{s=a}}catch(e){b(s||(s=new w),2,e)}}o();return s}const D=S(P);function F(e,t,n){if(typeof e[I]==="function"){var r=e[I](),s,i,o;function l(e){try{while(!(s=r.next()).done&&(!n||!n())){e=t(s.value);if(e&&e.then){if(B(e)){e=e.v}else{e.then(l,o||(o=b.bind(null,i=new w,2)));return}}}if(i){b(i,1,e)}else{i=e}}catch(e){b(i||(i=new w),2,e)}}l();if(r.return){var a=function(e){try{if(!s.done){r.return()}}catch(e){}return e};if(i&&i.then){return i.then(a,function(e){throw a(e)})}a()}return i}if(!("length"in e)){throw new TypeError("Object is not iterable")}var u=[];for(var c=0;c<e.length;c++){u.push(e[c])}return E(u,function(e){return t(u[e])},n)}const M=S(A);const z=S(y);const L=v["AI_APP_FINDER_API"];const N=v["AI_APP_FINDER_BASE_URL"];const R=v["CONTENT_ADDITION_PANEL_TYPES"];const j=v["FEATURE_TOGGLES"];const V={DeprecatedInfoText:"deprecated",MinQueryLength:5,MaxDescriptionLength:400};var k=function(e){e["Idle"]="idle";e["Searching"]="searching";e["Complete"]="complete";return e}(k||{});var $=function(e){e["NoResultsFound"]="noResultsFound";e["ServiceError"]="serviceError";e["ValidationError"]="validationError";e["DefaultError"]="defaultError";return e}($||{});var O=function(e){e["Static"]="STATIC";return e}(O||{});const U=D.extend("sap.cux.home.AppsAdditionPanel",{constructor:function e(){D.prototype.constructor.apply(this,arguments);this.appManagerInstance=z.getInstance()},init:function e(){D.prototype.init.call(this);this.userSelectedApps=new Set;this.setProperty("key",R.AI_APP_FINDER);this.setProperty("title",this._i18nBundle.getText("addAppsAndTile"));this._setupActions();void this._setupContent();this.attachEvent("onDialogClose",this.resetPanel.bind(this))},_setupActions:function e(){this.addAppsButton=new t(`${this.getId()}-add-app-btn`,{text:this._i18nBundle.getText("addFromInsightsDialogBtn"),type:_.Emphasized,press:()=>{void this.onPressAddApps()}});this.addAppsButton.bindProperty("enabled",{parts:["/hasError","/searchStatus","/userSelectedApps"],formatter:(e,t,n)=>!e&&t===k.Complete&&n.length>0});this.addActionButton(this.addAppsButton)},_setupContent:function e(){try{const e=this;return Promise.resolve(g.getServiceAsync("VisualizationInstantiation")).then(function(t){e.vizInstantiationService=t;return Promise.resolve(d.load({id:`${e.getId()}-content`,name:"sap.cux.home.utils.fragment.appsAdditionContent",controller:e})).then(function(t){const n=t;e.addAggregation("content",n);e.model=new h({query:"",hasError:false,errorType:$.DefaultError,errorDescription:"",searchStatus:k.Idle,loadingAnimation:e._generateSearchingAnimation(),suggestedAppsCount:0,userSelectedApps:[],suggestedApps:[]});n.setModel(e.model);n.setModel(new f({bundleName:"sap.cux.home.i18n.messagebundle"}),"i18n");e.addAppsButton.setModel(e.model);e.appSuggestionList=d.byId(`${e.getId()}-content`,"appsList");e.appSuggestionList.bindAggregation("items",{path:"/suggestedApps",factory:e._generateListItem.bind(e)})})})}catch(e){return Promise.reject(e)}},_generateListItem:function e(t,r){const i=new n(t,{selected:r.getProperty("addedToHomePage"),content:[new s(`${t}-result-container`,{renderType:"Bare",wrap:"Wrap",direction:r.getProperty("isStaticApp")?"Column":"Row",alignItems:r.getProperty("isStaticApp")?"Start":"Center",items:[this._getAppPreviewContainer(t,r),this._getAppDetailsContainer(t,r)]}).addStyleClass("sapUiSmallMargin")]});i.getMultiSelectControl(true).setEnabled(!r.getProperty("addedToHomePage"));return i},_getAppPreviewContainer:function e(t,n){const r=new o(`${t}-suggestedAppContainer`,{renderType:"Bare"});if(n.getProperty("isStaticApp")){r.addItem(new i(`${t}-staticApp`,{mode:"IconMode",frameType:"TwoByHalf",header:n.getProperty("title"),subheader:n.getProperty("subTitle"),tileIcon:n.getProperty("icon"),visible:n.getProperty("isStaticApp")}).addStyleClass("suggestedTile"))}else{const e=this.vizInstantiationService.instantiateVisualization(n.getProperty("vizData"));e?.setActive(true);e.setClickable(false);r.addItem(e)}return r},_getAppDetailsContainer:function e(t,n){return new p(`${t}-app-details-container`,{renderType:"Bare",gap:"0.5rem",items:[new a(`${t}-descriptionLabel`,{text:this._i18nBundle.getText("appDescription"),showColon:true}),new r(`${t}-description`,{text:n.getProperty("description"),maxCharacters:V.MaxDescriptionLength}),new o(`${t}-app-status-container`,{renderType:"Bare",visible:n.getProperty("status").length>0,items:[new a(`${t}-appStatusLabel`,{text:this._i18nBundle.getText("appStatus"),showColon:true}),new o(`${t}-app-status-texts`,{renderType:"Bare",items:this._generateStatusTexts(n.getProperty("status"))}).addStyleClass("sapUiTinyMarginBegin statusTextsContainer")]})]}).addStyleClass(n.getProperty("isStaticApp")?"sapUiSmallMarginTop":"sapUiSmallMarginBegin")},isSupported:function t(){try{const n=this;function r(){if(!n.isPanelSupported){n.removeActionButton(n.addAppsButton);const e=n.getParent();e.removePanel(n);e.updateActionButtons()}return n.isPanelSupported}const s=function(){if(n.isPanelSupported===undefined){n.isPanelSupported=false;const t=function(){if(n.getFavAppPanel()){const t=T(function(){return Promise.resolve(n.appManagerInstance.isFeatureEnabled(j.AI_SMART_APPFINDER)).then(function(e){const t=function(){if(e){return Promise.resolve(g.getServiceAsync("Navigation")).then(function(e){return Promise.resolve(e.isNavigationSupported([{target:{semanticObject:"IntelligentPrompt",action:"propose"}}])).then(function(e){let[{supported:t}]=e;n.isPanelSupported=t})})}}();if(t&&t.then)return t.then(function(){})})},function(t){e.error(t.message)});if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(i){return Promise.reject(i)}},_generateSearchingAnimation:function e(){return`<svg height="210" fill="none">\n <g>\n <rect height="210" rx="4" fill="white"/>\n <rect x="16" y="143" width="90%" height="8" rx="4" fill="var(--sapContent_Placeholderloading_Background)"/>\n <rect x="16" y="103" width="84%" height="32" rx="4" fill="var(--sapContent_Placeholderloading_Background)"/>\n <rect x="16" y="33" width="90%" height="8" rx="4" fill="var(--sapContent_Placeholderloading_Background)"/>\n <rect x="16" y="16" width="96%" height="12" rx="4" fill="var(--sapContent_Placeholderloading_Background)"/>\n </g>\n </svg>`},resetPanel:function e(){const t={query:"",hasError:false,searchStatus:k.Idle,suggestedAppsCount:0,userSelectedApps:[],suggestedApps:[]};this.model.setData({...this.model.getData(),...t});this.userSelectedApps.clear()},onPressGo:function t(n){try{const t=this;if(n.getParameter("clearButtonPressed")){t.resetPanel();return Promise.resolve()}const r=t.model.getProperty("/query");if(!t.isValidQuery(r))return Promise.resolve();const s=C(function(){return T(function(){t.model.setProperty("/hasError",false);t.model.setProperty("/searchStatus",k.Searching);t.appSuggestionList.removeSelections(true);return Promise.resolve(t.fetchAppsFromSearch(r)).then(function(e){const n=function(){if(e.length>0&&t.model.getProperty("/searchStatus")===k.Searching){return Promise.resolve(t.fetchAllAvailableVisualizations()).then(function(n){return Promise.resolve(t.appManagerInstance.fetchFavVizs(true,true)).then(function(r){return Promise.resolve(t.appManagerInstance.fetchInsightApps(true,t._i18nBundle.getText("insights"))).then(function(s){const i=t._generateApps(e,n,[...r,...s]);return Promise.resolve(t._filterUnsupportedApps(i)).then(function(e){t.model.setProperty("/suggestedApps",e);t.model.setProperty("/suggestedAppsCount",e.length)})})})})}}();if(n&&n.then)return n.then(function(){})})},function(n){e.error(n.message);t._handleError()})},function(e,n){if(t.model.getProperty("/searchStatus")===k.Searching){t.model.setProperty("/searchStatus",k.Complete)}if(e)throw n;return n});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_filterUnsupportedApps:function e(t){try{const e=t.map(e=>e.vizData?.target)||[];return Promise.resolve(g.getServiceAsync("Navigation")).then(function(n){return Promise.resolve(n.isNavigationSupported(e)).then(function(e){return t.filter((t,n)=>e[n])})})}catch(e){return Promise.reject(e)}},_generateApps:function e(t,n,r){return t.map(e=>{const t=n.find(t=>t.vizId===e.chipID);const s=r.some(t=>t.visualization?.vizId===e.chipID);return{title:e.title,chipID:e.chipID,subTitle:e.subTitle,description:e.appDescription,icon:e.iconUrl,vizData:t,addedToHomePage:s,isStaticApp:e.tileType===O.Static,status:this.getAppStatusTexts(e.configuration,s)}})},isValidQuery:function e(t){return Boolean(t?.trim()&&t.trim().length>=V.MinQueryLength)},fetchAllAvailableVisualizations:function e(){try{const t=this;function n(){return t.allAvailableVisualizations}const r=function(){if(!t.allAvailableVisualizations){return Promise.resolve(g.getServiceAsync("SearchableContent")).then(function(e){return Promise.resolve(e.getApps({enableVisualizationPreview:false})).then(function(e){t.allAvailableVisualizations=e.reduce((e,t)=>e.concat(t.visualizations),[])})})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(s){return Promise.reject(s)}},_fetchCSRFToken:function t(){try{return Promise.resolve(T(function(){return Promise.resolve(fetch(N,{method:"GET",headers:{"X-CSRF-Token":"Fetch"}})).then(function(e){return e.headers.get("X-CSRF-Token")})},function(t){e.error("Failed to fetch CSRF token",t);return null}))}catch(e){return Promise.reject(e)}},fetchAppsFromSearch:function t(n){try{const t=this;return Promise.resolve(T(function(){return Promise.resolve(t._fetchCSRFToken()).then(function(e){const r={"Content-Type":"application/json",...e&&{"X-CSRF-Token":e}};return Promise.resolve(fetch(L,{method:"POST",headers:r,body:JSON.stringify({UserInput:n})})).then(function(e){let n=false;function r(t){return n?t:Promise.resolve(e.json()).then(function(e){const t=e;return t.value||[]})}const s=function(){if(!e.ok){return Promise.resolve(e.json()).then(function(e){const r=e;t._handleError(r.error?.message||"");const s=[];n=true;return s})}}();return s&&s.then?s.then(r):r(s)})})},function(n){e.error(n.message);t._handleError();return[]}))}catch(e){return Promise.reject(e)}},getAppStatusTexts:function t(n,r){let s=[];if(r){s.push(this._i18nBundle.getText("alreadyAddedApp"))}if(n){try{const e=JSON.parse(n);const t=JSON.parse(e?.tileConfiguration);const r=(t?.display_info_text||"").toLowerCase();if(r===V.DeprecatedInfoText){s.push(this._i18nBundle.getText("deprecatedApp"))}}catch(t){e.warning(t.message)}}return s},_generateStatusTexts:function e(t){return t.map(e=>new l({text:this._i18nBundle.getText(e)}).addStyleClass(this.applyStatusClass(e)))},applyStatusClass:function e(t){if(t===this._i18nBundle.getText("alreadyAddedApp")){return"addedAppStatusText"}else if(t===this._i18nBundle.getText("deprecatedApp")){return"deprecatedAppStatusText"}else{return""}},onPressAddApps:function e(){try{const t=this;function n(){return Promise.resolve(t.refreshFavoriteApps()).then(function(){t.getParent().close();c.show(t._i18nBundle.getText("appAddedToFavorites"));t.resetPanel()})}const r=t.model.getProperty("/userSelectedApps");const s=r.map(e=>e.getBindingContext()?.getProperty("chipID"));const i=F(s,function(e){return Promise.resolve(t.appManagerInstance.addVisualization(e)).then(function(){})});return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(o){return Promise.reject(o)}},getAppsContainer:function e(){const t=this.getParent()?.getParent();return t.getContent().find(e=>e instanceof x)},getFavAppPanel:function e(){return this.getAppsContainer()?.getContent().find(e=>e instanceof M)},refreshFavoriteApps:function e(){try{const e=this;return Promise.resolve(e.getAppsContainer()?.refreshPanel(e.getFavAppPanel())).then(function(){})}catch(e){return Promise.reject(e)}},onListSelectionChange:function e(t){const n=t.getParameter("listItem");const r=t.getParameter("selected");if(!r)this.userSelectedApps.delete(n);else{const e=n.getBindingContext();const t=e?.getProperty("addedToHomePage");if(!t)this.userSelectedApps.add(n)}this.model.setProperty("/userSelectedApps",Array.from(this.userSelectedApps))},_handleError:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";const[,n,r]=t.match(/\((\d{2})\d*\)\s*(.*)/)||[];this.model.setProperty("/hasError",true);this.model.setProperty("/errorType",this._getErrorType(n));this.model.setProperty("/errorDescription",r||"")},_getErrorType:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";switch(t){case"10":return $.ServiceError;case"20":case"40":return $.NoResultsFound;case"30":return $.ValidationError;default:return $.DefaultError}}});return U});
|
|
17
|
+
/*!
|
|
18
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
19
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
20
|
+
*/
|
|
21
|
+
sap.ui.predefine("sap/cux/home/AppsContainer", ["sap/base/Log","sap/m/GenericTile","sap/m/Panel","sap/m/library","sap/ui/core/EventBus","sap/ui/core/theming/Parameters","sap/ushell/api/S4MyHome","./AppsContainerGenericPlaceholder","./BaseContainer","./RecommendedAppPanel","./library","./utils/DataFormatUtils","./utils/Device"],function(e,t,n,o,i,s,r,a,c,l,p,u,g){"use strict";function h(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function d(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const f=o["BackgroundDesign"];const y=o["FrameType"];const m=o["GenericTileMode"];const P=o["GenericTileScope"];const _=o["TileSizeBehavior"];const b=a["getAppsPlaceholder"];const T=h(c);const C=h(l);const A=p["OrientationType"];const v=u["getLeanURL"];const D=g["DeviceType"];const M=()=>{const e="sapLegendColor9";return{key:e,value:s.get({name:e}),assigned:false}};const S={PLACEHOLDER_ITEMS_COUNT:5};const w=T.extend("sap.cux.home.AppsContainer",{metadata:{events:{appsLoaded:{parameters:{apps:{type:"sap.cux.home.App[]"},tiles:{type:"sap.m.GenericTile[]"}}}}},renderer:{...T.renderer,apiVersion:2},constructor:function e(t,n){T.prototype.constructor.call(this,t,n);this._isInitialRender=true},init:function e(){T.prototype.init.call(this);this.setProperty("title",this._i18nBundle?.getText("appsTitle"));if(this.getDeviceType()===D.Mobile){this.setProperty("orientation",A.Vertical)}const t=i.getInstance();t.subscribe("importChannel","recommendationSettingChanged",(e,t,n)=>{const o=n.showRecommendation;if(!o){const e=this.getContent()?.[0];this.setProperty("selectedKey",e?.getProperty("key"))}});this.setProperty("enableLazyLoad",false);this.addStyleClass("sapCuxAppsContainer");this.addCustomSetting("text",this._i18nBundle.getText("myAppMsg"));this._attachRouteChangeEvent()},_attachRouteChangeEvent:function t(){const n=this;const o=function(e){try{const t=e.getParameter("isMyHomeRoute");const o=function(){if(t){const e=function(){if(n._appSwitched){n.showPersistedDialog();return Promise.resolve(n.load()).then(function(){n._appSwitched=false})}}();if(e&&e.then)return e.then(function(){})}else{n._setPanelsDirty();n._appSwitched=true}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};try{r.attachRouteMatched({},o,this)}catch(t){e.warning("Unable to attach route change handler",t instanceof Error?t.message:String(t))}},onBeforeRendering:function e(){if(this._isInitialRender){this._isInitialRender=false;this._attachPanelSupportedEvent();this._removeUnsupportedPanels()}this.adjustLayout();T.prototype.onBeforeRendering.call(this)},onAfterRendering:function e(){try{const e=this;return Promise.resolve(e._activateRecommendationTabPanel()).then(function(){})}catch(e){return Promise.reject(e)}},load:function e(){try{const e=this;const t=e.getPanels();return Promise.resolve(Promise.all(t.map(t=>e._setApps(t)))).then(function(){})}catch(e){return Promise.reject(e)}},getPanels:function e(){const t=this.getDeviceType()===D.Mobile;return t?this.getContent():[this._getSelectedPanel()]},showPersistedDialog:function e(){const t=this.getPanels();for(const e of t){e.firePersistDialog()}},_setPanelsDirty:function e(){const t=this.getContent();for(const e of t){e.setDesktopViewDirty(true);e.setMobileViewDirty(true)}},_generatePlaceholder:function e(t){if(!t.isLoaded()){t.destroyAggregation("apps",true);const e=t.generateApps(new Array(S.PLACEHOLDER_ITEMS_COUNT).fill({status:"Loading"}));t.setApps(e);this._updatePanelContent(t)}},_setApps:function t(n){try{const t=this;const o=d(function(){function e(){n.fireEvent("loaded")}const o=function(){if(n.isDirty()&&n.isMobileDirty()){t._generatePlaceholder(n);return Promise.resolve(n.loadApps?.()).then(function(){function e(){let e=[];let o=n.getApps();e=n.fetchTileVisualization(e);t.fireEvent("appsLoaded",{apps:o,tiles:e})}if(t.getDeviceType()===D.Mobile){n.setMobileViewDirty(false)}else{n.setDesktopViewDirty(false)}n.setLoaded(true);t._updatePanelContent(n);const o=function(){if(n.isA("sap.cux.home.BaseAppPersPanel")){return Promise.resolve(n.applyPersonalization()).then(function(){})}}();return o&&o.then?o.then(e):e(o)})}}();return o&&o.then?o.then(e):e(o)},function(o){t.showErrorCard(n);e.error(`Error setting apps for panel: ${n.getTitle()}`,o instanceof Error?o.message:String(o))});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_updatePanelContent:function e(t){const n=t.getApps()||[];const o=t.getAggregation("groups")||[];const i=this.getDeviceType()===D.Mobile;const s=i?t._generateMobileAppsWrapper():t._generateAppsWrapper();const r=i?"content":"items";s.destroyAggregation(r);let a=i?this._generateMobileCards([...o,...n],t.getId()):this._generateTiles([...o,...n]);this._addWrapperContent(s,a,r);this._updatePanelContentVisibility(t)},_updatePanelContentVisibility:function e(t){const n=t.getApps()||[];const o=t.getAggregation("groups")||[];const i=this.getDeviceType()===D.Mobile;const s=t._generateDesktopAppsWrapper();const r=t._generateMobileAppsWrapper();const a=t._generateErrorMessage();const c=[...n,...o].length!==0;s.setVisible(c&&!i);r.setVisible(c&&i);r.getParent().setWidth(i&&c?"100%":"auto");a.setVisible(!c)},_getAppTile:function e(n){const o=this.getDeviceType()===D.Mobile;const i=n.getAggregation("menuItems")||[];const s=o?`${n.getId()}-mobile-tile`:`${n.getId()}-tile`;return new t(s,{scope:i.length&&!o?P.ActionMore:P.Display,state:n.getStatus(),mode:m.IconMode,sizeBehavior:_.Small,header:n.getTitle(),backgroundColor:n.getBgColor()||M()?.key,tileIcon:n.getIcon(),url:v(n.getUrl()),frameType:y.TwoByHalf,renderOnThemeChange:true,dropAreaOffset:4,subheader:n.getSubTitle(),press:e=>n._onPress(e),width:o?"15rem":"100%"}).addStyleClass("tileLayout sapMGTTwoByHalf")},_getGroupTile:function e(n){const o=this.getDeviceType()===D.Mobile;const i=n.getAggregation("menuItems")||[];const s=o?`${n.getId()}-mobile-tile`:`${n.getId()}-tile`;return new t(s,{scope:i.length&&!o?P.ActionMore:P.Display,state:n.getStatus(),mode:m.IconMode,sizeBehavior:_.Small,header:n.getTitle(),backgroundColor:n.getBgColor()||M()?.key,tileIcon:n.getIcon(),frameType:y.TwoByHalf,renderOnThemeChange:true,dropAreaOffset:4,tileBadge:n.getNumber(),press:e=>n._onPress(e),width:o?"15rem":"100%"}).addStyleClass("tileLayout sapMGTTwoByHalf").data("groupId",n.getGroupId())},_onPanelSelect:function e(t){try{const e=this;T.prototype._onPanelSelect.call(e,t);const n=e._getSelectedPanel();return Promise.resolve(e._setApps(n)).then(function(){})}catch(e){return Promise.reject(e)}},_refreshAllPanels:function e(){try{const e=this;e._setPanelsDirty();return Promise.resolve(e._setApps(e._getSelectedPanel())).then(function(){})}catch(e){return Promise.reject(e)}},refreshPanel:function e(t){try{const e=this;t.setMobileViewDirty(true);t.setDesktopViewDirty(true);return Promise.resolve(e._setApps(t)).then(function(){})}catch(e){return Promise.reject(e)}},_toggleTabView:function e(){if(this.getDeviceType()!==D.Mobile){const e=this.getContent();const t=e.filter(e=>e.isSupported());const n=this._getInnerControl();n?.toggleStyleClass("sapUiITBHide",t.length===1)}},_onPanelSupported:function e(t,n){const o=n.getParameter("isSupported");t.setSupported(o);this._togglePanelVisibility(t,o);this._toggleTabView()},_togglePanelVisibility:function e(t,n){if(this.getDeviceType()===D.Mobile){const e=this._getPanelContentWrapper(t);e.setVisible(n)}else{const e=this._getInnerControl();const o=e?.getItems()||[];const i=o.find(e=>e.getKey()===t.getKey());i?.setVisible(n)}},_removeUnsupportedPanels:function e(){const t=this.getContent();const n=t.filter(e=>!e.isSupported());for(const e of n){this._togglePanelVisibility(e,false)}this._toggleTabView()},_attachPanelSupportedEvent:function e(){const t=this.getContent();for(const e of t){if(!e.hasListeners("supported")){e.attachSupported(this._onPanelSupported.bind(this,e))}}},_activateRecommendationTabPanel:function e(){try{const e=this;const t=e.getContent();const n=e.getDeviceType()===D.Mobile;const o=t?t.find(e=>e instanceof C):null;const i=function(){if(o instanceof C&&!n){return Promise.resolve(o._enableRecommendationTab()).then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},adjustLayout:function e(){const t=this.getDeviceType()===D.Mobile;const n=this.getProperty("orientation");const o=t?A.Vertical:A.SideBySide;const i=n!==o;this.toggleActionButtons(!t);if(!i){return}this.setProperty("orientation",o);const s=this.getContent();s.forEach(e=>{if(!e.isDirty()&&!e.isMobileDirty()){this._updatePanelContentVisibility(e)}else if(e.isDirty()!==e.isMobileDirty()){e.setDesktopViewDirty(false);e.setMobileViewDirty(false);this._updatePanelContent(e)}});this._removeUnsupportedPanels()},_generateMobileCards:function e(t,o){const i=[];for(let e=0;e<t.length;e+=7){const s=t.slice(e,e+7);const r=new n(`${o}--${e}`,{backgroundDesign:f.Solid,height:"23.5rem",width:"17rem",content:this._generateTiles(s)}).addStyleClass("sapUiMobileAppsCard appPanelBorder myAppMFBContent");i.push(r)}return i},_generateTiles:function e(t){return t.map(e=>e.isA("sap.cux.home.Group")?this._getGroupTile(e):this._getAppTile(e))},_addWrapperContent:function e(t,n,o){t.destroyAggregation(o);n.forEach(e=>{t.addAggregation(o,e)})},showErrorCard:function e(t){const n=t._generateErrorMessage();const o=t._generateDesktopAppsWrapper();const i=t._generateMobileAppsWrapper();o?.setVisible(false);i?.setVisible(false);n?.setVisible(true)},getGenericPlaceholderContent:function e(){return b()}});return w});
|
|
22
|
+
/*!
|
|
23
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
24
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
25
|
+
*/
|
|
26
|
+
sap.ui.predefine("sap/cux/home/AppsContainerGenericPlaceholder", [],function(){"use strict";function t(){return`\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plContent plResponsivePadding" style="background-color:transparent">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM" style="width: 225px;"></div>\n <div class="plPHPCardContainer" style="background-color:white">\n <div class="plPHPCard plPHPCardVersion4 PHPContentCard8">\n <div class="plPHPCardHeader"></div>\n <div class="plPHPCardContent">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plSmallestVisibleSizeM">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plSmallestVisibleSizeL">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plSmallestVisibleSizeXL">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare">\n </div>\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextLine"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n `}var l={__esModule:true};l.getAppsPlaceholder=t;return l});
|
|
17
27
|
/*!
|
|
18
28
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
19
29
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -23,27 +33,27 @@ sap.ui.predefine("sap/cux/home/BaseApp", ["sap/m/List","sap/m/Popover","sap/m/St
|
|
|
23
33
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
24
34
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
25
35
|
*/
|
|
26
|
-
sap.ui.predefine("sap/cux/home/BaseAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/
|
|
36
|
+
sap.ui.predefine("sap/cux/home/BaseAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/MessageToast","sap/m/VBox","sap/m/library","sap/ushell/Config","sap/ushell/Container","./App","./BasePanel","./utils/AppManager","./utils/DataFormatUtils","./utils/Device"],function(e,t,i,r,n,s,a,o,p,l,u,c,h,g,d,f){"use strict";function _(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function A(e,t){try{var i=e()}catch(e){return t(e)}if(i&&i.then){return i.then(void 0,t)}return i}const m=p["BackgroundDesign"];function y(e,t){try{var i=e()}catch(e){return t(true,e)}if(i&&i.then){return i.then(t.bind(null,false),t.bind(null,true))}return t(false,i)}const v=_(c);const I=_(h);const b=_(g);const M=d["getLeanURL"];const C=f["DeviceType"];const z=I.extend("sap.cux.home.BaseAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true}},events:{persistDialog:{},supported:{parameters:{isSupported:{type:"boolean"}}}}},constructor:function e(t,i){I.prototype.constructor.call(this,t,i);this._isDirty=true;this._isMobileDirty=true;this._isLoaded=false;this._isSupported=true;this._setAggregation=function(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"items";t.forEach(t=>{e.addAggregation(i,t,true)})}},init:function e(){I.prototype.init.call(this);this.appManagerInstance=b.getInstance();this._controlMap=new Map;this._appsPanelWrapper=this._generateWrapper();this._addContent(this._appsPanelWrapper)},_generateWrapper:function e(){if(!this._appsPanelWrapper){this._appsPanelWrapper=new o(`${this.getId()}-appsPanelWrapper`,{items:[this._generateDesktopAppsWrapper(),this._generateMobileAppsWrapper(),this._generateErrorMessage()],width:"100%"}).addStyleClass("sapCuxAppsPanel sapCuxAppsPanelWrapper")}return this._appsPanelWrapper},_generateDesktopAppsWrapper:function e(){const t=`${this.getId()}-desktopAppsWrapper`;if(!this._controlMap.get(t)){this._controlMap.set(t,new o({id:`${this.getId()}-desktopAppsWrapper`,items:[this._generateAppsWrapper()],visible:this.getDeviceType()!==C.Mobile,backgroundDesign:m.Solid}).addStyleClass("sapCuxAppsPanel sapCuxAppsContainerBorder"))}return this._controlMap.get(t)},_generateAppsWrapper:function e(){if(!this._appsWrapper){this._appsWrapper=new t({id:`${this.getId()}-appsWrapper`,layout:new i(`${this.getId()}-appsWrapperLayout`,{columnSize:"19rem",rowSize:"4.375rem",gap:"0.5rem"})})}return this._appsWrapper},_generateMobileAppsWrapper:function e(){if(!this._mobileAppsWrapper){this._mobileAppsWrapper=new r({id:`${this.getId()}-mobileAppsWrapper`,gridLayout:true,showDividers:false,height:"23.5rem",content:[],visible:this.getDeviceType()===C.Mobile}).addStyleClass("sapUiMargin-26Bottom sapMHeaderContainerAlign")}return this._mobileAppsWrapper},_generateErrorMessage:function e(){if(!this._errorCard){this._errorCard=new o(`${this.getId()}-errorCard`,{wrap:"Wrap",backgroundDesign:"Solid",items:[this.generateIllustratedMessage()],visible:this.getApps().length===0,justifyContent:"Center"}).addStyleClass("sapCuxAppsPanel")}this._errorCard.setHeight(this.getDeviceType()===C.Mobile?"23.5rem":"auto");return this._errorCard},generateApps:function e(t){return t.map((e,t)=>{const i=e.persConfig?.sectionId;const r=e.persConfig?.isDefaultSection;const n=i&&!r?`${this.getKey()}-groupApp-${t}`:`${this.getKey()}-app-${t}`;const s=new v(n,{title:e.title,subTitle:e.subtitle,bgColor:typeof e.BGColor==="object"?e.BGColor.key:e.BGColor,icon:e.icon,url:e.url,vizId:e.vizId||e.visualization?.vizId,status:e.status});if(e.oldAppId){s.data("oldAppId",e.oldAppId)}e.menuItems?.forEach(e=>{s.addAggregation("menuItems",e,true)});return s})},setApps:function e(t){t.forEach(e=>{this.addAggregation("apps",e,true)})},fetchTileVisualization:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.getDeviceType()===C.Mobile){const e=this._generateMobileAppsWrapper()?.getContent()||[];for(const i of e){t=t.concat(i?.getContent()||[])}}else{t=this._generateAppsWrapper()?.getItems()||[]}return t},convertActivitiesToVisualizations:function e(t){try{const e=this;return Promise.resolve(Promise.all([e._getAllAvailableVisualizations(),u.getServiceAsync("URLParsing")])).then(function(i){let[r,n]=i;const s=t.filter(e=>e.appType==="Application").map(e=>{e.orgAppId=e.appId;e.appId=e.url;return e});const a=s.map(t=>e._convertToVisualization(t,r,n)).filter(e=>e!==undefined);return Promise.resolve(e._updateVisualizationAvailability(a))})}catch(e){return Promise.reject(e)}},_getAllAvailableVisualizations:function e(){try{const t=this;function i(){return t._allAvailableVisualizations}const r=function(){if(!t._allAvailableVisualizations){return Promise.resolve(t.appManagerInstance._getCatalogApps()).then(function(e){t._allAvailableVisualizations=e.reduce((e,t)=>e.concat(t.visualizations||[]),[])})}}();return Promise.resolve(r&&r.then?r.then(i):i(r))}catch(n){return Promise.reject(n)}},_updateVisualizationAvailability:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance.fetchFavVizs(true,true)).then(function(e){t.forEach(t=>{t.addedInFavorites=e.some(e=>e.oldAppId===t.orgAppId)});return t})}catch(e){return Promise.reject(e)}},_updateActivityInfo:function e(t,i){this._catalogVisualizationCache=this._catalogVisualizationCache||new Map;t.targetURL=i.targetURL;t.vizId=i.vizId;this._catalogVisualizationCache.set(t.orgAppId,i);return t},_findBestMatchingVisualization:function e(t,i,r){const n=i.find(e=>e.targetURL===t.url);if(n){return this._updateActivityInfo(t,n)}else{const e=new Map;const n=[];i.forEach(t=>{const i=t.targetURL;if(!e.get(i)){const s={viz:t,params:r.parseShellHash(t.targetURL).params,prio:0};e.set(i,s);n.push(s)}});const s=n.filter(e=>this._filterMatchingVisualization(t,e,r));if(s.length){s.sort((e,t)=>e.prio-t.prio);return this._updateActivityInfo(t,s[0].viz)}}},_filterMatchingVisualization:function e(t,i,r){const n=r.parseShellHash(t.url);const s=n.params;const a=Object.keys(s);const o=i.params;const p=Object.keys(o).filter(e=>e!=="allItems");if(p.length===a.length){const e=a.every(e=>p.includes(e)&&o[e][0]===s[e][0]);if(e){i.prio=1;return true}return false}else if(!p.length){i.prio=Object.keys(i.params).length?2:3;return true}return false},_convertToVisualization:function e(t,i,r){this._catalogVisualizationCache=this._catalogVisualizationCache||new Map;const n=this._catalogVisualizationCache.get(t.orgAppId);if(n){return this._updateActivityInfo(t,n)}else{const e=i.filter(e=>e.vizId&&`#${e.target?.semanticObject}-${e.target?.action}`===t.orgAppId);if(e.length>1){return this._findBestMatchingVisualization(t,e,r)}else if(e.length===1){return this._updateActivityInfo(t,e[0])}}},_addAppToFavorites:function t(i){try{const t=this;t.setBusy(true);return Promise.resolve(y(function(){return A(function(){const e=i.getSource();const r=e.getParent();const n=r.getVizId?.();const s=function(){if(n){return Promise.resolve(t.appManagerInstance.addVisualization(n)).then(function(){return Promise.resolve((t.getParent?.())._refreshAllPanels()).then(function(){const e=t._i18nBundle.getText("appMovedToFavorites",[r.getTitle()]);a.show(e)})})}}();if(s&&s.then)return s.then(function(){})},function(t){e.error(t)})},function(e,i){t.setBusy(false);if(e)throw i;return i}))}catch(e){return Promise.reject(e)}},isLoaded:function e(){return this._isLoaded},setLoaded:function e(t){this._isLoaded=t},isDirty:function e(){return this._isDirty},setDesktopViewDirty:function e(t){this._isDirty=t},isMobileDirty:function e(){return this._isMobileDirty},setMobileViewDirty:function e(t){this._isMobileDirty=t},setBusy:function e(t){const i=this._generateAppsWrapper();i.setBusy(t)},_getGroup:function e(t){const i=this.getAggregation("groups")||[];return i.find(e=>e.getGroupId()===t)},isSupported:function e(){return this._isSupported},setSupported:function e(t){this._isSupported=t},_attachUserActivityTracking:function e(){if(l.last("/core/shell/enableRecentActivity")){l.on("/core/shell/model/enableTrackingActivity").do(e=>{this.fireSupported({isSupported:e})})}},refresh:function e(){try{const e=this;return Promise.resolve(e.getParent().refreshPanel(e)).then(function(){})}catch(e){return Promise.reject(e)}},generateIllustratedMessage:function e(){if(!this._errorMessage){this._errorMessage=new n(`${this.getId()}-errorMessage`,{illustrationSize:s.Base,title:this._i18nBundle.getText("noAppsTitle"),description:this._i18nBundle.getText("noData")})}return this._errorMessage},_applyUngroupedTileColor:function e(t,i){const r=this.fetchTileVisualization();const n=t.isA("sap.cux.home.Group")?t.getGroupId():null;const s=r.findIndex(e=>n?e.data("groupId")===n:e.getUrl()===M(t.getUrl()));r[s]?.setBackgroundColor(i)}});return z});
|
|
27
37
|
/*!
|
|
28
38
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
29
39
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
30
40
|
*/
|
|
31
|
-
sap.ui.predefine("sap/cux/home/BaseAppPersPanel", ["sap/ui/core/EventBus","./BaseAppPanel","./utils/Constants","./utils/DataFormatUtils","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,o,r,i,s){"use strict";function a(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const c=a(t);const u=n["DEFAULT_APP_ICON"];const p=n["DEFAULT_BG_COLOR"];const l=n["FALLBACK_ICON"];const g=n["MYHOME_PAGE_ID"];const P=o["getLeanURL"];const f=a(r);const d=a(i);const h=a(s);const I=c.extend("sap.cux.home.BaseAppPersPanel",{metadata:{library:"sap.cux.home",properties:{persContainerId:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"}}},constructor:function e(t,n){c.prototype.constructor.call(this,t,n)},init:function t(){c.prototype.init.call(this);this._eventBus=e.getInstance();this._eventBus.subscribe("pageChannel","pageUpdated",()=>{void this.applyPersonalization()},this)},_getPersonalizer:function e(){try{const e=this;const t=e._getPersContainerId();if(!t){throw new Error("No Container ID Provided for personalisation!")}return Promise.resolve(h?.getInstance(t,d.getOwnerComponent(e)))}catch(e){return Promise.reject(e)}},getPersonalization:function e(){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e?.read()).then(function(e){return e||{}})})}catch(e){return Promise.reject(e)}},setPersonalization:function e(t){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e.write(t)).then(function(){})})}catch(e){return Promise.reject(e)}},_getAppPersonalization:function e(){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(e){return e?.favoriteApps||[]})}catch(e){return Promise.reject(e)}},setFavAppsPersonalization:function e(t){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(n){const o=function(){if(n){n.favoriteApps=t;return Promise.resolve(e.setPersonalization(n)).then(function(){})}}();if(o&&o.then)return o.then(function(){})})}catch(e){return Promise.reject(e)}},applyPersonalization:function e(){try{const e=this;let t=e.fetchTileVisualization();return Promise.resolve(e._applyTilesPersonalization(t))}catch(e){return Promise.reject(e)}},_applyTilesPersonalization:function e(t,n){let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;try{const e=this;return Promise.resolve(Promise.all([e._getAppPersonalization(),e._getFavPages()])).then(function(r){let[i,s]=r;return Promise.resolve(e.appManagerInstance._getAllFavPageApps(s,o)).then(function(o){const r=e.getAggregation("groups")||[];const s=n?e._getGroup(n)?.getApps()||[]:e.getApps()||[];for(const a of t){const t=e._getItem(a,r,s);const{color:c,icon:u}=e._getItemPersonalization(t,i,o,n);if(c){t?.setProperty("bgColor",c,true);a.setBackgroundColor(c)}if(u){t?.setProperty("icon",u,true);a.setTileIcon(u)}}})})}catch(e){return Promise.reject(e)}},_getItem:function e(t,n,o){const r=t.data("groupId");if(r){return n.find(e=>e.getGroupId()===r)}else{return o.find(e=>P(e.getUrl())===t.getUrl())}},_getItemPersonalization:function e(t,n,o,r){let i="";let s="";if(!t)return{color:i,icon:s};if(t.isA("sap.cux.home.Group")){const e=n?.find(e=>e.isSection&&e.sectionId===t.getGroupId());i=e?.BGColor}else{const e=t;const a=[e.getUrl()];const c=e.data("oldAppId");if(c){a.push(c)}const u=e.getVizId();const l=r?n?.find(e=>!e.isSection&&e.sectionId===r&&e.appId&&a.includes(e.appId)):n?.find(e=>this?.isA("sap.cux.home.FavAppPanel")?e.isRecentlyAddedApp&&e.appId&&a.includes(e.appId):e.appId&&a.includes(e.appId));const g=o.find(e=>e.vizId===u||e.appId&&a.includes(e.appId));
|
|
41
|
+
sap.ui.predefine("sap/cux/home/BaseAppPersPanel", ["sap/ui/core/EventBus","./BaseAppPanel","./utils/Constants","./utils/DataFormatUtils","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,o,r,i,s){"use strict";function a(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const c=a(t);const u=n["DEFAULT_APP_ICON"];const p=n["DEFAULT_BG_COLOR"];const l=n["FALLBACK_ICON"];const g=n["MYHOME_PAGE_ID"];const P=o["getLeanURL"];const f=a(r);const d=a(i);const h=a(s);const I=c.extend("sap.cux.home.BaseAppPersPanel",{metadata:{library:"sap.cux.home",properties:{persContainerId:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"}}},constructor:function e(t,n){c.prototype.constructor.call(this,t,n)},init:function t(){c.prototype.init.call(this);this._eventBus=e.getInstance();this._eventBus.subscribe("pageChannel","pageUpdated",()=>{void this.applyPersonalization()},this)},_getPersonalizer:function e(){try{const e=this;const t=e._getPersContainerId();if(!t){throw new Error("No Container ID Provided for personalisation!")}return Promise.resolve(h?.getInstance(t,d.getOwnerComponent(e)))}catch(e){return Promise.reject(e)}},getPersonalization:function e(){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e?.read()).then(function(e){return e||{}})})}catch(e){return Promise.reject(e)}},setPersonalization:function e(t){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e.write(t)).then(function(){})})}catch(e){return Promise.reject(e)}},_getAppPersonalization:function e(){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(e){return e?.favoriteApps||[]})}catch(e){return Promise.reject(e)}},setFavAppsPersonalization:function e(t){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(n){const o=function(){if(n){n.favoriteApps=t;return Promise.resolve(e.setPersonalization(n)).then(function(){})}}();if(o&&o.then)return o.then(function(){})})}catch(e){return Promise.reject(e)}},applyPersonalization:function e(){try{const e=this;let t=e.fetchTileVisualization();return Promise.resolve(e._applyTilesPersonalization(t))}catch(e){return Promise.reject(e)}},_applyTilesPersonalization:function e(t,n){let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;try{const e=this;return Promise.resolve(Promise.all([e._getAppPersonalization(),e._getFavPages()])).then(function(r){let[i,s]=r;return Promise.resolve(e.appManagerInstance._getAllFavPageApps(s,o)).then(function(o){const r=e.getAggregation("groups")||[];const s=n?e._getGroup(n)?.getApps()||[]:e.getApps()||[];for(const a of t){const t=e._getItem(a,r,s);const{color:c,icon:u}=e._getItemPersonalization(t,i,o,n);if(c){t?.setProperty("bgColor",c,true);a.setBackgroundColor(c)}if(u){t?.setProperty("icon",u,true);a.setTileIcon(u)}}})})}catch(e){return Promise.reject(e)}},_getItem:function e(t,n,o){const r=t.data("groupId");if(r){return n.find(e=>e.getGroupId()===r)}else{return o.find(e=>P(e.getUrl())===t.getUrl())}},_getItemPersonalization:function e(t,n,o,r){let i="";let s="";if(!t)return{color:i,icon:s};if(t.isA("sap.cux.home.Group")){const e=n?.find(e=>e.isSection&&e.sectionId===t.getGroupId());i=e?.BGColor}else{const e=t;const a=[e.getUrl()];const c=e.data("oldAppId");if(c){a.push(c)}const u=e.getVizId();const l=r?n?.find(e=>!e.isSection&&e.sectionId===r&&e.appId&&a.includes(e.appId)):n?.find(e=>this?.isA("sap.cux.home.FavAppPanel")?e.isRecentlyAddedApp&&e.appId&&a.includes(e.appId):e.appId&&a.includes(e.appId));const g=o.find(e=>e.vizId===u||e.appId&&a.includes(e.appId));const P=l?.BGColor||g?.BGColor||p().key;i=typeof P==="object"?P.key:P;s=this?.isA("sap.cux.home.FavAppPanel")?this._getFavAppIcon(e,g?.icon):this.getAppIcon()}return{color:i,icon:s}},_getFavPages:function e(){try{const e=this;return Promise.resolve(e._getPageManagerInstance().getFavoritePages()).then(function(e){return e.concat({pageId:g,BGColor:p().key})})}catch(e){return Promise.reject(e)}},getAppIcon:function e(){return u},_getFavAppIcon:function e(t,n){return n||t?.getIcon()||l},_getPageManagerInstance:function e(){if(!this._pageManagerInstance){this._pageManagerInstance=f.getInstance(this._getPersContainerId(),d.getOwnerComponent(this))}return this._pageManagerInstance},_getPersContainerId:function e(){let t=this.getProperty("persContainerId");if(!t){t=d.getPersContainerId(this)}return t}});return I});
|
|
32
42
|
/*!
|
|
33
43
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
34
44
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
35
45
|
*/
|
|
36
|
-
sap.ui.predefine("sap/cux/home/BaseContainer", ["sap/m/Button","sap/m/FlexBox","sap/m/HBox","sap/m/IconTabBar","sap/m/IconTabFilter","sap/m/List","sap/m/Popover","sap/m/StandardListItem","sap/m/Title","sap/m/library","sap/ui/core/Control","sap/ui/core/CustomData","sap/ui/core/Element","sap/ui/core/Lib","./BaseContainerRenderer","./BasePanel","./MenuItem","./library","./utils/Accessibility","./utils/Device","./utils/FESRUtil","./utils/PerformanceUtils"],function(e,t,n,i,o,s,r,a,l,c,d,u,g,p,h,m,y,_,f,b,I,S){"use strict";function M(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const P=c["BackgroundDesign"];const B=c["ButtonType"];const v=c["PlacementType"];const C=M(h);const T=M(m);const E=M(y);const $=_["OrientationType"];const w=f["getInvisibleText"];const H=b["calculateDeviceType"];const x=b["DeviceType"];const A=I["addFESRId"];const F=I["addFESRSemanticStepName"];const L=I["FESR_EVENTS"];const V=I["getFESRId"];const R=S["recordElementLoadEnd"];const D=S["recordElementLoadStart"];const z=d.extend("sap.cux.home.BaseContainer",{renderer:C,metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Data",defaultValue:"",visibility:"hidden"},orientation:{type:"sap.cux.home.OrientationType",group:"Data",defaultValue:$.SideBySide,visibility:"hidden"},selectedKey:{type:"string",group:"Data",defaultValue:"",visibility:"hidden"},width:{type:"sap.ui.core.CSSSize",group:"Appearance",defaultValue:"100%",visibility:"public"},height:{type:"sap.ui.core.CSSSize",group:"Appearance",visibility:"public"},blocked:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busy:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busyIndicatorDelay:{type:"int",defaultValue:1e3,visibility:"hidden"},busyIndicatorSize:{type:"sap.ui.core.BusyIndicatorSize",defaultValue:"Medium",visibility:"hidden"},fieldGroupIds:{type:"string[]",defaultValue:[],visibility:"hidden"},visible:{type:"boolean",group:"Appearance",defaultValue:true,visibility:"hidden"},enableSettings:{type:"boolean",group:"Misc",visibility:"hidden"},enableFullScreen:{type:"boolean",group:"Misc",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",visibility:"hidden"},enableLazyLoad:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"},loaded:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"}},defaultAggregation:"content",aggregations:{content:{type:"sap.cux.home.BasePanel",singularName:"content",multiple:true,visibility:"public"},actionButtons:{type:"sap.m.Button",multiple:true,singularName:"actionButton",visibility:"public"},menuItems:{type:"sap.cux.home.MenuItem",multiple:true,singularName:"menuItem",visibility:"public"}},associations:{layout:{type:"sap.cux.home.BaseLayout",multiple:false,singularName:"layout",visibility:"hidden"},fullScreenButton:{type:"sap.m.Button",multiple:false,singularName:"fullScreenButton",visibility:"hidden"},fullScreenMenuItem:{type:"sap.cux.home.MenuItem",multiple:false,singularName:"fullScreenMenuItem",visibility:"hidden"}},events:{onExpand:{}},designtime:true},adjustLayout:function e(){},load:function e(){},constructor:function e(t,n){d.prototype.constructor.call(this,t,n);this._exemptedActions=[]},init:function e(){this._controlMap=new Map;this._commonHeaderElementStates=new Map;this._i18nBundle=p.getResourceBundleFor("sap.cux.home.i18n");this._createHeader(this);const t=new u(`${this.getId()}-custom-settings`,{key:"custom-settings",value:{}});this.addCustomData(t)},getCustomSettings:function e(){return this.data("custom-settings")||{}},addCustomSetting:function e(t,n){this.data("custom-settings")[t]=n},_createHeader:function e(t){const i=t.getId();const o=`${i}-header`;const s=t.isA("sap.cux.home.BasePanel");const r=this.getProperty("title")?.trim().length>0;if(!this._controlMap.get(o)){this._controlMap.set(`${i}-header-title`,new l(`${i}-title`));this._controlMap.set(`${i}-header-contentLeft`,new n(`${i}-contentLeft`,{renderType:"Bare"}).addStyleClass("sapCuxSectionContentArea"));this._controlMap.set(`${i}-header-contentRight`,new n(`${i}-contentRight`,{renderType:"Bare"}).addStyleClass("sapCuxSectionContentArea"));this._controlMap.set(`${i}-header-content`,new n(`${i}-header-content`,{width:"100%",justifyContent:"SpaceBetween",renderType:"Bare",items:[this._controlMap.get(`${i}-header-contentLeft`),this._controlMap.get(`${i}-header-contentRight`)]}).addStyleClass("sapUiTinyMarginBegin"));this._controlMap.set(o,new n(`${i}-header`,{alignItems:"Center",items:[this._controlMap.get(`${i}-header-title`),this._controlMap.get(`${i}-header-content`)]}));this.addDependent(this._controlMap.get(o))}this._controlMap.get(o)?.addStyleClass(s&&r?"sapCuxPanelHeader":"sapUiContainerHeader");this._controlMap.get(`${i}-header-title`).setTitleStyle(s&&r?"H6":"H4");return this._controlMap.get(o)},_getHeader:function e(){return this._controlMap.get(`${this.getId()}-header`)},_getInnerControl:function e(){return this.getProperty("orientation")===$.SideBySide?this._iconTabBar:this._wrapper},_onPanelSelect:function e(t){this.setProperty("selectedKey",t.getParameter("selectedKey"),true);this._updateContainerHeader(this)},_setPanelCount:function e(t,n){if(this.getProperty("orientation")===$.SideBySide){this._getIconTabFilter(t).setCount(n)}},_addToPanel:function e(t,n){if(this.getProperty("orientation")===$.SideBySide){this._getIconTabFilter(t)?.addContent(n)}else{this._controlMap.get(`${t.getId()}-wrapper`)?.addItem(n)}},_getIconTabFilter:function e(t){const n=`${t.getId()}-tabFilter`;if(!this._controlMap.get(n)){const e=new o(n,{key:t.getProperty("key"),text:t.getProperty("title"),tooltip:t.getProperty("tooltip")});e.addCustomData(new u({key:"sap-ui-fastnavgroup",value:"true",writeToDom:true}));this._controlMap.set(n,e);F(e,L.SELECT,t.getProperty("key"))}t._getContent()?.forEach(e=>this._controlMap.get(n).addContent(e));return this._controlMap.get(n)},onBeforeRendering:function e(){if(this.getProperty("selectedKey")===""){const e=this.getContent()?.[0]?.getProperty("key");this.setProperty("selectedKey",e,true)}this._createInnerControl();this._updateContainerHeader(this);this._addAllPanelContent();if(this.getProperty("enableLazyLoad")===false&&!this.getProperty("loaded")){this._loadContent()}this._markPerformanceMetrics()},onAfterRendering:function e(){this._attachResizeHandler();if(this.getProperty("enableLazyLoad")){this._observeContainer()}},_loadContent:function e(){this.setProperty("loaded",true);this.load?.()},_attachResizeHandler:function e(){if(this.getDomRef()&&this.getProperty("loaded")){this._resizeObserver?.disconnect();this._resizeObserver=new ResizeObserver(e=>{if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=window.setTimeout(()=>{if(this.getVisible()){this._setDeviceType(e);this.adjustLayout()}},10)});this._resizeObserver?.observe(this.getDomRef())}},_detachResizeHandler:function e(){this._resizeObserver?.disconnect()},_observeContainer:function e(){const t=this.getDomRef();if(!this._containerObserver){this._containerObserver=new IntersectionObserver(e=>e.forEach(e=>{if(!this.getProperty("loaded")&&this.getVisible()&&e.isIntersecting){this._loadContent()}}),{rootMargin:"0px",threshold:.1})}this._containerObserver?.disconnect();if(t){this._containerObserver.observe(t)}},_createInnerControl:function e(){const n=this.getProperty("orientation");if(n===$.Horizontal||n===$.Vertical){if(!this._wrapper){this._wrapper=new t(`${this.getId()}-wrapper`,{width:"100%",renderType:"Bare"}).addStyleClass("sapCuxBaseWrapper");this.addDependent(this._wrapper)}this._wrapper.setDirection(n===$.Horizontal?"Row":"Column")}else if(!this._iconTabBar){this._iconTabBar=new i(`${this.getId()}-iconTabBar`,{expandable:true,backgroundDesign:P.Transparent,headerMode:"Inline",headerBackgroundDesign:P.Transparent,select:e=>this._onPanelSelect(e)});this.addDependent(this._iconTabBar)}},_updateContainerHeader:function e(t){const n=this.getProperty("orientation")===$.SideBySide;const i=t.isA("sap.cux.home.BaseContainer");const o=!i&&n?this:t;this._controlMap.get(o.getId()+"-header-contentLeft")?.removeAllItems();this._controlMap.get(o.getId()+"-header-contentRight")?.removeAllItems();this._updateHeader(t)},_updateHeader:function e(t){const n=this.getProperty("orientation")===$.SideBySide;const i=t.isA("sap.cux.home.BaseContainer");const o=this._controlMap.get(t.getId()+"-header-title");o?.setText(t.getProperty("title"));o?.setVisible(t.getProperty("title")?.trim().length>0);if(this._getLayout()){this._addLayoutHeaderElements()}const s=i&&n?this._getSelectedPanel():t;const r=!i&&n?this:t;const a=this._filterVisibleHeaderElements(s?.getMenuItems());if(a.length>0){this._addMenuItems(r,a)}s?.getAggregation("actionButtons")?.forEach(e=>{this._controlMap.get(r.getId()+"-header-contentRight")?.addItem(this._getHeaderButton(e))})},_addLayoutHeaderElements:function e(){const t=e=>{const t=[{property:"enableFullScreen",aggregation:"menuItems",headerElement:this._getFullScreenMenuItem(e)},{property:"enableSettings",aggregation:"menuItems",headerElement:this._getHomeSettingsMenuItem(e)},{property:"enableFullScreen",aggregation:"actionButtons",headerElement:this._getFullScreenButton(e)}];t.forEach(t=>{let{property:n,aggregation:i,headerElement:o}=t;const s=e.getProperty(n);const r=this._commonHeaderElementStates.get(`${o.getId()}-${n}`);if(s!==r){this._commonHeaderElementStates.set(`${o.getId()}-${n}`,s);if(s){e.addAggregation(i,o)}else{e.removeAggregation(i,o)}if(n==="enableFullScreen"){this.setFullScreenElementRelations({isFullScreenEnabled:s,control:e,aggregation:i,headerElement:o})}}})};t(this);const n=this.getContent()||[];n.forEach(t);this._setupFullScreenElements()},_setupFullScreenElements:function e(){const t=this._getLayout();const n=e=>{const n=e.getProperty("enableFullScreen");const i=this._commonHeaderElementStates.get(`${e.getId()}-enableFullScreen`);if(n!==i){this._commonHeaderElementStates.set(`${e.getId()}-enableFullScreen`,n);if(n){t?.registerFullScreenElement(e)}else{t?.deregisterFullScreenElement(e)}}if(n){t?.updateFullScreenElement(e,{index:t?.indexOfItem(this)})}};n(this);const i=this.getContent()||[];i.forEach(n)},setFullScreenElementRelations:function e(t){const{isFullScreenEnabled:n,control:i,aggregation:o,headerElement:s}=t;const r=o==="actionButtons"?"fullScreenButton":"fullScreenMenuItem";if(n){i.setAssociation(r,s,true)}else{i.removeAssociation(r,s,true)}},_getHomeSettingsMenuItem:function e(t){const n=`${t.getId()}-settings`;if(!this._controlMap.get(n)){const e=new E(n,{title:this._i18nBundle.getText("myHomeSettings"),icon:"sap-icon://user-settings",press:()=>{const e=this._getLayout();e?.openSettingsDialog()}});A(e,"myHomeSettings");this._controlMap.set(n,e)}return this._controlMap.get(n)},_getFullScreenMenuItem:function e(t){const n=`${t.getId()}-showMore`;if(!this._controlMap.get(n)){const e=new E(n,{title:this._i18nBundle.getText("expand"),icon:"sap-icon://display-more",press:()=>{const e=this._getLayout();e?.toggleFullScreen(t)}});A(e,"toggleFullScreen");this._controlMap.set(n,e)}return this._controlMap.get(n)},_getFullScreenButton:function t(n){const i=`${n.getId()}-fullScreen`;if(!this._controlMap.get(i)){const t=new e(i,{text:this._i18nBundle.getText("expand"),type:B.Transparent,press:()=>{const e=this._getLayout();e?.toggleFullScreen(n)}});A(t,"toggleFullScreen");this._controlMap.set(i,t);this._exemptedActions.push(i)}return this._controlMap.get(i)},_getSelectedPanel:function e(){const t=this.getContent()?.find(e=>e.getProperty("key")===this.getProperty("selectedKey"))||this.getContent()?.[0];this.setProperty("selectedKey",t?.getProperty("key"),true);return t},_addAllPanelContent:function e(){const t=this.getContent()||[];if(this.getProperty("orientation")===$.SideBySide){this._iconTabBar.removeAllItems();t.forEach(e=>this._iconTabBar.addItem(this._getIconTabFilter(e)));this._iconTabBar.setSelectedKey(this.getProperty("selectedKey"))}else{this._wrapper.removeAllItems();t.forEach(e=>this._wrapper.addItem(this._getPanelContentWrapper(e)))}},_getPanelContentWrapper:function e(n){const i=`${n.getId()}-contentWrapper`;if(!this._controlMap.get(i)){this._controlMap.set(i,new t(i,{width:"100%",direction:"Column",renderType:"Bare"}))}this._controlMap.get(i).addItem(this._updatePanelHeader(n));n._getContent()?.forEach(e=>this._controlMap.get(i).addItem(e));return this._controlMap.get(i)},_updatePanelHeader:function e(t){const n=this._createHeader(t);const i=t.getProperty("title")?.trim().length>0;const o=this.getProperty("title")?.trim().length>0;this._updateContainerHeader(t);n.toggleStyleClass("sapCuxPanelHeader",o&&(i||this._filterVisibleHeaderElements(t.getMenuItems()).length>0||this._filterVisibleHeaderElements(t.getActionButtons()).length>0));return n},_filterVisibleHeaderElements:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t.filter(e=>e.getVisible())},_setTitle:function e(t){this.setProperty("title",t,true);this._controlMap.get(`${this.getId()}-header-title`).setText(t);return this},_addMenuItems:function t(n,i){if(!this._controlMap.get(`${n.getId()}-menu`)){const t=new s(`${n.getId()}-list`,{itemPress:e=>e.getSource().getParent().close()});this._controlMap.set(`${n.getId()}-menu`,t);const i=w(`${n.getId()}-popoverTitle`,this._i18nBundle.getText("actions"));const o=new r(`${n.getId()}-popover`,{placement:v.VerticalPreferredBottom,showHeader:false,ariaLabelledBy:[i?i?.getId():""],content:[t,i]});const a=new e(`${n.getId()}-menu-btn`,{icon:"sap-icon://slim-arrow-down",type:B.Transparent,tooltip:this._i18nBundle.getText("more"),press:e=>o.openBy(e.getSource())});this._controlMap.set(`${n.getId()}-menu-btn`,a)}this._controlMap.get(n.getId()+"-header-contentLeft")?.addItem(this._controlMap.get(`${n.getId()}-menu-btn`));this._controlMap.get(`${n.getId()}-menu`).removeAllItems();i.forEach(e=>this._controlMap.get(`${n.getId()}-menu`).addItem(this._getMenuListItem(e)))},_getHeaderButton:function t(n){const i=`${n.getId()}-btn`;if(!this._controlMap.get(i)){this._controlMap.set(i,new e(i,{type:B.Transparent,press:()=>n.firePress()}));F(this._controlMap.get(i),L.PRESS,V(n))}const o=this._controlMap.get(i);o.setText(n.getText());o.setTooltip(n.getTooltip());o.setIcon(n.getIcon());o.setVisible(n.getVisible());o.setEnabled(n.getEnabled());return o},_getLayout:function e(){return g.getElementById(this.getAssociation("layout",null))},_getMenuListItem:function e(t){if(!this._controlMap.get(`${t.getId()}-listItem`)){this._controlMap.set(`${t.getId()}-listItem`,new a(`${t.getId()}-listItem`,{type:"Active",icon:t.getIcon(),title:t.getTitle(),press:e=>t.firePress({button:e.getSource()})}));F(this._controlMap.get(`${t.getId()}-listItem`),L.PRESS,V(t))}const n=this._controlMap.get(`${t.getId()}-listItem`);n.setIcon(t.getIcon());n.setTitle(t.getTitle());n.setVisible(t.getVisible());return n},toggleMenuListItem:function e(t,n){if(t){const e=this._getMenuListItem(t);e?.setVisible(n);t.setProperty("visible",n,true)}},toggleActionButton:function e(t,n){if(t){const e=this._getHeaderButton(t);e?.setVisible(n);t.setProperty("visible",n,true)}},removeContent:function e(t){if(this.getProperty("selectedKey")&&this.getProperty("selectedKey")===t.getProperty("key")){this.setProperty("selectedKey",undefined,true)}this.removeAggregation("content",t)},getWidth:function e(){return this.getProperty("width")},toggleActionButtons:function e(t){const n=this.getProperty("orientation")===$.SideBySide;let i=false;const o=e=>{e.getActionButtons()?.forEach(e=>{const n=e.getVisible();if(n!==t&&!this._exemptedActions.includes(e.getId())){e.setProperty("visible",t,true);i=true}});if(!n&&i){this._updateContainerHeader(e)}};o(this);const s=this.getContent()||[];s.forEach(o);if(n&&i){this._updateContainerHeader(this)}},toggleFullScreenElements:function e(t,n){const i=g.getElementById(t.getAssociation("fullScreenButton",null));const o=g.getElementById(t.getAssociation("fullScreenMenuItem",null));const s=this.getProperty("orientation")===$.SideBySide;const r=this.getDeviceType()===x.Mobile;const a=t.getParent();let l=false;n=!r?n:false;[i,o].forEach(e=>{if(e&&n!==e.getVisible()){l=true;e.setProperty("visible",n,true)}});const c=t instanceof T&&t.getKey();if(l&&(!s||s&&this.getProperty("selectedKey")===c)){this._updateContainerHeader(a.getContent().length===1&&!s?t.getParent():t)}},_setDeviceType:function e(t){const[n]=t;const i=n?.contentRect.width;const o=H(i);if(this._deviceType!==o&&i>0){this._deviceType=o}},getDeviceType:function e(){return this._deviceType||H()},_markPerformanceMetrics:function e(){const t=this.getMetadata().getName();D(t);this.getContent()?.forEach(e=>{e.attachEventOnce("loaded",()=>{R(t)})})}});return z});
|
|
46
|
+
sap.ui.predefine("sap/cux/home/BaseContainer", ["sap/m/Button","sap/m/FlexBox","sap/m/HBox","sap/m/IconTabBar","sap/m/IconTabFilter","sap/m/List","sap/m/Popover","sap/m/StandardListItem","sap/m/Title","sap/m/library","sap/ui/core/Control","sap/ui/core/CustomData","sap/ui/core/Element","sap/ui/core/HTML","sap/ui/core/Lib","./BaseContainerRenderer","./BasePanel","./MenuItem","./library","./utils/Accessibility","./utils/Device","./utils/FESRUtil","./utils/PerformanceUtils"],function(e,t,n,i,o,s,r,a,l,c,d,u,g,p,h,m,y,f,_,b,I,S,M){"use strict";function P(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const B=c["BackgroundDesign"];const v=c["ButtonType"];const C=c["PlacementType"];const T=P(m);const E=P(y);const $=P(f);const w=_["OrientationType"];const H=b["getInvisibleText"];const x=I["calculateDeviceType"];const F=I["DeviceType"];const A=S["addFESRId"];const L=S["addFESRSemanticStepName"];const V=S["FESR_EVENTS"];const D=S["getFESRId"];const R=M["recordElementLoadEnd"];const z=M["recordElementLoadStart"];const k=d.extend("sap.cux.home.BaseContainer",{renderer:T,metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Data",defaultValue:"",visibility:"hidden"},orientation:{type:"sap.cux.home.OrientationType",group:"Data",defaultValue:w.SideBySide,visibility:"hidden"},selectedKey:{type:"string",group:"Data",defaultValue:"",visibility:"hidden"},width:{type:"sap.ui.core.CSSSize",group:"Appearance",defaultValue:"100%",visibility:"public"},height:{type:"sap.ui.core.CSSSize",group:"Appearance",visibility:"public"},blocked:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busy:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busyIndicatorDelay:{type:"int",defaultValue:1e3,visibility:"hidden"},busyIndicatorSize:{type:"sap.ui.core.BusyIndicatorSize",defaultValue:"Medium",visibility:"hidden"},fieldGroupIds:{type:"string[]",defaultValue:[],visibility:"hidden"},visible:{type:"boolean",group:"Appearance",defaultValue:true,visibility:"hidden"},enableSettings:{type:"boolean",group:"Misc",visibility:"hidden"},enableFullScreen:{type:"boolean",group:"Misc",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",visibility:"hidden"},enableLazyLoad:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"},loaded:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"}},defaultAggregation:"content",aggregations:{content:{type:"sap.cux.home.BasePanel",singularName:"content",multiple:true,visibility:"public"},actionButtons:{type:"sap.m.Button",multiple:true,singularName:"actionButton",visibility:"public"},menuItems:{type:"sap.cux.home.MenuItem",multiple:true,singularName:"menuItem",visibility:"public"}},associations:{layout:{type:"sap.cux.home.BaseLayout",multiple:false,singularName:"layout",visibility:"hidden"},fullScreenButton:{type:"sap.m.Button",multiple:false,singularName:"fullScreenButton",visibility:"hidden"},fullScreenMenuItem:{type:"sap.cux.home.MenuItem",multiple:false,singularName:"fullScreenMenuItem",visibility:"hidden"}},events:{onExpand:{}},designtime:true},adjustLayout:function e(){},load:function e(){},constructor:function e(t,n){d.prototype.constructor.call(this,t,n);this._exemptedActions=[]},init:function e(){this._controlMap=new Map;this._commonHeaderElementStates=new Map;this._i18nBundle=h.getResourceBundleFor("sap.cux.home.i18n");this._createHeader(this);const t=new u(`${this.getId()}-custom-settings`,{key:"custom-settings",value:{}});this.addCustomData(t)},getCustomSettings:function e(){return this.data("custom-settings")||{}},addCustomSetting:function e(t,n){this.data("custom-settings")[t]=n},_createHeader:function e(t){const i=t.getId();const o=`${i}-header`;const s=t.isA("sap.cux.home.BasePanel");const r=this.getProperty("title")?.trim().length>0;if(!this._controlMap.get(o)){this._controlMap.set(`${i}-header-title`,new l(`${i}-title`));this._controlMap.set(`${i}-header-contentLeft`,new n(`${i}-contentLeft`,{renderType:"Bare"}).addStyleClass("sapCuxSectionContentArea"));this._controlMap.set(`${i}-header-contentRight`,new n(`${i}-contentRight`,{renderType:"Bare"}).addStyleClass("sapCuxSectionContentArea"));this._controlMap.set(`${i}-header-content`,new n(`${i}-header-content`,{width:"100%",justifyContent:"SpaceBetween",renderType:"Bare",items:[this._controlMap.get(`${i}-header-contentLeft`),this._controlMap.get(`${i}-header-contentRight`)]}).addStyleClass("sapUiTinyMarginBegin"));this._controlMap.set(o,new n(`${i}-header`,{alignItems:"Center",items:[this._controlMap.get(`${i}-header-title`),this._controlMap.get(`${i}-header-content`)]}));this.addDependent(this._controlMap.get(o))}this._controlMap.get(o)?.addStyleClass(s&&r?"sapCuxPanelHeader":"sapUiContainerHeader");this._controlMap.get(`${i}-header-title`).setTitleStyle(s&&r?"H6":"H4");return this._controlMap.get(o)},_getHeader:function e(){return this._controlMap.get(`${this.getId()}-header`)},_getInnerControl:function e(){return this.getProperty("orientation")===w.SideBySide?this._iconTabBar:this._wrapper},_onPanelSelect:function e(t){this.setProperty("selectedKey",t.getParameter("selectedKey"),true);this._updateContainerHeader(this)},_setPanelCount:function e(t,n){if(this.getProperty("orientation")===w.SideBySide){this._getIconTabFilter(t).setCount(n)}},_addToPanel:function e(t,n){if(this.getProperty("orientation")===w.SideBySide){this._getIconTabFilter(t)?.addContent(n)}else{this._controlMap.get(`${t.getId()}-wrapper`)?.addItem(n)}},_getIconTabFilter:function e(t){const n=`${t.getId()}-tabFilter`;if(!this._controlMap.get(n)){const e=new o(n,{key:t.getProperty("key"),text:t.getProperty("title"),tooltip:t.getProperty("tooltip")});e.addCustomData(new u(`${t.getId()}--customFilter`,{key:"sap-ui-fastnavgroup",value:"true",writeToDom:true}));this._controlMap.set(n,e);L(e,V.SELECT,t.getProperty("key"))}t._getContent()?.forEach(e=>this._controlMap.get(n).addContent(e));return this._controlMap.get(n)},onBeforeRendering:function e(){if(this.getProperty("selectedKey")===""){const e=this.getContent()?.[0]?.getProperty("key");this.setProperty("selectedKey",e,true)}this._createInnerControl();this._updateContainerHeader(this);this._addAllPanelContent();if(this.getProperty("enableLazyLoad")===false&&!this.getProperty("loaded")){this._loadContent()}this._markPerformanceMetrics()},onAfterRendering:function e(){this._attachResizeHandler();if(this.getProperty("enableLazyLoad")){this._observeContainer()}},_loadContent:function e(){this.setProperty("loaded",true);this.load?.()},_attachResizeHandler:function e(){if(this.getDomRef()&&this.getProperty("loaded")){this._resizeObserver?.disconnect();this._resizeObserver=new ResizeObserver(e=>{if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=window.setTimeout(()=>{if(this.getVisible()){this._setDeviceType(e);this.adjustLayout()}},10)});this._resizeObserver?.observe(this.getDomRef())}},_detachResizeHandler:function e(){this._resizeObserver?.disconnect()},_observeContainer:function e(){const t=this.getDomRef();if(!this._containerObserver){this._containerObserver=new IntersectionObserver(e=>e.forEach(e=>{if(!this.getProperty("loaded")&&this.getVisible()&&e.isIntersecting){this._loadContent()}}),{rootMargin:"0px",threshold:.1})}this._containerObserver?.disconnect();if(t){this._containerObserver.observe(t)}},_createInnerControl:function e(){const n=this.getProperty("orientation");if(n===w.Horizontal||n===w.Vertical){if(!this._wrapper){this._wrapper=new t(`${this.getId()}-wrapper`,{width:"100%",renderType:"Bare"}).addStyleClass("sapCuxBaseWrapper");this.addDependent(this._wrapper)}this._wrapper.setDirection(n===w.Horizontal?"Row":"Column")}else if(!this._iconTabBar){this._iconTabBar=new i(`${this.getId()}-iconTabBar`,{expandable:true,backgroundDesign:B.Transparent,headerMode:"Inline",headerBackgroundDesign:B.Transparent,select:e=>this._onPanelSelect(e)});this.addDependent(this._iconTabBar)}},_updateContainerHeader:function e(t){const n=this.getProperty("orientation")===w.SideBySide;const i=t.isA("sap.cux.home.BaseContainer");const o=!i&&n?this:t;this._controlMap.get(o.getId()+"-header-contentLeft")?.removeAllItems();this._controlMap.get(o.getId()+"-header-contentRight")?.removeAllItems();this._updateHeader(t)},_updateHeader:function e(t){const n=this.getProperty("orientation")===w.SideBySide;const i=t.isA("sap.cux.home.BaseContainer");const o=this._controlMap.get(t.getId()+"-header-title");o?.setText(t.getProperty("title"));o?.setVisible(t.getProperty("title")?.trim().length>0);if(this._getLayout()){this._addLayoutHeaderElements()}const s=i&&n?this._getSelectedPanel():t;const r=!i&&n?this:t;const a=this._filterVisibleHeaderElements(s?.getMenuItems());if(a.length>0){this._addMenuItems(r,a)}s?.getAggregation("actionButtons")?.forEach(e=>{this._controlMap.get(r.getId()+"-header-contentRight")?.addItem(this._getHeaderButton(e))})},_addLayoutHeaderElements:function e(){const t=e=>{const t=[{property:"enableFullScreen",aggregation:"menuItems",headerElement:this._getFullScreenMenuItem(e)},{property:"enableSettings",aggregation:"menuItems",headerElement:this._getHomeSettingsMenuItem(e)},{property:"enableFullScreen",aggregation:"actionButtons",headerElement:this._getFullScreenButton(e)}];t.forEach(t=>{let{property:n,aggregation:i,headerElement:o}=t;const s=e.getProperty(n);const r=this._commonHeaderElementStates.get(`${o.getId()}-${n}`);if(s!==r){this._commonHeaderElementStates.set(`${o.getId()}-${n}`,s);if(s){e.addAggregation(i,o)}else{e.removeAggregation(i,o)}if(n==="enableFullScreen"){this.setFullScreenElementRelations({isFullScreenEnabled:s,control:e,aggregation:i,headerElement:o})}}})};t(this);const n=this.getContent()||[];n.forEach(t);this._setupFullScreenElements()},_setupFullScreenElements:function e(){const t=this._getLayout();const n=e=>{const n=e.getProperty("enableFullScreen");const i=this._commonHeaderElementStates.get(`${e.getId()}-enableFullScreen`);if(n!==i){this._commonHeaderElementStates.set(`${e.getId()}-enableFullScreen`,n);if(n){t?.registerFullScreenElement(e)}else{t?.deregisterFullScreenElement(e)}}if(n){t?.updateFullScreenElement(e,{index:t?.indexOfItem(this)})}};n(this);const i=this.getContent()||[];i.forEach(n)},setFullScreenElementRelations:function e(t){const{isFullScreenEnabled:n,control:i,aggregation:o,headerElement:s}=t;const r=o==="actionButtons"?"fullScreenButton":"fullScreenMenuItem";if(n){i.setAssociation(r,s,true)}else{i.removeAssociation(r,s,true)}},_getHomeSettingsMenuItem:function e(t){const n=`${t.getId()}-settings`;if(!this._controlMap.get(n)){const e=new $(n,{title:this._i18nBundle.getText("myHomeSettings"),icon:"sap-icon://user-settings",press:()=>{const e=this._getLayout();e?.openSettingsDialog()}});A(e,"myHomeSettings");this._controlMap.set(n,e)}return this._controlMap.get(n)},_getFullScreenMenuItem:function e(t){const n=`${t.getId()}-showMore`;if(!this._controlMap.get(n)){const e=new $(n,{title:this._i18nBundle.getText("expand"),icon:"sap-icon://display-more",press:()=>{const e=this._getLayout();e?.toggleFullScreen(t)}});A(e,"toggleFullScreen");this._controlMap.set(n,e)}return this._controlMap.get(n)},_getFullScreenButton:function t(n){const i=`${n.getId()}-fullScreen`;if(!this._controlMap.get(i)){const t=new e(i,{text:this._i18nBundle.getText("expand"),type:v.Transparent,press:()=>{const e=this._getLayout();e?.toggleFullScreen(n)}});A(t,"toggleFullScreen");this._controlMap.set(i,t);this._exemptedActions.push(i)}return this._controlMap.get(i)},_getSelectedPanel:function e(){const t=this.getContent()?.find(e=>e.getProperty("key")===this.getProperty("selectedKey"))||this.getContent()?.[0];this.setProperty("selectedKey",t?.getProperty("key"),true);return t},_addAllPanelContent:function e(){const t=this.getContent()||[];if(this.getProperty("orientation")===w.SideBySide){this._iconTabBar.removeAllItems();t.forEach(e=>this._iconTabBar.addItem(this._getIconTabFilter(e)));this._iconTabBar.setSelectedKey(this.getProperty("selectedKey"))}else{this._wrapper.removeAllItems();t.forEach(e=>this._wrapper.addItem(this._getPanelContentWrapper(e)))}},_getPanelContentWrapper:function e(n){const i=`${n.getId()}-contentWrapper`;if(!this._controlMap.get(i)){this._controlMap.set(i,new t(i,{width:"100%",direction:"Column",renderType:"Bare"}))}this._controlMap.get(i).addItem(this._updatePanelHeader(n));n._getContent()?.forEach(e=>this._controlMap.get(i).addItem(e));return this._controlMap.get(i)},_updatePanelHeader:function e(t){const n=this._createHeader(t);const i=t.getProperty("title")?.trim().length>0;const o=this.getProperty("title")?.trim().length>0;this._updateContainerHeader(t);n.toggleStyleClass("sapCuxPanelHeader",o&&(i||this._filterVisibleHeaderElements(t.getMenuItems()).length>0||this._filterVisibleHeaderElements(t.getActionButtons()).length>0));return n},_filterVisibleHeaderElements:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t.filter(e=>e.getVisible())},_setTitle:function e(t){this.setProperty("title",t,true);this._controlMap.get(`${this.getId()}-header-title`).setText(t);return this},_addMenuItems:function t(n,i){if(!this._controlMap.get(`${n.getId()}-menu`)){const t=new s(`${n.getId()}-list`,{itemPress:e=>e.getSource().getParent().close()});this._controlMap.set(`${n.getId()}-menu`,t);const i=H(`${n.getId()}-popoverTitle`,this._i18nBundle.getText("actions"));const o=new r(`${n.getId()}-popover`,{placement:C.VerticalPreferredBottom,showHeader:false,ariaLabelledBy:[i?i?.getId():""],content:[t,i]});const a=new e(`${n.getId()}-menu-btn`,{icon:"sap-icon://slim-arrow-down",type:v.Transparent,tooltip:this._i18nBundle.getText("more"),press:e=>o.openBy(e.getSource())});this._controlMap.set(`${n.getId()}-menu-btn`,a)}this._controlMap.get(n.getId()+"-header-contentLeft")?.addItem(this._controlMap.get(`${n.getId()}-menu-btn`));this._controlMap.get(`${n.getId()}-menu`).removeAllItems();i.forEach(e=>this._controlMap.get(`${n.getId()}-menu`).addItem(this._getMenuListItem(e)))},_getHeaderButton:function t(n){const i=`${n.getId()}-btn`;if(!this._controlMap.get(i)){this._controlMap.set(i,new e(i,{type:v.Transparent,press:()=>n.firePress()}));L(this._controlMap.get(i),V.PRESS,D(n))}const o=this._controlMap.get(i);o.setText(n.getText());o.setTooltip(n.getTooltip());o.setIcon(n.getIcon());o.setVisible(n.getVisible());o.setEnabled(n.getEnabled());return o},_getLayout:function e(){return g.getElementById(this.getAssociation("layout",null))},_getMenuListItem:function e(t){if(!this._controlMap.get(`${t.getId()}-listItem`)){this._controlMap.set(`${t.getId()}-listItem`,new a(`${t.getId()}-listItem`,{type:"Active",icon:t.getIcon(),title:t.getTitle(),press:e=>t.firePress({button:e.getSource()})}));L(this._controlMap.get(`${t.getId()}-listItem`),V.PRESS,D(t))}const n=this._controlMap.get(`${t.getId()}-listItem`);n.setIcon(t.getIcon());n.setTitle(t.getTitle());n.setVisible(t.getVisible());return n},toggleMenuListItem:function e(t,n){if(t){const e=this._getMenuListItem(t);e?.setVisible(n);t.setProperty("visible",n,true)}},toggleActionButton:function e(t,n){if(t){const e=this._getHeaderButton(t);e?.setVisible(n);t.setProperty("visible",n,true)}},removeContent:function e(t){if(this.getProperty("selectedKey")&&this.getProperty("selectedKey")===t.getProperty("key")){this.setProperty("selectedKey",undefined,true)}this.removeAggregation("content",t)},getWidth:function e(){return this.getProperty("width")},toggleActionButtons:function e(t){const n=this.getProperty("orientation")===w.SideBySide;let i=false;const o=e=>{e.getActionButtons()?.forEach(e=>{const n=e.getVisible();if(n!==t&&!this._exemptedActions.includes(e.getId())){e.setProperty("visible",t,true);i=true}});if(!n&&i){this._updateContainerHeader(e)}};o(this);const s=this.getContent()||[];s.forEach(o);if(n&&i){this._updateContainerHeader(this)}},toggleFullScreenElements:function e(t,n){const i=g.getElementById(t.getAssociation("fullScreenButton",null));const o=g.getElementById(t.getAssociation("fullScreenMenuItem",null));const s=this.getProperty("orientation")===w.SideBySide;const r=this.getDeviceType()===F.Mobile;const a=t.getParent();let l=false;n=!r?n:false;[i,o].forEach(e=>{if(e&&n!==e.getVisible()){l=true;e.setProperty("visible",n,true)}});const c=t instanceof E&&t.getKey();if(l&&(!s||s&&this.getProperty("selectedKey")===c)){this._updateContainerHeader(a.getContent().length===1&&!s?t.getParent():t)}},_setDeviceType:function e(t){const[n]=t;const i=n.target.parentNode;const o=i.clientWidth;const s=x(o);if(this._deviceType!==s&&o>0){this._deviceType=s}},getDeviceType:function e(){return this._deviceType||x()},_markPerformanceMetrics:function e(){const t=this.getMetadata().getName();z(t);this.getContent()?.forEach(e=>{e.attachEventOnce("loaded",()=>{R(t)})})},getGenericPlaceholder:function e(){const t=this.getGenericPlaceholderContent();if(!t){return undefined}return new p({content:t})},getGenericPlaceholderContent:function e(){return undefined}});return k});
|
|
37
47
|
/*!
|
|
38
48
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
39
49
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
40
50
|
*/
|
|
41
|
-
sap.ui.predefine("sap/cux/home/BaseContainerRenderer", ["./library"],function(e){"use strict";const t=e["OrientationType"];var n={apiVersion:2,render:function(e,n){e.openStart("div",n).class("sapCuxBaseContainer");if(n.getProperty("orientation")===t.SideBySide){e.class("sapCuxSideBySide")}else if(n.getProperty("orientation")===t.Horizontal){e.class("sapCuxHorizontal")}else{e.class("sapCuxVertical")}e.style("width",n.getWidth());e.style("height",n.getHeight());e.openEnd();const
|
|
51
|
+
sap.ui.predefine("sap/cux/home/BaseContainerRenderer", ["./library"],function(e){"use strict";const t=e["OrientationType"];var n={apiVersion:2,render:function(e,n){e.openStart("div",n).class("sapCuxBaseContainer");if(n.getProperty("orientation")===t.SideBySide){e.class("sapCuxSideBySide")}else if(n.getProperty("orientation")===t.Horizontal){e.class("sapCuxHorizontal")}else{e.class("sapCuxVertical")}e.style("width",n.getWidth());e.style("height",n.getHeight());e.openEnd();const r=n.getProperty("enableLazyLoad");if(!r||n.getProperty("loaded")){this.renderContent(e,n)}else{this.renderCustomPlaceholder(e,n)}e.close("div")},renderContent:function(e,t){if(t.getContent()?.length>0){e.openStart("div",t.getId()+"-header").class("sapUiBaseContainerHeader").openEnd();e.renderControl(t._getHeader());e.close("div");e.openStart("div",t.getId()+"-content").class("sapUiBaseContainerContent").openEnd();e.renderControl(t._getInnerControl());e.close("div")}},renderCustomPlaceholder:function(e,t){try{const n=t.getGenericPlaceholder();if(!n){e.openStart("div",t.getId()+"-placeholder").class("sapUiBaseContainerPlaceholder").openEnd().close("div");return}if(Array.isArray(n)){n.forEach(t=>e.renderControl(t))}else{e.renderControl(n)}}catch(e){}}};return n});
|
|
42
52
|
/*!
|
|
43
53
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
44
54
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
45
55
|
*/
|
|
46
|
-
sap.ui.predefine("sap/cux/home/BaseLayout", ["sap/base/Log","sap/base/util/deepEqual","sap/m/library","sap/m/Page","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/routing/HashChanger","./BaseLayoutRenderer","./BasePanel","./library","./utils/Device"],function(e,t,n,i,s,o,r,l,a,u,c){"use strict";function g(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const d=n["PageBackgroundDesign"];const h=g(l);const p=g(a);const f=u["OrientationType"];const m=c["DeviceType"];const _=c["calculateDeviceType"];const y=i.extend("sap.cux.home.BaseLayout",{renderer:h,metadata:{library:"sap.cux.home",properties:{enableSettings:{type:"boolean",group:"Misc",visibility:"hidden"},enableFullScreen:{type:"boolean",group:"Misc",visibility:"hidden"},expanded:{type:"boolean",group:"Misc",defaultValue:false,visibility:"hidden"},settingsDialogPersisted:{type:"boolean",group:"Misc",defaultValue:false,visibility:"hidden"},showHeader:{type:"boolean",group:"Appearance",defaultValue:true,visibility:"hidden"},showFooter:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busy:{type:"boolean",defaultValue:false,visibility:"hidden"},backgroundDesign:{type:"sap.m.PageBackgroundDesign",group:"Appearance",defaultValue:d.Transparent,visibility:"hidden"},persContainerId:{type:"string",defaultValue:"",visibility:"public"}},defaultAggregation:"items",aggregations:{items:{type:"sap.cux.home.BaseContainer",singularName:"item",multiple:true},settingsDialog:{type:"sap.cux.home.BaseSettingsDialog",singularName:"settingsDialog",multiple:false},keyUserSettingsDialog:{type:"sap.cux.home.BaseSettingsDialog",singularName:"keyUserSettingsDialog",multiple:false},fullScreenContainer:{type:"sap.m.Page",singularName:"fullScreenContainer",multiple:false,visibility:"hidden"}},events:{onCollapse:{}}},constructor:function e(t,n){i.prototype.constructor.call(this,t,n)},init:function e(){i.prototype.init.call(this);this._settingsPanels=[];this._elementConfigs=new Map;this._i18nBundle=o.getResourceBundleFor("sap.cux.home.i18n");this._slideDurationInSeconds=1;this._fullScreenContainer=new i(`${this.getId()}-fullScreen-container`,{backgroundDesign:"Transparent",showHeader:false});this.setAggregation("fullScreenContainer",this._fullScreenContainer)},onBeforeRendering:function e(t){i.prototype.onBeforeRendering.call(this,t);this._toggleHeaderVisibility();if(this.getProperty("settingsDialogPersisted")){const e=this.getAggregation("settingsDialog")?.getProperty("selectedKey");this.openSettingsDialog(e);this.setProperty("settingsDialogPersisted",false,true)}if(this.getProperty("enableFullScreen")){document.body.style.setProperty("--sapUiSlideDuration",`${this._slideDurationInSeconds}s`)}},_toggleHeaderVisibility:function e(){const t=this.getCustomHeader()!=null||this.getHeaderContent().length>0;this.setProperty("showHeader",t,true)},onAfterRendering:function e(){if(this.getProperty("enableFullScreen")){if(!this._layoutLoaded){this._layoutLoaded=true;setTimeout(()=>{this._hashChanger=new r;this._loadFullScreenFromHash(this._hashChanger.getHash()||"");const[e]=this._hashChanger.getHash().split("?");window.addEventListener?.("hashchange",()=>{const t=window.location.hash.substring(1);if(t.includes?.(e)){this._loadFullScreenFromHash(t,true)}})})}}},getContent:function e(){return this.getItems()},_getURLParams:function e(t){const n=t?.includes("?")?t.substring(t.indexOf("?")+1):"";return new URLSearchParams(n)},_loadFullScreenFromHash:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const i=this.getProperty("enableFullScreen");const s=this._getURLParams(t);const o=s.get("expanded")||"";const r=this._elementConfigs.get(o);const l=r?.targetContainer.getVisible()||false;const a=_()===m.Mobile;if(i&&r&&!a&&l){if(this._currentExpandedElement&&this._currentExpandedElement.fullScreenName!==o){this._toggleFullScreenForElement(r,n)}else if(!this._currentExpandedElement){this._toggleFullScreenForElement(r)}else if(s.has("expanded")){document.getElementById(`${this.getId()}-layout-container`)?.classList.add("slide")}}else{if(this._currentExpandedElement){this._toggleFullScreenForElement(this._currentExpandedElement)}else{if(s.has("expanded")){const e=this._removeURLParam(t,"expanded");this._hashChanger?.replaceHash(e,"Backwards")}}}},_toggleFullScreenForElement:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;setTimeout(()=>this.toggleFullScreen(t.sourceElements.values().next().value,n))},openSettingsDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const i=this.getAggregation("settingsDialog");i?.setProperty("selectedKey",t);i?.setProperty("context",n);i?.open()},setSettingsDialog:function e(t){const n=this.getProperty("enableSettings");if(n){const e=t?.getPanels();e?.forEach(e=>{this._addSettingsPanel(e)})}this.setAggregation("settingsDialog",t);return this},_addSettingsPanel:function e(t,n){if(t){if(n){this._settingsPanels=t}else{this._settingsPanels.push(t)}}},_getSettingsPanels:function e(){return this._settingsPanels},_extractElementConfig:function e(t){const n=t;const i=n instanceof p;const s=i?n.getParent():n;const o=i&&s.getProperty("orientation")===f.SideBySide;const r=(o?s:n).getProperty("fullScreenName");const l=(new Set).add(n);return{fullScreenName:r,sourceElements:l,targetContainer:s,index:this.indexOfItem(s),key:i?n.getKey():""}},registerFullScreenElement:function e(t){const n=this._extractElementConfig(t);const{fullScreenName:i}=n;if(i&&!this.getProperty("expanded")){if(this._elementConfigs.get(i)){const e=(this._elementConfigs.get(i)?.sourceElements||new Set).add(t);this._elementConfigs.set(i,{...n,sourceElements:e})}else{this._elementConfigs.set(i,n)}}},deregisterFullScreenElement:function e(t){const{fullScreenName:n}=this._extractElementConfig(t);if(n&&!this.getProperty("expanded")){this._elementConfigs.delete(n)}},updateFullScreenElement:function e(t,n){const i=this._extractElementConfig(t);const{fullScreenName:s}=i;if(s&&!this.getProperty("expanded")){const e={...this._elementConfigs.get(s),...n};this._elementConfigs.set(s,e)}},_addURLParam:function e(t,n,i){const s=this._getURLParams(t);s.set(n,i);return`${t.split("?")[0]}?${s.toString()}`},_removeURLParam:function e(t,n){const i=this._getURLParams(t);i.delete(n);return i.toString()?`${t.split("?")[0]}?${i.toString()}`:t.split("?")[0]},toggleFullScreen:function n(i){let s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const o=i instanceof p&&i.getParent()?.getProperty("orientation")===f.SideBySide;const r=(o?i.getParent():i)?.getProperty("fullScreenName");const l=this._elementConfigs.get(r);const a=s||this._checkToggleRequirements(l);if(l&&a){const{targetContainer:e}=l;const n=this._hashChanger?.getHash()||"";const o=e.indexOfAggregation("content",i);const a=e.getProperty("orientation")===f.SideBySide;let u=this.getProperty("expanded");e._detachResizeHandler();if(!s){this.setProperty("expanded",!this.getProperty("expanded"),true);u=this.getProperty("expanded");this._placeClonedElement(e,u,o);document.getElementById(`${this.getId()}-layout-container`)?.classList.toggle("slide",u)}this._toggleFullScreenButtonText(i,u);if(u){this._previousExpandedElement=this._currentExpandedElement;this._currentExpandedElement=l}else{delete this._currentExpandedElement}setTimeout(()=>{if(u){if(!a){e.setProperty("selectedKey",i.getProperty("key"))}const s=!t(this._previousExpandedElement?.targetContainer,e);this._adjustPreviousExpandedElementIfRequired(s);this._modifyContainer(e,o);this._currentExpandedElement=l;const u=this._addURLParam(n,"expanded",r);this._hashChanger?.replaceHash(u,"Forwards");this._focusFullScreenButton(i);i.fireEvent("onExpand")}else{this._domSnapshot?.remove();this.insertItem(e,l.index);if(!a){this._toggleInnerPanelVisibility(e,true)}delete this._currentExpandedElement;const t=this._removeURLParam(n,"expanded");this._hashChanger?.replaceHash(t,"Backwards");this._resetScrollPosition(i);this.fireEvent("onCollapse")}e._attachResizeHandler()},s?0:this._slideDurationInSeconds*1e3)}else{e.warning(`Element with ID: ${i?.getId()} not registered for full screen`)}},_modifyContainer:function e(n,i){const s=n.getProperty("orientation")===f.SideBySide;const o=!t(this._previousExpandedElement?.targetContainer,n);if(!this._previousExpandedElement||o){this._getFullScreenContainer().removeAllContent();this._sourceElementClone?.remove();this._getFullScreenContainer().addContent(n)}if(!s){this._toggleInnerPanelVisibility(n,false,i)}},_checkToggleRequirements:function e(t){const n=this.getProperty("expanded");let i=true;if(n){const e=t?.fullScreenName;i=this._currentExpandedElement?.fullScreenName===e}return i},_adjustPreviousExpandedElementIfRequired:function e(t){if(this._previousExpandedElement){const e=this._previousExpandedElement.sourceElements.values().next().value;this._toggleFullScreenButtonText(e,false);if(t){this.insertItem(this._previousExpandedElement.targetContainer,this._previousExpandedElement.index);this._scrollPosition=0;if(this._previousExpandedElement.targetContainer.getProperty("orientation")!==f.SideBySide){this._toggleInnerPanelVisibility(this._previousExpandedElement.targetContainer,true)}}}},_resetScrollPosition:function e(t){setTimeout(()=>{s.getElementById(`${t.getAssociation("fullScreenButton",null)}-btn`)?.focus();const e=this._getSectionRef(this);if(e!==undefined){e.scrollTop=this._scrollPosition}})},_toggleInnerPanelVisibility:function e(t,n,i){t._getInnerControl().getItems().forEach((e,t)=>{e.toggleStyleClass("sapCuxHidden",t===i?n:!n)})},_toggleFullScreenButtonText:function e(t,n){const i=t.isA("sap.cux.home.BasePanel");const s=i?t.getParent():t;const o=i&&s.getProperty("orientation")===f.SideBySide;const r=e=>{const t=this._getFullScreenButton(e);t.setProperty("text",this._i18nBundle.getText(n?"collapse":"expand"),true);const i=this._getFullScreenMenuItem(e);i.setProperty("title",this._i18nBundle.getText(n?"collapse":"expand"),true)};if(o){s.getContent()?.forEach(r)}else{r(t)}s._updateContainerHeader(o?s:t)},_focusFullScreenButton:function e(t){setTimeout(()=>{s.getElementById(`${t.getAssociation("fullScreenButton",null)}-btn`)?.focus()})},_getFullScreenButton:function e(t){return s.getElementById(t.getAssociation("fullScreenButton",null))},_getFullScreenMenuItem:function e(t){return s.getElementById(t.getAssociation("fullScreenMenuItem",null))},_getFullScreenContainer:function e(){return this.getAggregation("fullScreenContainer")},_getSectionRef:function e(t){const n=this.getProperty("showHeader")&&t!==this._getFullScreenContainer()?1:0;return t.getDomRef()?.childNodes[n]},_placeClonedElement:function e(t,n,i){this._scrollPosition=n?this._getSectionRef(this)?.scrollTop:this._scrollPosition;this._domSnapshot=n?this.getDomRef()?.cloneNode(true).cloneNode(true):this._domSnapshot;const s=t.getProperty("orientation")===f.SideBySide;const o=s?t:t._getInnerControl()?.getItems()[i]||t;const r=o.getDomRef()||t.getDomRef();this._sourceElementClone=n?r?.cloneNode(true):this._sourceElementClone;const l=n?this._getSectionRef(this._getFullScreenContainer()):this.getDomRef();if(l){setTimeout(()=>{l.innerHTML="";l.append(n?this._sourceElementClone:this._domSnapshot)})}},_getCurrentExpandedElementName:function e(){return this._getCurrentExpandedElement()?.fullScreenName},_getCurrentExpandedElement:function e(){const t=this._getURLParams(this._hashChanger?.getHash()||"").has("expanded");if(t){return this._currentExpandedElement}}});return y});
|
|
56
|
+
sap.ui.predefine("sap/cux/home/BaseLayout", ["sap/base/Log","sap/base/util/deepEqual","sap/m/library","sap/m/Page","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/routing/HashChanger","./BaseLayoutRenderer","./BasePanel","./library","./utils/Device"],function(e,t,n,i,s,o,l,r,a,u,g){"use strict";function c(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const d=n["PageBackgroundDesign"];const h=c(r);const p=c(a);const f=u["OrientationType"];const m=g["DeviceType"];const _=g["calculateDeviceType"];const y=i.extend("sap.cux.home.BaseLayout",{renderer:h,metadata:{library:"sap.cux.home",properties:{enableSettings:{type:"boolean",group:"Misc",visibility:"hidden"},enableFullScreen:{type:"boolean",group:"Misc",visibility:"hidden"},expanded:{type:"boolean",group:"Misc",defaultValue:false,visibility:"hidden"},settingsDialogPersisted:{type:"boolean",group:"Misc",defaultValue:false,visibility:"hidden"},showHeader:{type:"boolean",group:"Appearance",defaultValue:true,visibility:"hidden"},showFooter:{type:"boolean",group:"Appearance",defaultValue:false,visibility:"hidden"},busy:{type:"boolean",defaultValue:false,visibility:"hidden"},backgroundDesign:{type:"sap.m.PageBackgroundDesign",group:"Appearance",defaultValue:d.Transparent,visibility:"hidden"},persContainerId:{type:"string",defaultValue:"",visibility:"public"}},defaultAggregation:"items",aggregations:{items:{type:"sap.cux.home.BaseContainer",singularName:"item",multiple:true},settingsDialog:{type:"sap.cux.home.BaseSettingsDialog",singularName:"settingsDialog",multiple:false},keyUserSettingsDialog:{type:"sap.cux.home.BaseSettingsDialog",singularName:"keyUserSettingsDialog",multiple:false},contentAdditionDialog:{type:"sap.cux.home.BaseSettingsDialog",singularName:"contentAdditionDialog",multiple:false,visibility:"hidden"},fullScreenContainer:{type:"sap.m.Page",singularName:"fullScreenContainer",multiple:false,visibility:"hidden"}},events:{onCollapse:{}}},constructor:function e(t,n){i.prototype.constructor.call(this,t,n)},init:function e(){i.prototype.init.call(this);this._settingsPanels=[];this._elementConfigs=new Map;this._i18nBundle=o.getResourceBundleFor("sap.cux.home.i18n");this._slideDurationInSeconds=1;this._fullScreenContainer=new i(`${this.getId()}-fullScreen-container`,{backgroundDesign:"Transparent",showHeader:false});this.setAggregation("fullScreenContainer",this._fullScreenContainer)},onBeforeRendering:function e(t){i.prototype.onBeforeRendering.call(this,t);this._toggleHeaderVisibility();if(this.getProperty("settingsDialogPersisted")){const e=this.getAggregation("settingsDialog")?.getProperty("selectedKey");this.openSettingsDialog(e);this.setProperty("settingsDialogPersisted",false,true)}if(this.getProperty("enableFullScreen")){document.body.style.setProperty("--sapUiSlideDuration",`${this._slideDurationInSeconds}s`)}},_toggleHeaderVisibility:function e(){const t=this.getCustomHeader()!=null||this.getHeaderContent().length>0;this.setProperty("showHeader",t,true)},onAfterRendering:function e(){if(this.getProperty("enableFullScreen")){if(!this._layoutLoaded){this._layoutLoaded=true;setTimeout(()=>{this._hashChanger=new l;this._loadFullScreenFromHash(this._hashChanger.getHash()||"");const[e]=this._hashChanger.getHash().split("?");window.addEventListener?.("hashchange",()=>{const t=window.location.hash.substring(1);if(t.includes?.(e)){this._loadFullScreenFromHash(t,true)}})})}}},getContent:function e(){return this.getItems()},_getURLParams:function e(t){const n=t?.includes("?")?t.substring(t.indexOf("?")+1):"";return new URLSearchParams(n)},_loadFullScreenFromHash:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const i=this.getProperty("enableFullScreen");const s=this._getURLParams(t);const o=s.get("expanded")||"";const l=this._elementConfigs.get(o);const r=l?.targetContainer.getVisible()||false;const a=_()===m.Mobile;if(i&&l&&!a&&r){if(this._currentExpandedElement&&this._currentExpandedElement.fullScreenName!==o){this._toggleFullScreenForElement(l,n)}else if(!this._currentExpandedElement){this._toggleFullScreenForElement(l)}else if(s.has("expanded")){document.getElementById(`${this.getId()}-layout-container`)?.classList.add("slide")}}else{if(this._currentExpandedElement){this._toggleFullScreenForElement(this._currentExpandedElement)}else{if(s.has("expanded")){const e=this._removeURLParam(t,"expanded");this._hashChanger?.replaceHash(e,"Backwards")}}}},_toggleFullScreenForElement:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;setTimeout(()=>this.toggleFullScreen(t.sourceElements.values().next().value,n))},openSettingsDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const i=this.getAggregation("settingsDialog");i?.setProperty("selectedKey",t);i?.setProperty("context",n);i?.open()},openContentAdditionDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";const n=this.getAggregation("contentAdditionDialog");n?.setProperty("selectedKey",t);n?.open()},setSettingsDialog:function e(t){const n=this.getProperty("enableSettings");if(n){const e=t?.getPanels();e?.forEach(e=>{this._addSettingsPanel(e)})}this.setAggregation("settingsDialog",t);return this},_addSettingsPanel:function e(t,n){if(t){if(n){this._settingsPanels=t}else{this._settingsPanels.push(t)}}},_getSettingsPanels:function e(){return this._settingsPanels},_extractElementConfig:function e(t){const n=t;const i=n instanceof p;const s=i?n.getParent():n;const o=i&&s.getProperty("orientation")===f.SideBySide;const l=(o?s:n).getProperty("fullScreenName");const r=(new Set).add(n);return{fullScreenName:l,sourceElements:r,targetContainer:s,index:this.indexOfItem(s),key:i?n.getKey():""}},registerFullScreenElement:function e(t){const n=this._extractElementConfig(t);const{fullScreenName:i}=n;if(i&&!this.getProperty("expanded")){if(this._elementConfigs.get(i)){const e=(this._elementConfigs.get(i)?.sourceElements||new Set).add(t);this._elementConfigs.set(i,{...n,sourceElements:e})}else{this._elementConfigs.set(i,n)}}},deregisterFullScreenElement:function e(t){const{fullScreenName:n}=this._extractElementConfig(t);if(n&&!this.getProperty("expanded")){this._elementConfigs.delete(n)}},updateFullScreenElement:function e(t,n){const i=this._extractElementConfig(t);const{fullScreenName:s}=i;if(s&&!this.getProperty("expanded")){const e={...this._elementConfigs.get(s),...n};this._elementConfigs.set(s,e)}},_addURLParam:function e(t,n,i){const s=this._getURLParams(t);s.set(n,i);return`${t.split("?")[0]}?${s.toString()}`},_removeURLParam:function e(t,n){const i=this._getURLParams(t);i.delete(n);return i.toString()?`${t.split("?")[0]}?${i.toString()}`:t.split("?")[0]},toggleFullScreen:function n(i){let s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const o=i instanceof p&&i.getParent()?.getProperty("orientation")===f.SideBySide;const l=(o?i.getParent():i)?.getProperty("fullScreenName");const r=this._elementConfigs.get(l);const a=s||this._checkToggleRequirements(r);if(r&&a){const{targetContainer:e}=r;const n=this._hashChanger?.getHash()||"";const o=e.indexOfAggregation("content",i);const a=e.getProperty("orientation")===f.SideBySide;let u=this.getProperty("expanded");e._detachResizeHandler();if(!s){this.setProperty("expanded",!this.getProperty("expanded"),true);u=this.getProperty("expanded");this._placeClonedElement(e,u,o);document.getElementById(`${this.getId()}-layout-container`)?.classList.toggle("slide",u)}this._toggleFullScreenButtonText(i,u);if(u){this._previousExpandedElement=this._currentExpandedElement;this._currentExpandedElement=r}else{delete this._currentExpandedElement}setTimeout(()=>{if(u){if(!a){e.setProperty("selectedKey",i.getProperty("key"))}const s=!t(this._previousExpandedElement?.targetContainer,e);this._adjustPreviousExpandedElementIfRequired(s);this._modifyContainer(e,o);this._currentExpandedElement=r;const u=this._addURLParam(n,"expanded",l);this._hashChanger?.setHash(u);this._focusFullScreenButton(i);i.fireEvent("onExpand")}else{this._domSnapshot?.remove();this.insertItem(e,r.index);if(!a){this._toggleInnerPanelVisibility(e,true)}delete this._currentExpandedElement;const t=this._removeURLParam(n,"expanded");this._hashChanger?.setHash(t);this._resetScrollPosition(i);this.fireEvent("onCollapse")}e._attachResizeHandler()},s?0:this._slideDurationInSeconds*1e3)}else{e.warning(`Element with ID: ${i?.getId()} not registered for full screen`)}},_modifyContainer:function e(n,i){const s=n.getProperty("orientation")===f.SideBySide;const o=!t(this._previousExpandedElement?.targetContainer,n);if(!this._previousExpandedElement||o){this._getFullScreenContainer().removeAllContent();this._sourceElementClone?.remove();this._getFullScreenContainer().addContent(n)}if(!s){this._toggleInnerPanelVisibility(n,false,i)}},_checkToggleRequirements:function e(t){const n=this.getProperty("expanded");let i=true;if(n){const e=t?.fullScreenName;i=this._currentExpandedElement?.fullScreenName===e}return i},_adjustPreviousExpandedElementIfRequired:function e(t){if(this._previousExpandedElement){const e=this._previousExpandedElement.sourceElements.values().next().value;this._toggleFullScreenButtonText(e,false);if(t){this.insertItem(this._previousExpandedElement.targetContainer,this._previousExpandedElement.index);this._scrollPosition=0;if(this._previousExpandedElement.targetContainer.getProperty("orientation")!==f.SideBySide){this._toggleInnerPanelVisibility(this._previousExpandedElement.targetContainer,true)}}}},_resetScrollPosition:function e(t){setTimeout(()=>{s.getElementById(`${t.getAssociation("fullScreenButton",null)}-btn`)?.focus();const e=this._getSectionRef(this);if(e!==undefined){e.scrollTop=this._scrollPosition}})},_toggleInnerPanelVisibility:function e(t,n,i){t._getInnerControl().getItems().forEach((e,t)=>{e.toggleStyleClass("sapCuxHidden",t===i?n:!n)})},_toggleFullScreenButtonText:function e(t,n){const i=t.isA("sap.cux.home.BasePanel");const s=i?t.getParent():t;const o=i&&s.getProperty("orientation")===f.SideBySide;const l=e=>{const t=this._getFullScreenButton(e);t.setProperty("text",this._i18nBundle.getText(n?"collapse":"expand"),true);const i=this._getFullScreenMenuItem(e);i.setProperty("title",this._i18nBundle.getText(n?"collapse":"expand"),true)};if(o){s.getContent()?.forEach(l)}else{l(t)}s._updateContainerHeader(o?s:t)},_focusFullScreenButton:function e(t){setTimeout(()=>{s.getElementById(`${t.getAssociation("fullScreenButton",null)}-btn`)?.focus()})},_getFullScreenButton:function e(t){return s.getElementById(t.getAssociation("fullScreenButton",null))},_getFullScreenMenuItem:function e(t){return s.getElementById(t.getAssociation("fullScreenMenuItem",null))},_getFullScreenContainer:function e(){return this.getAggregation("fullScreenContainer")},_getSectionRef:function e(t){const n=this.getProperty("showHeader")&&t!==this._getFullScreenContainer()?1:0;return t.getDomRef()?.childNodes[n]},_placeClonedElement:function e(t,n,i){this._scrollPosition=n?this._getSectionRef(this)?.scrollTop:this._scrollPosition;this._domSnapshot=n?this.getDomRef()?.cloneNode(true).cloneNode(true):this._domSnapshot;const s=t.getProperty("orientation")===f.SideBySide;const o=s?t:t._getInnerControl()?.getItems()[i]||t;const l=o.getDomRef()||t.getDomRef();this._sourceElementClone=n?l?.cloneNode(true):this._sourceElementClone;const r=n?this._getSectionRef(this._getFullScreenContainer()):this.getDomRef();if(r){setTimeout(()=>{r.innerHTML="";r.append(n?this._sourceElementClone:this._domSnapshot)})}},_getCurrentExpandedElementName:function e(){return this._getCurrentExpandedElement()?.fullScreenName},_getCurrentExpandedElement:function e(){const t=this._getURLParams(this._hashChanger?.getHash()||"").has("expanded");if(t){return this._currentExpandedElement}}});return y});
|
|
47
57
|
/*!
|
|
48
58
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
49
59
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -53,12 +63,12 @@ sap.ui.predefine("sap/cux/home/BaseLayoutRenderer", ["sap/m/PageRenderer"],funct
|
|
|
53
63
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
54
64
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
55
65
|
*/
|
|
56
|
-
sap.ui.predefine("sap/cux/home/BaseNewsItem", ["sap/m/GenericTile","sap/m/NewsContent","sap/m/TileContent","sap/ui/core/Element","sap/ui/core/Lib"],function(t,e,i,o
|
|
66
|
+
sap.ui.predefine("sap/cux/home/BaseNewsItem", ["sap/m/GenericTile","sap/m/NewsContent","sap/m/TileContent","sap/ui/core/Element","sap/ui/core/Lib"],function(t,e,i,n,o){"use strict";const s=n.extend("sap.cux.home.BaseNewsItem",{metadata:{library:"sap.cux.home",properties:{imageUrl:{type:"string",group:"Misc"},title:{type:"string",group:"Misc"},subTitle:{type:"string",group:"Misc"},footer:{type:"string",group:"Misc"}}},constructor:function t(e,i){n.prototype.constructor.call(this,e,i)},init:function t(){n.prototype.init.call(this);this._i18nBundle=o.getResourceBundleFor("sap.cux.home.i18n");if(!this._oTile){this.createTile()}},setImageUrl:function t(e){const i=e;this._oTile.setBackgroundImage(i);return this.setProperty("imageUrl",i,true)},setSubTitle:function t(e){this._oTile.getTileContent()[0].getContent().setSubheader(e);return this.setProperty("subTitle",e,true)},setTitle:function t(e){this._oTile.getTileContent()[0].getContent().setContentText(e);return this.setProperty("title",e,true)},setFooter:function t(e){this._oTile.getTileContent()[0].setFooter(e);return this.setProperty("footer",e,true)},getTile:function t(){if(!this._oTile){this.createTile()}return this._oTile},createTile:function n(){this._oTile=new t(`${this.getId()}-news-tile`,{mode:"ArticleMode",frameType:"Stretch",backgroundImage:this.getImageUrl(),tileContent:[new i(`${this.getId()}-news-tile-content`,{footer:this.getFooter(),content:new e(`${this.getId()}-news-content`,{contentText:this.getTitle(),subheader:this.getSubTitle()})})]})}});return s});
|
|
57
67
|
/*!
|
|
58
68
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
59
69
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
60
70
|
*/
|
|
61
|
-
sap.ui.predefine("sap/cux/home/BaseNewsPanel", ["sap/m/Button","sap/m/FlexItemData","sap/m/IllustratedMessage","sap/m/VBox","sap/ui/layout/VerticalLayout","./BasePanel","./utils/Constants"],function(t,e,s,i,n,a,r){"use strict";function
|
|
71
|
+
sap.ui.predefine("sap/cux/home/BaseNewsPanel", ["sap/m/Button","sap/m/FlexItemData","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/VBox","sap/ui/layout/VerticalLayout","./BasePanel","./utils/Constants"],function(t,e,s,i,n,a,r,o,l){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const u=d(o);const p=l["SETTINGS_PANELS_KEYS"];const c=u.extend("sap.cux.home.BaseNewsPanel",{metadata:{library:"sap.cux.home",aggregations:{newsItems:{type:"sap.cux.home.BaseNewsItem",singularName:"newsItem",multiple:true}}},constructor:function t(e,s){u.prototype.constructor.call(this,e,s)},init:function t(){u.prototype.init.call(this);this.newsVerticalLayout=new r(`${this.getId()}-newsContent`,{content:[this.generateErrorMessage()],layoutData:new e({id:`${this.getId()}-flexItemdata`,order:0,growFactor:1})});this._addContent(this.newsVerticalLayout)},getNewsWrapper:function t(){return this.newsVerticalLayout},generateErrorMessage:function e(){if(!this.errorCard){const e=new s(`${this.getId()}-errorMessage`,{illustrationSize:i.Small,illustrationType:n.NoNotifications,title:this._i18nBundle.getText("noNewsTitle"),description:this._i18nBundle.getText("noNewsDescription"),additionalContent:[new t(`${this.getId()}-idManageNewsBtn`,{text:this._i18nBundle.getText("editLinkNews"),tooltip:this._i18nBundle.getText("editLinkNews"),type:"Emphasized",press:this.handleEditNews.bind(this)})]});this.errorCard=new a(`${this.getId()}-errorCard`,{wrap:"Wrap",backgroundDesign:"Solid",items:[e],visible:false,height:"17rem",width:"100%"}).addStyleClass("sapUiRoundedBorder noCardsBorder sapUiSmallMarginTopBottom")}return this.errorCard},handleEditNews:function t(){const e=this.getParent();e?._getLayout().openSettingsDialog(p.NEWS)}});return c});
|
|
62
72
|
/*!
|
|
63
73
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
64
74
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -68,32 +78,37 @@ sap.ui.predefine("sap/cux/home/BasePagePanel", ["./BasePanel"],function(e){"use
|
|
|
68
78
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
69
79
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
70
80
|
*/
|
|
71
|
-
sap.ui.predefine("sap/cux/home/BasePanel", ["sap/ui/core/dnd/DragDropInfo","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/library","./utils/Device","./utils/DragDropUtils"],function(t,e,n,i,o,
|
|
81
|
+
sap.ui.predefine("sap/cux/home/BasePanel", ["sap/ui/core/dnd/DragDropInfo","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/library","./utils/Device","./utils/DragDropUtils"],function(t,e,n,i,o,a){"use strict";const s=i["dnd"];const r=o["calculateDeviceType"];const u=a["attachKeyboardHandler"];const c=e.extend("sap.cux.home.BasePanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",defaultValue:""},key:{type:"string",group:"Misc",defaultValue:""},tooltip:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},enableSettings:{type:"boolean",group:"Misc",visibility:"hidden"},enableKeyUserSettings:{type:"boolean",group:"Misc",visibility:"hidden",defaultValue:true},enableFullScreen:{type:"boolean",group:"Misc",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",visibility:"hidden"}},defaultAggregation:"content",aggregations:{content:{multiple:true,singularName:"content",visibility:"hidden"},actionButtons:{type:"sap.m.Button",multiple:true,singularName:"actionButton"},menuItems:{type:"sap.cux.home.MenuItem",multiple:true,singularName:"menuItem"}},events:{onExpand:{},loaded:{}},associations:{fullScreenButton:{type:"sap.m.Button",multiple:false,singularName:"fullScreenButton",visibility:"hidden"}}},constructor:function t(n,i){e.prototype.constructor.call(this,n,i)},init:function t(){this._content=[];this._i18nBundle=n.getResourceBundleFor("sap.cux.home.i18n")},_getContent:function t(){this._content=this._content||this.getAggregation("content");return this._content},_addContent:function t(e){this._content=this._content||this.getAggregation("content");this._content.push(e);this.insertAggregation("content",e,0);this.getParent()?._addToPanel(this,e)},_setCount:function t(e){this.getParent()?._setPanelCount(this,e)},getDeviceType:function t(){const e=this.getParent();return e?e.getDeviceType():r()},addDragDropConfigTo:function e(n,i,o){let a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:s.DropPosition.Between;n.addDragDropConfig(new t(`${n.getId()}--addDragDropConfig`,{sourceAggregation:"items",targetAggregation:"items",dropPosition:a,dropLayout:s.DropLayout.Horizontal,drop:i})).attachBrowserEvent("keydown",t=>{const e=t.metaKey||t.ctrlKey;void u(t,e,t=>{i(t)})});if(o){n.attachBrowserEvent("keydown",o)}}});return c});
|
|
72
82
|
/*!
|
|
73
83
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
74
84
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
75
85
|
*/
|
|
76
|
-
sap.ui.predefine("sap/cux/home/BaseSettingsDialog", ["sap/m/Dialog","sap/ui/core/Lib"],function(e,t){"use strict";const
|
|
86
|
+
sap.ui.predefine("sap/cux/home/BaseSettingsDialog", ["sap/m/Dialog","sap/ui/core/Lib"],function(e,t){"use strict";const n=e.extend("sap.cux.home.BaseSettingsDialog",{renderer:{apiVersion:2},metadata:{library:"sap.cux.home",properties:{selectedKey:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},context:{type:"object",group:"Misc",defaultValue:{},visibility:"hidden"}},defaultAggregation:"panels",aggregations:{panels:{type:"sap.cux.home.BaseSettingsPanel",singularName:"panel",multiple:true}}},constructor:function t(n,i){e.prototype.constructor.call(this,n,i)},init:function n(){e.prototype.init.call(this);this._i18nBundle=t.getResourceBundleFor("sap.cux.home.i18n");this._panelCache=[];this.addStyleClass("sapContrastPlus")},getPanels:function e(){return this._panelCache.slice()},addPanel:function e(t){this._panelCache.push(t);this.addAggregation("panels",t);return this},insertPanel:function e(t,n){this._panelCache.splice(n,0,t);this.insertAggregation("panels",t,n);return this},removePanel:function e(t){this._panelCache.splice(this._panelCache.indexOf(t),1);return this.removeAggregation("panels",t)},removeAllPanels:function e(){this._panelCache=[];this.removeAllAggregation("panels");return this.getPanels()}});return n});
|
|
77
87
|
/*!
|
|
78
88
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
79
89
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
80
90
|
*/
|
|
81
|
-
sap.ui.predefine("sap/cux/home/BaseSettingsPanel", ["sap/ui/core/dnd/DragDropInfo","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/library","./utils/DragDropUtils"],function(e,
|
|
91
|
+
sap.ui.predefine("sap/cux/home/BaseSettingsPanel", ["sap/ui/core/dnd/DragDropInfo","sap/ui/core/Element","sap/ui/core/Lib","sap/ui/core/library","./utils/DragDropUtils"],function(t,e,n,i,o){"use strict";const s=i["dnd"];const r=o["attachKeyboardHandler"];const a=e.extend("sap.cux.home.BaseSettingsPanel",{metadata:{library:"sap.cux.home",properties:{key:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},title:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},icon:{type:"sap.ui.core.URI",group:"Misc",defaultValue:"",visibility:"hidden"},showHeader:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"}},defaultAggregation:"content",aggregations:{content:{type:"sap.ui.core.Control",singularName:"content",multiple:true,visibility:"hidden"},actionButtons:{type:"sap.m.Button",multiple:true,singularName:"actionButton",visibility:"hidden"}},associations:{panel:{type:"string"}},events:{panelNavigated:{parameters:{context:{type:"object"}}},onDialogClose:{}}},constructor:function t(n,i){e.prototype.constructor.call(this,n,i);this._keyuserChanges=[]},init:function t(){this._i18nBundle=n.getResourceBundleFor("sap.cux.home.i18n");this._actionButtonsCache=[]},_getPanel:function t(){return e.getElementById(this.getAssociation("panel",null))},_persistDialog:function t(){const e=this._getPanel();const n=e?.getParent();const i=n?.getParent();i?.setProperty("settingsDialogPersisted",true,true)},getKeyUserChanges:function t(){return this._keyuserChanges},addKeyUserChanges:function t(e){this._keyuserChanges.push(e)},clearKeyUserChanges:function t(){this._keyuserChanges=[]},addDragDropConfigTo:function e(n,i){n.addDragDropConfig(new t(`${n.getId()}--settingsDragDropConfig`,{sourceAggregation:"items",targetAggregation:"items",dropPosition:s.DropPosition.On,dropLayout:s.DropLayout.Horizontal,drop:i})).attachBrowserEvent("keydown",t=>{const e=t.metaKey||t.ctrlKey;void r(t,e,t=>{i(t)})})},getActionButtons:function t(){return this._actionButtonsCache.slice()},addActionButton:function t(e){this._actionButtonsCache.push(e);this.addAggregation("actionButtons",e);return this},insertActionButton:function t(e,n){this._actionButtonsCache.splice(n,0,e);this.insertAggregation("actionButtons",e,n);return this},removeActionButton:function t(e){const n=this._actionButtonsCache.splice(this._actionButtonsCache.indexOf(e),1);this.removeAggregation("actionButtons",e);return n[0]||null},isSupported:function t(){try{return Promise.resolve(true)}catch(t){return Promise.reject(t)}}});return a});
|
|
82
92
|
/*!
|
|
83
93
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
84
94
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
85
95
|
*/
|
|
86
|
-
sap.ui.predefine("sap/cux/home/CardsPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/fe/navigation/SelectionVariant","sap/insights/CardHelper","sap/insights/base/InMemoryCachingHost","sap/m/HBox","sap/m/HeaderContainer","sap/m/VBox","sap/ui/core/EventBus","sap/ui/integration/widgets/Card","sap/ui/model/json/JSONModel","sap/ushell/Container","sap/ushell/api/S4MyHome","./BasePanel","./MenuItem","./utils/AppManager","./utils/Constants","./utils/DataFormatUtils","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/InsightsUtils","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(t,e,n,r,i,s,a,o,c,d,h,l,u,g,f,p,m,C,_,I,P,y,M,v,S){"use strict";function A(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function b(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const E=A(f);function w(t,e){try{var n=t()}catch(t){return e(true,t)}if(n&&n.then){return n.then(e.bind(null,false),e.bind(null,true))}return e(false,n)}const D=A(p);const R=A(m);const H=C["FEATURE_TOGGLES"];const T=C["SETTINGS_PANELS_KEYS"];const x=_["recycleId"];const O=I["DeviceType"];const B=I["fetchElementProperties"];const V=P["focusDraggedItem"];const $=y["addFESRId"];const F=M["createShowMoreActionButton"];const W=M["createShowMoreMenuItem"];const N=M["getAssociatedFullScreenMenuItem"];const j=M["sortMenuItems"];const L=A(v);const k=A(S);var U=function(t){t["REFRESH"]="cards-refresh";t["EDIT_CARDS"]="cards-editCards";t["AI_INSIGHT_CARD"]="cards-addAIInsightCard";return t}(U||{});var z=function(t){t["REFRESH"]="container-cards-refresh";t["EDIT_CARDS"]="container-cards-editCards";t["SHOW_MORE"]="cardsContainerFullScreenMenuItem";t["AI_INSIGHT_CARD"]="container-cards-addAIInsightCard";return t}(z||{});var G=function(t){t["SHOW_MORE"]="cardsContanerFullScreenActionButton";return t}(G||{});const J=[U.REFRESH,U.EDIT_CARDS,U.AI_INSIGHT_CARD,"showMore","settings"];const q="showRecommendation";let K=false;const Q=E.extend("sap.cux.home.CardsPanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},key:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",defaultValue:"SI2",visibility:"hidden"},host:{type:"sap.ui.integration.Host",group:"Misc",defaultValue:null,visibility:"hidden"}},defaultAggregation:"cards",aggregations:{cards:{type:"sap.ui.integration.widgets.Card",multiple:true,singularName:"card",visibility:"hidden"}},events:{handleHidePanel:{parameters:{}},handleUnhidePanel:{parameters:{}}}},constructor:function t(e,n){E.prototype.constructor.call(this,e,n);this.aVisibleCardInstances=[];this.cardsInViewport=[];this._appSwitched=false;this._headerVisible=false},init:function t(){const e=this;E.prototype.init.call(this);this.setProperty("key","cards");this.setProperty("enableFullScreen",true);this.cardWidth=this.getDeviceType()===O.Mobile?"17rem":"22rem";this.cardHeight=this.getDeviceType()===O.Mobile?"25.5rem":"33rem";this._oData={userVisibleCards:[],userAllCards:[],isPhone:this.getDeviceType()===O.Mobile};this._controlModel=new l(this._oData);this.appManagerInstance=R.getInstance();this._controlMap=new Map;const n=this._createRefreshMenuItem(U.REFRESH,"cardsRefresh");const r=this._createEditCardsMenuItem(U.EDIT_CARDS,"manageCards");const i=[n,r];i.forEach(t=>this.addAggregation("menuItems",t));this._sortMenuItems(J);this.oEventBus=d.getInstance();this.oEventBus.subscribe("importChannel","cardsImport",function(t,n,r){try{return Promise.resolve(e._createCards(r)).then(function(){return Promise.resolve(e.rerenderCards()).then(function(){e._importdone()})})}catch(t){return Promise.reject(t)}},this);this._setupWrapper();this._toggleCardActivity()},_toggleCardActivity:function e(){const n=this;const r=function(t){try{const e=t.getParameter("isMyHomeRoute");const r=function(){if(e){const t=function(){if(n._appSwitched){return Promise.resolve(n.rerenderCards()).then(function(){n._appSwitched=false})}}();if(t&&t.then)return t.then(function(){})}else{n._appSwitched=true}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(t){return Promise.reject(t)}};try{g.attachRouteMatched({},r,this)}catch(e){t.warning(e instanceof Error?e.message:String(e))}},_createCards:function t(e){try{const t=this;return Promise.resolve(t.cardHelperInstance?._createCards(e)).then(function(){return t.rerenderCards()})}catch(t){return Promise.reject(t)}},_getManifestEntryFromCard:function t(e,n){const r=e;const i=e.getManifestEntry(n);if(i){return Promise.resolve(i)}else{if(!r._pManifestReady){r._pManifestReady=new Promise(t=>{e.attachManifestReady(()=>{t(e.getManifestEntry(n))})})}return r._pManifestReady}},_addRuntimeHost:function t(){const e=this,n=this,r=this,i=this,a=this;const o=this.getProperty("host")||new s("runtimeHost");const c=function(t){try{const n=t.getParameter("type");let r=t.getParameter("parameters")||{};const i=function(){if(n==="Navigation"&&r.ibnTarget){t.preventDefault();const n=t.getParameter("card")||{},i=n?.getManifestEntry("sap.card")||{},s=i?.header?.actions||[];let a;if(i?.configuration?.parameters?._semanticDateRangeSetting?.value){a=JSON.parse(i.configuration.parameters._semanticDateRangeSetting.value)}if(a&&Object.keys(a).length){r=e.cardHelperInstance.processSemanticDate(r,i)}let o=e.getContentActions(i)||[];const c=s[0]||{},d=o[0]||{};const h=!!(c?.parameters&&typeof c.parameters==="string"&&c.parameters.indexOf("{= extension.formatters.addPropertyValueToAppState")>-1||d?.parameters&&typeof d.parameters==="string"&&d.parameters.indexOf("{= extension.formatters.addPropertyValueToAppState")>-1);e._manageOldCardExtension(h,t,r);return Promise.resolve(u.getServiceAsync("Navigation")).then(function(t){return Promise.resolve(t.navigate({target:r.ibnTarget,params:r.ibnParams})).then(function(){})})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(t){return Promise.reject(t)}};const d=[{type:"Custom",text:this._i18nBundle?.getText("refresh"),icon:"sap-icon://refresh",action:t=>{this._refreshCardData(t)},visible:function(t){try{return Promise.resolve(n._getManifestEntryFromCard(t,"sap.insights")).then(function(t){return t&&!t.cacheType})}catch(t){return Promise.reject(t)}}},{type:"Custom",text:this._i18nBundle?.getText("viewFilteredBy"),icon:"sap-icon://filter",action:t=>{const e=t.getManifestEntry("sap.app").id;this.getParent()?._getLayout().openSettingsDialog(T.INSIGHTS_CARDS,{cardId:e})},visible:function(t){try{return Promise.resolve(r._getManifestEntryFromCard(t,"sap.insights")).then(function(e){if(e){const e=t.getManifestEntry("sap.card")?.configuration?.parameters;const n=e?._relevantODataFilters?.value||[];const r=n?.length;const i=e?._relevantODataParameters?.value||[];const s=i?.length;const a=t.getManifestEntry("sap.app").dataSources;const o=a?.filterService;const c=o?.settings;return!!((r||s)&&c&&c.odataVersion==="2.0")}else{return false}})}catch(t){return Promise.reject(t)}}},{type:"Custom",text:this._i18nBundle?.getText("navigateToParent"),icon:"sap-icon://display-more",visible:function(t){try{return Promise.resolve(i._getManifestEntryFromCard(t,"sap.insights").then(function(e){try{if(e){return Promise.resolve(i.cardHelperInstance.getParentAppDetails({descriptorContent:t.getManifestEntry("/")})).then(function(t){if(t.semanticObject&&t.action){return Promise.resolve(u.getServiceAsync("Navigation")).then(function(e){const n=[{target:{semanticObject:t.semanticObject,action:t.action}}];return Promise.resolve(e.isNavigationSupported(n)).then(function(t){const e=t;return e[0].supported||false})})}else{return true}})}else{return Promise.resolve(false)}}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}},action:function(t){try{return Promise.resolve(a.cardHelperInstance.getParentAppDetails({descriptorContent:t.getManifestEntry("/")})).then(function(t){const e=t.semanticURL||t.semanticObject;return Promise.resolve(u.getServiceAsync("Navigation")).then(function(t){return Promise.resolve(t.navigate({target:{shellHash:e}})).then(function(){})})})}catch(t){return Promise.reject(t)}}}];o.attachAction(c);o.setProperty("actions",d);this.setProperty("host",o)},_manageOldCardExtension:function t(e,n,i){if(e){const t=new r;const e=n.getParameter("card").getCombinedParameters();(e?._relevantODataParameters).forEach(t=>{if(i.ibnParams){i.ibnParams[t]=e[t]}});(e?._relevantODataFilters).forEach(n=>{const r=JSON.parse(e[n]);const s=r.SelectOptions[0];const a=s.Ranges;if(a?.length===1&&a[0].Sign==="I"&&a[0].Option==="EQ"){if(i.ibnParams){i.ibnParams[n]=a[0].Low}}else if(a?.length>0){t.massAddSelectOption(n,a)}});const s=JSON.parse(i?.ibnParams?.["sap-xapp-state-data"]);s.selectionVariant=t.toJSONObject();if(i.ibnParams){i.ibnParams["sap-xapp-state-data"]=JSON.stringify(s)}}},getContentActions:function t(e){if(e.type==="List"){return e?.content?.item?.actions}else if(e.type==="Table"){return e?.content?.row?.actions}else{return e?.content?.actions}},_importdone:function t(){const e={status:true};this.oEventBus.publish("importChannel","cardsImported",e)},_refreshCardData:function t(e){sap.ui.require(["sap/insights/base/CacheData"],t=>{const n=e.getManifestEntry("sap.app").id;const r=t.getInstance();r.clearCache(n);e.refreshData()})},renderPanel:function t(){try{const e=this;function n(){function t(){return Promise.resolve(e.rerenderCards()).then(function(){e.fireEvent("loaded")})}const n=function(){if(e.aiFlagEnabled===undefined){return Promise.resolve(e.updateAICardCreationStatus()).then(function(){})}}();return n&&n.then?n.then(t):t(n)}const r=function(){if(!e.cardHelperInstance){return Promise.resolve(i.getServiceAsync()).then(function(t){e.cardHelperInstance=t})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(s){return Promise.reject(s)}},rerenderCards:function e(){let n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const e=this;const r=b(function(){const t=e._getCardContainer().getMetadata().getDefaultAggregationName();e._getCardContainer().removeAllAggregation(t);e._showPlaceHolders();return Promise.resolve(e.cardHelperInstance?._getUserVisibleCardModel()).then(function(t){const r=t.getProperty("/cards");e._controlModel.setProperty("/userVisibleCards",r);const i=function(){if(r?.length){e._showCards(r)}else{const t=function(){if(!n){return Promise.resolve(e._checkForRecommendationCards()).then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(i&&i.then)return i.then(function(){})})},function(n){if(n instanceof Error){t.error(n.message)}e.fireHandleHidePanel()});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_checkForRecommendationCards:function t(){try{const t=this;return Promise.resolve(t._getPersonalization()).then(function(e){t.oPersonalizer=e;return Promise.resolve(t.oPersonalizer.read()).then(function(e){let n=false;function r(e){if(n)return e;t.fireHandleHidePanel()}const i=e?.[q];const s=function(){if(i===undefined){return Promise.resolve(t.appManagerInstance.getRecommenedCards()).then(function(e){if(e){const r=t._handleRecommendationCards(e);n=true;return r}})}}();return s&&s.then?s.then(r):r(s)})})}catch(t){return Promise.reject(t)}},_handleRecommendationCards:function t(e){try{const t=this;const n=e.map(t=>t.descriptorContent);return Promise.resolve(t.cardHelperInstance?._createCards(n)).then(function(){return Promise.resolve(t._updateRecommendationStatus()).then(function(){return t.rerenderCards()})})}catch(t){return Promise.reject(t)}},_setupWrapper:function t(){if(!this._cardsFlexWrapper){this._cardsFlexWrapper=new c(`${this.getId()}-cardsFlexWrapper`,{renderType:"Bare",width:"100%",items:[this._createCardContainer(),this._createMobileCardContainer()]});this._cardsFlexWrapper.setModel(this._controlModel);this._addContent(this._cardsFlexWrapper)}},_createCardContainer:function t(){this.cardsContainerSettings=new n(`${this.getId()}-insightsCardsContainerSettings`,{columnSize:this.cardWidth,rowSize:this.cardHeight,gap:"1rem"});this.cardsContainer=new e(`${this.getId()}-insightsCardsFlexBox`,{visible:"{= !${/isPhone}}"}).addStyleClass("sapUiSmallMarginTop").setLayout(this.cardsContainerSettings);this.cardsContainer.setModel(this._controlModel);this.addDragDropConfigTo(this.cardsContainer,t=>this._handleCardsDnd(t));return this.cardsContainer},_createMobileCardContainer:function t(){this.cardsMobileContainer=new o(`${this.getId()}-insightsCardsMobileFlexBox`,{scrollStep:0,scrollStepByItem:1,gridLayout:true,scrollTime:1e3,showDividers:false,visible:"{/isPhone}"});this.cardsMobileContainer.setModel(this._controlModel);this.addDragDropConfigTo(this.cardsMobileContainer,t=>this._handleCardsDnd(t));return this.cardsMobileContainer},_showPlaceHolders:function t(){const e=this.appManagerInstance._getAnalyticalCardManifest();const n=new Array(this._calculatePlaceholderCardCount()).fill(null);const r=n.map(()=>{const t=new h({width:this.cardWidth,height:this.cardHeight,previewMode:"Abstract",manifest:e,host:this.getProperty("host")}).addStyleClass("sapUiSmallMarginEnd");return t});const i=new a({justifyContent:"SpaceBetween",items:r});const s=this._getCardContainer().getMetadata().getDefaultAggregationName();if(s){this._getCardContainer().addAggregation(s,i)}},_calculatePlaceholderCardCount:function t(){const e=this._getInsightsContainer()?._getLayout()?.getDomRef();let n=0;if(e){const t=e.childNodes[0];const r=B(t,["width","padding-left","padding-right"]);let i=r.width-r["padding-left"]-r["padding-right"];const s=this.getDeviceType()===O.Mobile?17:this._calculateCardWidth(i);n=this.getDeviceType()===O.Mobile?this.aVisibleCardInstances.length:Math.floor(i/(s*16+14));this.cardWidth=`${s}rem`}return n||1},_showCards:function t(e){const n=this.getMetadata().getName();this.fireHandleUnhidePanel();this._getInsightsContainer()?.updatePanelsItemCount(e.length,n);if(this._headerVisible){this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsCardsTitle")} (${e.length})`)}const r=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().removeAllAggregation(r);this.aVisibleCardInstances=[];this.cardsInViewport=[];if(!K){this._addRuntimeHost();K=true}e.forEach((t,e)=>{const n=t.descriptorContent;const r=new h({width:this.cardWidth,height:this.cardHeight,manifest:n,host:this.getProperty("host")});this.aVisibleCardInstances.push(r);this.addAggregation("cards",r,true);const i=[r];const s=n["sap.card"].type;if(s==="Table"||s==="List"){const t=new a(x(`${this.getId()}--overlay--${e}`),{width:this.cardWidth,height:"2rem"}).addStyleClass("insightsCardOverflowTop");const n=new a(x(`${this.getId()}--overlayHBoxId--${e}`),{height:"0"}).addStyleClass("sapMFlexBoxJustifyCenter");n.addItem(t);i.push(n)}const o=new c(x(`${this.getId()}--previewBoxId--${e}`),{direction:"Column",justifyContent:"Center",items:i});const d=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().addAggregation(d,o)})},_handleEditCards:function t(e){let n=e.getSource().getParent()||this;if(n?.isA("sap.cux.home.CardsPanel")){n=n.getParent()}n?._getLayout().openSettingsDialog(T.INSIGHTS_CARDS)},handleHideHeader:function t(){this._headerVisible=false;this.setProperty("title","");this._toggleHeaderActions(false)},handleAddHeader:function t(){this._headerVisible=true;this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsCardsTitle")} (${this._controlModel.getProperty("/userVisibleCards")?.length})`);this._toggleHeaderActions(true)},refreshCards:function t(){this.aVisibleCardInstances.forEach(t=>this._refreshCardData(t))},_handleCardsDnd:function e(n){try{const e=this;const r=n.getParameter("dropPosition"),i=n.getParameter("draggedControl"),s=i.getParent()?.indexOfItem(i),a=n.getParameter("droppedControl"),o=i.getParent().indexOfItem(a);e._cardsFlexWrapper?.setBusy(true);const c=w(function(){return b(function(){function t(){setTimeout(()=>{V(e._getCardContainer(),o)},0)}const n=function(){if(!e._controlModel.getProperty("/userAllCards").length){return Promise.resolve(e.cardHelperInstance._getUserAllCardModel()).then(function(t){e._controlModel.setProperty("/userAllCards",t.getProperty("/cards"));return Promise.resolve(e.updateCardList(r,o,s)).then(function(){})})}else{return Promise.resolve(e.updateCardList(r,o,s)).then(function(){})}}();return n&&n.then?n.then(t):t(n)},function(e){if(e instanceof Error){t.error(e.message)}})},function(t,n){e._cardsFlexWrapper?.setBusy(false);if(t)throw n;return n});return Promise.resolve(c&&c.then?c.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},updateCardList:function t(e,n,r){try{const t=this;const i=t._controlModel.getProperty("/userVisibleCards"),s=t._controlModel.getProperty("/userAllCards"),a=i[r]?.rank,o=i[n]?.rank;let c=s.findIndex(t=>t.rank===a),d=s.findIndex(t=>t.rank===o);if(e==="Before"&&r===n-1||e==="After"&&r===n+1||r===n){return Promise.resolve()}if(e==="Before"&&c<d){d--}else if(e==="After"&&c>d){d++}const h=function(){if(c!==d){const e=t.cardHelperInstance.handleDndCardsRanking(c,d,s);return Promise.resolve(t.cardHelperInstance._updateMultipleCards(e,"PUT")).then(function(){t._sortCardsOnRank(s);t._controlModel.setProperty("/userAllCards",s);t._controlModel.setProperty("/userVisibleCards",s.filter(t=>t.visibility));return Promise.resolve(t.rerenderCards()).then(function(){})})}}();return Promise.resolve(h&&h.then?h.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_sortCardsOnRank:function t(e){e.sort((t,e)=>{if(t.rank&&e.rank){if(t.rank<e.rank){return-1}else if(t.rank>e.rank){return 1}}return 0})},_getPersonalization:function t(){const e=L.getPersContainerId(this);const n=L.getOwnerComponent(this);return k.getInstance(e,n)},_updateRecommendationStatus:function t(){try{const e=this;function n(){return Promise.resolve(e.oPersonalizer.read()).then(function(t){if(!t){t={}}t.showRecommendation=true;return e.oPersonalizer.write(t)})}const r=function(){if(!e.oPersonalizer){return Promise.resolve(e._getPersonalization()).then(function(t){e.oPersonalizer=t})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(i){return Promise.reject(i)}},_calculateVisibleCardCount:function t(){const e=this._getInsightsContainer()._getLayout();const n=e.getDomRef();const r=this.getDeviceType();let i=1;if(n){const t=e.getProperty("showHeader");const s=t?1:0;const a=n.childNodes[s];const o=B(a,["width","padding-left","padding-right"]);const c=o.width-o["padding-left"]-o["padding-right"];let d=r===O.Mobile?17:this._calculateCardWidth(c);i=r===O.Mobile?this.aVisibleCardInstances.length:Math.floor(c/(d*16+14));this.cardWidth=`${d}rem`}return i},_calculateCardWidth:function t(e){const n=304;const r=352;const i=14;let s=1;let a=n;while(e/s>=n+i){a=e/s;s+=1}a-=i;a=a>r?r:a;return a/16},_adjustLayout:function t(){const e=this._getInsightsContainer()?._getLayout();let n=this.cardWidth;const r=this.getDeviceType()===O.Mobile;if(e&&this.aVisibleCardInstances?.length>0){const t=e._getCurrentExpandedElementName()===this.getProperty("fullScreenName");let n=this._calculateVisibleCardCount();if(t){n=this.aVisibleCardInstances.length}this._controlModel.setProperty("/isPhone",r);if(n!==this.cardsInViewport.length){this.cardsInViewport=this.aVisibleCardInstances.slice(0,n);const t=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().removeAllAggregation(t);this.cardsInViewport.forEach(t=>{const e=t.getManifest();const n=e["sap.card"]?.type;let r;if(n==="Table"||n==="List"){const t=new a({width:this.cardWidth,height:"2rem"}).addStyleClass("insightsCardOverflowLayer insightsCardOverflowTop");r=new a({height:"0"}).addStyleClass("sapMFlexBoxJustifyCenter");r.addItem(t)}const i=new c({direction:"Column",justifyContent:"Center",items:[t]});if(r){i.addItem(r)}const s=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().addAggregation(s,i)})}const i=t||this.aVisibleCardInstances.length>n;if(this._headerVisible){this._getInsightsContainer()?.toggleFullScreenElements(this,i)}else{const t=N(this);const e=t.getTitle();this._getInsightsContainer()?.updateMenuItem(this._controlMap.get(`${this.getId()}-${z.SHOW_MORE}`),i,e);this._getInsightsContainer()?.updateActionButton(this._controlMap.get(`${this.getId()}-${G.SHOW_MORE}`),i,e)}}else{this.cardWidth=this.getDeviceType()===O.Mobile?"17rem":"22rem"}if(n!==this.cardWidth){this.aVisibleCardInstances.forEach(t=>t.setWidth(this.cardWidth));this.cardsContainerSettings?.setColumnSize(this.cardWidth)}},getContainerMenuItems:function t(){if(!this._containerMenuItems){const t=this._createRefreshMenuItem(z.REFRESH,"containerCardsRefresh");const e=this._createEditCardsMenuItem(z.EDIT_CARDS,"containerManageCards");const n=W(this,z.SHOW_MORE,"containerCardsShowMore");this._controlMap.set(`${this.getId()}-${z.SHOW_MORE}`,n);this._containerMenuItems=[t,e,n]}return this._containerMenuItems},getContainerActionButtons:function t(){if(!this._containerActionButtons){this._containerActionButtons=[];const t=F(this,G.SHOW_MORE,"containerCardsShowMore");if(t){this._controlMap.set(`${this.getId()}-${G.SHOW_MORE}`,t);this._containerActionButtons.push(t)}}return this._containerActionButtons},_getInsightsContainer:function t(){if(!this.insightsContainer){this.insightsContainer=this.getParent()}return this.insightsContainer},_createRefreshMenuItem:function t(e,n){const r=new D(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",visible:false,press:()=>this.refreshCards()});this._controlMap.set(`${this.getId()}-${e}`,r);if(n){$(r,n)}return r},_createEditCardsMenuItem:function t(e,n){const r=new D(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("manageCards"),icon:"sap-icon://edit",visible:false,press:t=>this._handleEditCards(t)});this._controlMap.set(`${this.getId()}-${e}`,r);if(n){$(r,n)}return r},_createAddInsightCardMenuItem:function t(e,n){const r=new D(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("addInsightsCards"),icon:"sap-icon://duplicate",press:()=>this._generateInsightCardsWithAI()});this._controlMap.set(`${this.getId()}-${e}`,r);if(n){$(r,n)}return r},_generateInsightCardsWithAI:function t(){const e=this;this.cardHelperInstance.showAddCardWithSearchDialog(function(){try{return Promise.resolve(e.rerenderCards(true)).then(function(){})}catch(t){return Promise.reject(t)}})},updateAICardCreationStatus:function e(){try{const e=this;let n=[u.getServiceAsync("Navigation"),e.appManagerInstance.isFeatureEnabled(H.AI_GENERATED_CARD)];return Promise.resolve(Promise.all(n).then(n=>{let r=n[0];let i=n[1];if(i){r.isNavigationSupported([{target:{semanticObject:"IntelligentPrompt",action:"personalize"}}]).then(t=>{e.aiFlagEnabled=t[0].supported||false;if(e.aiFlagEnabled){const t=e._createAddInsightCardMenuItem(U.AI_INSIGHT_CARD,"AddAIInsightCard");e.addAggregation("menuItems",t);e._sortMenuItems(J);const n=e._createAddInsightCardMenuItem(z.AI_INSIGHT_CARD,"AddAIInsightCard");e.insightsContainer?.addCommonMenuItems([n])}}).catch(e=>{t.warning(e instanceof Error?e.message:String(e))})}}))}catch(t){return Promise.reject(t)}},_toggleHeaderActions:function t(e){this.getAggregation("menuItems")?.forEach(t=>{this._getInsightsContainer()?.toggleMenuListItem(t,e)});this.getAggregation("actionButtons")?.forEach(t=>this._getInsightsContainer()?.toggleActionButton(t,e))},_getCardContainer:function t(){if(this.getDeviceType()===O.Mobile){return this.cardsMobileContainer}return this.cardsContainer},_sortMenuItems:function t(e){const n=this.getAggregation("menuItems");let r=j(e,n);this.removeAllAggregation("menuItems");r?.forEach(t=>this.addAggregation("menuItems",t))}});Q.cardsMenuItems=U;Q.cardsContainerMenuItems=z;Q.cardsContainerActionButtons=G;return Q});
|
|
96
|
+
sap.ui.predefine("sap/cux/home/CardsPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/fe/navigation/SelectionVariant","sap/insights/CardHelper","sap/insights/base/InMemoryCachingHost","sap/m/HBox","sap/m/HeaderContainer","sap/m/VBox","sap/ui/core/EventBus","sap/ui/integration/widgets/Card","sap/ui/model/json/JSONModel","sap/ushell/Container","sap/ushell/api/S4MyHome","./BasePanel","./MenuItem","./TilesPanel","./utils/Accessibility","./utils/AppManager","./utils/Constants","./utils/DataFormatUtils","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/InsightsUtils","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,r,s,i,a,o,c,d,h,l,u,g,f,p,m,C,_,P,I,y,v,M,A,S,b){"use strict";function E(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function D(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const w=E(f);function R(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const H=E(p);const T=E(m);const O=C["checkPanelExists"];const x=E(_);const V=P["FEATURE_TOGGLES"];const N=P["SETTINGS_PANELS_KEYS"];const $=I["recycleId"];const B=y["calculateCardWidth"];const j=y["DeviceType"];const W=y["fetchElementProperties"];const F=v["focusDraggedItem"];const k=M["addFESRId"];const L=A["createShowMoreActionButton"];const U=A["createShowMoreMenuItem"];const G=A["getAssociatedFullScreenMenuItem"];const z=A["sortMenuItems"];const J=A["targetsAreEqual"];const q=E(S);const K=E(b);var Q=function(e){e["REFRESH"]="cards-refresh";e["EDIT_CARDS"]="cards-editCards";e["AI_INSIGHT_CARD"]="cards-addAIInsightCard";return e}(Q||{});var Y=function(e){e["REFRESH"]="container-cards-refresh";e["EDIT_CARDS"]="container-cards-editCards";e["SHOW_MORE"]="cardsContainerFullScreenMenuItem";e["AI_INSIGHT_CARD"]="container-cards-addAIInsightCard";return e}(Y||{});var X=function(e){e["SHOW_MORE"]="cardsContanerFullScreenActionButton";return e}(X||{});const Z=[Q.REFRESH,Q.EDIT_CARDS,Q.AI_INSIGHT_CARD,"showMore","settings"];const ee={PLACEHOLDER_CARD_COUNT:10,CARDS_GAP:16};const te="showRecommendation";let ne=false;const re=w.extend("sap.cux.home.CardsPanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},key:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",defaultValue:"SI2",visibility:"hidden"},host:{type:"sap.ui.integration.Host",group:"Misc",defaultValue:null,visibility:"hidden"}},defaultAggregation:"cards",aggregations:{cards:{type:"sap.ui.integration.widgets.Card",multiple:true,singularName:"card",visibility:"hidden"}},events:{handleHidePanel:{parameters:{}},handleUnhidePanel:{parameters:{}},visibleCardsUpdated:{parameters:{cards:{type:"sap.ui.integration.widgets.Card[]"}}}}},constructor:function e(t,n){w.prototype.constructor.call(this,t,n);this.aVisibleCardInstances=[];this.cardsInViewport=[];this._appSwitched=false;this._headerVisible=false},init:function e(){const t=this;w.prototype.init.call(this);this.setProperty("key","cards");this.setProperty("enableFullScreen",true);this.cardWidth="19rem";this.cardHeight=this.getDeviceType()===j.Mobile?"25.5rem":"33rem";this._oData={userVisibleCards:[],userAllCards:[],isPhone:this.getDeviceType()===j.Mobile};this._controlModel=new l(this._oData);this.appManagerInstance=x.getInstance();this._controlMap=new Map;const n=this._createRefreshMenuItem(Q.REFRESH,"cardsRefresh");const r=this._createEditCardsMenuItem(Q.EDIT_CARDS,"manageCards");const s=[n,r];s.forEach(e=>this.addAggregation("menuItems",e));this._sortMenuItems(Z);this.oEventBus=d.getInstance();this.oEventBus.subscribe("importChannel","cardsImport",function(e,n,r){try{return Promise.resolve(t._createCards(r)).then(function(){return Promise.resolve(t.rerenderCards()).then(function(){t._importdone()})})}catch(e){return Promise.reject(e)}},this);this._setupWrapper();this._toggleCardActivity()},_toggleCardActivity:function t(){const n=this;const r=function(e){try{const t=e.getParameter("isMyHomeRoute");const r=function(){if(t){const e=function(){if(n._appSwitched){return Promise.resolve(n.rerenderCards()).then(function(){n._appSwitched=false})}}();if(e&&e.then)return e.then(function(){})}else{n._appSwitched=true}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};try{g.attachRouteMatched({},r,this)}catch(t){e.warning(t instanceof Error?t.message:String(t))}},_createCards:function e(t){try{const e=this;return Promise.resolve(e.cardHelperInstance?._createCards(t)).then(function(){return e.rerenderCards()})}catch(e){return Promise.reject(e)}},_getManifestEntryFromCard:function e(t,n){const r=t;const s=t.getManifestEntry(n);if(s){return Promise.resolve(s)}else{if(!r._pManifestReady){r._pManifestReady=new Promise(e=>{t.attachManifestReady(()=>{e(t.getManifestEntry(n))})})}return r._pManifestReady}},_addRuntimeHost:function e(){const t=this,n=this,r=this,s=this,a=this;const o=this.getProperty("host")||new i("runtimeHost");const c=function(e){try{const n=e.getParameter("type");let r=e.getParameter("parameters")||{};const s=function(){if(n==="Navigation"&&r.ibnTarget){e.preventDefault();const n=e.getParameter("card")||{},s=n?.getManifestEntry("sap.card")||{},i=s?.header?.actions||[];let a;if(s?.configuration?.parameters?._semanticDateRangeSetting?.value){a=JSON.parse(s.configuration.parameters._semanticDateRangeSetting.value)}if(a&&Object.keys(a).length){r=t.cardHelperInstance.processSemanticDate(r,s)}let o=t.getContentActions(s);const c=i[0]||{},d=o[0]||{};const h=!!(c?.parameters&&typeof c.parameters==="string"&&c.parameters.indexOf("{= extension.formatters.addPropertyValueToAppState")>-1||d?.parameters&&typeof d.parameters==="string"&&d.parameters.indexOf("{= extension.formatters.addPropertyValueToAppState")>-1);t._manageOldCardExtension(h,e,r);return Promise.resolve(u.getServiceAsync("Navigation")).then(function(e){return Promise.resolve(e.navigate({target:r.ibnTarget,params:r.ibnParams})).then(function(){})})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};const d=[{type:"Custom",text:this._i18nBundle?.getText("refresh"),icon:"sap-icon://refresh",action:e=>{this._refreshCardData(e)},visible:function(e){try{return Promise.resolve(n._getManifestEntryFromCard(e,"sap.insights")).then(function(e){return e&&!e.cacheType})}catch(e){return Promise.reject(e)}}},{type:"Custom",text:this._i18nBundle?.getText("viewFilteredBy"),icon:"sap-icon://filter",action:e=>{const t=e.getManifestEntry("sap.app").id;this.getParent()?._getLayout().openSettingsDialog(N.INSIGHTS_CARDS,{cardId:t})},visible:function(e){try{return Promise.resolve(r._getManifestEntryFromCard(e,"sap.insights")).then(function(t){if(t){const t=e.getManifestEntry("sap.card")?.configuration?.parameters;const n=t?._relevantODataFilters?.value||[];const r=n?.length;const s=t?._relevantODataParameters?.value||[];const i=s?.length;const a=e.getManifestEntry("sap.app").dataSources;const o=a?.filterService;const c=o?.settings;return!!((r||i)&&c&&c.odataVersion==="2.0")}else{return false}})}catch(e){return Promise.reject(e)}}},{type:"Custom",text:this._i18nBundle?.getText("navigateToParent"),icon:"sap-icon://display-more",visible:function(e){try{return Promise.resolve(s._getManifestEntryFromCard(e,"sap.insights").then(function(t){try{if(t){return Promise.resolve(s.cardHelperInstance.getParentAppDetails({descriptorContent:e.getManifestEntry("/")})).then(function(e){if(e.semanticObject&&e.action){return Promise.resolve(u.getServiceAsync("Navigation")).then(function(t){const n=[{target:{semanticObject:e.semanticObject,action:e.action}}];return Promise.resolve(t.isNavigationSupported(n)).then(function(e){const t=e;return t[0].supported||false})})}else{return true}})}else{return Promise.resolve(false)}}catch(e){return Promise.reject(e)}}))}catch(e){return Promise.reject(e)}},action:function(e){try{return Promise.resolve(a.cardHelperInstance.getParentAppDetails({descriptorContent:e.getManifestEntry("/")})).then(function(e){const t=e.semanticURL||e.semanticObject;return Promise.resolve(u.getServiceAsync("Navigation")).then(function(e){return Promise.resolve(e.navigate({target:{shellHash:t}})).then(function(){})})})}catch(e){return Promise.reject(e)}}}];o.attachAction(c);o.setProperty("actions",d);this.setProperty("host",o)},_manageOldCardExtension:function e(t,n,s){if(t){const e=new r;const t=n.getParameter("card").getCombinedParameters();(t?._relevantODataParameters).forEach(e=>{if(s.ibnParams){s.ibnParams[e]=t[e]}});(t?._relevantODataFilters).forEach(n=>{const r=JSON.parse(t[n]);const i=r.SelectOptions[0];const a=i.Ranges;if(a?.length===1&&a[0].Sign==="I"&&a[0].Option==="EQ"){if(s.ibnParams){s.ibnParams[n]=a[0].Low}}else if(a?.length>0){e.massAddSelectOption(n,a)}});const i=JSON.parse(s?.ibnParams?.["sap-xapp-state-data"]);i.selectionVariant=e.toJSONObject();if(s.ibnParams){s.ibnParams["sap-xapp-state-data"]=JSON.stringify(i)}}},getContentActions:function e(t){let n;if(t.type==="List"){n=t?.content?.item?.actions}else if(t.type==="Table"){n=t?.content?.row?.actions}else{n=t?.content?.actions}return n||[]},_importdone:function e(){const t={status:true};this.oEventBus.publish("importChannel","cardsImported",t)},_refreshCardData:function e(t){sap.ui.require(["sap/insights/base/CacheData"],e=>{const n=t.getManifestEntry("sap.app").id;const r=e.getInstance();r.clearCache(n);t.refreshData()})},refreshData:function t(){try{const t=this;const n=D(function(){return Promise.resolve(s.getServiceAsync()).then(function(e){t.cardHelperInstance=e;return Promise.resolve(t.cardHelperInstance._refreshUserCards(false)).then(function(){return Promise.resolve(t.renderPanel()).then(function(){})})})},function(t){e.error("Failed to refresh cards: ",t instanceof Error?t.message:t)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},renderPanel:function e(){try{const t=this;function n(){function e(){return Promise.resolve(t.rerenderCards()).then(function(){t.fireEvent("loaded")})}const n=function(){if(t.aiFlagEnabled===undefined){return Promise.resolve(t.updateAICardCreationStatus()).then(function(){})}}();return n&&n.then?n.then(e):e(n)}const r=function(){if(!t.cardHelperInstance){return Promise.resolve(s.getServiceAsync()).then(function(e){t.cardHelperInstance=e})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(i){return Promise.reject(i)}},rerenderCards:function t(){let n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;if(!t._cardsRendered){t._cardsRendered=new Promise((r,s)=>{void function(){try{const i=D(function(){const e=t._getCardContainer().getMetadata().getDefaultAggregationName();t._getCardContainer().removeAllAggregation(e);t._showPlaceHolders();return Promise.resolve(t.cardHelperInstance?._getUserVisibleCardModel()).then(function(e){const s=e.getProperty("/cards");const i=e?.bindList("/cards");if(!i.hasListeners("change")){i?.enableExtendedChangeDetection(true,"/cards",{});i?.attachChange(function(){try{return Promise.resolve(t._cardsRendered??Promise.resolve()).then(function(){const n=e.getProperty("/cards");if(n.length!==t.aVisibleCardInstances.length){t._showCards(n)}})}catch(e){return Promise.reject(e)}})}t._controlModel.setProperty("/userVisibleCards",s);return Promise.resolve(t.getPersonalisationProperty(te)).then(function(e){function i(){t._cardsRendered=undefined;r()}const a=function(){if(s.length===0&&e===undefined&&!n){return Promise.resolve(t._getRecommendationCards()).then(function(){})}else{const n=function(){if(s.length){function n(){return Promise.resolve(t.checkForRecommendedCards(s)).then(function(){})}const r=function(){if(e===undefined){return Promise.resolve(t._updateRecommendationStatus()).then(function(){})}}();return r&&r.then?r.then(n):n(r)}else{t.fireHandleHidePanel()}}();if(n&&n.then)return n.then(function(){})}}();return a&&a.then?a.then(i):i(a)})})},function(n){t.fireHandleHidePanel();t._cardsRendered=undefined;if(n instanceof Error){e.error(n.message);s(n)}});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()})}return Promise.resolve(t._cardsRendered)}catch(e){return Promise.reject(e)}},setNewVisibleCards:function e(){try{const e=this;return Promise.resolve(e.cardHelperInstance._getUserVisibleCardModel()).then(function(t){const n=t.getProperty("/cards");e._controlModel.setProperty("/userVisibleCards",n);e._showCards(n)})}catch(e){return Promise.reject(e)}},checkForRecommendedCards:function e(t){try{const e=this;let n=[];t.forEach((e,t)=>{let r=e.descriptorContent;if(r["sap.card"]?.rec===true&&(!r["sap.card"]["configuration"]||!r["sap.card"]["configuration"]["csrfTokens"])){n.push({cardId:r?.["sap.app"]?.id,rank:r?.["sap.insights"]?.ranking||e?.rank,id:r?.["sap.insights"]?.["parentAppId"]||"",target:r?.["sap.card"]?.["header"]?.["actions"]?.length?r["sap.card"]["header"]["actions"][0]?.["parameters"]?.ibnTarget:undefined,index:t})}});return Promise.resolve(function(){if(n.length){const t=e.getUniqueManifestDetails(n);return Promise.resolve(e.regenerateCards(t,n)).then(function(t){let n=false;function r(t){return n?t:Promise.resolve(e.setNewVisibleCards()).then(function(){})}const s=function(){if(t?.length){return Promise.resolve(e.cardHelperInstance._updateCards(t.map(e=>e?.newManifest?.descriptorContent))).then(function(){})}else{n=true}}();return s&&s.then?s.then(r):r(s)})}else{e._showCards(t)}}())}catch(e){return Promise.reject(e)}},getUniqueManifestDetails:function e(t){const n=[];t.forEach(e=>{const t=n.some(t=>t.id===e.id&&J(t.target,e.target));if(!t){n.push(JSON.parse(JSON.stringify(e)))}});return n},_getManifests:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance._getCardManifest(undefined,t)).then(function(n){if(n?.length){let r=n.map(function(e){if(e?.["sap.card"]){e["sap.card"].rec=true}return{id:e["sap.app"]?.id,descriptorContent:e}});let s=e._removeDuplicateRegeneratedCards(r,t);return s}else{return[]}})}catch(e){return Promise.reject(e)}},regenerateCards:function t(n,r){try{const t=this;return Promise.resolve(D(function(){return Promise.resolve(t._getManifests(n)).then(function(e){const t=e=>{if(e?.target?.semanticObject&&e?.target?.action){return e.id+"|"+e.target.semanticObject+"|"+e.target.action}return e.id};let n={};e.forEach(function(e){let r=t(e);if(e.newManifest){n[r]=e.newManifest}});let s=[];if(e.length){r.forEach(function(e){let r=t(e);if(n[r]){e.newManifest=n[r]}const i=e["newManifest"];const a=i?.descriptorContent;if(a){a["sap.insights"]={...a["sap.insights"],ranking:e.rank};if(a["sap.app"]){a["sap.app"].id=e.cardId}i.id=e.cardId;s.push(JSON.parse(JSON.stringify(e)))}})}return s})},function(t){e.error(t instanceof Error?t.message:String(t));return undefined}))}catch(e){return Promise.reject(e)}},_removeDuplicateRegeneratedCards:function e(t,n){const r={};n.forEach(e=>{if(e.id){r[e.id]=JSON.parse(JSON.stringify(e))}});t.forEach(function(e){const t=e?.descriptorContent?.["sap.insights"]?.parentAppId;if(t&&r[t]){const n=r[t];if(!n["newManifest"]){n["newManifest"]=e}}});return Object.values(r)},_getPersonalizationData:function e(){try{const t=this;function n(){return Promise.resolve(t.oPersonalizer.read()).then(function(e){return e||{}})}const r=function(){if(!t.oPersonalizer){return Promise.resolve(t._getPersonalization()).then(function(e){t.oPersonalizer=e})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(s){return Promise.reject(s)}},getPersonalisationProperty:function e(t){try{const e=this;return Promise.resolve(e._getPersonalizationData()).then(function(e){return e?.[t]})}catch(e){return Promise.reject(e)}},_getRecommendationCards:function e(){try{const e=this;return Promise.resolve(e.appManagerInstance.getRecommenedCards()).then(function(t){if(t?.length){return e._handleRecommendationCards(t)}e.fireHandleHidePanel()})}catch(e){return Promise.reject(e)}},_handleRecommendationCards:function e(t){try{const e=this;const n=t.map(e=>e.descriptorContent);return Promise.resolve(e.cardHelperInstance?._createCards(n)).then(function(){return Promise.resolve(e._updateRecommendationStatus()).then(function(){return e.setNewVisibleCards()})})}catch(e){return Promise.reject(e)}},_setupWrapper:function e(){if(!this._cardsFlexWrapper){this._cardsFlexWrapper=new c(`${this.getId()}-cardsFlexWrapper`,{renderType:"Bare",width:"100%",items:[this._createCardContainer(),this._createMobileCardContainer()]});this._cardsFlexWrapper.setModel(this._controlModel);this._addContent(this._cardsFlexWrapper)}},_createCardContainer:function e(){this.cardsContainerSettings=new n(`${this.getId()}-insightsCardsContainerSettings`,{columnSize:this.cardWidth,rowSize:this.cardHeight,gap:"1rem"});this.cardsContainer=new t(`${this.getId()}-insightsCardsFlexBox`,{visible:"{= !${/isPhone}}"}).addStyleClass("sapUiSmallMarginTop").setLayout(this.cardsContainerSettings);this.cardsContainer.setModel(this._controlModel);this.addDragDropConfigTo(this.cardsContainer,e=>this._handleCardsDnd(e));return this.cardsContainer},_createMobileCardContainer:function e(){this.cardsMobileContainer=new o(`${this.getId()}-insightsCardsMobileFlexBox`,{scrollStep:0,scrollStepByItem:1,gridLayout:true,scrollTime:1e3,showDividers:false,visible:"{/isPhone}"});this.cardsMobileContainer.setModel(this._controlModel);this.addDragDropConfigTo(this.cardsMobileContainer,e=>this._handleCardsDnd(e));return this.cardsMobileContainer},_showPlaceHolders:function e(){const t=this.appManagerInstance._getAnalyticalCardManifest();const n=new Array(this._calculatePlaceholderCardCount()).fill(null);const r=n.map((e,n)=>{const r=new h($(`${this.getId()}--placeHolderCard--${n}`),{width:this.cardWidth,height:this.cardHeight,previewMode:"Abstract",manifest:t,host:this.getProperty("host")}).addStyleClass("sapUiSmallMarginEnd");return r});const s=new a($(`${this.getId()}--wrapperBox`),{justifyContent:"SpaceBetween",items:r});const i=this._getCardContainer().getMetadata().getDefaultAggregationName();if(i){this._getCardContainer().addAggregation(i,s)}},_calculatePlaceholderCardCount:function e(){const t=this._getInsightsContainer()?._getLayout()?.getDomRef();let n=0;if(t){const e=t.childNodes[0];const r=W(e,["width","padding-left","padding-right"]);let s=r.width-r["padding-left"]-r["padding-right"];const i={containerWidth:s,totalCards:ee.PLACEHOLDER_CARD_COUNT,minWidth:304,maxWidth:583};const a=this.getDeviceType()===j.Mobile?19:B(i);n=this.getDeviceType()===j.Mobile?this.aVisibleCardInstances.length:Math.floor(s/(a+ee.CARDS_GAP));this.cardWidth=`${a/16}rem`}return n||1},_showCards:function e(t){const n=this.getMetadata().getName();this.fireHandleUnhidePanel();this._getInsightsContainer()?.updatePanelsItemCount(t.length,n);if(this._headerVisible){this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsCardsTitle")} (${t.length})`)}const r=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().removeAllAggregation(r);this.aVisibleCardInstances=[];this.cardsInViewport=[];if(!ne){this._addRuntimeHost();ne=true}t.forEach((e,t)=>{const n=e.descriptorContent;const r=new h($(`${this.getId()}--userCard--${t}`),{width:this.cardWidth,height:this.cardHeight,manifest:n,host:this.getProperty("host")});this.aVisibleCardInstances.push(r);this.addAggregation("cards",r,true);const s=[r];const i=n["sap.card"]?.type;if(i==="Table"||i==="List"){const e=new a($(`${this.getId()}--overlay--${t}`),{width:this.cardWidth,height:"2rem"}).addStyleClass("insightsCardOverflowTop");const n=new a($(`${this.getId()}--overlayHBoxId--${t}`),{height:"0"}).addStyleClass("sapMFlexBoxJustifyCenter");n.addItem(e);s.push(n)}const o=new c($(`${this.getId()}--previewBoxId--${t}`),{direction:"Column",justifyContent:"Center",items:s});const d=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().addAggregation(d,o)})},_handleEditCards:function e(t){let n=t.getSource().getParent()||this;if(n?.isA("sap.cux.home.CardsPanel")){n=n.getParent()}n?._getLayout().openSettingsDialog(N.INSIGHTS_CARDS)},handleHideHeader:function e(){this._headerVisible=false;this.setProperty("title","");this._toggleHeaderActions(false)},handleAddHeader:function e(){this._headerVisible=true;this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsCardsTitle")} (${this._controlModel.getProperty("/userVisibleCards")?.length})`);this._toggleHeaderActions(true)},refreshCards:function e(){this.aVisibleCardInstances.forEach(e=>this._refreshCardData(e))},_handleCardsDnd:function t(n){try{const t=this;const r=n.getParameter("dropPosition"),s=n.getParameter("draggedControl"),i=s.getParent()?.indexOfItem(s),a=n.getParameter("droppedControl"),o=s.getParent().indexOfItem(a);t._cardsFlexWrapper?.setBusy(true);const c=R(function(){return D(function(){function e(){setTimeout(()=>{F(t._getCardContainer(),o)},0)}const n=function(){if(!t._controlModel.getProperty("/userAllCards").length){return Promise.resolve(t.cardHelperInstance._getUserAllCardModel()).then(function(e){t._controlModel.setProperty("/userAllCards",e.getProperty("/cards"));return Promise.resolve(t.updateCardList(r,o,i)).then(function(){})})}else{return Promise.resolve(t.updateCardList(r,o,i)).then(function(){})}}();return n&&n.then?n.then(e):e(n)},function(t){if(t instanceof Error){e.error(t.message)}})},function(e,n){t._cardsFlexWrapper?.setBusy(false);if(e)throw n;return n});return Promise.resolve(c&&c.then?c.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},updateCardList:function e(t,n,r){try{const e=this;const s=e._controlModel.getProperty("/userVisibleCards"),i=e._controlModel.getProperty("/userAllCards"),a=s[r]?.rank,o=s[n]?.rank;let c=i.findIndex(e=>e.rank===a),d=i.findIndex(e=>e.rank===o);if(t==="Before"&&r===n-1||t==="After"&&r===n+1||r===n){return Promise.resolve()}if(t==="Before"&&c<d){d--}else if(t==="After"&&c>d){d++}const h=function(){if(c!==d){const t=e.cardHelperInstance.handleDndCardsRanking(c,d,i);return Promise.resolve(e.cardHelperInstance._updateMultipleCards(t,"PUT")).then(function(){e._sortCardsOnRank(i);e._controlModel.setProperty("/userAllCards",i);e._controlModel.setProperty("/userVisibleCards",i.filter(e=>e.visibility));return Promise.resolve(e.rerenderCards()).then(function(){})})}}();return Promise.resolve(h&&h.then?h.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_sortCardsOnRank:function e(t){t.sort((e,t)=>{if(e.rank&&t.rank){if(e.rank<t.rank){return-1}else if(e.rank>t.rank){return 1}}return 0})},_getPersonalization:function e(){const t=q.getPersContainerId(this);const n=q.getOwnerComponent(this);return K.getInstance(t,n)},_updateRecommendationStatus:function e(){try{const e=this;return Promise.resolve(e._getPersonalizationData()).then(function(t){t[te]=true;return e.oPersonalizer.write(t)})}catch(e){return Promise.reject(e)}},_calculateVisibleCardCount:function e(){const t=this._getInsightsContainer()._getLayout();const n=t.getDomRef();const r=this.getDeviceType();let s=1;if(n){const e=t.getProperty("showHeader");const i=e?1:0;const a=n.childNodes[i];const o=W(a,["width","padding-left","padding-right"]);const c=o.width-o["padding-left"]-o["padding-right"];const d=this.aVisibleCardInstances.length;const h={containerWidth:c,totalCards:d,minWidth:304,maxWidth:583};const l=B(h);this.cardWidth=`${l/16}rem`;if(r===j.Mobile){s=d}else{s=Math.max(Math.floor(c/l),1)}}return s},_adjustLayout:function e(){const t=this._getInsightsContainer()?._getLayout();let n=this.cardWidth;const r=this.getDeviceType()===j.Mobile;if(t&&this.aVisibleCardInstances?.length>0){const e=t._getCurrentExpandedElementName()===this.getProperty("fullScreenName");let n=this._calculateVisibleCardCount();if(e){n=this.aVisibleCardInstances.length}this._controlModel.setProperty("/isPhone",r);if(n!==this.cardsInViewport.length){this.cardsInViewport=this.aVisibleCardInstances.slice(0,n);const e=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().removeAllAggregation(e);this.cardsInViewport.forEach(e=>{const t=e.getManifest();const n=t["sap.card"]?.type;let r;if(n==="Table"||n==="List"){const e=new a({width:this.cardWidth,height:"2rem"}).addStyleClass("insightsCardOverflowLayer insightsCardOverflowTop");r=new a({height:"0"}).addStyleClass("sapMFlexBoxJustifyCenter");r.addItem(e)}const s=new c({direction:"Column",justifyContent:"Center",items:[e]});if(r){s.addItem(r)}const i=this._getCardContainer().getMetadata().getDefaultAggregationName();this._getCardContainer().addAggregation(i,s)});this.shareCardsInViewport()}const s=e||this.aVisibleCardInstances.length>n;if(this._headerVisible){this._getInsightsContainer()?.toggleFullScreenElements(this,s)}else{const e=G(this);const t=e.getTitle();this._getInsightsContainer()?.updateMenuItem(this._controlMap.get(`${this.getId()}-${Y.SHOW_MORE}`),s,t);this._getInsightsContainer()?.updateActionButton(this._controlMap.get(`${this.getId()}-${X.SHOW_MORE}`),s,t)}}else{this.cardWidth=this.getDeviceType()===j.Mobile?"19rem":"22rem"}if(n!==this.cardWidth){this.aVisibleCardInstances.forEach(e=>e.setWidth(this.cardWidth));this.cardsContainerSettings?.setColumnSize(this.cardWidth)}},getContainerMenuItems:function e(){if(!this._containerMenuItems){const e=this._createRefreshMenuItem(Y.REFRESH,"containerCardsRefresh");const t=this._createEditCardsMenuItem(Y.EDIT_CARDS,"containerManageCards");const n=U(this,Y.SHOW_MORE,"containerCardsShowMore");this._controlMap.set(`${this.getId()}-${Y.SHOW_MORE}`,n);this._containerMenuItems=[e,t,n]}return this._containerMenuItems},getContainerActionButtons:function e(){if(!this._containerActionButtons){this._containerActionButtons=[];const e=L(this,X.SHOW_MORE,"containerCardsShowMore");if(e){this._controlMap.set(`${this.getId()}-${X.SHOW_MORE}`,e);this._containerActionButtons.push(e)}}return this._containerActionButtons},_getInsightsContainer:function e(){if(!this.insightsContainer){this.insightsContainer=this.getParent()}return this.insightsContainer},_createRefreshMenuItem:function e(t,n){const r=new H(`${this.getId()}-${t}`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",visible:false,press:()=>this.refreshCards()});this._controlMap.set(`${this.getId()}-${t}`,r);if(n){k(r,n)}return r},_createEditCardsMenuItem:function e(t,n){const r=new H(`${this.getId()}-${t}`,{title:this._i18nBundle.getText("manageCards"),icon:"sap-icon://edit",visible:false,press:e=>this._handleEditCards(e)});this._controlMap.set(`${this.getId()}-${t}`,r);if(n){k(r,n)}return r},_createAddInsightCardMenuItem:function e(t,n){const r=new H(`${this.getId()}-${t}`,{title:this._i18nBundle.getText("addInsightsCard"),icon:"sap-icon://duplicate",visible:false,press:()=>this._generateInsightCardsWithAI()});this._controlMap.set(`${this.getId()}-${t}`,r);if(n){k(r,n)}return r},_generateInsightCardsWithAI:function e(){const t=this;this.cardHelperInstance.showAddCardWithSearchDialog(function(){try{return Promise.resolve(t.rerenderCards(true)).then(function(){})}catch(e){return Promise.reject(e)}})},_isDesktopDevice:function e(){const t=this.getDeviceType();return t!==j.Mobile&&t!==j.Tablet},updateAICardCreationStatus:function t(){try{const t=this;let n=[u.getServiceAsync("Navigation"),t.appManagerInstance.isFeatureEnabled(V.AI_GENERATED_CARD)];return Promise.resolve(Promise.all(n).then(n=>{let r=n[0];let s=n[1];if(s){r.isNavigationSupported([{target:{semanticObject:"IntelligentPrompt",action:"personalize"}}]).then(e=>{t.aiFlagEnabled=e[0].supported||false;if(t.aiFlagEnabled&&t._isDesktopDevice()){const e=t._createAddInsightCardMenuItem(Q.AI_INSIGHT_CARD,"AddAIInsightCard");t.addAggregation("menuItems",e);t._sortMenuItems(Z);const n=t._createAddInsightCardMenuItem(Y.AI_INSIGHT_CARD,"AddAIInsightCard");const r=t.getMetadata().getName();const s=t._getInsightsContainer().getMetadata().getName();const i=t._getInsightsContainer().getContent();const a=i.find(e=>e instanceof T)?.getMetadata()?.getName()||"";const o=O(t.insightsContainer,s,r);const c=O(t.insightsContainer,s,a);n.setVisible(!o||!c);e.setVisible(o&&c);t.insightsContainer?.addCommonMenuItems([n])}}).catch(t=>{e.warning(t instanceof Error?t.message:String(t))})}}))}catch(e){return Promise.reject(e)}},_toggleHeaderActions:function e(t){this.getAggregation("menuItems")?.forEach(e=>{this._getInsightsContainer()?.toggleMenuListItem(e,t)});this.getAggregation("actionButtons")?.forEach(e=>this._getInsightsContainer()?.toggleActionButton(e,t))},_getCardContainer:function e(){if(this.getDeviceType()===j.Mobile){return this.cardsMobileContainer}return this.cardsContainer},_sortMenuItems:function e(t){const n=this.getAggregation("menuItems");let r=z(t,n);this.removeAllAggregation("menuItems");r?.forEach(e=>this.addAggregation("menuItems",e))},shareCardsInViewport:function e(){const t=this._calculateVisibleCardCount();const n=this._controlModel.getProperty("/userVisibleCards");const r=n?.slice(0,t);if(r?.length){this.fireEvent("visibleCardsUpdated",{cards:r})}}});re.cardsMenuItems=Q;re.cardsContainerMenuItems=Y;re.cardsContainerActionButtons=X;return re});
|
|
87
97
|
/*!
|
|
88
98
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
89
99
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
90
100
|
*/
|
|
91
|
-
sap.ui.predefine("sap/cux/home/
|
|
101
|
+
sap.ui.predefine("sap/cux/home/ContentAdditionDialog", ["sap/m/Button","sap/m/FlexBox","sap/m/IconTabBar","sap/m/IconTabFilter","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/library","./AppsAdditionPanel","./BaseSettingsDialog","./InsightsAdditionPanel"],function(t,e,n,i,o,s,r,a,c,l,u){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const h=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function f(t,e,n){if(!t.s){if(n instanceof g){if(n.s){if(e&1){e=n.s}n=n.v}else{n.o=f.bind(null,t,e);return}}if(n&&n.then){n.then(f.bind(null,t,e),f.bind(null,t,2));return}t.s=e;t.v=n;const i=t.o;if(i){i(t)}}}const g=function(){function t(){}t.prototype.then=function(e,n){const i=new t;const o=this.s;if(o){const t=o&1?e:n;if(t){try{f(i,1,t(this.v))}catch(t){f(i,2,t)}return i}else{return this}}this.o=function(t){try{const o=t.v;if(t.s&1){f(i,1,e?e(o):o)}else if(n){f(i,1,n(o))}else{f(i,2,o)}}catch(t){f(i,2,t)}};return i};return t}();function p(t){return t instanceof g&&t.s&1}function y(t,e,n){var i=-1,o,s;function r(a){try{while(++i<t.length&&(!n||!n())){a=e(i);if(a&&a.then){if(p(a)){a=a.v}else{a.then(r,s||(s=f.bind(null,o=new g,2)));return}}}if(o){f(o,1,a)}else{o=a}}catch(t){f(o||(o=new g),2,t)}}r();return o}const b=a["BackgroundDesign"];function B(t,e,n){if(typeof t[h]==="function"){var i=t[h](),o,s,r;function u(t){try{while(!(o=i.next()).done&&(!n||!n())){t=e(o.value);if(t&&t.then){if(p(t)){t=t.v}else{t.then(u,r||(r=f.bind(null,s=new g,2)));return}}}if(s){f(s,1,t)}else{s=t}}catch(t){f(s||(s=new g),2,t)}}u();if(i.return){var a=function(t){try{if(!o.done){i.return()}}catch(t){}return t};if(s&&s.then){return s.then(a,function(t){throw a(t)})}a()}return s}if(!("length"in t)){throw new TypeError("Object is not iterable")}var c=[];for(var l=0;l<t.length;l++){c.push(t[l])}return y(c,function(t){return e(c[t])},n)}const T=a["ButtonType"];const m=a["IconTabHeaderMode"];const C=d(c);const P=d(l);const I=d(u);const w=P.extend("sap.cux.home.ContentAdditionDialog",{renderer:{apiVersion:2},init:function t(){P.prototype.init.call(this);this.setStretch(false);this.setContentWidth("59.375rem");this.setContentHeight("43.75rem");this.setVerticalScrolling(false);this.setTitle(this._i18nBundle.getText("addContent"));this.addStyleClass("sapCuxContentAdditionDialog");this.setEscapeHandler(this.onDialogClose.bind(this));this.addPanel(new C(`${this.getId()}-appsAdditionPanel`));this.addPanel(new I(`${this.getId()}-cardsAdditionPanel`));this._setupDialogContent()},_setupDialogContent:function t(){this.iconTabBar=new n(`${this.getId()}-iconTabBar`,{headerMode:m.Inline,backgroundDesign:b.Transparent,select:()=>{this.setProperty("selectedKey",this.iconTabBar.getSelectedKey());this.updateActionButtons()}});this.errorMessageContainer=new e(`${this.getId()}-errorMessageContainer`,{direction:"Column",renderType:"Bare",height:"100%",justifyContent:"Center",items:[new o(`${this.getId()}-errorMessage`,{illustrationSize:s.Auto,illustrationType:r.NoData})]});const i=new e(`${this.getId()}-wrapper`,{direction:"Column",renderType:"Bare",height:"100%",items:[this.iconTabBar,this.errorMessageContainer]});this.addContent(i)},onBeforeRendering:function t(e){P.prototype.onBeforeRendering.call(this,e);void this._addPanelsToIconTabBar();const n=this.getProperty("selectedKey");this.iconTabBar.setSelectedKey(n);this.updateActionButtons()},_addPanelsToIconTabBar:function t(){try{const t=this;const e=function(){if(!t.panelsAdded){function e(){t.panelsAdded=true;const e=t.iconTabBar.getItems().length>0;t.iconTabBar.setVisible(e);t.errorMessageContainer.setVisible(!e)}const n=t.getPanels();const o=B(n,function(e){return Promise.resolve(e.isSupported()).then(function(n){if(!n){return}const o=e.getProperty("key");const s=new i(`${t.getId()}-${o}`,{key:o,text:e.getProperty("title")});const r=e.getAggregation("content");r?.forEach(t=>s.addContent(t));t.iconTabBar.addItem(s)})});return o&&o.then?o.then(e):e(o)}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_getPanel:function t(e){return this.getPanels().find(t=>t.getProperty("key")===e)},updateActionButtons:function e(){this.cancelButton=this.cancelButton||new t(`${this.getId()}-close-btn`,{text:this._i18nBundle.getText("closeSettings"),type:T.Transparent,press:this.onDialogClose.bind(this)});const n=this.iconTabBar.getSelectedKey()||this.getPanels()[0]?.getProperty("key");this.removeAllButtons();this._getPanel(n).getActionButtons().forEach(t=>{this.addButton(t)});this.addButton(this.cancelButton)},onDialogClose:function t(){this.getPanels().forEach(t=>t.fireEvent("onDialogClose"));this.close()}});return w});
|
|
92
102
|
/*!
|
|
93
103
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
94
104
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
95
105
|
*/
|
|
96
|
-
sap.ui.predefine("sap/cux/home/FavAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/ColorPalette","sap/m/ColorPalettePopover","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/IllustratedMessage","sap/m/Input","sap/m/Label","sap/m/List","sap/m/MessageBox","sap/m/MessageStrip","sap/m/MessageToast","sap/m/NavContainer","sap/m/ObjectIdentifier","sap/m/Page","sap/m/Popover","sap/m/ScrollContainer","sap/m/SearchField","sap/m/StandardListItem","sap/m/Text","sap/m/Title","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","sap/m/library","sap/ui/base/Event","sap/ui/core/Element","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/library","sap/ui/core/message/MessageType","sap/ui/core/theming/Parameters","sap/ui/layout/form/SimpleForm","sap/ui/layout/library","sap/ushell/Config","sap/ushell/Container","sap/ushell/components/pages/MyHomeImport","sap/ushell/components/pages/controller/PageRuntime.controller","./BaseApp","./BaseAppPersPanel","./Group","./MenuItem","./utils/Accessibility","./utils/Constants","./utils/DataFormatUtils","./utils/FESRUtil","./utils/InsightsUtils"],function(e,t,n,o,i,s,r,a,l,p,c,u,d,g,h,f,m,_,I,v,A,P,C,M,G,y,x,B,D,T,S,$,w,b,z,E,F,N,V,U,R,j,L,H,k,O,K,W,Y,q,J){"use strict";function Q(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const X=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Z(e,t,n){if(!e.s){if(n instanceof ee){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=Z.bind(null,e,t);return}}if(n&&n.then){n.then(Z.bind(null,e,t),Z.bind(null,e,2));return}e.s=t;e.v=n;const o=e.o;if(o){o(e)}}}const ee=function(){function e(){}e.prototype.then=function(t,n){const o=new e;const i=this.s;if(i){const e=i&1?t:n;if(e){try{Z(o,1,e(this.v))}catch(e){Z(o,2,e)}return o}else{return this}}this.o=function(e){try{const i=e.v;if(e.s&1){Z(o,1,t?t(i):i)}else if(n){Z(o,1,n(i))}else{Z(o,2,i)}}catch(e){Z(o,2,e)}};return o};return e}();function te(e){return e instanceof ee&&e.s&1}function ne(e,t,n){var o=-1,i,s;function r(a){try{while(++o<e.length&&(!n||!n())){a=t(o);if(a&&a.then){if(te(a)){a=a.v}else{a.then(r,s||(s=Z.bind(null,i=new ee,2)));return}}}if(i){Z(i,1,a)}else{i=a}}catch(e){Z(i||(i=new ee),2,e)}}r();return i}const oe=D["ButtonType"];function ie(e,t,n){if(typeof e[X]==="function"){var o=e[X](),i,s,r;function c(e){try{while(!(i=o.next()).done&&(!n||!n())){e=t(i.value);if(e&&e.then){if(te(e)){e=e.v}else{e.then(c,r||(r=Z.bind(null,s=new ee,2)));return}}}if(s){Z(s,1,e)}else{s=e}}catch(e){Z(s||(s=new ee),2,e)}}c();if(o.return){var a=function(e){try{if(!i.done){o.return()}}catch(e){}return e};if(s&&s.then){return s.then(a,function(e){throw a(e)})}a()}return s}if(!("length"in e)){throw new TypeError("Object is not iterable")}var l=[];for(var p=0;p<e.length;p++){l.push(e[p])}return ne(l,function(e){return t(l[e])},n)}const se=D["ListType"];function re(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const ae=D["PlacementType"];function le(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const pe=b["dnd"];const ce=N["form"];const ue=L["ActionsPopover"];const de=Q(H);const ge=Q(k);const he=Q(O);const fe=K["checkPanelExists"];const me=W["DEFAULT_BG_COLOR"];const _e=W["END_USER_COLORS"];const Ie=W["MYAPPS_SECTION_ID"];const ve=W["MYHOME_PAGE_ID"];const Ae=Y["getLeanURL"];const Pe=q["addFESRId"];const Ce=q["addFESRSemanticStepName"];const Me=J["sortMenuItems"];const Ge=()=>V.last("/core/shell/enablePersonalization")||V.last("/core/catalog/enabled");var ye=function(e){e["CREATE_GROUP"]="createGrpMenuBtn";e["ADD_APPS"]="addAppsMenuBtn";e["ADD_FROM_INSIGHTS"]="addInsightsMenuBtn";return e}(ye||{});const xe="sap.cux.home.TilesPanel";const Be="sap.cux.home.InsightsContainer";const De=[ye.CREATE_GROUP,ye.ADD_APPS,ye.ADD_FROM_INSIGHTS,"settings"];const Te=de.extend("sap.cux.home.FavAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"},groups:{type:"sap.cux.home.Group",singularName:"group",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){de.prototype.constructor.call(this,t,n);this._selectedApps=[];this._isInitialLoad=true;this._updateAppColorPersonalization=(e,t)=>{const{visualization:n,color:o}=t;const{appId:i,oldAppId:s,persConfig:r}=n;const a=r?.sectionId;const l=r?.isDefaultSection;const p=this._getPersonalizationIndex(e,{appId:i,oldAppId:s,sectionId:a,isRecentlyAddedApp:l});if(p>-1){e[p].BGColor=o}else{e.push({BGColor:o,sectionId:a,isRecentlyAddedApp:l,appId:i,isSection:false})}}},init:function e(){const t=this,n=this;de.prototype.init.call(this);this.setProperty("key","favApps");this.setProperty("title",this._i18nBundle.getText("favoritesTab"));this.setProperty("tooltip",this._i18nBundle.getText("favAppsInfo"));void this._createActionButtons();this._createHeaderMenuItems();const o=this._generateAppsWrapper();if(o){this.addDragDropConfigTo(o,e=>this._onFavItemDrop(e),e=>this._handleKeyboardMoveApp(e),pe.DropPosition.OnOrBetween)}this.oEventBus=$.getInstance();this.oEventBus.subscribe("importChannel","appsImport",function(e,n,o){try{const e=o?.apps||[];const n=o?.groupInfo||[];return Promise.resolve(t.addAppsAndSections(e,n)).then(function(){t._importdone();return Promise.resolve(t.getParent()._refreshAllPanels()).then(function(){})})}catch(e){return Promise.reject(e)}},this);this.oEventBus.subscribe("importChannel","resetImported",function(){try{return Promise.resolve(n.setImportButtonVisibility(true)).then(function(){})}catch(e){return Promise.reject(e)}},this);this.attachPersistDialog(()=>{if(this._selectedGroupId){void this._showGroupDetailDialog(this._selectedGroupId)}});document.addEventListener("click",e=>this._resetCutElement(e));document.addEventListener("keydown",e=>this._resetCutElement(e))},_importdone:function e(){const t={status:true};this.oEventBus.publish("importChannel","appsImported",t)},addAppsAndSections:function e(t,n){try{const e=this;let o=[];return Promise.resolve(e._getAppPersonalization()).then(function(i){return Promise.resolve(U.getServiceAsync("Pages")).then(function(s){function r(){return Promise.resolve(e.setFavAppsPersonalization(i)).then(function(){return o.reduce((e,t)=>e.then(()=>t()),Promise.resolve()).then(()=>e.updateDefaultSectionPersonalization(i))})}const a=ie(t,function(t){const r=t.visualizations;const a=function(){if(r?.length){const a=function(){if(t.default||t.id===Ie){const s=e.filterPersonalizations(n,t);i=i.concat(s);o.push(()=>t.default?e.addSectionViz(r):e.addSectionViz(r,Ie))}else{return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(a){const l=s._generateId(ve);const p=e.filterPersonalizations(n,t,l);i=i.concat(p);o.push(()=>e.appManagerInstance.addSection({sectionIndex:a.length,sectionProperties:{id:l,title:t.title,visible:true,visualizations:r?.map(e=>{e.id=s._generateId(ve);return e})}}))})}}();if(a&&a.then)return a.then(function(){})}}();if(a&&a.then)return a.then(function(){})});return a&&a.then?a.then(r):r(a)})})}catch(e){return Promise.reject(e)}},filterPersonalizations:function e(t,n,o){const i=t.reduce(function(e,t){if(t.sectionId===n.id){const i=n.visualizations;const s=i?.find(e=>e.targetURL===t.appId);if(s||t.isSection){t.sectionId=o||n.id;e.push(t)}}return e},[]);return i},updateDefaultSectionPersonalization:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(e){let n=e.find(e=>e.default);if(n){t.forEach(e=>{if(e.isRecentlyAddedApp){e.sectionId=n.id}})}return t})}catch(e){return Promise.reject(e)}},addSectionViz:function e(t,n){try{const e=this;return Promise.resolve(t.reduce((t,o)=>t.then(()=>e._addVisualization({visualization:o},n)),Promise.resolve()))}catch(e){return Promise.reject(e)}},loadApps:function e(){try{const e=this;return Promise.resolve(e.appManagerInstance.fetchFavVizs(true,false)).then(function(t){e.destroyAggregation("groups",true);const n=t.filter(e=>e.isSection).map(t=>({...t,menuItems:e._getGroupActions(t)}));const o=e._generateGroups(n);e._setGroups(o);e.destroyAggregation("apps",true);const i=t.filter(e=>!e.isSection).map((t,n)=>({...t,menuItems:e._getAppActions(undefined,n,t)}));const s=e.generateApps(i);e.setApps(s);if(e._selectedGroupId){void e._setGroupDetailDialogApps(e._selectedGroupId)}const r=e.getParent();r.toggleMenuListItem(e._createGroupMenuItem,e.getApps().length>0);e._switchToRecommendedIfNoFavApps(s,o);if(fe(r,Be,xe)){e._createAddFromInsTilesMenuItem(ye.ADD_FROM_INSIGHTS)}r._updateContainerHeader(r)})}catch(e){return Promise.reject(e)}},_switchToRecommendedIfNoFavApps:function e(t,n){const o=this.getParent();if(this._isInitialLoad&&[...t,...n].length===0){o.setProperty?.("selectedKey","recommendedApps")}this._isInitialLoad=false},_createAddFromInsTilesMenuItem:function e(t){const n=`${this.getId()}-${t}`;if(!this._controlMap.get(n)){const e=new he(n,{title:this._i18nBundle.getText("addFromInsights"),icon:"sap-icon://duplicate",press:()=>void this._handleAddFromInsights()});Pe(e,"staticTilesDialog");this._menuItems.push(e);this.addAggregation("menuItems",e);this._sortMenuItems(De);this._controlMap.set(n,e)}return this._controlMap.get(n)},_sortMenuItems:function e(t){const n=this.getAggregation("menuItems");let o=Me(t,n);this.removeAllAggregation("menuItems");o?.forEach(e=>this.addAggregation("menuItems",e))},_generateGroups:function e(t){return t.map((e,t)=>{const n=new ge(`${this.getId()}-group-${t}`,{title:e.title,bgColor:e.BGColor,status:e.status,icon:e.icon,number:e.badge,groupId:e.id,press:this._handleGroupPress.bind(this)});e.menuItems?.forEach(e=>{n.addAggregation("menuItems",e)});return n})},_setGroups:function e(t){t.forEach(e=>{this.addAggregation("groups",e,true)})},_getAppActions:function e(t,n,o){const i=t?.getGroupId();const s=o?.persConfig?.isDefaultSection;const r=!i;const a=[];const l=new he({id:i&&!s?`${i}--selectColorGroupAppMenuItem--${n}`:`${this.getKey()}--selectColorAppMenuItem--${n}`,title:this._i18nBundle.getText("selectColor"),type:se.Navigation,press:this._openColorPopover.bind(this)});a.push(l);Pe(l,"changeColor");if(this._getAllowedMoveGroups(i)?.length>=1){const e=new he({id:i&&!s?`${i}--moveToGroupAppMenuItem--${n}`:`${this.getKey()}--moveToMenuItem--${n}`,title:this._i18nBundle.getText("moveTo"),type:se.Navigation,press:e=>this._openMoveToGroupPopover(e,t)});a.push(e);Pe(e,"moveToGroup")}if(r){const e=new he(`${this.getKey()}--createGroupMenuItem--${n}`,{title:this._i18nBundle.getText("createGroup"),press:e=>{const t=e.getSource();const n=t.getParent();this._selectedApps=[n];this._openCreateGroupDialog()}});a.push(e);Pe(e,"createGroupDialog")}const p=new he({id:i&&!s?`${i}--removeFromMyHomeGroupAppMenuItem--${n}`:`${this.getKey()}--removeFromMyHomeMenuItem--${n}`,title:this._i18nBundle.getText("removeFromMyHome"),press:e=>{const n=e.getSource();const o=n.getParent();this._handleRemove(o,t)}});a.push(p);Pe(p,"removeFromMyHome");if(!r){const e=new he(`${this.getKey()}--removeFromGroupMenuItem--${n}`,{title:this._i18nBundle.getText("removeFromGroup"),press:e=>{const t=e.getSource();const n=t.getParent();void this._handleMoveToGroup(n,i)}});a.push(e);Pe(e,"ungroupApp")}return a},_getGroupActions:function e(t){const n=new he(`id-${t.id}-renameGroup`,{title:this._i18nBundle.getText("renameGroup"),press:this._onRenameGroup.bind(this)});Pe(n,"renameGroup");const o=new he(`id-${t.id}-selectColor`,{title:this._i18nBundle.getText("selectColor"),type:se.Navigation,press:this._openColorPopover.bind(this)});Pe(o,"changeColor");const i=new he(`id-${t.id}-removeAllApps`,{title:this._i18nBundle.getText("removeAllApps"),press:this._handleUngroupApps.bind(this,t)});Pe(i,"removeAllApps");const s=[n,o,i];if(!t.isPresetSection){const e=new he(`id-${t.id}-delete`,{title:this._i18nBundle.getText("delete"),press:this._onDeleteGroup.bind(this)});Pe(e,"deleteGroup");s.push(e)}return s},_createActionButtons:function e(){try{const e=this;if(!e._actionButtons){e._actionButtons=[];if(Ge()){const t=new o(`${e.getId()}-addAppsBtn`,{icon:"sap-icon://action",tooltip:e._i18nBundle.getText("addAppsTooltip"),text:e._i18nBundle.getText("addApps"),press:()=>{void e.navigateToAppFinder()}});Pe(t,"addAppsBtn");e._actionButtons.push(t)}}e._actionButtons.forEach(t=>{e.addAggregation("actionButtons",t)});return Promise.resolve(e._validateAppsMigration()).then(function(t){if(t){e._createImportButton()}})}catch(e){return Promise.reject(e)}},_createImportButton:function e(){if(!this._importButton){this._importButton=new o(`${this.getId()}-importAppsBtn`,{tooltip:this._i18nBundle.getText("importAppsNow"),text:this._i18nBundle.getText("importAppsNow"),press:this._openImportAppsDialog.bind(this)});Pe(this._importButton,"importAppsDialog");this._actionButtons.push(this._importButton);this.insertAggregation("actionButtons",this._importButton,0)}return this._importButton},setImportButtonVisibility:function e(t){try{const e=this;return Promise.resolve(R.setImportEnabled(t)).then(function(){e._createImportButton().setVisible(t)})}catch(e){return Promise.reject(e)}},_createHeaderMenuItems:function e(){if(!this._menuItems){this._createGroupMenuItem=new he(`${this.getId()}-${ye.CREATE_GROUP}`,{title:this._i18nBundle.getText("createGroup"),icon:"sap-icon://add",press:()=>this._openCreateGroupDialog()});this._menuItems=[this._createGroupMenuItem];if(Ge()){this._menuItems.push(new he(`${this.getId()}-${ye.ADD_APPS}`,{title:this._i18nBundle.getText("addApps"),icon:"sap-icon://action",press:()=>{void this.navigateToAppFinder()}}))}Pe(this._createGroupMenuItem,"createGroupDialog");const e=this._menuItems.find(e=>e.getId()===`${this.getId()}-${ye.ADD_APPS}`);if(e){Pe(e,"appsAppFinder")}this._menuItems.forEach(e=>{this.addAggregation("menuItems",e,true)});this._sortMenuItems(De)}},_getDragDropInfo:function e(t,n){try{const e=this;const o=t.getParameter?.("draggedControl"),i=t.getParameter?.("droppedControl"),s=t.getParameter?.("dropPosition"),r=o.getParent(),a=r.indexOfItem(o),l=r.indexOfItem(i),p=e._getTileItem(o,n),c=e._getTileItem(i,n);const u={dragItem:p,dropItem:c,dropPosition:s,dropControl:r,dragItemIndex:a,dropItemIndex:l};const d=function(){if(a!==l){const t=function(){if(!p?.isA("sap.cux.home.Group")&&!c?.isA("sap.cux.home.Group")){return Promise.resolve(e._adjustAppDragDropInfo(u,n)).then(function(){})}else{const t=function(){if(p?.isA("sap.cux.home.Group")){return Promise.resolve(e._adjustGroupDragDropInfo(u)).then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(d&&d.then?d.then(function(){return u}):u)}catch(e){return Promise.reject(e)}},_adjustAppDragDropInfo:function e(t,n){try{const e=this;let o=false;const i=t.dragItem;const s=t.dropItem;return Promise.resolve(Promise.all([e.appManagerInstance.getVisualization(i.getUrl(),n),e.appManagerInstance.getVisualization(s.getUrl(),n)])).then(function(i){let[s,r]=i;if(t.dropPosition===pe.RelativeDropPosition.Before){if(t.dragItemIndex===t.dropItemIndex-1){t.dropItemIndex--}if(t.dragItemIndex<t.dropItemIndex&&s?.persConfig?.sectionIndex===r?.persConfig?.sectionIndex){t.dropItemIndex--;o=true}}else if(t.dropPosition===pe.RelativeDropPosition.After){if(t.dragItemIndex===t.dropItemIndex+1){t.dropItemIndex++}if(t.dragItemIndex>t.dropItemIndex&&s?.persConfig?.sectionIndex===r?.persConfig?.sectionIndex){t.dropItemIndex++;o=true}}if(o){const o=t.dropControl.getItems()[t.dropItemIndex];const i=e._getTileItem(o,n);if(i){t.dropItem=i}}})}catch(e){return Promise.reject(e)}},_getTileItem:function e(t,n){const o=t.data("groupId");if(o){return this._getGroup(o)}else{const e=n?this._getGroup(n):null;const o=e?e.getApps():this.getApps();return o.find(e=>Ae(e.getUrl())===t.getUrl())}},_adjustGroupDragDropInfo:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance._getSections()).then(function(n){let o;t.dragItemIndex=n.findIndex(e=>e.id===t.dragItem.getGroupId());if(!t.dropItem.isA("sap.cux.home.Group")){const n=e.getAggregation("groups").length;t.dropItemIndex=t.dropPosition===pe.RelativeDropPosition.Before&&t.dropItemIndex===n&&t.dragItemIndex!==n?n+1:t.dragItemIndex}else{o=n.findIndex(e=>e.id===t.dropItem.getGroupId());t.dropItemIndex=o}if(t.dropPosition===pe.RelativeDropPosition.Before&&t.dragItemIndex===t.dropItemIndex-1){t.dropItemIndex--}else if(t.dropPosition===pe.RelativeDropPosition.After&&(t.dragItemIndex!==t.dropItemIndex||o&&t.dropItemIndex>=o)){t.dropItemIndex++}})}catch(e){return Promise.reject(e)}},_onFavItemDrop:function e(t,n){try{const e=this;const o=t.getParameter?.("draggedControl");return Promise.resolve(e._getDragDropInfo(t,n)).then(function(t){function i(){o.removeStyleClass("sapMGTPressActive")}const{dragItemIndex:s,dropItemIndex:r,dropPosition:a,dragItem:l,dropItem:p}=t;if(s===r)return;const c=function(){if(a===pe.RelativeDropPosition.On){return Promise.resolve(e._handleOnItemDrop(l,p)).then(function(){void e.refresh()})}else{const o=function(){if(a===pe.RelativeDropPosition.After||a===pe.RelativeDropPosition.Before){e._setBusy(true);return Promise.resolve(e._handleItemsReorder(t,n)).then(function(){return Promise.resolve(e.refresh()).then(function(){if(n){void e._setGroupDetailDialogApps(n)}e._setBusy(false)})})}}();if(o&&o.then)return o.then(function(){})}}();return c&&c.then?c.then(i):i(c)})}catch(e){return Promise.reject(e)}},_handleOnItemDrop:function e(t,n){try{const e=this;if(t.isA("sap.cux.home.Group"))return Promise.resolve();const o=function(){if(!n.isA("sap.cux.home.Group")){const o=t;const i=n;e._selectedApps=[o,i];e._openCreateGroupDialog(true)}else{const o=n.getGroupId();e._setBusy(true);return Promise.resolve(e._handleMoveToGroup(t,undefined,o)).then(function(){e._setBusy(false)})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_handleItemsReorder:function e(t,n){try{const e=this;const{dragItem:o,dropItem:i,dragItemIndex:s,dropItemIndex:r}=t;const a=o.isA("sap.cux.home.Group");const l=i.isA("sap.cux.home.Group");const p=function(){if(!a&&!l){const t=o;const s=i;return Promise.resolve(Promise.all([e.appManagerInstance.getVisualization(t.getUrl(),n),e.appManagerInstance.getVisualization(s.getUrl(),n)])).then(function(t){let[n,o]=t;return Promise.resolve(e.appManagerInstance.moveVisualization({sourceSectionIndex:n?.persConfig?.sectionIndex,sourceVisualizationIndex:n?.persConfig?.visualizationIndex,targetSectionIndex:o?.persConfig?.sectionIndex,targetVisualizationIndex:o?.persConfig?.visualizationIndex})).then(function(){})})}else{const t=function(){if(a&&l){return Promise.resolve(e.appManagerInstance.moveSection(s,r)).then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},navigateToAppFinder:function e(t){try{return Promise.resolve(U.getServiceAsync("Navigation")).then(function(e){const n={pageID:ve};if(t){n.sectionID=t}return Promise.resolve(e.navigate({target:{shellHash:`Shell-appfinder?&/catalog/${JSON.stringify(n)}`}})).then(function(){})})}catch(e){return Promise.reject(e)}},_validateAppsMigration:function t(){try{return Promise.resolve(re(function(){return Promise.resolve(R.isImportEnabled())},function(t){e.warning(t instanceof Error?t.message:"Error while checking if import apps is enabled");return false}))}catch(e){return Promise.reject(e)}},_openImportAppsDialog:function e(){const t=new j;t.onImportDialogPress()},_openCreateGroupDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;const n=this._generateCreateGroupDialog(t);const o=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`);o.destroyItems();const i=[...this.getApps()].map(e=>{const t=e.clone();t._onPress=e=>this._highlightApp(e,t);return this.getParent()._getAppTile(t)});this._setAggregation(o,i);let s=this.getApps();this.getParent().fireEvent("appsLoaded",{apps:s,tiles:i});this._updateSelectedAppCount();n.open()},_closeCreateGroupDialog:function e(){const t=this._generateCreateGroupDialog();t?.close();this._resetCreateGroupDialog()},_resetCreateGroupDialog:function e(){const t=this._generateCreateGroupNavContainer();const n=this._controlMap.get(`${this.getId()}-createGroupDialog-mainPage-form-groupName-input`);const o=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-search`);n.setValue("");t.to(t.getInitialPage());this._selectedApps=[];o.setValue("");this._setNoAppsSelectedError(false);this._selectedGroupColor=undefined},_generateCreateGroupDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;const n=`${this.getId()}-createGroupDialog`;const i=this._generateCreateGroupNavContainer();const s=e=>{const t=this._controlMap.get(`${n}-nextBtn`);const o=this._controlMap.get(`${n}-backBtn`);const s=this._controlMap.get(`${n}-createBtn`);const r=i.indexOfPage(i.getCurrentPage());t.setVisible(r!==i.getPages().length-1&&!e);o.setVisible(r!==0&&!e);s.setVisible(r===i.getPages().length-1||e)};if(!this._controlMap.get(n)){this._controlMap.set(`${n}-nextBtn`,new o({id:`${n}-nextBtn`,text:this._i18nBundle.getText("nextButton"),press:()=>{if(this._validateGroupName()){i.to(this._generateCreateGroupAppsPage());s(t);this._highlightSelectedApps()}},type:"Emphasized"}));const e=this._controlMap.get(`${n}-nextBtn`);Ce(e,"press","createGroupNextBtn");this._controlMap.set(`${n}-backBtn`,new o({id:`${n}-backBtn`,text:this._i18nBundle.getText("backButton"),press:()=>{i.back();s(t)}}));const r=this._controlMap.get(`${n}-backBtn`);Ce(r,"press","createGroupBackBtn");this._controlMap.set(`${n}-createBtn`,new o({id:`${n}-createBtn`,text:this._i18nBundle.getText("createButton"),press:()=>{void this._onPressGroupCreate()},type:"Emphasized"}));const l=this._controlMap.get(`${n}-createBtn`);Ce(l,"press","addCreateGroup");this._controlMap.set(n,new a(n,{title:this._i18nBundle.getText("createGroup"),content:i,escapeHandler:this._closeCreateGroupDialog.bind(this),contentHeight:"25rem",contentWidth:"41.75rem",buttons:[e,r,l,new o({id:`${n}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeCreateGroupDialog.bind(this)})]}).addStyleClass("sapCuxCreateGroupDialog sapContrastPlus"))}s(t);return this._controlMap.get(n)},_highlightApp:function e(t,n){const o=t.getSource(),i=!o.hasStyleClass("sapCuxHighlightApp"),s=this._generateAppsScrollContainer();this._selectedApps=this._selectedApps||[];if(i){this._selectedApps.push(n)}else{this._selectedApps.splice(this._selectedApps.findIndex(e=>n.getUrl()===e.getUrl()),1)}this._updateSelectedAppCount();o.toggleStyleClass("sapCuxHighlightApp",i);this._setNoAppsSelectedError(this._selectedApps.length<1);s.setHeight(this._selectedApps.length<1?"15.3rem":"17.5rem")},_generateAppsScrollContainer:function e(){const o=`${this.getId()}-createGroupDialog-appsPage-scrollContainer`;if(!this._controlMap.get(o)){this._controlMap.set(`${o}-apps`,new t({id:`${o}-apps`,layout:new n(`${o}--appsContainerSettings`,{columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsGridContainerPadding"));this._controlMap.set(o,new A(o,{id:o,vertical:true,visible:true,height:"17.5rem",content:[this._controlMap.get(`${o}-apps`)]}).addStyleClass("sapUiSmallMarginBeginEnd"))}return this._controlMap.get(o)},_updateSelectedAppCount:function e(){const t=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-headerContainer-count`);t.setText(this._i18nBundle.getText("selectedAppsCount",[this._selectedApps?.length||this._i18nBundle.getText("noAppSelected")]))},_generateCreateGroupNavContainer:function e(){const t=`${this.getId()}-createGroupDialog-wrapper`;if(!this._controlMap.get(t)){this._controlMap.set(t,new m(t,{initialPage:`${this.getId()}-createGroupDialog-mainPage`,pages:[this._generateCreateGroupMainPage(),this._generateCreateGroupAppsPage()]}))}return this._controlMap.get(t)},_generateCreateGroupMainPage:function e(){const t=`${this.getId()}-createGroupDialog-mainPage`;if(!this._controlMap.get(t)){this._controlMap.set(`${t}-form-groupName-input`,new c({id:`${t}-form-groupName-input`,width:"13.75rem",required:true,liveChange:this._validateGroupName.bind(this)}));this._controlMap.set(t,new I({id:t,showHeader:false,enableScrolling:false,backgroundDesign:"List",content:[new B({id:`${t}-headerContainer`,items:[new G({id:`${t}-title`,text:this._i18nBundle.getText("settings")}),new M({id:`${t}-description`,text:this._i18nBundle.getText("settingsDescription")})]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),new F(`${t}-form`,{layout:ce.SimpleFormLayout.ResponsiveGridLayout,labelSpanS:4,labelSpanM:4,content:[new u({id:`${t}-form-groupName-label`,text:this._i18nBundle.getText("groupNameLbl")}).addStyleClass("sapUiTinyMarginTop"),this._controlMap.get(`${t}-form-groupName-input`),new u({id:`${t}-form-groupColor-label`,text:this._i18nBundle.getText("groupColorLbl")}).addStyleClass("sapUiTinyMarginTop"),new i(`${t}-form-groupColor-pallet`,{colors:_e().map(e=>e.value),colorSelect:this._onColorSelect.bind(this)}).addStyleClass("adjustSelectedColorPalette")]}).addStyleClass("sapUiMediumMarginTop")]}))}return this._controlMap.get(t)},_generateCreateGroupAppsPage:function e(){const t=`${this.getId()}-createGroupDialog-appsPage`;if(!this._controlMap.get(t)){this._controlMap.set(`${t}-search`,new P({id:`${t}-search`,liveChange:this._onCreateAppSearch.bind(this)}).addStyleClass("sapUiTinyMarginTopBottom"));this._controlMap.set(`${t}-errorMessageStrip`,new h(`${t}-errorMessageStrip`,{id:`${t}-errorMessageStrip`,type:z.Error,showIcon:true,text:this._i18nBundle.getText("selectionErrorMessage"),visible:false}));this._controlMap.set(`${t}-headerContainer-count`,new M({id:`${t}-headerContainer-count`}));this._controlMap.set(t,new I(t,{showHeader:false,backgroundDesign:"List",enableScrolling:false,content:[new B(`${t}-headerContainer`,{items:[new l(`${t}-headerContainer-titleCount`,{id:`${t}-headerContainer-titleCount`,items:[new G({id:`${t}-headerContainer-title`,text:this._i18nBundle.getText("selectedAppsTitle")}).addStyleClass("sapUiTinyMarginEnd"),this._controlMap.get(`${t}-headerContainer-count`)]}),new M({id:`${t}-description`,text:this._i18nBundle.getText("appsSelectionDescription")}).addStyleClass("sapUiTinyMarginBottom"),this._controlMap.get(`${t}-search`),this._controlMap.get(`${t}-errorMessageStrip`)]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),this._generateAppsScrollContainer(),this._generateCreateGroupErrorMsg()]}))}return this._controlMap.get(t)},_generateCreateGroupErrorMsg:function e(){const t=`${this.getId()}-createGroupDialog-appsPage-noFilterApps`;if(!this._controlMap.get(t)){this._controlMap.set(t,new p({id:t,illustrationSize:"Spot",illustrationType:"sapIllus-SearchFolder",title:this._i18nBundle.getText("noSearchedAppTitle"),description:this._i18nBundle.getText("noSearchedAppDes"),visible:false}))}return this._controlMap.get(t)},_onColorSelect:function e(t){this._selectedGroupColor=this._getLegendColor(t.getParameter("value")).key},_getLegendColor:function e(t){return _e().find(e=>e.value===t)||me()},_setNoAppsSelectedError:function e(t){const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-errorMessageStrip`);n.setVisible(t)},_validateGroupName:function e(){const t=this._controlMap.get(`${this.getId()}-createGroupDialog-mainPage-form-groupName-input`);const n=t.getValue().trim();t.setValueState(n?"None":"Error");t.setValueStateText(n?"":this._i18nBundle.getText("invalidGroupName"));return n?true:false},_highlightSelectedApps:function e(){const t=this._selectedApps||[];const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`);const o=n.getItems()||[];o.forEach(e=>{e.toggleStyleClass("sapCuxHighlightApp",t.some(t=>Ae(t.getUrl())===e.getUrl()))})},_onCreateAppSearch:function e(t){const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`),o=t.getSource().getValue(),i=n.getItems()||[],s=new RegExp(o,"i");i.forEach(e=>{e.setVisible(s.test(e.getHeader()))});const r=i.filter(e=>e.getVisible());const a=r.length>0;this._generateAppsScrollContainer()?.setVisible(a);this._generateCreateGroupErrorMsg()?.setVisible(!a)},_onPressGroupCreate:function t(){try{const t=this;const n=t._controlMap.get(`${t.getId()}-createGroupDialog-mainPage-form-groupName-input`);const o=function(){if(t._validateGroupName()){const o=function(){if(t._selectedApps?.length){t._setBusy(true);const o=le(function(){return re(function(){return Promise.resolve(t._createGroup({selectedApps:t._selectedApps,groupName:n.getValue(),groupColor:t._getGroupColor()})).then(function(){return Promise.resolve(t.refresh()).then(function(){f.show(t._i18nBundle.getText("newGroupCreated"),{of:t._controlMap.get(`${t.getId()}-createGroupDialog`),offset:"0 80"});const e=t.getAggregation("groups")||[];void t._showGroupDetailDialog(e[0]?.getGroupId())})})},function(n){e.error(n);f.show(t._i18nBundle.getText("unableToCreateGroup"))})},function(e,n){t._setBusy(false);t._closeCreateGroupDialog();if(e)throw n;return n});if(o&&o.then)return o.then(function(){})}else{t._setNoAppsSelectedError(true)}}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_createGroup:function e(t){try{const e=this;const{selectedApps:n,groupName:o,groupColor:i}=t;return Promise.resolve(e.appManagerInstance.getSectionVisualizations()).then(function(t){const s=n.reduce((e,n)=>{const o=t.find(e=>e.url===n.getUrl());if(o){e.push(o)}return e},[]);const r=s[0].persConfig.sectionId;return Promise.resolve(e.appManagerInstance.addSection({sectionIndex:1,sectionProperties:{title:o||e._i18nBundle.getText("newGroup"),visible:true,visualizations:s.map(e=>e.visualization)}})).then(function(){const t=s.reduce((e,t)=>{if(t.visualization?.id){const n=(t.persConfig?.duplicateApps||[]).map(e=>e.visualization?.id);e=e.concat([t.visualization?.id],n)}return e},[]);return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:r,vizIds:t})).then(function(){return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(t){const n=t.find(e=>e.default);const o=t[n?1:0]?.id;return Promise.resolve(e._updateAppPersonalization(s.map(e=>({visualization:e,targetGroupId:o})))).then(function(){return Promise.resolve(e._updateGroupPersonalization(o,i)).then(function(){})})})})})})}catch(e){return Promise.reject(e)}},_getGroupColor:function e(){const t=me().key;const n=this._selectedApps[0];const o=this._selectedApps.some(e=>e.getBgColor()!==n.getBgColor());return this._selectedGroupColor||(o?t:n.getBgColor())},_openColorPopover:function e(t){const n=`${this.getId()}-colorPopover`,o=_e().map(e=>e.value);const i=t.getSource();this._currentItem=i.getParent();let r=this._controlMap.get(n);if(!r){r=new s(n,{id:n,colors:o,showDefaultColorButton:false,showMoreColorsButton:false,showRecentColorsSection:false,colorSelect:e=>{ue._closeActionsPopover();const t=e.getParameter("value");void this._handleColorSelect(this._currentItem,t)}}).addStyleClass("sapContrastPlus");r._oPopover.setPlacement(ae.HorizontalPreferredRight);this._controlMap.set(n,r)}r.openBy(t.getParameter("listItem"))},_handleColorSelect:function e(t,n){try{const o=this;function i(){o.oEventBus.publish("appsChannel","favAppColorChanged",{item:t,color:n})}const s=o._getLegendColor(n).key;t.setProperty("bgColor",s,true);const r=t.isA("sap.cux.home.Group")?t.getGroupId():null;const a=!r&&t.getParent()?.isA("sap.cux.home.Group");if(a){o._refreshGroupDetailDialog(t,false)}else{o._applyUngroupedTileColor(t,n);o.oEventBus.publish("appsChannel","favAppColorChanged",{item:t,color:n})}const l=function(){if(r){void o._updateGroupPersonalization(r,s);const e=o._controlMap.get(`${o.getId()}-detailDialog-toolbar-color`);e?.setColor(n)}else{const e=t;const n=a?e.getParent().getGroupId():undefined;return Promise.resolve(o.appManagerInstance.getVisualization(e.getUrl(),n)).then(function(e){if(e){void o._updateAppPersonalization([{visualization:e,color:s}])}})}}();return Promise.resolve(l&&l.then?l.then(i):i(l))}catch(p){return Promise.reject(p)}},_getAllowedMoveGroups:function e(t){let n=this.getAggregation("groups")||[];if(t){n=n.filter(e=>e.getGroupId()!==t)}return n},_setBusy:function e(t){[this._generateGroupDetailDialog(),this._generateCreateGroupDialog(),this._generateAddFromInsightsDialog()].forEach(e=>{e.setBusy(t)});de.prototype.setBusy.call(this,t)},_openMoveToGroupPopover:function e(t,n){const o=`${this.getId()}-moveToGroupPopover`,i=t?.getSource(),s=i?.getParent(),r=n?.getGroupId();let a=this._controlMap.get(`${o}-list`),l=this._controlMap.get(o);if(!l){a=new d({id:`${o}-list`,itemPress:()=>ue._closeActionsPopover()});this._controlMap.set(`${o}-list`,a);l=new v({id:o,showHeader:false,placement:ae.HorizontalPreferredRight,content:[a]}).addStyleClass("sapContrastPlus");this._controlMap.set(o,l)}a.removeAllItems();this._getAllowedMoveGroups(r).forEach(e=>a.addItem(new C({title:e.getTitle(),type:"Active",press:()=>{void this._handleMoveToGroup(s,r,e.getGroupId())}})));l.openBy(t.getParameter("listItem"))},_handleRemove:function t(n,o){const i=this;const s=o?.getApps()?.length===1;let r=this._i18nBundle.getText("removeAppMessage",[n.getTitle()]),a=this._i18nBundle.getText("remove"),l=this._i18nBundle.getText("remove"),p=g.Icon.QUESTION;if(s){r=this._i18nBundle.getText("removeFromMyHomeMessage",[n.getTitle()]);a=this._i18nBundle.getText("delete");l=this._i18nBundle.getText("delete");p=g.Icon.WARNING}g.show(r,{icon:p,title:a,actions:[l,g.Action.CANCEL],emphasizedAction:l,onClose:function(t){try{const r=function(){if(t===l){i._setBusy(true);const t=le(function(){return re(function(){return Promise.resolve(i._removeApp(n,o)).then(function(){if(s){i._closeGroupDetailDialog()}if(o){i._refreshGroupDetailDialog(n)}return Promise.resolve(i.getParent()._refreshAllPanels()).then(function(){f.show(i._i18nBundle.getText("appRemoved"))})})},function(t){e.error(t);f.show(i._i18nBundle.getText("unableToRemoveApp"))})},function(e,t){i._setBusy(false);if(e)throw t;return t});if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})},_removeApp:function e(t,n){try{const e=this;const o=n?.getApps()?.length===1,i=n?.getGroupId(),s=t.getUrl();return Promise.resolve(e.appManagerInstance.getVisualization(s,i)).then(function(t){const n=function(){if(o){return Promise.resolve(e._deleteGroup(i)).then(function(){})}else{let n=[t?.visualization?.id];if(!i){n=n.concat(t?.persConfig?.duplicateApps?.map(e=>e.visualization?.id))}const o=function(){if(t?.persConfig?.sectionId&&n.length>0){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig.sectionId,vizIds:n})).then(function(){void e._deletePersonalization({appId:s,oldAppId:t?.oldAppId,sectionId:t?.persConfig?.sectionId,isRecentlyAddedApp:t?.persConfig?.isDefaultSection})})}}();if(o&&o.then)return o.then(function(){})}}();if(n&&n.then)return n.then(function(){})})}catch(e){return Promise.reject(e)}},_handleMoveToGroup:function e(t,n,o){try{const e=this;const i=n?e._getGroup(n):undefined,s=i?.getApps()?.length===1;const r=function(){if(s){const i=e._i18nBundle.getText("moveAppMessage",[t.getTitle()]);const s=e._i18nBundle.getText("delete");g.show(i,{icon:g.Icon.WARNING,title:s,actions:[s,g.Action.CANCEL],emphasizedAction:s,onClose:i=>{if(i===s){void e._moveAppAndHandleGroupChanges(t,n,o)}}})}else{return Promise.resolve(e._moveAppAndHandleGroupChanges(t,n,o)).then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_moveAppAndHandleGroupChanges:function t(n,o,i){try{const t=this;const s=o?t._getGroup(o):null,r=i?t._getGroup(i):null,a=r?.getTitle(),l=s?.getApps()?.length===1;const p=le(function(){return re(function(){t._setBusy(true);return Promise.resolve(t._moveAppToGroup(n,o,i)).then(function(){function e(){if(o){t._refreshGroupDetailDialog(n)}const e=a?t._i18nBundle.getText("appMoved",[a]):t._i18nBundle.getText("appUngrouped");f.show(e);return Promise.resolve(t.refresh()).then(function(){})}const i=function(){if(l&&o){return Promise.resolve(t._deleteGroup(o)).then(function(){t._closeGroupDetailDialog()})}}();return i&&i.then?i.then(e):e(i)})},function(t){e.error(t)})},function(e,n){t._setBusy(false);if(e)throw n;return n});return Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_refreshGroupDetailDialog:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;const o=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const i=o.getItems();const s=t.getParent();const r=s.getApps();if(n){const e=r.findIndex(e=>e.getUrl()===t.getUrl());r[e].destroy(true);i[e].destroy(true)}else{r.forEach((e,n)=>{if(e.getUrl()===t.getUrl()){e.setProperty("bgColor",t.getBgColor(),true);i[n].setBackgroundColor(t.getBgColor())}})}},_moveAppToGroup:function e(t,n,o){try{const e=this;const i=t.getUrl();return Promise.resolve(Promise.all([e.appManagerInstance.getSectionVisualizations(n),e.appManagerInstance._getSections()])).then(function(t){let[s,r]=t;const a=s.find(e=>e.url===i),l=a?.persConfig?.visualizationIndex??-1,p=a?.persConfig?.sectionIndex;const c=!o;const u=!n;const d=r.findIndex(e=>!o?e.default:e.id===o);const g=l>-1?s[l]:null;const h=function(){if(g!==null){function t(){return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(t){const n=t.find(e=>e.default);return Promise.resolve(e._updateAppPersonalization([{visualization:g,targetGroupId:o??n?.id,isTargetGroupDefault:c}])).then(function(){})})}const n=function(){if(c){return Promise.resolve(e._moveAppToDefaultGroup(g)).then(function(){})}else{function t(){return Promise.resolve(e.appManagerInstance.moveVisualization({sourceSectionIndex:p,sourceVisualizationIndex:l,targetSectionIndex:d,targetVisualizationIndex:-1})).then(function(){})}const n=function(){if(u){return Promise.resolve(e._removeDuplicateVisualizations(g)).then(function(){})}}();return n&&n.then?n.then(t):t(n)}}();return n&&n.then?n.then(t):t(n)}}();if(h&&h.then)return h.then(function(){})})}catch(e){return Promise.reject(e)}},_moveAppToDefaultGroup:function e(t){try{const e=this;return Promise.resolve(e._addVisualization(t)).then(function(){const n=function(){if(t.persConfig?.sectionId&&t.visualization?.id){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig?.sectionId,vizIds:[t.visualization?.id]})).then(function(){})}}();if(n&&n.then)return n.then(function(){})})}catch(e){return Promise.reject(e)}},_removeDuplicateVisualizations:function e(t){try{const e=this;const n=t?.persConfig?.duplicateApps?.map(e=>e.visualization?.id)||[];const o=function(){if(t.persConfig?.sectionId&&n.length>0){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig?.sectionId,vizIds:n})).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_onRenameGroup:function e(t){const n=t.getSource()?.getParent();void this._showGroupDetailDialog(n.getGroupId(),true)},_handleUngroupApps:function e(t){const n=this._i18nBundle.getText("ungroupAppsMessage",[t.title]),o=this._i18nBundle.getText("delete"),i=this._i18nBundle.getText("delete");g.show(n,{icon:g.Icon.WARNING,title:o,actions:[i,g.Action.CANCEL],emphasizedAction:i,onClose:e=>{if(e===i){void this._ungroupApps(t.id)}}})},_onDeleteGroup:function e(t){const n=this;const o=t.getSource()?.getParent(),i=this._i18nBundle.getText("deleteGroupMessage",[o.getTitle()]),s=this._i18nBundle.getText("delete"),r=this._i18nBundle.getText("delete"),a=this._i18nBundle.getText("moveApps");g.show(i,{icon:g.Icon.WARNING,title:s,actions:[r,this._i18nBundle.getText("moveApps"),g.Action.CANCEL],emphasizedAction:r,onClose:function(e){try{const t=function(){if(e===r){n._setBusy(true);return Promise.resolve(n._deleteGroup(o.getGroupId())).then(function(){f.show(n._i18nBundle.getText("groupDeleted"));void n.refresh();n._closeGroupDetailDialog();n._setBusy(false)})}else if(e===a){void n._ungroupApps(o.getGroupId())}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})},_ungroupApps:function t(n){try{const t=this;t._setBusy(true);const o=le(function(){return re(function(){return Promise.resolve(t.appManagerInstance.getSectionVisualizations(n)).then(function(e){return Promise.resolve(t.appManagerInstance._getSections()).then(function(o){const i=o.find(e=>e.id===n);return Promise.resolve(Promise.all(e.map(e=>t._addVisualization(e)))).then(function(){return Promise.resolve(t.appManagerInstance._getSections(true)).then(function(o){const s=o.find(e=>e.default);return Promise.resolve(t._updateAppPersonalization(e.map(e=>({visualization:e,targetGroupId:s?.id,isTargetGroupDefault:true})))).then(function(){function o(){f.show(t._i18nBundle.getText("appsUngrouped")??"");return Promise.resolve(t.refresh()).then(function(){})}const s=function(){if(i?.preset){return Promise.resolve(t.appManagerInstance.removeVisualizations({sectionId:n,vizIds:e.map(e=>e.visualization?.id)})).then(function(){})}else{return Promise.resolve(t._deleteGroup(n)).then(function(){})}}();return s&&s.then?s.then(o):o(s)})})})})})},function(n){e.error(n);f.show(t._i18nBundle.getText("unableToUngroupApps")??"")})},function(e,n){t._setBusy(false);t._closeGroupDetailDialog();if(e)throw n;return n});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_showGroupDetailDialog:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const e=this;const o=e._getGroup(t);if(!o){return Promise.resolve()}e._selectedGroupId=t;const i=e._generateGroupDetailDialog();const s=e._controlMap.get(`${e.getId()}-detailDialog-toolbar-color`);s.setColor(E.get({name:o.getBgColor()}));return Promise.resolve(e._setGroupDetailDialogApps(t)).then(function(){i.open();e._setGroupNameControl(o.getTitle(),n)})}catch(e){return Promise.reject(e)}},_setGroupDetailDialogApps:function e(t){try{const e=this;const n=e._getGroup(t);const o=function(){if(n){return Promise.resolve(e.appManagerInstance.getSectionVisualizations(t,false)).then(function(o){n.destroyAggregation("apps",true);o=o.map((t,o)=>({...t,menuItems:e._getAppActions(n,o,t)}));const i=e.generateApps(o);const s=e._controlMap.get(`${e.getId()}-detailDialog-apps`);e._setAggregation(n,i,"apps");s.destroyItems();e._setAggregation(s,n.getApps().map(t=>e.getParent()._getAppTile(t)));e._applyGroupedAppsPersonalization(t);e._dispatchAppsLoadedEvent(i)})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_applyGroupedAppsPersonalization:function e(t){const n=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const o=n?.getItems()||[];void this._applyTilesPersonalization(o,t,false)},_dispatchAppsLoadedEvent:function e(t){const n=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const o=n?.getItems()||[];this.getParent().fireEvent("appsLoaded",{apps:t,tiles:o})},_generateGroupDetailDialog:function e(){const i=`${this.getId()}-detailDialog`;if(!this._controlMap.get(i)){this._controlMap.set(`${i}-toolbar-color`,new w({id:`${i}-toolbar-color`,src:"sap-icon://color-fill",size:"1.25rem"}).addStyleClass("sapUiTinyMarginEnd"));this._controlMap.set(`${i}-toolbar-title`,new G({id:`${i}-toolbar-title`,visible:true}));const e=new c({id:`${i}-toolbar-title-edit`,width:"13.75rem",visible:false});this._controlMap.set(`${i}-toolbar-title-edit`,e);e.onsapfocusleave=()=>{void this._onGroupEditName(e.getValue())};const s=new t({id:`${i}-apps`,layout:new n(`${i}-appsLayout`,{columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsContainerBorder sapCuxAppsDetailContainerPadding");this.addDragDropConfigTo(s,e=>this._onFavItemDrop(e,this._selectedGroupId));this._controlMap.set(`${i}-apps`,s);this._controlMap.set(`${i}-addAppsBtn`,new o(`${i}-addAppsBtn`,{text:this._i18nBundle.getText("addApps"),icon:"sap-icon://action",visible:Ge(),press:()=>{const e=this._selectedGroupId;this._closeGroupDetailDialog();this._selectedGroupId=e;void this.navigateToAppFinder(e)}}));this._controlMap.set(i,new a(i,{content:this._controlMap.get(`${i}-apps`),contentWidth:"60.75rem",endButton:new o({id:`${i}-groupDetailCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeGroupDetailDialog.bind(this)}),escapeHandler:this._closeGroupDetailDialog.bind(this),customHeader:new y(`${this.getId()}-toolbar`,{content:[this._controlMap.get(`${i}-toolbar-color`),this._controlMap.get(`${i}-toolbar-title`),this._controlMap.get(`${i}-toolbar-title-edit`),new x({id:`${this.getId()}-toolbarSpacer`}),this._controlMap.get(`${i}-addAppsBtn`),new o({id:"overflowBtn",icon:"sap-icon://overflow",type:"Transparent",press:e=>{const t=e.getSource();const n=this._selectedGroupId?this._getGroup(this._selectedGroupId):null;const o=n?.getAggregation("menuItems");const i=ue.get(o);i.openBy(t)}})]})}).addStyleClass("sapCuxGroupDetailDialog"))}return this._controlMap.get(i)},_closeGroupDetailDialog:function e(){const t=this._controlMap.get(`${this.getId()}-detailDialog`);const n=this._getGroup(this._selectedGroupId);n?.destroyApps();this._selectedGroupId=undefined;t?.close()},_onGroupEditName:function e(t){try{const n=this;function o(){n._setGroupNameControl(t,false);n._setBusy(false)}n._setBusy(true);const i=n._selectedGroupId,s=n._getGroup(i),r=s?.getTitle();const a=function(){if(t&&t!==r){return Promise.resolve(n._renameGroup(i,t)).then(function(){s?.setProperty("title",t,true);void n.refresh();f.show(n._i18nBundle.getText("groupNameChanged")||"")})}}();return Promise.resolve(a&&a.then?a.then(o):o(a))}catch(l){return Promise.reject(l)}},_renameGroup:function e(t,n){try{return Promise.resolve(U.getServiceAsync("Pages")).then(function(e){const o=e.getPageIndex(ve),i=e.getModel().getProperty(`/pages/${o}/sections/`),s=i.findIndex(e=>e.id===t);const r=function(){if(s>-1){return Promise.resolve(e.renameSection(o,s,n)).then(function(){})}}();if(r&&r.then)return r.then(function(){})})}catch(e){return Promise.reject(e)}},_setGroupNameControl:function e(t,n){const o=this._controlMap.get(`${this.getId()}-detailDialog`);const i=this._controlMap.get(`${this.getId()}-detailDialog-toolbar-title`);const s=this._controlMap.get(`${this.getId()}-detailDialog-toolbar-title-edit`);s.setValue(t);i.setText(t);s?.setVisible(n);i?.setVisible(!n);if(n){o.setInitialFocus(s)}},_generateAddFromInsightsDialog:function e(){const t=`${this.getId()}-addFromInsightsDialog`;const n=()=>{const e=this._getSelectedInsights();this._controlMap.get(`${t}-addBtn`).setEnabled(e.length>0)};if(!this._controlMap.get(t)){const e=(e,t)=>{const n=new o(e,{icon:"sap-icon://action",text:this._i18nBundle.getText("appFinderBtn"),press:()=>{this._closeAddFromInsightsDialog();void this.navigateToAppFinder()},visible:Ge(),type:t||oe.Default});Ce(n,"press","appsAppFinder");return n};this._controlMap.set(`${t}-list`,new d({id:`${t}-list`,mode:"MultiSelect",selectionChange:n}));this._controlMap.set(`${t}-addBtn`,new o({id:`${t}-addBtn`,text:this._i18nBundle.getText("addFromInsightsDialogBtn"),type:"Emphasized",press:()=>{void this._addFromInsights()},enabled:false}));const i=this._controlMap.get(`${t}-addBtn`);Ce(i,"press","addStaticTiles");this._controlMap.set(`${t}-errorMessage`,new p({id:`${t}-errorMessage`,illustrationSize:"Spot",illustrationType:"sapIllus-AddColumn",title:this._i18nBundle.getText("noAppsTitle"),description:this._i18nBundle.getText("noDataMsgInsightTiles"),visible:true}).addStyleClass("sapUiLargeMarginTop"));this._controlMap.set(t,new a(t,{title:this._i18nBundle.getText("addFromInsights"),content:[new u({id:`${t}-label`,text:this._i18nBundle.getText("addFromInsightsDialogLabel"),wrapping:true}).addStyleClass("sapMTitleAlign sapUiTinyMarginTopBottom sapUiSmallMarginBeginEnd"),new l({id:`${t}-textContainer`,justifyContent:"SpaceBetween",alignItems:"Center",items:[new G({id:`${t}-text`,text:this._i18nBundle.getText("addFromInsightsDialogTitle")}),e(`${t}-addAppsBtn`,oe.Transparent)]}).addStyleClass("sapUiTinyMarginTop dialogHeader sapUiSmallMarginBeginEnd"),this._controlMap.get(`${t}-list`),this._controlMap.get(`${t}-errorMessage`)],contentWidth:"42.75rem",contentHeight:"32.5rem",endButton:new o({id:`${t}-addFromInsightsCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeAddFromInsightsDialog.bind(this)}),escapeHandler:this._closeAddFromInsightsDialog.bind(this),buttons:[this._controlMap.get(`${t}-addBtn`),new o({id:`${t}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeAddFromInsightsDialog.bind(this)})]}).addStyleClass("sapContrastPlus sapCuxAddFromInsightsDialog"))}n();return this._controlMap.get(t)},_handleAddFromInsights:function e(){try{const e=this;return Promise.resolve(e._getInsightTilesToAdd()).then(function(t){const n=e._generateAddFromInsightsDialog();e._controlMap.get(`${e.getId()}-addFromInsightsDialog-errorMessage`)?.setVisible(t.length===0);e._generateInsightListItems(t);n.open()})}catch(e){return Promise.reject(e)}},_generateInsightListItems:function e(t){const n=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);if(t.length){n.destroyItems();const e=t.map((e,t)=>new r({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}`,content:[new l({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content`,alignItems:"Center",items:[new w({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content-icon`,src:e.icon,backgroundColor:this._getLegendColor(e.BGColor||"").value,color:"white",width:"2.25rem",height:"2.25rem",size:"1.25rem"}).addStyleClass("sapUiRoundedBorder sapUiTinyMargin"),new _({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content-identifier`,title:e.title,text:e.subtitle,tooltip:e.title}).addStyleClass("sapUiTinyMargin")]})]}).addStyleClass("sapUiContentPadding").data("vizId",e.visualization?.vizId));this._setAggregation(n,e)}n?.setVisible(t.length!==0)},_getInsightTilesToAdd:function e(){try{const e=this;return Promise.resolve(Promise.all([e.appManagerInstance.fetchInsightApps(true,e._i18nBundle.getText("insights")),e.appManagerInstance.fetchFavVizs(false,true)])).then(function(t){let[n,o]=t;const i=n.reduce((e,t)=>{if(!t.isCount&&!t.isSmartBusinessTile){const n=o.findIndex(e=>e.visualization?.vizId===t.visualization?.vizId||e.appId===t.appId);if(n===-1){e.push(t)}}return e},[]);return e.appManagerInstance._filterDuplicateVizs(i,false)})}catch(e){return Promise.reject(e)}},_closeAddFromInsightsDialog:function e(){const t=this._generateAddFromInsightsDialog();const n=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);n.removeSelections();t?.close()},_getSelectedInsights:function e(){const t=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);return t.getSelectedItems()||[]},_addFromInsights:function e(){try{const t=this;function n(){t._closeAddFromInsightsDialog();f.show(t._i18nBundle.getText(o.length===1?"addFromInsightTileSuccess":"addFromInsightTilesSuccess",[o.length]));return Promise.resolve(t.getParent()._refreshAllPanels()).then(function(){t._setBusy(false)})}t._setBusy(true);const o=t._getSelectedInsights();const i=ie(o,function(e){return Promise.resolve(t.appManagerInstance.addVisualization(e.data("vizId"))).then(function(){})});return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(s){return Promise.reject(s)}},_updateAppPersonalization:function e(t){try{const e=this;return Promise.resolve(e._getAppPersonalization()).then(function(n){for(const o of t){const{visualization:t}=o;const{persConfig:i}=t;const s=i?.sectionId;const r=o.targetGroupId??s;if(s!==r){e._updateMoveAppPersonalization(n,o)}else{e._updateAppColorPersonalization(n,o)}}return Promise.resolve(e.setFavAppsPersonalization(n)).then(function(){})})}catch(e){return Promise.reject(e)}},_updateMoveAppPersonalization:function e(t,n){const{visualization:o,isTargetGroupDefault:i}=n;const{appId:s,oldAppId:r,persConfig:a}=o;const l=a?.sectionId;const p=a?.isDefaultSection;const c=a?.duplicateApps||[];const u=n.targetGroupId??l;const d=this._getPersonalizationIndex(t,{appId:s,oldAppId:r,sectionId:l,isRecentlyAddedApp:p});if(d>-1){const e={...t[d],sectionId:u,isRecentlyAddedApp:i,isSection:false};if(c.length===0){t.splice(d,1)}const n=this._getPersonalizationIndex(t,{appId:s,oldAppId:r,sectionId:u,isRecentlyAddedApp:i});if(n>-1){t.splice(n,1)}t.push(e)}},_updateGroupPersonalization:function e(t,n){try{const e=this;return Promise.resolve(e._getAppPersonalization()).then(function(o){const i=e._getPersonalizationIndex(o,{isSection:true,sectionId:t});const s={BGColor:n,isSection:true,sectionId:t,isRecentlyAddedApp:false};if(i>-1){o[i]=s}else{o.push(s)}return Promise.resolve(e.setFavAppsPersonalization(o)).then(function(){})})}catch(e){return Promise.reject(e)}},_getPersonalizationIndex:function e(t,n){const{appId:o,oldAppId:i,sectionId:s,isSection:r,isRecentlyAddedApp:a}=n;return t.findIndex(e=>{if(r){return e.sectionId===s&&e.isSection}else{return a?(e.appId===o||e.appId===i)&&e.isRecentlyAddedApp:(e.appId===o||e.appId===i)&&e.sectionId===s}})},_addVisualization:function e(t,n){if(t.visualization){return t.visualization.isBookmark?this.appManagerInstance.addBookMark(t.visualization):this.appManagerInstance.addVisualization(t.visualization.vizId,n)}return Promise.reject(new Error("No visualization provided to add"))},_deleteGroup:function e(t){try{const e=this;return Promise.resolve(U.getServiceAsync("Pages")).then(function(n){const o=n.getPageIndex(ve),i=n.getModel().getProperty(`/pages/${o}/sections/`),s=i.findIndex(e=>e.id===t);const r=function(){if(s>-1){return Promise.resolve(n.deleteSection(o,s)).then(function(){void e._deletePersonalization({sectionId:t,isSection:true})})}}();if(r&&r.then)return r.then(function(){})})}catch(e){return Promise.reject(e)}},_deletePersonalization:function e(t){try{const e=this;const{isSection:n,sectionId:o}=t;return Promise.resolve(e._getAppPersonalization()).then(function(i){if(!n){const n=e._getPersonalizationIndex(i,t);if(n>-1){i.splice(n,1)}}else{i=i.filter(e=>e.sectionId!==o)}void e.setFavAppsPersonalization(i)})}catch(e){return Promise.reject(e)}},_handleGroupPress:function e(t){const n=t.getParameter("groupId");if(n){void this._showGroupDetailDialog(n)}},_handleKeyboardMoveApp:function e(t,n){try{const e=this;const o=S.closestTo(t.target.firstElementChild);const i=o.getParent();const s=function(){if(t.metaKey||t.ctrlKey){if(t.key==="x"&&!o.data("groupId")&&!e._cutApp&&!n){o.$().css("opacity",.6);o._oMoreIcon.setEnabled(false);e._cutApp=o}const s=function(){if(t.key==="v"&&e._cutApp&&!n){const t=new T("keyboardDragDropEvent",i,{draggedControl:e._cutApp,droppedControl:o,dropPosition:pe.RelativeDropPosition.On});return Promise.resolve(e._onFavItemDrop(t)).then(function(){e._cutApp=undefined})}}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_resetCutElement:function e(t){const n=this._generateAppsWrapper().getId();if(!t.target.id.includes(n)){this._cutApp?.$().css("opacity","");this._cutApp=undefined}},generateIllustratedMessage:function e(){const t=de.prototype.generateIllustratedMessage.call(this);t.setDescription(this._i18nBundle.getText("noFavAppsDescription"));t.addAdditionalContent(new o(`${this.getId()}-errorMessage-addApps`,{text:this._i18nBundle.getText("addApps"),tooltip:this._i18nBundle.getText("addAppsTooltip"),icon:"sap-icon://action",visible:Ge(),press:()=>{void this.navigateToAppFinder()},type:"Emphasized"}));return t}});Te.favouritesMenuItems=ye;return Te});
|
|
106
|
+
sap.ui.predefine("sap/cux/home/ErrorPanel", ["sap/m/Button","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/VBox","./BasePanel","./utils/Constants"],function(t,e,s,a,n,i,o){"use strict";function r(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const d=r(i);const p=o["SETTINGS_PANELS_KEYS"];const l=d.extend("sap.cux.home.ErrorPanel",{metadata:{library:"sap.cux.home",properties:{messageTitle:{type:"string",group:"Misc",defaultValue:""},messageDescription:{type:"string",group:"Misc",defaultValue:""},actionButton:{type:"sap.m.Button",group:"Misc"}}},constructor:function t(e,s){d.prototype.constructor.call(this,e,s)},getData:function i(){this.setProperty("enableSettings",false);if(!this._oWrapperNoCardsVBox){const i=new e(`${this.getId()}-errorPanelIllustratedMessage`,{illustrationSize:s.Small,illustrationType:a.AddDimensions,title:this.getProperty("messageTitle"),description:this.getProperty("messageDescription"),additionalContent:[new t(`${this.getId()}-addInsightsBtn`,{text:this._i18nBundle.getText("manageInsightBtn"),type:"Emphasized",press:this.handleAddInsights.bind(this)})]});this._oWrapperNoCardsVBox=new n(`${this.getId()}-wrapperNoCardsVBox`,{backgroundDesign:"Solid"}).addStyleClass("sapUiSmallMarginTop");const o=this.getProperty("actionButton");if(o){i.insertAdditionalContent(o,0)}this._oWrapperNoCardsVBox.addItem(i);this._addContent(this._oWrapperNoCardsVBox)}},handleAddInsights:function t(){const e=this.getParent();e?._getLayout().openSettingsDialog(p.INSIGHTS_CARDS)}});return l});
|
|
107
|
+
/*!
|
|
108
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
109
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
110
|
+
*/
|
|
111
|
+
sap.ui.predefine("sap/cux/home/FavAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/ColorPalette","sap/m/ColorPalettePopover","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/Input","sap/m/Label","sap/m/List","sap/m/MessageBox","sap/m/MessageStrip","sap/m/MessageToast","sap/m/NavContainer","sap/m/ObjectIdentifier","sap/m/Page","sap/m/Popover","sap/m/ScrollContainer","sap/m/SearchField","sap/m/StandardListItem","sap/m/Text","sap/m/Title","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","sap/m/library","sap/ui/base/Event","sap/ui/core/Element","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/library","sap/ui/core/message/MessageType","sap/ui/core/theming/Parameters","sap/ui/layout/form/SimpleForm","sap/ui/layout/library","sap/ushell/Config","sap/ushell/Container","sap/ushell/components/pages/MyHomeImport","sap/ushell/components/pages/controller/PageRuntime.controller","./BaseApp","./BaseAppPersPanel","./Group","./MenuItem","./utils/Accessibility","./utils/Constants","./utils/DataFormatUtils","./utils/FESRUtil","./utils/InsightsUtils"],function(e,t,n,o,i,s,r,a,l,p,c,u,d,g,h,f,m,_,I,v,P,A,C,M,G,y,B,x,D,T,S,$,w,b,z,E,F,N,V,U,R,j,L,H,k,O,K,W,Y,q,J,Q,X){"use strict";function Z(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const ee=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function te(e,t,n){if(!e.s){if(n instanceof ne){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=te.bind(null,e,t);return}}if(n&&n.then){n.then(te.bind(null,e,t),te.bind(null,e,2));return}e.s=t;e.v=n;const o=e.o;if(o){o(e)}}}const ne=function(){function e(){}e.prototype.then=function(t,n){const o=new e;const i=this.s;if(i){const e=i&1?t:n;if(e){try{te(o,1,e(this.v))}catch(e){te(o,2,e)}return o}else{return this}}this.o=function(e){try{const i=e.v;if(e.s&1){te(o,1,t?t(i):i)}else if(n){te(o,1,n(i))}else{te(o,2,i)}}catch(e){te(o,2,e)}};return o};return e}();function oe(e){return e instanceof ne&&e.s&1}function ie(e,t,n){var o=-1,i,s;function r(a){try{while(++o<e.length&&(!n||!n())){a=t(o);if(a&&a.then){if(oe(a)){a=a.v}else{a.then(r,s||(s=te.bind(null,i=new ne,2)));return}}}if(i){te(i,1,a)}else{i=a}}catch(e){te(i||(i=new ne),2,e)}}r();return i}const se=S["ButtonType"];function re(e,t,n){if(typeof e[ee]==="function"){var o=e[ee](),i,s,r;function c(e){try{while(!(i=o.next()).done&&(!n||!n())){e=t(i.value);if(e&&e.then){if(oe(e)){e=e.v}else{e.then(c,r||(r=te.bind(null,s=new ne,2)));return}}}if(s){te(s,1,e)}else{s=e}}catch(e){te(s||(s=new ne),2,e)}}c();if(o.return){var a=function(e){try{if(!i.done){o.return()}}catch(e){}return e};if(s&&s.then){return s.then(a,function(e){throw a(e)})}a()}return s}if(!("length"in e)){throw new TypeError("Object is not iterable")}var l=[];for(var p=0;p<e.length;p++){l.push(e[p])}return ie(l,function(e){return t(l[e])},n)}const ae=S["ListType"];function le(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const pe=S["PlacementType"];function ce(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const ue=E["dnd"];const de=U["form"];const ge=k["ActionsPopover"];const he=Z(O);const fe=Z(K);const me=Z(W);const _e=Y["checkPanelExists"];const Ie=q["DEFAULT_BG_COLOR"];const ve=q["END_USER_COLORS"];const Pe=q["MYAPPS_SECTION_ID"];const Ae=q["MYHOME_PAGE_ID"];const Ce=J["getLeanURL"];const Me=J["recycleId"];const Ge=Q["addFESRId"];const ye=Q["addFESRSemanticStepName"];const Be=X["sortMenuItems"];const xe=()=>R.last("/core/shell/enablePersonalization")||R.last("/core/catalog/enabled");var De=function(e){e["CREATE_GROUP"]="createGrpMenuBtn";e["ADD_APPS"]="addAppsMenuBtn";e["ADD_FROM_INSIGHTS"]="addInsightsMenuBtn";return e}(De||{});const Te="sap.cux.home.TilesPanel";const Se="sap.cux.home.InsightsContainer";const $e=[De.CREATE_GROUP,De.ADD_APPS,De.ADD_FROM_INSIGHTS,"settings"];const we=he.extend("sap.cux.home.FavAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"},groups:{type:"sap.cux.home.Group",singularName:"group",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){he.prototype.constructor.call(this,t,n);this._selectedApps=[];this._isInitialLoad=true;this._updateAppColorPersonalization=(e,t)=>{const{visualization:n,color:o}=t;const{appId:i,oldAppId:s,persConfig:r}=n;const a=r?.sectionId;const l=r?.isDefaultSection;const p=this._getPersonalizationIndex(e,{appId:i,oldAppId:s,sectionId:a,isRecentlyAddedApp:l});if(p>-1){e[p].BGColor=o}else{e.push({BGColor:o,sectionId:a,isRecentlyAddedApp:l,appId:i,isSection:false})}}},init:function e(){const t=this,n=this;he.prototype.init.call(this);this.setProperty("key","favApps");this.setProperty("title",this._i18nBundle.getText("favoritesTab"));this.setProperty("tooltip",this._i18nBundle.getText("favAppsInfo"));void this._createActionButtons();this._createHeaderMenuItems();const o=this._generateAppsWrapper();if(o){this.addDragDropConfigTo(o,e=>this._onFavItemDrop(e),e=>this._handleKeyboardMoveApp(e),ue.DropPosition.OnOrBetween)}this.oEventBus=b.getInstance();this.oEventBus.subscribe("importChannel","appsImport",function(e,n,o){try{const e=o?.apps||[];const n=o?.groupInfo||[];return Promise.resolve(t.addAppsAndSections(e,n)).then(function(){t._importdone();return Promise.resolve(t.getParent()._refreshAllPanels()).then(function(){})})}catch(e){return Promise.reject(e)}},this);this.oEventBus.subscribe("importChannel","resetImported",function(){try{return Promise.resolve(n.setImportButtonVisibility(true)).then(function(){})}catch(e){return Promise.reject(e)}},this);this.attachPersistDialog(()=>{if(this._selectedGroupId){void this._showGroupDetailDialog(this._selectedGroupId)}});document.addEventListener("click",e=>this._resetCutElement(e));document.addEventListener("keydown",e=>this._resetCutElement(e))},_importdone:function e(){const t={status:true};this.oEventBus.publish("importChannel","appsImported",t)},addAppsAndSections:function e(t,n){try{const e=this;let o=[];return Promise.resolve(e._getAppPersonalization()).then(function(i){return Promise.resolve(j.getServiceAsync("Pages")).then(function(s){function r(){return Promise.resolve(e.setFavAppsPersonalization(i)).then(function(){return o.reduce((e,t)=>e.then(()=>t()),Promise.resolve()).then(()=>e.updateDefaultSectionPersonalization(i))})}const a=re(t,function(t){const r=t.visualizations;const a=function(){if(r?.length){const a=function(){if(t.default||t.id===Pe){const s=e.filterPersonalizations(n,t);i=i.concat(s);o.push(()=>t.default?e.addSectionViz(r):e.addSectionViz(r,Pe))}else{return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(a){const l=s._generateId(Ae);const p=e.filterPersonalizations(n,t,l);i=i.concat(p);o.push(()=>e.appManagerInstance.addSection({sectionIndex:a.length,sectionProperties:{id:l,title:t.title,visible:true,visualizations:r?.map(e=>{e.id=s._generateId(Ae);return e})}}))})}}();if(a&&a.then)return a.then(function(){})}}();if(a&&a.then)return a.then(function(){})});return a&&a.then?a.then(r):r(a)})})}catch(e){return Promise.reject(e)}},filterPersonalizations:function e(t,n,o){const i=t.reduce(function(e,t){if(t.sectionId===n.id){const i=n.visualizations;const s=i?.find(e=>e.targetURL===t.appId);if(s||t.isSection){t.sectionId=o||n.id;e.push(t)}}return e},[]);return i},updateDefaultSectionPersonalization:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(e){let n=e.find(e=>e.default);if(n){t.forEach(e=>{if(e.isRecentlyAddedApp){e.sectionId=n.id}})}return t})}catch(e){return Promise.reject(e)}},addSectionViz:function e(t,n){try{const e=this;return Promise.resolve(t.reduce((t,o)=>t.then(()=>e._addVisualization({visualization:o},n)),Promise.resolve()))}catch(e){return Promise.reject(e)}},loadApps:function e(){try{const e=this;return Promise.resolve(e.appManagerInstance.fetchFavVizs(true,false)).then(function(t){e.destroyAggregation("groups",true);const n=t.filter(e=>e.isSection).map(t=>({...t,menuItems:e._getGroupActions(t)}));const o=e._generateGroups(n);e._setGroups(o);e.destroyAggregation("apps",true);const i=t.filter(e=>!e.isSection).map((t,n)=>({...t,menuItems:e._getAppActions(undefined,n,t)}));const s=e.generateApps(i);e.setApps(s);if(e._selectedGroupId){void e._setGroupDetailDialogApps(e._selectedGroupId)}const r=e.getParent();r.toggleMenuListItem(e._createGroupMenuItem,e.getApps().length>0);return Promise.resolve(e._switchToRecommendedIfNoFavApps(s,o)).then(function(){if(_e(r,Se,Te)){e._createAddFromInsTilesMenuItem(De.ADD_FROM_INSIGHTS)}r._updateContainerHeader(r)})})}catch(e){return Promise.reject(e)}},_switchToRecommendedIfNoFavApps:function e(t,n){try{const o=this;function i(){o._isInitialLoad=false}const s=o.getParent();const r=function(){if(o._isInitialLoad&&[...t,...n].length===0){s.setProperty?.("selectedKey","recommendedApps");return Promise.resolve(s.load()).then(function(){})}}();return Promise.resolve(r&&r.then?r.then(i):i(r))}catch(a){return Promise.reject(a)}},_createAddFromInsTilesMenuItem:function e(t){const n=`${this.getId()}-${t}`;if(!this._controlMap.get(n)){const e=new me(n,{title:this._i18nBundle.getText("addFromInsights"),icon:"sap-icon://duplicate",press:()=>void this._handleAddFromInsights()});Ge(e,"staticTilesDialog");this._menuItems.push(e);this.addAggregation("menuItems",e);this._sortMenuItems($e);this._controlMap.set(n,e)}return this._controlMap.get(n)},_sortMenuItems:function e(t){const n=this.getAggregation("menuItems");let o=Be(t,n);this.removeAllAggregation("menuItems");o?.forEach(e=>this.addAggregation("menuItems",e))},_generateGroups:function e(t){return t.map((e,t)=>{const n=typeof e.BGColor==="object"&&"key"in e.BGColor?e.BGColor.key:e.BGColor;const o=new fe(`${this.getId()}-group-${t}`,{title:e.title,bgColor:n,status:e.status,icon:e.icon,number:e.badge,groupId:e.id,press:this._handleGroupPress.bind(this)});e.menuItems?.forEach(e=>{o.addAggregation("menuItems",e)});return o})},_setGroups:function e(t){t.forEach(e=>{this.addAggregation("groups",e,true)})},_getAppActions:function e(t,n,o){const i=t?.getGroupId();const s=o?.persConfig?.isDefaultSection;const r=!i;const a=[];const l=new me({id:i&&!s?`${i}--selectColorGroupAppMenuItem--${n}`:`${this.getKey()}--selectColorAppMenuItem--${n}`,title:this._i18nBundle.getText("selectColor"),type:ae.Navigation,press:this._openColorPopover.bind(this)});a.push(l);Ge(l,"changeColor");if(this._getAllowedMoveGroups(i)?.length>=1){const e=new me({id:i&&!s?`${i}--moveToGroupAppMenuItem--${n}`:`${this.getKey()}--moveToMenuItem--${n}`,title:this._i18nBundle.getText("moveTo"),type:ae.Navigation,press:e=>this._openMoveToGroupPopover(e,t)});a.push(e);Ge(e,"moveToGroup")}if(r){const e=new me(`${this.getKey()}--createGroupMenuItem--${n}`,{title:this._i18nBundle.getText("createGroup"),press:e=>{const t=e.getSource();const n=t.getParent();this._selectedApps=[n];this._openCreateGroupDialog()}});a.push(e);Ge(e,"createGroupDialog")}const p=new me({id:i&&!s?`${i}--removeFromMyHomeGroupAppMenuItem--${n}`:`${this.getKey()}--removeFromMyHomeMenuItem--${n}`,title:this._i18nBundle.getText("removeFromMyHome"),press:e=>{const n=e.getSource();const o=n.getParent();this._handleRemove(o,t)}});a.push(p);Ge(p,"removeFromMyHome");if(!r){const e=new me(`${this.getKey()}--removeFromGroupMenuItem--${n}`,{title:this._i18nBundle.getText("removeFromGroup"),press:e=>{const t=e.getSource();const n=t.getParent();void this._handleMoveToGroup(n,i)}});a.push(e);Ge(e,"ungroupApp")}return a},_getGroupActions:function e(t){const n=new me(`id-${t.id}-renameGroup`,{title:this._i18nBundle.getText("renameGroup"),press:this._onRenameGroup.bind(this)});Ge(n,"renameGroup");const o=new me(`id-${t.id}-selectColor`,{title:this._i18nBundle.getText("selectColor"),type:ae.Navigation,press:this._openColorPopover.bind(this)});Ge(o,"changeColor");const i=new me(`id-${t.id}-removeAllApps`,{title:this._i18nBundle.getText("removeAllApps"),press:this._handleUngroupApps.bind(this,t)});Ge(i,"removeAllApps");const s=[n,o,i];if(!t.isPresetSection){const e=new me(`id-${t.id}-delete`,{title:this._i18nBundle.getText("delete"),press:this._onDeleteGroup.bind(this)});Ge(e,"deleteGroup");s.push(e)}return s},_createActionButtons:function e(){try{const e=this;if(!e._actionButtons){e._actionButtons=[];if(xe()){const t=new o(`${e.getId()}-addAppsBtn`,{icon:"sap-icon://action",tooltip:e._i18nBundle.getText("addAppsTooltip"),text:e._i18nBundle.getText("addApps"),press:()=>{void e.navigateToAppFinder()}});Ge(t,"addAppsBtn");e._actionButtons.push(t)}}e._actionButtons.forEach(t=>{e.addAggregation("actionButtons",t)});return Promise.resolve(e._validateAppsMigration()).then(function(t){if(t){e._createImportButton()}})}catch(e){return Promise.reject(e)}},_createImportButton:function e(){if(!this._importButton){this._importButton=new o(`${this.getId()}-importAppsBtn`,{tooltip:this._i18nBundle.getText("importAppsNow"),text:this._i18nBundle.getText("importAppsNow"),press:this._openImportAppsDialog.bind(this)});Ge(this._importButton,"importAppsDialog");this._actionButtons.push(this._importButton);this.insertAggregation("actionButtons",this._importButton,0)}return this._importButton},setImportButtonVisibility:function e(t){try{const e=this;return Promise.resolve(L.setImportEnabled(t)).then(function(){e._createImportButton().setVisible(t)})}catch(e){return Promise.reject(e)}},_createHeaderMenuItems:function e(){if(!this._menuItems){this._createGroupMenuItem=new me(`${this.getId()}-${De.CREATE_GROUP}`,{title:this._i18nBundle.getText("createGroup"),icon:"sap-icon://add",press:()=>this._openCreateGroupDialog()});this._menuItems=[this._createGroupMenuItem];if(xe()){this._menuItems.push(new me(`${this.getId()}-${De.ADD_APPS}`,{title:this._i18nBundle.getText("addApps"),icon:"sap-icon://action",press:()=>{void this.navigateToAppFinder()}}))}Ge(this._createGroupMenuItem,"createGroupDialog");const e=this._menuItems.find(e=>e.getId()===`${this.getId()}-${De.ADD_APPS}`);if(e){Ge(e,"appsAppFinder")}this._menuItems.forEach(e=>{this.addAggregation("menuItems",e,true)});this._sortMenuItems($e)}},_getDragDropInfo:function e(t,n){try{const e=this;const o=t.getParameter?.("draggedControl"),i=t.getParameter?.("droppedControl"),s=t.getParameter?.("dropPosition"),r=o.getParent(),a=r.indexOfItem(o),l=r.indexOfItem(i),p=e._getTileItem(o,n),c=e._getTileItem(i,n);const u={dragItem:p,dropItem:c,dropPosition:s,dropControl:r,dragItemIndex:a,dropItemIndex:l};const d=function(){if(a!==l){const t=function(){if(!p?.isA("sap.cux.home.Group")&&!c?.isA("sap.cux.home.Group")){return Promise.resolve(e._adjustAppDragDropInfo(u,n)).then(function(){})}else{const t=function(){if(p?.isA("sap.cux.home.Group")){return Promise.resolve(e._adjustGroupDragDropInfo(u)).then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(d&&d.then?d.then(function(){return u}):u)}catch(e){return Promise.reject(e)}},_adjustAppDragDropInfo:function e(t,n){try{const e=this;let o=false;const i=t.dragItem;const s=t.dropItem;return Promise.resolve(Promise.all([e.appManagerInstance.getVisualization(i.getUrl(),n),e.appManagerInstance.getVisualization(s.getUrl(),n)])).then(function(i){let[s,r]=i;if(t.dropPosition===ue.RelativeDropPosition.Before){if(t.dragItemIndex===t.dropItemIndex-1){t.dropItemIndex--}if(t.dragItemIndex<t.dropItemIndex&&s?.persConfig?.sectionIndex===r?.persConfig?.sectionIndex){t.dropItemIndex--;o=true}}else if(t.dropPosition===ue.RelativeDropPosition.After){if(t.dragItemIndex===t.dropItemIndex+1){t.dropItemIndex++}if(t.dragItemIndex>t.dropItemIndex&&s?.persConfig?.sectionIndex===r?.persConfig?.sectionIndex){t.dropItemIndex++;o=true}}if(o){const o=t.dropControl.getItems()[t.dropItemIndex];const i=e._getTileItem(o,n);if(i){t.dropItem=i}}})}catch(e){return Promise.reject(e)}},_getTileItem:function e(t,n){const o=t.data("groupId");if(o){return this._getGroup(o)}else{const e=n?this._getGroup(n):null;const o=e?e.getApps():this.getApps();return o.find(e=>Ce(e.getUrl())===t.getUrl())}},_adjustGroupDragDropInfo:function e(t){try{const e=this;return Promise.resolve(e.appManagerInstance._getSections()).then(function(n){let o;t.dragItemIndex=n.findIndex(e=>e.id===t.dragItem.getGroupId());if(!t.dropItem.isA("sap.cux.home.Group")){const n=e.getAggregation("groups").length;t.dropItemIndex=t.dropPosition===ue.RelativeDropPosition.Before&&t.dropItemIndex===n&&t.dragItemIndex!==n?n+1:t.dragItemIndex}else{o=n.findIndex(e=>e.id===t.dropItem.getGroupId());t.dropItemIndex=o}if(t.dropPosition===ue.RelativeDropPosition.Before&&t.dragItemIndex===t.dropItemIndex-1){t.dropItemIndex--}else if(t.dropPosition===ue.RelativeDropPosition.After&&(t.dragItemIndex!==t.dropItemIndex||o&&t.dropItemIndex>=o)){t.dropItemIndex++}})}catch(e){return Promise.reject(e)}},_onFavItemDrop:function e(t,n){try{const e=this;const o=t.getParameter?.("draggedControl");return Promise.resolve(e._getDragDropInfo(t,n)).then(function(t){function i(){o.removeStyleClass("sapMGTPressActive")}const{dragItemIndex:s,dropItemIndex:r,dropPosition:a,dragItem:l,dropItem:p}=t;if(s===r)return;const c=function(){if(a===ue.RelativeDropPosition.On){return Promise.resolve(e._handleOnItemDrop(l,p)).then(function(){void e.refresh()})}else{const o=function(){if(a===ue.RelativeDropPosition.After||a===ue.RelativeDropPosition.Before){e._setBusy(true);return Promise.resolve(e._handleItemsReorder(t,n)).then(function(){return Promise.resolve(e.refresh()).then(function(){if(n){void e._setGroupDetailDialogApps(n)}e._setBusy(false)})})}}();if(o&&o.then)return o.then(function(){})}}();return c&&c.then?c.then(i):i(c)})}catch(e){return Promise.reject(e)}},_handleOnItemDrop:function e(t,n){try{const e=this;if(t.isA("sap.cux.home.Group"))return Promise.resolve();const o=function(){if(!n.isA("sap.cux.home.Group")){const o=t;const i=n;e._selectedApps=[o,i];e._openCreateGroupDialog(true)}else{const o=n.getGroupId();e._setBusy(true);return Promise.resolve(e._handleMoveToGroup(t,undefined,o)).then(function(){e._setBusy(false)})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_handleItemsReorder:function e(t,n){try{const e=this;const{dragItem:o,dropItem:i,dragItemIndex:s,dropItemIndex:r}=t;const a=o.isA("sap.cux.home.Group");const l=i.isA("sap.cux.home.Group");const p=function(){if(!a&&!l){const t=o;const s=i;return Promise.resolve(Promise.all([e.appManagerInstance.getVisualization(t.getUrl(),n),e.appManagerInstance.getVisualization(s.getUrl(),n)])).then(function(t){let[n,o]=t;return Promise.resolve(e.appManagerInstance.moveVisualization({sourceSectionIndex:n?.persConfig?.sectionIndex,sourceVisualizationIndex:n?.persConfig?.visualizationIndex,targetSectionIndex:o?.persConfig?.sectionIndex,targetVisualizationIndex:o?.persConfig?.visualizationIndex})).then(function(){})})}else{const t=function(){if(a&&l){return Promise.resolve(e.appManagerInstance.moveSection(s,r)).then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},navigateToAppFinder:function e(t){try{return Promise.resolve(j.getServiceAsync("Navigation")).then(function(e){const n={pageID:Ae};if(t){n.sectionID=t}return Promise.resolve(e.navigate({target:{shellHash:`Shell-appfinder?&/catalog/${JSON.stringify(n)}`}})).then(function(){})})}catch(e){return Promise.reject(e)}},_validateAppsMigration:function t(){try{return Promise.resolve(le(function(){return Promise.resolve(L.isImportEnabled())},function(t){e.warning(t instanceof Error?t.message:"Error while checking if import apps is enabled");return false}))}catch(e){return Promise.reject(e)}},_openImportAppsDialog:function e(){const t=new H;t.onImportDialogPress()},_openCreateGroupDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;const n=this._generateCreateGroupDialog(t);const o=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`);o.destroyItems();const i=[...this.getApps()].map(e=>{const t=e.clone();t._onPress=e=>this._highlightApp(e,t);return this.getParent()._getAppTile(t)});this._setAggregation(o,i);let s=this.getApps();this.getParent().fireEvent("appsLoaded",{apps:s,tiles:i});this._updateSelectedAppCount();n.open()},_closeCreateGroupDialog:function e(){const t=this._generateCreateGroupDialog();t?.close();this._resetCreateGroupDialog()},_resetCreateGroupDialog:function e(){const t=this._generateCreateGroupNavContainer();const n=this._controlMap.get(`${this.getId()}-createGroupDialog-mainPage-form-groupName-input`);const o=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-search`);n.setValue("");t.to(t.getInitialPage());this._selectedApps=[];o.setValue("");this._setNoAppsSelectedError(false);this._selectedGroupColor=undefined},_generateCreateGroupDialog:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;const n=`${this.getId()}-createGroupDialog`;const i=this._generateCreateGroupNavContainer();const s=e=>{const t=this._controlMap.get(`${n}-nextBtn`);const o=this._controlMap.get(`${n}-backBtn`);const s=this._controlMap.get(`${n}-createBtn`);const r=i.indexOfPage(i.getCurrentPage());t.setVisible(r!==i.getPages().length-1&&!e);o.setVisible(r!==0&&!e);s.setVisible(r===i.getPages().length-1||e)};if(!this._controlMap.get(n)){this._controlMap.set(`${n}-nextBtn`,new o({id:`${n}-nextBtn`,text:this._i18nBundle.getText("nextButton"),press:()=>{if(this._validateGroupName()){i.to(this._generateCreateGroupAppsPage());s(t);this._highlightSelectedApps()}},type:"Emphasized"}));const e=this._controlMap.get(`${n}-nextBtn`);ye(e,"press","createGroupNextBtn");this._controlMap.set(`${n}-backBtn`,new o({id:`${n}-backBtn`,text:this._i18nBundle.getText("backButton"),press:()=>{i.back();s(t)}}));const r=this._controlMap.get(`${n}-backBtn`);ye(r,"press","createGroupBackBtn");this._controlMap.set(`${n}-createBtn`,new o({id:`${n}-createBtn`,text:this._i18nBundle.getText("createButton"),press:()=>{void this._onPressGroupCreate()},type:"Emphasized"}));const l=this._controlMap.get(`${n}-createBtn`);ye(l,"press","addCreateGroup");this._controlMap.set(n,new a(n,{title:this._i18nBundle.getText("createGroup"),content:i,escapeHandler:this._closeCreateGroupDialog.bind(this),contentHeight:"25rem",contentWidth:"41.75rem",buttons:[e,r,l,new o({id:`${n}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeCreateGroupDialog.bind(this)})]}).addStyleClass("sapCuxCreateGroupDialog sapContrastPlus"))}s(t);return this._controlMap.get(n)},_highlightApp:function e(t,n){const o=t.getSource(),i=!o.hasStyleClass("sapCuxHighlightApp"),s=this._generateAppsScrollContainer();this._selectedApps=this._selectedApps||[];if(i){this._selectedApps.push(n)}else{this._selectedApps.splice(this._selectedApps.findIndex(e=>n.getUrl()===e.getUrl()),1)}this._updateSelectedAppCount();o.toggleStyleClass("sapCuxHighlightApp",i);this._setNoAppsSelectedError(this._selectedApps.length<1);s.setHeight(this._selectedApps.length<1?"15.3rem":"17.5rem")},_generateAppsScrollContainer:function e(){const o=`${this.getId()}-createGroupDialog-appsPage-scrollContainer`;if(!this._controlMap.get(o)){this._controlMap.set(`${o}-apps`,new t({id:`${o}-apps`,layout:new n(`${o}--appsContainerSettings`,{columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsGridContainerPadding"));this._controlMap.set(o,new C(o,{id:o,vertical:true,visible:true,height:"17.5rem",content:[this._controlMap.get(`${o}-apps`)]}).addStyleClass("sapUiSmallMarginBeginEnd"))}return this._controlMap.get(o)},_updateSelectedAppCount:function e(){const t=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-headerContainer-count`);t.setText(this._i18nBundle.getText("selectedAppsCount",[this._selectedApps?.length||this._i18nBundle.getText("noAppSelected")]))},_generateCreateGroupNavContainer:function e(){const t=`${this.getId()}-createGroupDialog-wrapper`;if(!this._controlMap.get(t)){this._controlMap.set(t,new I(t,{initialPage:`${this.getId()}-createGroupDialog-mainPage`,pages:[this._generateCreateGroupMainPage(),this._generateCreateGroupAppsPage()]}))}return this._controlMap.get(t)},_generateCreateGroupMainPage:function e(){const t=`${this.getId()}-createGroupDialog-mainPage`;if(!this._controlMap.get(t)){this._controlMap.set(`${t}-form-groupName-input`,new d({id:`${t}-form-groupName-input`,width:"13.75rem",required:true,liveChange:this._validateGroupName.bind(this)}));this._controlMap.set(t,new P({id:t,showHeader:false,enableScrolling:false,backgroundDesign:"List",content:[new T({id:`${t}-headerContainer`,items:[new B({id:`${t}-title`,text:this._i18nBundle.getText("settings")}),new y({id:`${t}-description`,text:this._i18nBundle.getText("settingsDescription")})]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),new V(`${t}-form`,{layout:de.SimpleFormLayout.ResponsiveGridLayout,labelSpanS:4,labelSpanM:4,content:[new g({id:`${t}-form-groupName-label`,text:this._i18nBundle.getText("groupNameLbl")}).addStyleClass("sapUiTinyMarginTop"),this._controlMap.get(`${t}-form-groupName-input`),new g({id:`${t}-form-groupColor-label`,text:this._i18nBundle.getText("groupColorLbl")}).addStyleClass("sapUiTinyMarginTop"),new i(`${t}-form-groupColor-pallet`,{colors:ve().map(e=>e.value),colorSelect:this._onColorSelect.bind(this)}).addStyleClass("adjustSelectedColorPalette")]}).addStyleClass("sapUiMediumMarginTop")]}))}return this._controlMap.get(t)},_generateCreateGroupAppsPage:function e(){const t=`${this.getId()}-createGroupDialog-appsPage`;if(!this._controlMap.get(t)){this._controlMap.set(`${t}-search`,new M({id:`${t}-search`,liveChange:this._onCreateAppSearch.bind(this)}).addStyleClass("sapUiTinyMarginTopBottom"));this._controlMap.set(`${t}-errorMessageStrip`,new m(`${t}-errorMessageStrip`,{id:`${t}-errorMessageStrip`,type:F.Error,showIcon:true,text:this._i18nBundle.getText("selectionErrorMessage"),visible:false}));this._controlMap.set(`${t}-headerContainer-count`,new y({id:`${t}-headerContainer-count`}));this._controlMap.set(t,new P(t,{showHeader:false,backgroundDesign:"List",enableScrolling:false,content:[new T(`${t}-headerContainer`,{items:[new l(`${t}-headerContainer-titleCount`,{id:`${t}-headerContainer-titleCount`,items:[new B({id:`${t}-headerContainer-title`,text:this._i18nBundle.getText("selectedAppsTitle")}).addStyleClass("sapUiTinyMarginEnd"),this._controlMap.get(`${t}-headerContainer-count`)]}),new y({id:`${t}-description`,text:this._i18nBundle.getText("appsSelectionDescription")}).addStyleClass("sapUiTinyMarginBottom"),this._controlMap.get(`${t}-search`),this._controlMap.get(`${t}-errorMessageStrip`)]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),this._generateAppsScrollContainer(),this._generateCreateGroupErrorMsg()]}))}return this._controlMap.get(t)},_generateCreateGroupErrorMsg:function e(){const t=`${this.getId()}-createGroupDialog-appsPage-noFilterApps`;if(!this._controlMap.get(t)){this._controlMap.set(t,new p({id:t,illustrationSize:c.Base,title:this._i18nBundle.getText("noSearchedAppTitle"),description:this._i18nBundle.getText("noSearchedAppDes"),visible:false}).addStyleClass("sapUiLargeMarginTop"))}return this._controlMap.get(t)},_onColorSelect:function e(t){this._selectedGroupColor=this._getLegendColor(t.getParameter("value")).key},_getLegendColor:function e(t){return ve().find(e=>e.value===t)||Ie()},_setNoAppsSelectedError:function e(t){const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-errorMessageStrip`);n.setVisible(t)},_validateGroupName:function e(){const t=this._controlMap.get(`${this.getId()}-createGroupDialog-mainPage-form-groupName-input`);const n=t.getValue().trim();t.setValueState(n?"None":"Error");t.setValueStateText(n?"":this._i18nBundle.getText("invalidGroupName"));return n?true:false},_highlightSelectedApps:function e(){const t=this._selectedApps||[];const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`);const o=n.getItems()||[];o.forEach(e=>{e.toggleStyleClass("sapCuxHighlightApp",t.some(t=>Ce(t.getUrl())===e.getUrl()))})},_onCreateAppSearch:function e(t){const n=this._controlMap.get(`${this.getId()}-createGroupDialog-appsPage-scrollContainer-apps`),o=t.getSource().getValue(),i=n.getItems()||[],s=new RegExp(o,"i");i.forEach(e=>{e.setVisible(s.test(e.getHeader()))});const r=i.filter(e=>e.getVisible());const a=r.length>0;this._generateAppsScrollContainer()?.setVisible(a);this._generateCreateGroupErrorMsg()?.setVisible(!a)},_onPressGroupCreate:function t(){try{const t=this;const n=t._controlMap.get(`${t.getId()}-createGroupDialog-mainPage-form-groupName-input`);const o=function(){if(t._validateGroupName()){const o=function(){if(t._selectedApps?.length){t._setBusy(true);const o=ce(function(){return le(function(){return Promise.resolve(t._createGroup({selectedApps:t._selectedApps,groupName:n.getValue(),groupColor:t._getGroupColor()})).then(function(){return Promise.resolve(t.refresh()).then(function(){_.show(t._i18nBundle.getText("newGroupCreated"),{of:t._controlMap.get(`${t.getId()}-createGroupDialog`),offset:"0 80"});const e=t.getAggregation("groups")||[];void t._showGroupDetailDialog(e[0]?.getGroupId())})})},function(n){e.error(n);_.show(t._i18nBundle.getText("unableToCreateGroup"))})},function(e,n){t._setBusy(false);t._closeCreateGroupDialog();if(e)throw n;return n});if(o&&o.then)return o.then(function(){})}else{t._setNoAppsSelectedError(true)}}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_createGroup:function e(t){try{const e=this;const{selectedApps:n,groupName:o,groupColor:i}=t;return Promise.resolve(e.appManagerInstance.getSectionVisualizations()).then(function(t){const s=n.reduce((e,n)=>{const o=t.find(e=>e.url===n.getUrl());if(o){e.push(o)}return e},[]);const r=s[0].persConfig.sectionId;return Promise.resolve(e.appManagerInstance.addSection({sectionIndex:1,sectionProperties:{title:o||e._i18nBundle.getText("newGroup"),visible:true,visualizations:s.map(e=>e.visualization)}})).then(function(){const t=s.reduce((e,t)=>{if(t.visualization?.id){const n=(t.persConfig?.duplicateApps||[]).map(e=>e.visualization?.id);e=e.concat([t.visualization?.id],n)}return e},[]);return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:r,vizIds:t})).then(function(){return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(t){const n=t.find(e=>e.default);const o=t[n?1:0]?.id;return Promise.resolve(e._updateAppPersonalization(s.map(e=>({visualization:e,targetGroupId:o})))).then(function(){return Promise.resolve(e._updateGroupPersonalization(o,i)).then(function(){})})})})})})}catch(e){return Promise.reject(e)}},_getGroupColor:function e(){const t=Ie().key;const n=this._selectedApps[0];const o=this._selectedApps.some(e=>e.getBgColor()!==n.getBgColor());return this._selectedGroupColor||(o?t:n.getBgColor())},_openColorPopover:function e(t){const n=`${this.getId()}-colorPopover`,o=ve().map(e=>e.value);const i=t.getSource();this._currentItem=i.getParent();let r=this._controlMap.get(n);if(!r){r=new s(n,{id:n,colors:o,showDefaultColorButton:false,showMoreColorsButton:false,showRecentColorsSection:false,colorSelect:e=>{ge._closeActionsPopover();const t=e.getParameter("value");void this._handleColorSelect(this._currentItem,t)}}).addStyleClass("sapContrastPlus");r._oPopover.setPlacement(pe.HorizontalPreferredRight);this._controlMap.set(n,r)}r.openBy(t.getParameter("listItem"))},_handleColorSelect:function e(t,n){try{const o=this;function i(){o.oEventBus.publish("appsChannel","favAppColorChanged",{item:t,color:n})}const s=o._getLegendColor(n).key;t.setProperty("bgColor",s,true);const r=t.isA("sap.cux.home.Group")?t.getGroupId():null;const a=!r&&t.getParent()?.isA("sap.cux.home.Group");if(a){o._refreshGroupDetailDialog(t,false)}else{o._applyUngroupedTileColor(t,n);o.oEventBus.publish("appsChannel","favAppColorChanged",{item:t,color:n})}const l=function(){if(r){void o._updateGroupPersonalization(r,s);const e=o._controlMap.get(`${o.getId()}-detailDialog-toolbar-color`);e?.setColor(n)}else{const e=t;const n=a?e.getParent().getGroupId():undefined;return Promise.resolve(o.appManagerInstance.getVisualization(e.getUrl(),n)).then(function(e){if(e){void o._updateAppPersonalization([{visualization:e,color:s}])}})}}();return Promise.resolve(l&&l.then?l.then(i):i(l))}catch(p){return Promise.reject(p)}},_getAllowedMoveGroups:function e(t){let n=this.getAggregation("groups")||[];if(t){n=n.filter(e=>e.getGroupId()!==t)}return n},_setBusy:function e(t){[this._generateGroupDetailDialog(),this._generateCreateGroupDialog(),this._generateAddFromInsightsDialog()].forEach(e=>{e.setBusy(t)});he.prototype.setBusy.call(this,t)},_openMoveToGroupPopover:function e(t,n){const o=`${this.getId()}-moveToGroupPopover`,i=t?.getSource(),s=i?.getParent(),r=n?.getGroupId();let a=this._controlMap.get(`${o}-list`),l=this._controlMap.get(o);if(!l){a=new h({id:`${o}-list`,itemPress:()=>ge._closeActionsPopover()});this._controlMap.set(`${o}-list`,a);l=new A({id:o,showHeader:false,placement:pe.HorizontalPreferredRight,content:[a]}).addStyleClass("sapContrastPlus");this._controlMap.set(o,l)}a.removeAllItems();this._getAllowedMoveGroups(r).forEach(e=>a.addItem(new G(Me(`${this.getId()}-moveTo-${s.getId()}`),{title:e.getTitle(),type:"Active",press:()=>{void this._handleMoveToGroup(s,r,e.getGroupId())}})));l.openBy(t.getParameter("listItem"))},_handleRemove:function t(n,o){const i=this;const s=o?.getApps()?.length===1;let r=this._i18nBundle.getText("removeAppMessage",[n.getTitle()]),a=this._i18nBundle.getText("remove"),l=this._i18nBundle.getText("remove"),p=f.Icon.QUESTION;if(s){r=this._i18nBundle.getText("removeFromMyHomeMessage",[n.getTitle()]);a=this._i18nBundle.getText("delete");l=this._i18nBundle.getText("delete");p=f.Icon.WARNING}f.show(r,{icon:p,title:a,actions:[l,f.Action.CANCEL],emphasizedAction:l,onClose:function(t){try{const r=function(){if(t===l){i._setBusy(true);const t=ce(function(){return le(function(){return Promise.resolve(i._removeApp(n,o)).then(function(){if(s){i._closeGroupDetailDialog()}else if(o){i._refreshGroupDetailDialog(n)}return Promise.resolve(i.getParent()._refreshAllPanels()).then(function(){_.show(i._i18nBundle.getText("appRemoved"))})})},function(t){e.error(t);_.show(i._i18nBundle.getText("unableToRemoveApp"))})},function(e,t){i._setBusy(false);if(e)throw t;return t});if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})},_removeApp:function e(t,n){try{const e=this;const o=n?.getApps()?.length===1,i=n?.getGroupId(),s=t.getUrl();return Promise.resolve(e.appManagerInstance.getVisualization(s,i)).then(function(t){const n=function(){if(o){return Promise.resolve(e._deleteGroup(i)).then(function(){})}else{let n=[t?.visualization?.id];if(!i){n=n.concat(t?.persConfig?.duplicateApps?.map(e=>e.visualization?.id))}const o=function(){if(t?.persConfig?.sectionId&&n.length>0){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig.sectionId,vizIds:n})).then(function(){void e._deletePersonalization({appId:s,oldAppId:t?.oldAppId,sectionId:t?.persConfig?.sectionId,isRecentlyAddedApp:t?.persConfig?.isDefaultSection})})}}();if(o&&o.then)return o.then(function(){})}}();if(n&&n.then)return n.then(function(){})})}catch(e){return Promise.reject(e)}},_handleMoveToGroup:function e(t,n,o){try{const e=this;const i=n?e._getGroup(n):undefined,s=i?.getApps()?.length===1;const r=function(){if(s){const i=e._i18nBundle.getText("moveAppMessage",[t.getTitle()]);const s=e._i18nBundle.getText("delete");f.show(i,{icon:f.Icon.WARNING,title:s,actions:[s,f.Action.CANCEL],emphasizedAction:s,onClose:i=>{if(i===s){void e._moveAppAndHandleGroupChanges(t,n,o)}}})}else{return Promise.resolve(e._moveAppAndHandleGroupChanges(t,n,o)).then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_moveAppAndHandleGroupChanges:function t(n,o,i){try{const t=this;const s=o?t._getGroup(o):null,r=i?t._getGroup(i):null,a=r?.getTitle(),l=s?.getApps()?.length===1;const p=ce(function(){return le(function(){t._setBusy(true);return Promise.resolve(t._moveAppToGroup(n,o,i)).then(function(){function e(){const e=a?t._i18nBundle.getText("appMoved",[a]):t._i18nBundle.getText("appUngrouped");_.show(e);return Promise.resolve(t.refresh()).then(function(){})}const i=function(){if(l){return Promise.resolve(t._deleteGroup(o)).then(function(){t._closeGroupDetailDialog()})}else if(o){t._refreshGroupDetailDialog(n)}}();return i&&i.then?i.then(e):e(i)})},function(t){e.error(t)})},function(e,n){t._setBusy(false);if(e)throw n;return n});return Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_refreshGroupDetailDialog:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;const o=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const i=o.getItems();const s=t.getParent();if(!s){return}const r=s.getApps();if(n){const e=r.findIndex(e=>e.getUrl()===t.getUrl());if(e>-1){r[e].destroy(true);i[e].destroy(true)}}else{r.forEach((e,n)=>{if(e.getUrl()===t.getUrl()){e.setProperty("bgColor",t.getBgColor(),true);i[n].setBackgroundColor(t.getBgColor())}})}},_moveAppToGroup:function e(t,n,o){try{const e=this;const i=t.getUrl();return Promise.resolve(Promise.all([e.appManagerInstance.getSectionVisualizations(n),e.appManagerInstance._getSections()])).then(function(t){let[s,r]=t;const a=s.find(e=>e.url===i),l=a?.persConfig?.visualizationIndex??-1,p=a?.persConfig?.sectionIndex;const c=!o;const u=!n;const d=r.findIndex(e=>!o?e.default:e.id===o);const g=function(){if(a){function t(){return Promise.resolve(e.appManagerInstance._getSections(true)).then(function(t){const n=t.find(e=>e.default);return Promise.resolve(e._updateAppPersonalization([{visualization:a,targetGroupId:o??n?.id,isTargetGroupDefault:c}])).then(function(){})})}const n=function(){if(c){return Promise.resolve(e._moveAppToDefaultGroup(a)).then(function(){})}else{function t(){return Promise.resolve(e.appManagerInstance.moveVisualization({sourceSectionIndex:p,sourceVisualizationIndex:l,targetSectionIndex:d,targetVisualizationIndex:-1})).then(function(){})}const n=function(){if(u){return Promise.resolve(e._removeDuplicateVisualizations(a)).then(function(){})}}();return n&&n.then?n.then(t):t(n)}}();return n&&n.then?n.then(t):t(n)}}();if(g&&g.then)return g.then(function(){})})}catch(e){return Promise.reject(e)}},_moveAppToDefaultGroup:function e(t){try{const e=this;return Promise.resolve(e._addVisualization(t)).then(function(){const n=function(){if(t.persConfig?.sectionId&&t.visualization?.id){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig?.sectionId,vizIds:[t.visualization?.id]})).then(function(){})}}();if(n&&n.then)return n.then(function(){})})}catch(e){return Promise.reject(e)}},_removeDuplicateVisualizations:function e(t){try{const e=this;const n=t?.persConfig?.duplicateApps?.map(e=>e.visualization?.id)||[];const o=function(){if(t.persConfig?.sectionId&&n.length>0){return Promise.resolve(e.appManagerInstance.removeVisualizations({sectionId:t.persConfig?.sectionId,vizIds:n})).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_onRenameGroup:function e(t){const n=t.getSource()?.getParent();void this._showGroupDetailDialog(n.getGroupId(),true)},_handleUngroupApps:function e(t){const n=this._i18nBundle.getText("ungroupAppsMessage",[t.title]),o=this._i18nBundle.getText("delete"),i=this._i18nBundle.getText("delete");f.show(n,{icon:f.Icon.WARNING,title:o,actions:[i,f.Action.CANCEL],emphasizedAction:i,onClose:e=>{if(e===i){void this._ungroupApps(t.id)}}})},_onDeleteGroup:function e(t){const n=this;const o=t.getSource()?.getParent(),i=this._i18nBundle.getText("deleteGroupMessage",[o.getTitle()]),s=this._i18nBundle.getText("delete"),r=this._i18nBundle.getText("delete"),a=this._i18nBundle.getText("moveApps");f.show(i,{icon:f.Icon.WARNING,title:s,actions:[r,this._i18nBundle.getText("moveApps"),f.Action.CANCEL],emphasizedAction:r,onClose:function(e){try{const t=function(){if(e===r){n._setBusy(true);return Promise.resolve(n._deleteGroup(o.getGroupId())).then(function(){_.show(n._i18nBundle.getText("groupDeleted"));void n.refresh();n._closeGroupDetailDialog();n._setBusy(false)})}else if(e===a){void n._ungroupApps(o.getGroupId())}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})},_ungroupApps:function t(n){try{const t=this;t._setBusy(true);const o=ce(function(){return le(function(){return Promise.resolve(t.appManagerInstance.getSectionVisualizations(n)).then(function(e){return Promise.resolve(t.appManagerInstance._getSections()).then(function(o){const i=o.find(e=>e.id===n);return Promise.resolve(Promise.all(e.map(e=>t._addVisualization(e)))).then(function(){return Promise.resolve(t.appManagerInstance._getSections(true)).then(function(o){const s=o.find(e=>e.default);return Promise.resolve(t._updateAppPersonalization(e.map(e=>({visualization:e,targetGroupId:s?.id,isTargetGroupDefault:true})))).then(function(){function o(){_.show(t._i18nBundle.getText("appsUngrouped")??"");return Promise.resolve(t.refresh()).then(function(){})}const s=function(){if(i?.preset){return Promise.resolve(t.appManagerInstance.removeVisualizations({sectionId:n,vizIds:e.map(e=>e.visualization?.id)})).then(function(){})}else{return Promise.resolve(t._deleteGroup(n)).then(function(){})}}();return s&&s.then?s.then(o):o(s)})})})})})},function(n){e.error(n);_.show(t._i18nBundle.getText("unableToUngroupApps")??"")})},function(e,n){t._setBusy(false);t._closeGroupDetailDialog();if(e)throw n;return n});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_showGroupDetailDialog:function e(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const e=this;const o=e._getGroup(t);if(!o){return Promise.resolve()}e._selectedGroupId=t;const i=e._generateGroupDetailDialog();const s=e._controlMap.get(`${e.getId()}-detailDialog-toolbar-color`);s.setColor(N.get({name:o.getBgColor()}));return Promise.resolve(e._setGroupDetailDialogApps(t)).then(function(){i.open();e._setGroupNameControl(o.getTitle(),n)})}catch(e){return Promise.reject(e)}},_setGroupDetailDialogApps:function e(t){try{const e=this;const n=e._getGroup(t);const o=function(){if(n){return Promise.resolve(e.appManagerInstance.getSectionVisualizations(t,false)).then(function(o){n.destroyAggregation("apps",true);o=o.map((t,o)=>({...t,menuItems:e._getAppActions(n,o,t)}));const i=e.generateApps(o);const s=e._controlMap.get(`${e.getId()}-detailDialog-apps`);e._setAggregation(n,i,"apps");s.destroyItems();e._setAggregation(s,n.getApps().map(t=>e.getParent()._getAppTile(t)));e._applyGroupedAppsPersonalization(t);e._dispatchAppsLoadedEvent(i)})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_applyGroupedAppsPersonalization:function e(t){const n=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const o=n?.getItems()||[];void this._applyTilesPersonalization(o,t,false)},_dispatchAppsLoadedEvent:function e(t){const n=this._controlMap.get(`${this.getId()}-detailDialog-apps`);const o=n?.getItems()||[];this.getParent().fireEvent("appsLoaded",{apps:t,tiles:o})},_generateGroupDetailDialog:function e(){const i=`${this.getId()}-detailDialog`;if(!this._controlMap.get(i)){this._controlMap.set(`${i}-toolbar-color`,new z({id:`${i}-toolbar-color`,src:"sap-icon://color-fill",size:"1.25rem"}).addStyleClass("sapUiTinyMarginEnd"));this._controlMap.set(`${i}-toolbar-title`,new B({id:`${i}-toolbar-title`,visible:true}));const e=new d({id:`${i}-toolbar-title-edit`,width:"13.75rem",visible:false});this._controlMap.set(`${i}-toolbar-title-edit`,e);e.onsapfocusleave=()=>{void this._onGroupEditName(e.getValue())};const s=new t({id:`${i}-apps`,layout:new n(`${i}-appsLayout`,{columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsContainerBorder sapCuxAppsDetailContainerPadding");this.addDragDropConfigTo(s,e=>this._onFavItemDrop(e,this._selectedGroupId));this._controlMap.set(`${i}-apps`,s);this._controlMap.set(`${i}-addAppsBtn`,new o(`${i}-addAppsBtn`,{text:this._i18nBundle.getText("addApps"),icon:"sap-icon://action",visible:xe(),press:()=>{const e=this._selectedGroupId;this._closeGroupDetailDialog();this._selectedGroupId=e;void this.navigateToAppFinder(e)}}));this._controlMap.set(i,new a(i,{content:this._controlMap.get(`${i}-apps`),contentWidth:"60.75rem",endButton:new o({id:`${i}-groupDetailCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeGroupDetailDialog.bind(this)}),escapeHandler:this._closeGroupDetailDialog.bind(this),customHeader:new x(`${this.getId()}-toolbar`,{content:[this._controlMap.get(`${i}-toolbar-color`),this._controlMap.get(`${i}-toolbar-title`),this._controlMap.get(`${i}-toolbar-title-edit`),new D({id:`${this.getId()}-toolbarSpacer`}),this._controlMap.get(`${i}-addAppsBtn`),new o({id:"overflowBtn",icon:"sap-icon://overflow",type:"Transparent",press:e=>{const t=e.getSource();const n=this._selectedGroupId?this._getGroup(this._selectedGroupId):null;const o=n?.getAggregation("menuItems");const i=ge.get(o);i.openBy(t)}})]})}).addStyleClass("sapCuxGroupDetailDialog"))}return this._controlMap.get(i)},_closeGroupDetailDialog:function e(){const t=this._controlMap.get(`${this.getId()}-detailDialog`);const n=this._getGroup(this._selectedGroupId);n?.destroyApps();this._selectedGroupId=undefined;t?.close()},_onGroupEditName:function e(t){try{const n=this;function o(){n._setGroupNameControl(t,false);n._setBusy(false)}n._setBusy(true);const i=n._selectedGroupId,s=n._getGroup(i),r=s?.getTitle();const a=function(){if(t&&t!==r){return Promise.resolve(n._renameGroup(i,t)).then(function(){s?.setProperty("title",t,true);void n.refresh();_.show(n._i18nBundle.getText("groupNameChanged")||"")})}}();return Promise.resolve(a&&a.then?a.then(o):o(a))}catch(l){return Promise.reject(l)}},_renameGroup:function e(t,n){try{return Promise.resolve(j.getServiceAsync("Pages")).then(function(e){const o=e.getPageIndex(Ae),i=e.getModel().getProperty(`/pages/${o}/sections/`),s=i.findIndex(e=>e.id===t);const r=function(){if(s>-1){return Promise.resolve(e.renameSection(o,s,n)).then(function(){})}}();if(r&&r.then)return r.then(function(){})})}catch(e){return Promise.reject(e)}},_setGroupNameControl:function e(t,n){const o=this._controlMap.get(`${this.getId()}-detailDialog`);const i=this._controlMap.get(`${this.getId()}-detailDialog-toolbar-title`);const s=this._controlMap.get(`${this.getId()}-detailDialog-toolbar-title-edit`);s.setValue(t);i.setText(t);s?.setVisible(n);i?.setVisible(!n);if(n){o.setInitialFocus(s)}},_generateAddFromInsightsDialog:function e(){const t=`${this.getId()}-addFromInsightsDialog`;const n=()=>{const e=this._getSelectedInsights();this._controlMap.get(`${t}-addBtn`).setEnabled(e.length>0)};if(!this._controlMap.get(t)){const e=(e,t)=>{const n=new o(e,{icon:"sap-icon://action",text:this._i18nBundle.getText("appFinderBtn"),press:()=>{this._closeAddFromInsightsDialog();void this.navigateToAppFinder()},visible:xe(),type:t||se.Default});ye(n,"press","appsAppFinder");return n};this._controlMap.set(`${t}-list`,new h({id:`${t}-list`,mode:"MultiSelect",selectionChange:n}));this._controlMap.set(`${t}-addBtn`,new o({id:`${t}-addBtn`,text:this._i18nBundle.getText("addFromInsightsDialogBtn"),type:"Emphasized",press:()=>{void this._addFromInsights()},enabled:false}));const i=this._controlMap.get(`${t}-addBtn`);ye(i,"press","addStaticTiles");this._controlMap.set(`${t}-errorMessage`,new p({id:`${t}-errorMessage`,illustrationSize:c.Base,title:this._i18nBundle.getText("noAppsTitle"),description:this._i18nBundle.getText("noDataMsgInsightTiles"),visible:true}).addStyleClass("sapUiLargeMarginTop"));this._controlMap.set(t,new a(t,{title:this._i18nBundle.getText("addFromInsights"),content:[new g({id:`${t}-label`,text:this._i18nBundle.getText("addFromInsightsDialogLabel"),wrapping:true}).addStyleClass("sapMTitleAlign sapUiTinyMarginTopBottom sapUiSmallMarginBeginEnd"),new l({id:`${t}-textContainer`,justifyContent:"SpaceBetween",alignItems:"Center",items:[new B({id:`${t}-text`,text:this._i18nBundle.getText("addFromInsightsDialogTitle")}),e(`${t}-addAppsBtn`,se.Transparent)]}).addStyleClass("sapUiTinyMarginTop dialogHeader sapUiSmallMarginBeginEnd"),this._controlMap.get(`${t}-list`),this._controlMap.get(`${t}-errorMessage`)],contentWidth:"42.75rem",contentHeight:"32.5rem",endButton:new o({id:`${t}-addFromInsightsCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeAddFromInsightsDialog.bind(this)}),escapeHandler:this._closeAddFromInsightsDialog.bind(this),buttons:[this._controlMap.get(`${t}-addBtn`),new o({id:`${t}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeAddFromInsightsDialog.bind(this)})]}).addStyleClass("sapContrastPlus sapCuxAddFromInsightsDialog"))}n();return this._controlMap.get(t)},_handleAddFromInsights:function e(){try{const e=this;return Promise.resolve(e._getInsightTilesToAdd()).then(function(t){const n=e._generateAddFromInsightsDialog();e._controlMap.get(`${e.getId()}-addFromInsightsDialog-errorMessage`)?.setVisible(t.length===0);e._generateInsightListItems(t);n.open()})}catch(e){return Promise.reject(e)}},_generateInsightListItems:function e(t){const n=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);if(t.length){n.destroyItems();const e=t.map((e,t)=>{const n=typeof e.BGColor==="object"&&"key"in e.BGColor?e.BGColor.key:e.BGColor;return new r({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}`,content:[new l({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content`,alignItems:"Center",items:[new z({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content-icon`,src:e.icon,backgroundColor:this._getLegendColor(n||"").value,color:"white",width:"2.25rem",height:"2.25rem",size:"1.25rem"}).addStyleClass("sapUiRoundedBorder sapUiTinyMargin"),new v({id:`${this.getId()}-addFromInsightsDialog-listItem-${t}-content-identifier`,title:e.title,text:e.subtitle,tooltip:e.title}).addStyleClass("sapUiTinyMargin")]})]}).addStyleClass("sapUiContentPadding").data("vizId",e.visualization?.vizId)});this._setAggregation(n,e)}n?.setVisible(t.length!==0)},_getInsightTilesToAdd:function e(){try{const e=this;return Promise.resolve(Promise.all([e.appManagerInstance.fetchInsightApps(true,e._i18nBundle.getText("insights")),e.appManagerInstance.fetchFavVizs(false,true)])).then(function(t){let[n,o]=t;const i=n.reduce((e,t)=>{if(!t.isCount&&!t.isSmartBusinessTile){const n=o.findIndex(e=>e.visualization?.vizId===t.visualization?.vizId||e.appId===t.appId);if(n===-1){e.push(t)}}return e},[]);return e.appManagerInstance._filterDuplicateVizs(i,false)})}catch(e){return Promise.reject(e)}},_closeAddFromInsightsDialog:function e(){const t=this._generateAddFromInsightsDialog();const n=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);n.removeSelections();t?.close()},_getSelectedInsights:function e(){const t=this._controlMap.get(`${this.getId()}-addFromInsightsDialog-list`);return t.getSelectedItems()||[]},_addFromInsights:function e(){try{const t=this;function n(){t._closeAddFromInsightsDialog();_.show(t._i18nBundle.getText(o.length===1?"addFromInsightTileSuccess":"addFromInsightTilesSuccess",[o.length]));return Promise.resolve(t.getParent()._refreshAllPanels()).then(function(){t._setBusy(false)})}t._setBusy(true);const o=t._getSelectedInsights();const i=re(o,function(e){return Promise.resolve(t.appManagerInstance.addVisualization(e.data("vizId"))).then(function(){})});return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(s){return Promise.reject(s)}},_updateAppPersonalization:function e(t){try{const e=this;return Promise.resolve(e._getAppPersonalization()).then(function(n){for(const o of t){const{visualization:t}=o;const{persConfig:i}=t;const s=i?.sectionId;const r=o.targetGroupId??s;if(s!==r){e._updateMoveAppPersonalization(n,o)}else{e._updateAppColorPersonalization(n,o)}}return Promise.resolve(e.setFavAppsPersonalization(n)).then(function(){})})}catch(e){return Promise.reject(e)}},_updateMoveAppPersonalization:function e(t,n){const{visualization:o,isTargetGroupDefault:i}=n;const{appId:s,oldAppId:r,persConfig:a}=o;const l=a?.sectionId;const p=a?.isDefaultSection;const c=a?.duplicateApps||[];const u=n.targetGroupId??l;const d=this._getPersonalizationIndex(t,{appId:s,oldAppId:r,sectionId:l,isRecentlyAddedApp:p});if(d>-1){const e={...t[d],sectionId:u,isRecentlyAddedApp:i,isSection:false};if(c.length===0){t.splice(d,1)}const n=this._getPersonalizationIndex(t,{appId:s,oldAppId:r,sectionId:u,isRecentlyAddedApp:i});if(n>-1){t.splice(n,1)}t.push(e)}},_updateGroupPersonalization:function e(t,n){try{const e=this;return Promise.resolve(e._getAppPersonalization()).then(function(o){const i=e._getPersonalizationIndex(o,{isSection:true,sectionId:t});const s={BGColor:n,isSection:true,sectionId:t,isRecentlyAddedApp:false};if(i>-1){o[i]=s}else{o.push(s)}return Promise.resolve(e.setFavAppsPersonalization(o)).then(function(){})})}catch(e){return Promise.reject(e)}},_getPersonalizationIndex:function e(t,n){const{appId:o,oldAppId:i,sectionId:s,isSection:r,isRecentlyAddedApp:a}=n;return t.findIndex(e=>{if(r){return e.sectionId===s&&e.isSection}else{return a?(e.appId===o||e.appId===i)&&e.isRecentlyAddedApp:(e.appId===o||e.appId===i)&&e.sectionId===s}})},_addVisualization:function e(t,n){if(t.visualization){return t.visualization.isBookmark?this.appManagerInstance.addBookMark(t.visualization):this.appManagerInstance.addVisualization(t.visualization.vizId,n)}return Promise.reject(new Error("No visualization provided to add"))},_deleteGroup:function e(t){try{const e=this;return Promise.resolve(j.getServiceAsync("Pages")).then(function(n){const o=n.getPageIndex(Ae),i=n.getModel().getProperty(`/pages/${o}/sections/`),s=i.findIndex(e=>e.id===t);const r=function(){if(s>-1){return Promise.resolve(n.deleteSection(o,s)).then(function(){void e._deletePersonalization({sectionId:t,isSection:true})})}}();if(r&&r.then)return r.then(function(){})})}catch(e){return Promise.reject(e)}},_deletePersonalization:function e(t){try{const e=this;const{isSection:n,sectionId:o}=t;return Promise.resolve(e._getAppPersonalization()).then(function(i){if(!n){const n=e._getPersonalizationIndex(i,t);if(n>-1){i.splice(n,1)}}else{i=i.filter(e=>e.sectionId!==o)}void e.setFavAppsPersonalization(i)})}catch(e){return Promise.reject(e)}},_handleGroupPress:function e(t){const n=t.getParameter("groupId");if(n){void this._showGroupDetailDialog(n)}},_handleKeyboardMoveApp:function e(t,n){try{const e=this;const o=w.closestTo(t.target.firstElementChild);const i=o.getParent();const s=function(){if(t.metaKey||t.ctrlKey){if(t.key==="x"&&!o.data("groupId")&&!e._cutApp&&!n){o.$().css("opacity",.6);o._oMoreIcon.setEnabled(false);e._cutApp=o}const s=function(){if(t.key==="v"&&e._cutApp&&!n){const t=new $("keyboardDragDropEvent",i,{draggedControl:e._cutApp,droppedControl:o,dropPosition:ue.RelativeDropPosition.On});return Promise.resolve(e._onFavItemDrop(t)).then(function(){e._cutApp=undefined})}}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_resetCutElement:function e(t){const n=this._generateAppsWrapper().getId();if(!t.target.id.includes(n)){this._cutApp?.$().css("opacity","");this._cutApp=undefined}},generateIllustratedMessage:function e(){const t=he.prototype.generateIllustratedMessage.call(this);t.setDescription(this._i18nBundle.getText("noFavAppsDescription"));t.setIllustrationSize(c.Small);t.setIllustrationType(u.AddingColumns);t.addAdditionalContent(new o(`${this.getId()}-errorMessage-addApps`,{text:this._i18nBundle.getText("addApps"),tooltip:this._i18nBundle.getText("addAppsTooltip"),icon:"sap-icon://action",visible:xe(),press:()=>{void this.navigateToAppFinder()},type:"Emphasized"}));return t}});we.favouritesMenuItems=De;return we});
|
|
97
112
|
/*!
|
|
98
113
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
99
114
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -109,6 +124,11 @@ sap.ui.predefine("sap/cux/home/Group", ["./BaseApp"],function(e){"use strict";fu
|
|
|
109
124
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
110
125
|
*/
|
|
111
126
|
sap.ui.predefine("sap/cux/home/IToDoPanel", [],function(){"use strict";return IToDoPanel});
|
|
127
|
+
/*!
|
|
128
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
129
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
130
|
+
*/
|
|
131
|
+
sap.ui.predefine("sap/cux/home/InsightsAdditionPanel", ["sap/m/Button","sap/m/library","sap/m/Text","./BaseSettingsPanel","./utils/Constants"],function(t,n,e,s,i){"use strict";function o(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const d=n["ButtonType"];const a=o(s);const r=i["CONTENT_ADDITION_PANEL_TYPES"];const u=a.extend("sap.cux.home.InsightsAdditionPanel",{init:function n(){a.prototype.init.call(this);this.setProperty("key",r.AI_INSIGHTS_CARDS);this.setProperty("title",this._i18nBundle.getText("insightsCards"));this.addCardsButton=new t(`${this.getId()}-add-cards-btn`,{text:this._i18nBundle.getText("addFromInsightsDialogBtn"),type:d.Emphasized,press:this.onPressAddCards.bind(this)});this.addActionButton(this.addCardsButton);this._setupContent();this.attachEvent("onDialogClose",this.onDilaogClose.bind(this))},_setupContent:function t(){const n=new e(`${this.getId()}-dummy-text`,{text:this._i18nBundle.getText("insightsCards")});this.addAggregation("content",n)},isSupported:function t(){try{return Promise.resolve(true)}catch(t){return Promise.reject(t)}},onPressAddCards:function t(){},onDilaogClose:function t(){}});return u});
|
|
112
132
|
/*!
|
|
113
133
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
114
134
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -118,7 +138,12 @@ sap.ui.predefine("sap/cux/home/InsightsCardsSettingsPanel", ["sap/insights/Manag
|
|
|
118
138
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
119
139
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
120
140
|
*/
|
|
121
|
-
sap.ui.predefine("sap/cux/home/InsightsContainer", ["./BaseContainer","./CardsPanel","./ErrorPanel","./TilesPanel","./utils/Device","./utils/InsightsUtils"],function(t,e,n,i,s,o){"use strict";function
|
|
141
|
+
sap.ui.predefine("sap/cux/home/InsightsContainer", ["./BaseContainer","./CardsPanel","./ErrorPanel","./InsightsContainerGenericPlaceholder","./TilesPanel","./utils/Device","./utils/InsightsUtils"],function(t,e,n,i,s,o,a){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const l=d(t);const h=d(e);const r=e["cardsContainerActionButtons"];const c=e["cardsContainerMenuItems"];const u=d(n);const g=i["getInsightsPlaceholder"];const f=d(s);const m=s["tilesContainerActionButtons"];const _=s["tilesContainerMenuItems"];const p=o["DeviceType"];const C=a["sortMenuItems"];const P="sap.cux.home.TilesPanel";const H="sap.cux.home.CardsPanel";const E=[_.REFRESH,c.REFRESH,_.ADD_APPS,_.EDIT_TILES,c.EDIT_CARDS,c.AI_INSIGHT_CARD,_.SHOW_MORE,c.SHOW_MORE,"settings"];const I=l.extend("sap.cux.home.InsightsContainer",{renderer:{...l.renderer,apiVersion:2},constructor:function t(e,n){l.prototype.constructor.call(this,e,n);this._isInitialRender=true},init:function t(){l.prototype.init.call(this);this.setProperty("title",this._i18nBundle?.getText("insights"));this.setProperty("enableSettings",true);this.setProperty("orientation","Vertical");this.panelLoaded={[P]:{loaded:undefined,count:0},[H]:{loaded:undefined,count:0}};this.panelContext={};this.setTooltip(String(this._i18nBundle.getText("insights")));this.addCustomSetting("title",this._i18nBundle.getText("insightLayoutSectionTitle"));this.setTooltip(String(this._i18nBundle.getText("insightLayoutSectionTitle")))},load:function t(){if(this._isInitialRender){const t=this.getContent();t.forEach(t=>{this.panelContext[t.getMetadata().getName()]=t;this.addCommonMenuItems(t.getContainerMenuItems?.());this.addCommonActionButtons(t.getContainerActionButtons?.())});this._addContainerHeader();t.forEach(t=>{const e=t;e.handleHideHeader();e.attachHandleHidePanel(()=>this.handleHidePanel(e));e.attachHandleUnhidePanel(()=>this.unhidePanelIfHidden(e));void e.renderPanel()});this._isInitialRender=false}},handleHidePanel:function t(e){this.removeContent(e);const n=e.getMetadata().getName();this.handlePanelLoad(n,{loaded:false,count:0});const i=this._getLoadedPanelNames()||[];const s=this.getVisibleOrPendingPanels()||[];const o=i?.length;this._addContainerHeader();if(s.length===0){if(!this._errorPanel){this._errorPanel=new u(`${this.getId()}-errorPanel`,{messageTitle:this._i18nBundle.getText("noAppsTitle"),messageDescription:this._i18nBundle.getText("noInsightsMsg")});this._errorPanel.getData()}this.addAggregation("content",this._errorPanel)}else if(o===1){const t=this.getContent()[0];if(t&&!(t instanceof u)){t?.handleHideHeader()}}},_addContainerHeader:function t(){const e=this._getLoadedPanelNames();let n=[];let i=[];this.setProperty("title",this._i18nBundle?.getText("insights"));if(e.length===0||this.getContent()[0]instanceof u){n=[_.REFRESH,c.REFRESH,_.SHOW_MORE,c.SHOW_MORE];this._hideMenuItems(n);i=[m.SHOW_MORE,r.SHOW_MORE];this._hideActionButtons(i)}else if(e.length===1){const t=e[0];this.setProperty("title",`${this._i18nBundle?.getText("insights")} (${this.panelLoaded[t].count||0})`);if(this.panelContext[e[0]]instanceof f){n=[c.REFRESH,c.SHOW_MORE];i=[r.SHOW_MORE]}if(this.panelContext[e[0]]instanceof h){n=[_.REFRESH,_.SHOW_MORE];i=[m.SHOW_MORE]}this._hideMenuItems(n);this._hideActionButtons(i)}},_removeContainerHeader:function t(){this.setProperty("title","");this.getAggregation("menuItems")?.forEach(t=>this.toggleMenuListItem(t,false));this.getAggregation("actionButtons")?.forEach(t=>this.toggleActionButton(t,false));const e=this._getLoadedPanelNames();e.forEach(t=>{this.panelContext[t]?.handleAddHeader?.()})},_hideMenuItems:function t(e){const n=this.getAggregation("menuItems");n?.forEach(t=>{const n=e.some(e=>t.getId().includes(e));this.toggleMenuListItem(t,!n)})},_hideActionButtons:function t(e){const n=this.getAggregation("actionButtons");n?.forEach(t=>{const n=e.some(e=>t.getId().includes(e));this.toggleActionButton(t,!n)})},updatePanelsItemCount:function t(e,n){this.panelLoaded[n].count=e;const i=this._getLoadedPanelNames();if(i.length===1){this.setProperty("title",`${this._i18nBundle?.getText("insights")} (${e||0})`)}},unhidePanelIfHidden:function t(e){const n=this._getLayout();const i=n._getCurrentExpandedElementName();if(this._errorPanel){this.removeContent(this._errorPanel)}const s=(t,s)=>{const o=this._getPanelContentWrapper(e);if(!i||i===e.getProperty("fullScreenName")){if(this.panelLoaded[t].loaded===false){s();if(o.hasStyleClass("sapCuxHidden")){o.removeStyleClass("sapCuxHidden")}}this.handlePanelLoad(t,{loaded:true,count:this.panelLoaded[t].count})}else{const e=()=>{s();if(o.hasStyleClass("sapCuxHidden")){o.removeStyleClass("sapCuxHidden")}n.detachOnCollapse(e)};this.handlePanelLoad(t,{loaded:true,count:this.panelLoaded[t].count});n.attachOnCollapse(e)}};if(e instanceof f&&!this.panelLoaded[P].loaded){s(P,()=>this.insertContent(this.panelContext[P],0))}if(e instanceof h&&!this.panelLoaded[H].loaded){s(H,()=>this.addContent(this.panelContext[H]))}},_updateHeaderElements:function t(e){const n=this._getLoadedPanelNames();if(n.length>1){this._removeContainerHeader()}else{this._addContainerHeader();e.handleHideHeader()}},adjustLayout:function t(){if(this.getDeviceType()===p.Mobile){this.toggleActionButtons(false)}else{const t=this._getLoadedPanelNames();if(t.length<2){this.getAggregation("actionButtons")?.forEach(t=>{if(t.getId().includes(m.ADD_TILES)){this.toggleActionButton(t,true)}})}}this.getContent().forEach(t=>t._adjustLayout?.())},addCommonMenuItems:function t(e){e.forEach(t=>this.addAggregation("menuItems",t));this._sortMenuItems(E)},addCommonActionButtons:function t(e){e.forEach(t=>this.addAggregation("actionButtons",t))},handlePanelLoad:function t(e,n){if(this.panelLoaded[e].loaded!==n.loaded){this.panelLoaded[e]=n;this._updateHeaderElements(this.panelContext[e])}this.adjustLayout()},updateActionButton:function t(e,n,i){if(e?.getVisible()!==n||e?.getText()!==i){this.toggleActionButton(e,n);e?.setText(i);this._updateContainerHeader(this)}},updateMenuItem:function t(e,n,i){if(e?.getVisible()!==n||e?.getTitle()!==i){this.toggleMenuListItem(e,n);e?.setTitle(i);this._updateContainerHeader(this)}},_getLoadedPanelNames:function t(){return Object.keys(this.panelLoaded).filter(t=>this.panelLoaded[t].loaded)},getVisibleOrPendingPanels:function t(){return Object.keys(this.panelLoaded).filter(t=>this.panelLoaded[t].loaded!==false)},_sortMenuItems:function t(e){const n=this.getAggregation("menuItems");let i=C(e,n);this.removeAllAggregation("menuItems");i?.forEach(t=>this.addAggregation("menuItems",t))},getGenericPlaceholderContent:function t(){return g()}});return I});
|
|
142
|
+
/*!
|
|
143
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
144
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
145
|
+
*/
|
|
146
|
+
sap.ui.predefine("sap/cux/home/InsightsContainerGenericPlaceholder", [],function(){"use strict";function t(){return`\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM" style="width: 225px;"></div>\n <div class='plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plContent plResponsivePadding' style="background-color:transparent">\n <div class="pInsightsTilesContainer">\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plOVPCard pInsightsTiles" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCardContainer">\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeS" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeM" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion3 OVPContentCard6 plSmallestVisibleSizeM" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeM" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeL" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeL" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeXL" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plOVPCard plOVPCardVersion4 OVPContentCard5 plSmallestVisibleSizeXL" style="background-color:white">\n <div class="plOVPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 100px;"></div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignStart plVerticalAlignTop">\n <div class="plAvatar sapMGTLoadingShimmer plAvatarSizeM plAvatarShapeSquare plOVPCardHeaderAvatar" style="width: 120px; height: 40px; background-size: 900px 900px;"></div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignEnd plVerticalAlignTop plVerticalRepeater plOVPCardHeaderText">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 50px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plVerticalRepeaterItem" style="width: 30px;"></div>\n </div>\n </div>\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plOVPCardHeaderText" style="width: 80px;"></div>\n </div>\n </div>\n <div class="plOVPCardContent">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop">\n <div class="plBarChart">\n <div style="vertical-align: inherit;">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plOVPCardContentChart plChartHorMeasure plChartVertMeasure plHorizontalBarChart">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 160px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 120px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plVerticalRepeaterItem" style="width: 90px;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n `}var e={__esModule:true};e.getInsightsPlaceholder=t;return e});
|
|
122
147
|
/*!
|
|
123
148
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
124
149
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -128,12 +153,12 @@ sap.ui.predefine("sap/cux/home/InsightsTilesSettingsPanel", ["sap/base/Log","sap
|
|
|
128
153
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
129
154
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
130
155
|
*/
|
|
131
|
-
sap.ui.predefine("sap/cux/home/KeyUserLayoutSettingsPanel", ["sap/m/Column","sap/m/ColumnListItem","sap/m/HBox","sap/m/ObjectIdentifier","sap/m/Table","sap/m/ToggleButton","sap/ui/core/CustomData","sap/ui/core/Element","sap/ui/core/Icon","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Constants","./utils/DragDropUtils"],function(e,
|
|
156
|
+
sap.ui.predefine("sap/cux/home/KeyUserLayoutSettingsPanel", ["sap/m/Column","sap/m/ColumnListItem","sap/m/HBox","sap/m/ObjectIdentifier","sap/m/Table","sap/m/ToggleButton","sap/ui/core/CustomData","sap/ui/core/Element","sap/ui/core/Icon","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Constants","./utils/DataFormatUtils","./utils/DragDropUtils"],function(t,e,n,s,a,i,o,l,c,r,d,g,u,m){"use strict";function h(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const p=h(r);const y=d["CHANGE_TYPES"];const I=g["KEYUSER_SETTINGS_PANELS_KEYS"];const C=u["recycleId"];const S=m["focusDraggedItem"];const f=p.extend("sap.cux.home.KeyUserLayoutSettingsPanel",{metadata:{library:"sap.cux.home"},init:function t(){p.prototype.init.call(this);this.setProperty("key",I.LAYOUT);this.setProperty("title",this._i18nBundle.getText("editModeTitle"));this.addAggregation("content",this.getContent());this.attachPanelNavigated(()=>{const t=this._getPanel();t.resetSections();void this.loadSections()})},getContent:function e(){if(!this.layoutTable){this.layoutTable=new a(this.getId()+"--idLayoutSettingsTable",{width:"calc(100% - 2rem)",items:[],columns:[new t(this.getId()+"--idSectionTitleColumn",{width:"100%"})]}).addStyleClass("layoutSettingsTable sapContrastPlus sapUiSmallMarginBegin");this.addDragDropConfigTo(this.layoutTable,t=>this.onDropLayoutSettings(t))}return this.layoutTable},loadSections:function t(){try{const t=this;const a=t._getPanel();return Promise.resolve(a._calculateSectionsState()).then(function(){t.orderedSections=a.getSections()||[];const l=t.getParent();t.layoutTable.removeAllItems();t.orderedSections.forEach((a,r)=>{t.layoutTable.addItem(new e(C(`${t.getId()}--layoutSettingsColumnListItem--${r}`),{type:t.getParent()?.hasDetailsPage?.(a.completeId)?"Navigation":"Inactive",cells:[new n(C(`${t.getId()}--layoutColumnListHBox--${r}`),{alignItems:"Center",items:[new c(C(`${t.getId()}--layoutColumnListItemIcon--${r}`),{src:"sap-icon://vertical-grip"}).addStyleClass("sapUiSmallMarginEnd"),new n(C(`${t.getId()}--layoutColumnListItemHBox--${r}`),{justifyContent:"SpaceBetween",alignItems:"Center",width:"100%",items:[new s(C(`${t.getId()}--layoutColumnListObjectIdentifier--${r}`),{title:a.title,text:a.text,tooltip:a.title}),new i(C(`${t.getId()}--layoutColumnListToggleButton--${r}`),{tooltip:a.visible?t._i18nBundle.getText("hideBtn"):t._i18nBundle.getText("showBtn"),icon:"sap-icon://show",type:"Emphasized",enabled:!a.blocked,press:e=>t.createShowHideChangeFile(e,a),pressed:!a.visible,ariaLabelledBy:["selectLabel"]}).addStyleClass("sapUiTinyMarginEnd sapUiTinyMarginTop")]}).addStyleClass("sapUiTinyMarginBegin")],width:"100%"})],press:()=>l?.navigateToPage?.(l.getDetailsPage(a.completeId)),customData:new o(C(`${t.getId()}--custom-data--${r}`),{key:"sectionObject",value:a})})).addStyleClass("insightsListItem insightsListMargin")})})}catch(t){return Promise.reject(t)}},onDropLayoutSettings:function t(e){const n=this._getPanel();const s=n.getId();const a=e.getParameter?.("draggedControl")||e.draggedControl;const i=a.getParent()?.indexOfItem(a);const o=e.getParameter?.("droppedControl")||e.droppedControl;const l=a.getParent()?.indexOfItem(o);if(i!==l){const t=this.orderedSections;const e=a.data("sectionObject");const c=o.data("sectionObject");const r=this._getActualIndex(e.completeId);const d=this._getActualIndex(c.completeId);this._rearrangeLayoutElements(r,d);t.splice(i,1);t.splice(l,0,e);n.setSections(t);this.addKeyUserChanges({selectorControl:n,changeSpecificData:{changeType:y.MOVE,content:{movedElements:[{id:e.completeId,sourceIndex:r,targetIndex:d}],source:{id:s,aggregation:"items"},target:{id:s,aggregation:"items"}}}});void this.loadSections()}S(this.layoutTable,l)},_getActualIndex:function t(e){const n=this._getPanel();this._allLayoutElements=this._allLayoutElements||[...n.getItems()];const s=n.getProperty("expanded");const a=n._getCurrentExpandedElement();if(s&&a){if(!this._allLayoutElements.some(t=>t.getId()===a.targetContainer.getId())){this._allLayoutElements.splice(n.indexOfItem(a.targetContainer),0,a.targetContainer)}}return this._allLayoutElements.findIndex(t=>t.getId()===e)},_rearrangeLayoutElements:function t(e,n){const s=this._allLayoutElements.splice(e,1)[0];this._allLayoutElements.splice(n,0,s)},createShowHideChangeFile:function t(e,n){const s=!e.getParameter("pressed");const a=this.getKeyUserChanges();const i=s?y.UNHIDE:y.HIDE;const o=a.find(t=>t.selectorControl.getId()===n.completeId);if(o){o.changeSpecificData.changeType=i}else{this.addKeyUserChanges({selectorControl:l.getElementById(n.completeId),changeSpecificData:{changeType:i}})}}});return f});
|
|
132
157
|
/*!
|
|
133
158
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
134
159
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
135
160
|
*/
|
|
136
|
-
sap.ui.predefine("sap/cux/home/KeyUserNewsPagesSettingsPanel", ["sap/m/List","sap/m/Page","sap/m/StandardListItem","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","./BaseSettingsPanel","./flexibility/Layout.flexibility","./KeyUserNewsSettingsPanel","./KeyUserPagesSettingsPanel","./NewsPanel","./PagePanel","./utils/Constants"],function(e,t,s,i,n,a,g,o,h,r,
|
|
161
|
+
sap.ui.predefine("sap/cux/home/KeyUserNewsPagesSettingsPanel", ["sap/m/List","sap/m/Page","sap/m/StandardListItem","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","./BaseSettingsPanel","./flexibility/Layout.flexibility","./KeyUserNewsSettingsPanel","./KeyUserPagesSettingsPanel","./NewsPanel","./PagePanel","./utils/Constants"],function(e,t,s,i,n,a,g,o,h,l,r,d,c){"use strict";function S(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function w(e,t){try{var s=e()}catch(e){return t(e)}if(s&&s.then){return s.then(void 0,t)}return s}const P=S(g);const p=o["CHANGE_TYPES"];const u=S(h);const f=S(l);const y=S(r);const I=S(d);const N=c["KEYUSER_SETTINGS_PANELS_KEYS"];const m=P.extend("sap.cux.home.KeyUserNewsPagesSettingsPanel",{metadata:{library:"sap.cux.home"},init:function e(){P.prototype.init.call(this);this.setProperty("key",N.NEWS_PAGES);this.setProperty("title",this._i18nBundle.getText("editNewsPages"));this._eventBus=a.getInstance();this._eventBus.subscribe("KeyUserChanges","addNewsPagesChanges",(e,t,s)=>{const{changes:i}=s;this.addNewsPagesChanges(i)},this);this.addAggregation("content",this.getContent());this.attachPanelNavigated(()=>this.loadSettings())},getContent:function e(){if(!this.wrapperVBox){this.wrapperVBox=new i(`${this.getId()}-wrapperVBox`)}return this.wrapperVBox},loadSettings:function e(){const t=this.getPanel();const s=n.getElementById(t);const i=s?.getParent();i.getContent()?.forEach(e=>{if(e instanceof y){this.newsPanel=e;this.wrapperVBox.addItem(this.getNewsSettingsList(e))}if(e instanceof I){this.pagePanel=e;this.wrapperVBox.addItem(this.getPageSettingsList(e))}})},newsVisibilityChangeHandler:function e(t){const s=t.getParameter("listItem");this.newsFeedVisibility=s?.getSelected();const i=this._getPanel();const n=i.getParent();const a=n.getParent();const g=this.getKeyUserChanges();const o=g.find(e=>e.changeSpecificData.changeType===p.NEWS_FEED_VISIBILITY);if(!this.newsFeedVisibility&&this.newsSettingsPanel){this.newsSettingsPanel.removeUrlMesageStrip()}if(!o){this.addKeyUserChanges({selectorControl:a,changeSpecificData:{changeType:p.NEWS_FEED_VISIBILITY,content:{isNewsFeedVisible:this.newsFeedVisibility}}})}else if(o.changeSpecificData.content.isNewsFeedVisible!==this.newsFeedVisibility){o.changeSpecificData.content.isNewsFeedVisible=this.newsFeedVisibility}},getNewsSettingsList:function t(i){const n=this._getPanel();if(!this.newsSettingsList){this.newsSettingsList=new e(`${this.getId()}-news-settings-list`,{selectionChange:this.newsVisibilityChangeHandler.bind(this),mode:"MultiSelect"});this.standardListItem=new s(`${this.getId()}-newsSettingsStandardListItem`,{selected:n._getContent()[0].getParent().getVisible(),press:this.navigateToNewsSettingsPage.bind(this),type:"Navigation",title:this._i18nBundle.getText("newsFeed")});this.newsSettingsList.addItem(this.standardListItem);this.newsSettingsList.setAssociation("panel",i)}else{if(this.newsFeedVisibility===undefined){this.standardListItem.setSelected(Boolean(n.getParent()?.getProperty("newsFeedVisibility"))&&Boolean(n.getProperty("newsAvailable")))}else{this.standardListItem.setSelected(this.newsFeedVisibility)}}return this.newsSettingsList},getPageSettingsList:function t(i){if(!this.pageSettingsList){this.pageSettingsList=new e(`${this.getId()}-page-settings-list`,{mode:"None",items:[new s(`${this.getId()}-pageSettingsList`,{selected:true,press:this.openPageSettingsDialog.bind(this),type:"Navigation",title:this._i18nBundle.getText("pageGroupHeader")})]});this.pageSettingsList.setAssociation("panel",i)}return this.pageSettingsList},onNavBack:function e(t){t?.back();if(!this.standardListItem.getSelected()){this.newsSettingsPanel?.removeUrlMesageStrip()}},navigateToNewsSettingsPage:function e(){const s=this.getParent()?.getNavContainer?.();if(!this.newsSettingsPage){this.newsSettingsPanel=new u(`${this.getId()}--news-settings-panel`);this.newsSettingsPanel.setAssociation("panel",this.newsPanel);this.newsSettingsPage=new t(`${this.getId()}-news-settings-page`,{title:this.newsSettingsPanel.getProperty("title"),showHeader:true,content:this.newsSettingsPanel.getAggregation("content"),backgroundDesign:"Transparent",showNavButton:true,navButtonPress:this.onNavBack.bind(this,s)})}s?.addPage(this.newsSettingsPage);s?.to(this.newsSettingsPage);this.newsSettingsPanel.firePanelNavigated()},openPageSettingsDialog:function e(){if(!this.pageSettingsPanel){this.pageSettingsPanel=new f(`${this.getId()}--pages-settings-panel`);this.pageSettingsPanel.setAssociation("panel",this.pagePanel);this.pageSettingsDialog=this.pageSettingsPanel.getAggregation("content")?.[0]}this.pageSettingsDialog?.open();this.pageSettingsPanel?.firePanelNavigated()},addNewsPagesChanges:function e(t){t.forEach(e=>{this.addKeyUserChanges(e)})},isNewsChangesValid:function e(){const t=this;return Promise.resolve(w(function(){return Promise.resolve(t.newsSettingsPanel?.isValidChanges(t.standardListItem.getSelected()))},function(){return true}))},onSaveClearChanges:function e(){this.newsFeedVisibility=undefined;this.newsSettingsPanel?.clearKeyUserChanges()},onCancelClearKeyUserChanges:function e(){const t=this._getPanel();this.newsFeedVisibility=undefined;this.standardListItem?.setSelected(t._getContent()[0].getParent().getVisible());this.newsSettingsPanel?.clearNewsPanelChanges()}});return m});
|
|
137
162
|
/*!
|
|
138
163
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
139
164
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -143,7 +168,7 @@ sap.ui.predefine("sap/cux/home/KeyUserNewsSettingsPanel", ["sap/m/Button","sap/m
|
|
|
143
168
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
144
169
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
145
170
|
*/
|
|
146
|
-
sap.ui.predefine("sap/cux/home/KeyUserPagesSettingsPanel", ["sap/m/Button","sap/m/ColorPalette","sap/m/Dialog","sap/m/FlexBox","sap/m/FlexItemData","sap/m/HBox","sap/m/Label","sap/m/List","sap/m/ScrollContainer","sap/m/SearchField","sap/m/StandardListItem","sap/m/Switch","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/theming/Parameters","sap/ui/model/Filter","sap/ui/model/FilterOperator","sap/ui/model/json/JSONModel","sap/ui/table/Column","sap/ui/table/TreeTable","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Constants","./utils/IconList","./utils/PageManager","./utils/PersonalisationUtils"],function(e,t,o,s,n,a,i,l,r,c,d,h,g,p,C,u,P,y,I,S,f,m,w,B,T,x,M,b,k){"use strict";function _(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const A=_(B);const L=T["CHANGE_TYPES"];const G=x["DEFAULT_BG_COLOR"];const $=x["END_USER_COLORS"];const v=x["FALLBACK_ICON"];const D=x["KEYUSER_SETTINGS_PANELS_KEYS"];const O=M["ICONS"];const E=_(b);const U=_(k);const z=A.extend("sap.cux.home.KeyUserPagesSettingsPanel",{constructor:function e(){A.prototype.constructor.apply(this,arguments);this.keyuserSpaceColorChanges=[];this.keyuserPageColorChanges=[];this.keyuserSpaceIconChanges=[];this.keyuserPageIconChanges=[]},metadata:{library:"sap.cux.home"},init:function e(){A.prototype.init.call(this);this.controlMap=new Map;this.controlModel=new f({spaces:[],selectedSpacePage:{},iconList:[]});this.setProperty("key",D.PAGES);this.setProperty("title",this._i18nBundle.getText("editPages"));this._eventBus=u.getInstance();this.addAggregation("content",this.getContent());this.attachPanelNavigated(()=>this.loadSettings())},getContent:function t(){const s=`${this.getId()}-keyUserPagesSettingsDialog`;if(!this.controlMap.get(s)){const t=new o(s,{title:this._i18nBundle.getText("editPages"),contentWidth:"47rem",contentHeight:"90%",verticalScrolling:false,endButton:new e(`${this.getId()}-keyUserPagesSettingsCloseButton`,{text:this._i18nBundle.getText("Close"),press:this._handleDialogClose.bind(this),type:"Transparent"})}).addStyleClass("sapContrastPlus");this.controlMap.set(s,t);this.addDialogContent()}return this.controlMap.get(s)},loadSettings:function e(){if(!this.pageManagerInstance){this.pageManagerInstance=E.getInstance(U.getPersContainerId(this._getPanel()),U.getOwnerComponent(this._getPanel()))}void this.prepareSpacesPagesData();this.prepareIconList()},addDialogContent:function e(){const t=this.controlMap.get(`${this.getId()}-keyUserPagesSettingsDialog`);const o=new s(`${this.getId()}-wrapperFlexBox`,{alignItems:"Start",justifyContent:"Start",height:"100%",width:"100%",direction:"Row"});o.setModel(this.controlModel);o.addItem(this.getSpacePagesListItems());o.addItem(this.getDetailsView());t.addContent(o)},getSpacePagesListItems:function e(){const t=new s(`${this.getId()}-spacePagesFlexBox`,{direction:"Column",alignItems:"Start",height:"100%",width:"24rem",justifyContent:"Start"}).addStyleClass("spacePagesFlexBox");const o=new p(`${this.getId()}-spacePagesTitle`,{text:this._i18nBundle.getText("pageGroupHeader"),titleStyle:"H4"}).addStyleClass("sapUiSmallMarginBottom");t.addItem(o);const i=new C(`${this.getId()}-treeTableWrapper`,{height:"100%"});const l=`${this.getId()}-spacePagesTreeTable`;const r=new w(l,{selectionMode:"Single",selectionBehavior:"RowOnly",rows:"{path:'/spaces', parameters: {arrayNames:['children'], numberOfExpandedLevels: 1}}",id:"idEditIntrestTreeTable",groupHeaderProperty:"label",columnHeaderVisible:false,rowMode:"Auto",rowSelectionChange:this.handleTreeTableRowSelection.bind(this),width:"22rem",layoutData:new n({growFactor:1}),columns:[new m({template:new a({alignItems:"Center",justifyContent:"SpaceBetween",width:"100%",items:[new g({text:"{label}"}),new a({alignItems:"Center",items:[new P({tooltip:"{label}",src:"{icon}",backgroundColor:"{BGColor/value}",width:"2.5rem",height:"2.5rem",size:"1.5rem",color:"white"}).addStyleClass("sapUiTinyMargin")]})]})})]}).addStyleClass("spacePageTable");this.controlMap.set(l,r);i.addItem(r);t.addItem(i);return t},getDetailsView:function e(){const t=new s(`${this.getId()}-personalisationDetailsWrapperFlex`,{height:"100%",width:"23rem",direction:"Column",visible:"{= ${/spaces/length} === 0 ? false : true}"}).addStyleClass("personalisationDetailsWrapperFlex");t.addItem(this.getColorPalette());t.addItem(this.getIconList());return t},getColorPalette:function e(){const o=new C(`${this.getId()}-colorPaletteWrapperVBox`,{width:"100%"}).addStyleClass("sapUiSmallMarginBottom");const s=new p(`${this.getId()}-colorPaletteTitle`,{text:"{/selectedSpacePage/label}",titleStyle:"H4"});o.addItem(s);const n=new i(`${this.getId()}-colorPaletteSpacePageLabel`,{wrapping:true,text:"{= ${/selectedSpacePage/type} === 'Space' ? '"+this._i18nBundle.getText("space")+"' : '"+this._i18nBundle.getText("page")+"' }"}).addStyleClass("personalisationDetailsLabel");o.addItem(n);const l=new C(`${this.getId()}-colorPaletteVBox`,{width:"100%"}).addStyleClass("sapUiMargin-26Top");o.addItem(l);const r=new i(`${this.getId()}-colorPaletteLabel`,{wrapping:true,design:"Bold",text:this._i18nBundle.getText("selectColor")}).addStyleClass("personalisationDetailsLabel");l.addItem(r);const c=new t(`${this.getId()}-colorPalette`,{colors:$().map(e=>e.value),colorSelect:this._handleColorSelect.bind(this)}).addStyleClass("sapContrastPlus sapUiTinyMarginBottom");this.controlMap.set(`${this.getId()}-colorPalette`,c);l.addItem(c);const d=new a(`${this.getId()}-switchWrapperHBox`,{alignItems:"Center",justifyContent:"SpaceBetween",height:"2rem",width:"100%"});o.addItem(d);const u=new g(`${this.getId()}-switchText`,{text:this._i18nBundle.getText("editPagesColorMessage")});d.addItem(u);const P=new a(`${this.getId()}-switchHBox`,{alignItems:"Center"});d.addItem(P);const y=`${this.getId()}-Switch`;const I=new h(y,{state:"{ path: '/selectedSpacePage/applyColorToAllPages', mode: 'TwoWay' }",change:this._handleSwitchChange.bind(this),enabled:"{= ${/selectedSpacePage/spaceId} ? false : true }",customTextOn:" ",customTextOff:" "});this.controlMap.set(y,I);P.addItem(I);return o},getIconList:function e(){const t=new C(`${this.getId()}-iconListWrapperVBox`,{width:"100%",height:"calc(100% - 15rem)"});const o=new i(`${this.getId()}-iconListLabel`,{wrapping:true,design:"Bold",text:this._i18nBundle.getText("icon")}).addStyleClass("personalisationDetailsLabel");t.addItem(o);const s=`${this.getId()}-iconListSearchField`;const n=new c(s,{width:"100%",liveChange:this.handleIconSearch.bind(this)});this.controlMap.set(s,n);t.addItem(n);const a=new r(`${this.getId()}-iconListScrollContainer`,{vertical:true,horizontal:false,height:"95%"});t.addItem(a);const h=`${this.getId()}-iconList`;const g=new l(h,{items:{path:"/iconList",template:new d(`${this.getId()}-iconStandardListItem`,{title:"{title}",icon:"{icon}",type:"Active",press:e=>this._handleIconSelect(e.getSource()),iconDensityAware:false,iconInset:false})}});this.controlMap.set(h,g);a.addContent(g);return t},prepareSpacesPagesData:function e(){try{const e=this;return Promise.resolve(e.pageManagerInstance.fetchAllAvailableSpaces()).then(function(t){if(!Array.isArray(t)){return}t.forEach(t=>{t.BGColor=t.BGColor?e.refreshColor(t.BGColor):G();t.isSpacePersonalization=t.BGColor||t.icon?true:false;t.icon=t.icon||v;t.persistedApplyColorToAllPages=t.applyColorToAllPages;t.children.forEach(o=>{if(t.applyColorToAllPages){o.BGColor=e.refreshColor(t.BGColor);o.oldColor=o.isPagePersonalization?e.refreshColor(o.oldColor):G()}else{o.BGColor=o.BGColor?e.refreshColor(o.BGColor):G()}o.spaceId=t.id;o.personalizationState=o.isPagePersonalization;o.iconPersonalizationState=o.isPageIconPersonalization;o.icon=o.icon||t.icon||v})});e.controlModel.setProperty("/spaces",t);const o=e.controlMap.get(`${e.getId()}-spacePagesTreeTable`);const s=o.getSelectedIndices();if(!s.includes(0)){o.setSelectedIndex(0)}})}catch(e){return Promise.reject(e)}},refreshColor:function e(t){const o={...t};o.value=y.get({name:t.key});return o},handleTreeTableRowSelection:function e(t){const o=t.getParameter("rowContext");const s=o?.getObject();const n=this.controlModel.getProperty("/selectedSpacePage");const a=this.controlMap.get(`${this.getId()}-colorPalette`);const i=this.controlMap.get(`${this.getId()}-iconListSearchField`);const l=this.controlMap.get(`${this.getId()}-iconList`);const r=this.controlMap.get(`${this.getId()}-Switch`);let c=undefined;let d=a.getBlocked();if(s.type==="Page"){const e=o.getPath();const t=e.replace(/\/children\/\d*/,"");c=this.controlModel.getProperty(t)}d=n?.type===s.type&&n?.id===s.id?!d:false;a.setBlocked(d?true:c?.applyColorToAllPages);i.setBlocked(d);l.setBlocked(d);r.setBlocked(d);this.controlModel.setProperty("/selectedSpacePage",s);this.selectedContext=o},prepareIconList:function e(){const t=this.controlModel.getProperty("/iconList");if(!t.length){let e;const t=[];Object.keys(O).forEach(o=>{Object.keys(O[o].icons).forEach(function(s){switch(o){case"SAP-icons":e="sap-icon://"+s;break;case"SAP-icons-TNT":e="sap-icon://"+o+"/"+s;break;case"BusinessSuiteInAppSymbols":e="sap-icon://"+o+"/icon-"+s;break}t.push({title:s,icon:e,tags:O[o].icons[s].concat([s]).toString(),categoryId:o})})});this.controlModel.setProperty("/iconList",t)}},handleIconSearch:function e(t){const o=t.getSource().getValue();const s=[];if(o&&o.length>0){s.push(new I("tags",S.Contains,o))}const n=this.controlMap.get(`${this.getId()}-iconList`);const a=n.getBinding("items");a?.filter(s)},_handleColorSelect:function e(t,o){const s=t?.getParameter("value")||o||"";const n=this.selectedContext.getObject();const a=!n.spaceId;const i=this._convertColorToLegend(s);const l=n?.BGColor?.key;if(a){const e=n;const t=this.keyuserSpaceColorChanges.find(t=>t.spaceId===e.id);if(t){t.BGColor=i;t.applyColorToAllPages=e.applyColorToAllPages;t.oldApplyColorToAllPages=e.persistedApplyColorToAllPages}else{this.keyuserSpaceColorChanges.push({spaceId:e.id,BGColor:i,oldColor:l,applyColorToAllPages:e.applyColorToAllPages,oldApplyColorToAllPages:e.persistedApplyColorToAllPages})}if(e.applyColorToAllPages){this._applyInnerPageColoring(e,i,s,true)}this.controlModel.setProperty("BGColor/key",i,this.selectedContext);this.controlModel.setProperty("BGColor/value",s,this.selectedContext);this.controlModel.setProperty("isSpacePersonalization",true,this.selectedContext)}else{const e=n;const t=this.keyuserPageColorChanges.find(t=>t.pageId===e.id);const o=this.controlModel.getProperty("/spaces").find(t=>t.id===e.spaceId);const a=o?.isSpacePersonalization;const r=this.keyuserSpaceColorChanges.find(e=>e.spaceId===o?.id);if(t){t.BGColor=i}else{this.keyuserPageColorChanges.push({pageId:e.id,spaceId:e.spaceId,BGColor:i,oldColor:a&&!e.isPagePersonalization?r?.oldColor:l})}this.controlModel.setProperty("BGColor/key",i,this.selectedContext);this.controlModel.setProperty("BGColor/value",s,this.selectedContext);this.controlModel.setProperty("isPagePersonalization",true,this.selectedContext)}},_handleIconSelect:function e(t){const o=t.getIcon();const s=this.selectedContext.getObject();const n=!s.spaceId;if(n){const e=s;const t=this.keyuserSpaceIconChanges.find(t=>t.spaceId===e.id);if(t){t.icon=o}else{this.keyuserSpaceIconChanges.push({spaceId:e.id,icon:o,oldIcon:e.icon})}const n=this._getInnerPages(e).filter(e=>!e.page.isPageIconPersonalization);n.forEach(e=>{this.controlModel.setProperty(e.bindingPath+"/icon",o)});this.controlModel.setProperty("icon",o,this.selectedContext);this.controlModel.setProperty("isSpaceIconPersonalization",true,this.selectedContext)}else{const e=s;const t=this.keyuserPageIconChanges.find(t=>t.pageId===e.id);const n=this.controlModel.getProperty("/spaces").find(t=>t.id===e.spaceId);const a=n?.isSpaceIconPersonalization;const i=this.keyuserSpaceIconChanges.find(e=>e.spaceId===n?.id);if(t){t.icon=o}else{this.keyuserPageIconChanges.push({pageId:e.id,spaceId:e.spaceId,icon:o,oldIcon:a&&!e.isPageIconPersonalization?i?.oldIcon:s.icon})}this.controlModel.setProperty("icon",o,this.selectedContext);this.controlModel.setProperty("isPageIconPersonalization",true,this.selectedContext)}},_convertColorToLegend:function e(t){let o=$().find(function(e){return e.value===t});return o?o.key:G().key},_handleSwitchChange:function e(t){const o=this.selectedContext.getObject();const s=t.getParameter("state");const n=this.keyuserSpaceColorChanges.find(e=>e.spaceId===o.id);if(n){n.applyColorToAllPages=o.applyColorToAllPages}else{this._handleColorSelect(null,o.BGColor?.value)}const a=s?o.BGColor?.key:G().key;const i=s?o.BGColor?.value:G().value;this._applyInnerPageColoring(o,a,i,s)},_applyInnerPageColoring:function e(t,o,s,n){const a=this._getInnerPages(t);a.forEach(e=>{if(!n&&e.page.isPagePersonalization){const t=this.keyuserPageColorChanges.find(function(t){return t.pageId===e.page.id});if(t){const o=t.BGColor;this.controlModel.setProperty(e.bindingPath+"/BGColor/key",o);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",y.get({name:o}))}else{this.controlModel.setProperty(e.bindingPath+"/BGColor/key",e.page.oldColor?.key);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",e.page.oldColor?.value)}}else{this.controlModel.setProperty(e.bindingPath+"/BGColor/key",o);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",s)}})},_getInnerPages:function e(t){return t.children.map((e,t)=>({page:e,bindingPath:this.selectedContext.getPath()+"/children/"+t}))},_mergeKeyUserChanges:function e(){const t=this._getPanel();const o=t.getParent();const s=o.getParent();if(this.keyuserSpaceColorChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:L.SPACE_COLOR,content:[...this.keyuserSpaceColorChanges]}};this.addKeyUserChanges(e)}if(this.keyuserPageColorChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:L.PAGE_COLOR,content:[...this.keyuserPageColorChanges]}};this.addKeyUserChanges(e)}if(this.keyuserSpaceIconChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:L.SPACE_ICON,content:[...this.keyuserSpaceIconChanges]}};this.addKeyUserChanges(e)}if(this.keyuserPageIconChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:L.PAGE_ICON,content:[...this.keyuserPageIconChanges]}};this.addKeyUserChanges(e)}},_handleDialogClose:function e(){this._mergeKeyUserChanges();this._eventBus.publish("KeyUserChanges","addNewsPagesChanges",{changes:this.getKeyUserChanges()});const t=`${this.getId()}-keyUserPagesSettingsDialog`;this.controlMap.get(t).close()}});return z});
|
|
171
|
+
sap.ui.predefine("sap/cux/home/KeyUserPagesSettingsPanel", ["sap/m/Button","sap/m/ColorPalette","sap/m/Dialog","sap/m/FlexBox","sap/m/FlexItemData","sap/m/HBox","sap/m/Label","sap/m/List","sap/m/ScrollContainer","sap/m/SearchField","sap/m/StandardListItem","sap/m/Switch","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/theming/Parameters","sap/ui/model/Filter","sap/ui/model/FilterOperator","sap/ui/model/json/JSONModel","sap/ui/table/Column","sap/ui/table/TreeTable","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Constants","./utils/IconList","./utils/PageManager","./utils/PersonalisationUtils"],function(e,t,o,s,n,a,i,l,r,c,d,h,g,p,C,u,P,y,I,S,f,m,w,B,T,x,M,b,k){"use strict";function _(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const A=_(B);const $=T["CHANGE_TYPES"];const L=x["DEFAULT_BG_COLOR"];const G=x["END_USER_COLORS"];const v=x["FALLBACK_ICON"];const D=x["KEYUSER_SETTINGS_PANELS_KEYS"];const O=M["ICONS"];const E=_(b);const U=_(k);const z=A.extend("sap.cux.home.KeyUserPagesSettingsPanel",{constructor:function e(){A.prototype.constructor.apply(this,arguments);this.keyuserSpaceColorChanges=[];this.keyuserPageColorChanges=[];this.keyuserSpaceIconChanges=[];this.keyuserPageIconChanges=[]},metadata:{library:"sap.cux.home"},init:function e(){A.prototype.init.call(this);this.controlMap=new Map;this.controlModel=new f({spaces:[],selectedSpacePage:{},iconList:[]});this.setProperty("key",D.PAGES);this.setProperty("title",this._i18nBundle.getText("editPages"));this._eventBus=u.getInstance();this.addAggregation("content",this.getContent());this.attachPanelNavigated(()=>this.loadSettings())},getContent:function t(){const s=`${this.getId()}-keyUserPagesSettingsDialog`;if(!this.controlMap.get(s)){const t=new o(s,{title:this._i18nBundle.getText("editPages"),contentWidth:"47rem",contentHeight:"90%",verticalScrolling:false,endButton:new e(`${this.getId()}-keyUserPagesSettingsCloseButton`,{text:this._i18nBundle.getText("Close"),press:this._handleDialogClose.bind(this),type:"Transparent"})}).addStyleClass("sapContrastPlus");this.controlMap.set(s,t);this.addDialogContent()}return this.controlMap.get(s)},loadSettings:function e(){if(!this.pageManagerInstance){this.pageManagerInstance=E.getInstance(U.getPersContainerId(this._getPanel()),U.getOwnerComponent(this._getPanel()))}void this.prepareSpacesPagesData();this.prepareIconList()},addDialogContent:function e(){const t=this.controlMap.get(`${this.getId()}-keyUserPagesSettingsDialog`);const o=new s(`${this.getId()}-wrapperFlexBox`,{alignItems:"Start",justifyContent:"Start",height:"100%",width:"100%",direction:"Row"});o.setModel(this.controlModel);o.addItem(this.getSpacePagesListItems());o.addItem(this.getDetailsView());t.addContent(o)},getSpacePagesListItems:function e(){const t=new s(`${this.getId()}-spacePagesFlexBox`,{direction:"Column",alignItems:"Start",height:"100%",width:"24rem",justifyContent:"Start"}).addStyleClass("spacePagesFlexBox");const o=new p(`${this.getId()}-spacePagesTitle`,{text:this._i18nBundle.getText("pageGroupHeader"),titleStyle:"H4"}).addStyleClass("sapUiSmallMarginBottom");t.addItem(o);const i=new C(`${this.getId()}-treeTableWrapper`,{height:"100%"});const l=`${this.getId()}-spacePagesTreeTable`;const r=new w(l,{selectionMode:"Single",selectionBehavior:"RowOnly",rows:"{path:'/spaces', parameters: {arrayNames:['children'], numberOfExpandedLevels: 1}}",id:"idEditIntrestTreeTable",groupHeaderProperty:"label",columnHeaderVisible:false,rowMode:"Auto",rowSelectionChange:this.handleTreeTableRowSelection.bind(this),width:"22rem",layoutData:new n(`${l}--layoutData`,{growFactor:1}),columns:[new m(`${l}--treeTableColumn`,{template:new a(`${l}--treeTableTemplateBox`,{alignItems:"Center",justifyContent:"SpaceBetween",width:"100%",items:[new g(`${l}--treeTableItemText`,{text:"{label}"}),new a(`${l}--treeTableColumnItemBox`,{alignItems:"Center",items:[new P(`${l}--treeTableItemIcon`,{tooltip:"{label}",src:"{icon}",backgroundColor:"{BGColor/value}",width:"2.5rem",height:"2.5rem",size:"1.5rem",color:"white"}).addStyleClass("sapUiTinyMargin")]})]})})]}).addStyleClass("spacePageTable");this.controlMap.set(l,r);i.addItem(r);t.addItem(i);return t},getDetailsView:function e(){const t=new s(`${this.getId()}-personalisationDetailsWrapperFlex`,{height:"100%",width:"23rem",direction:"Column",visible:"{= ${/spaces/length} === 0 ? false : true}"}).addStyleClass("personalisationDetailsWrapperFlex");t.addItem(this.getColorPalette());t.addItem(this.getIconList());return t},getColorPalette:function e(){const o=new C(`${this.getId()}-colorPaletteWrapperVBox`,{width:"100%"}).addStyleClass("sapUiSmallMarginBottom");const s=new p(`${this.getId()}-colorPaletteTitle`,{text:"{/selectedSpacePage/label}",titleStyle:"H4"});o.addItem(s);const n=new i(`${this.getId()}-colorPaletteSpacePageLabel`,{wrapping:true,text:"{= ${/selectedSpacePage/type} === 'Space' ? '"+this._i18nBundle.getText("space")+"' : '"+this._i18nBundle.getText("page")+"' }"}).addStyleClass("personalisationDetailsLabel");o.addItem(n);const l=new C(`${this.getId()}-colorPaletteVBox`,{width:"100%"}).addStyleClass("sapUiMargin-26Top");o.addItem(l);const r=new i(`${this.getId()}-colorPaletteLabel`,{wrapping:true,design:"Bold",text:this._i18nBundle.getText("selectColor")}).addStyleClass("personalisationDetailsLabel");l.addItem(r);const c=new t(`${this.getId()}-colorPalette`,{colors:G().map(e=>e.value),colorSelect:this._handleColorSelect.bind(this)}).addStyleClass("sapContrastPlus sapUiTinyMarginBottom");this.controlMap.set(`${this.getId()}-colorPalette`,c);l.addItem(c);const d=new a(`${this.getId()}-switchWrapperHBox`,{alignItems:"Center",justifyContent:"SpaceBetween",height:"2rem",width:"100%"});o.addItem(d);const u=new g(`${this.getId()}-switchText`,{text:this._i18nBundle.getText("editPagesColorMessage")});d.addItem(u);const P=new a(`${this.getId()}-switchHBox`,{alignItems:"Center"});d.addItem(P);const y=`${this.getId()}-Switch`;const I=new h(y,{state:"{ path: '/selectedSpacePage/applyColorToAllPages', mode: 'TwoWay' }",change:this._handleSwitchChange.bind(this),enabled:"{= ${/selectedSpacePage/spaceId} ? false : true }",customTextOn:" ",customTextOff:" "});this.controlMap.set(y,I);P.addItem(I);return o},getIconList:function e(){const t=new C(`${this.getId()}-iconListWrapperVBox`,{width:"100%",height:"calc(100% - 15rem)"});const o=new i(`${this.getId()}-iconListLabel`,{wrapping:true,design:"Bold",text:this._i18nBundle.getText("icon")}).addStyleClass("personalisationDetailsLabel");t.addItem(o);const s=`${this.getId()}-iconListSearchField`;const n=new c(s,{width:"100%",liveChange:this.handleIconSearch.bind(this)});this.controlMap.set(s,n);t.addItem(n);const a=new r(`${this.getId()}-iconListScrollContainer`,{vertical:true,horizontal:false,height:"95%"});t.addItem(a);const h=`${this.getId()}-iconList`;const g=new l(h,{items:{path:"/iconList",template:new d(`${this.getId()}-iconStandardListItem`,{title:"{title}",icon:"{icon}",type:"Active",press:e=>this._handleIconSelect(e.getSource()),iconDensityAware:false,iconInset:false})}});this.controlMap.set(h,g);a.addContent(g);return t},prepareSpacesPagesData:function e(){try{const e=this;return Promise.resolve(e.pageManagerInstance.fetchAllAvailableSpaces()).then(function(t){if(!Array.isArray(t)){return}t.forEach(t=>{t.BGColor=t.BGColor?e.refreshColor(t.BGColor):L();t.isSpacePersonalization=t.BGColor||t.icon?true:false;t.icon=t.icon||v;t.persistedApplyColorToAllPages=t.applyColorToAllPages;t.children.forEach(o=>{if(t.applyColorToAllPages){o.BGColor=e.refreshColor(t.BGColor);o.oldColor=o.isPagePersonalization?e.refreshColor(o.oldColor):L()}else{o.BGColor=o.BGColor?e.refreshColor(o.BGColor):L()}o.spaceId=t.id;o.personalizationState=o.isPagePersonalization;o.iconPersonalizationState=o.isPageIconPersonalization;o.icon=o.icon||t.icon||v})});e.controlModel.setProperty("/spaces",t);const o=e.controlMap.get(`${e.getId()}-spacePagesTreeTable`);const s=o.getSelectedIndices();if(!s.includes(0)){o.setSelectedIndex(0)}})}catch(e){return Promise.reject(e)}},refreshColor:function e(t){const o={...t};o.value=y.get({name:t.key});return o},handleTreeTableRowSelection:function e(t){const o=t.getParameter("rowContext");const s=o?.getObject();const n=this.controlModel.getProperty("/selectedSpacePage");const a=this.controlMap.get(`${this.getId()}-colorPalette`);const i=this.controlMap.get(`${this.getId()}-iconListSearchField`);const l=this.controlMap.get(`${this.getId()}-iconList`);const r=this.controlMap.get(`${this.getId()}-Switch`);let c=undefined;let d=a.getBlocked();if(s.type==="Page"){const e=o.getPath();const t=e.replace(/\/children\/\d*/,"");c=this.controlModel.getProperty(t)}d=n?.type===s.type&&n?.id===s.id?!d:false;a.setBlocked(d?true:c?.applyColorToAllPages);i.setBlocked(d);l.setBlocked(d);r.setBlocked(d);this.controlModel.setProperty("/selectedSpacePage",s);this.selectedContext=o},prepareIconList:function e(){const t=this.controlModel.getProperty("/iconList");if(!t.length){let e;const t=[];Object.keys(O).forEach(o=>{Object.keys(O[o].icons).forEach(function(s){switch(o){case"SAP-icons":e="sap-icon://"+s;break;case"SAP-icons-TNT":e="sap-icon://"+o+"/"+s;break;case"BusinessSuiteInAppSymbols":e="sap-icon://"+o+"/icon-"+s;break}t.push({title:s,icon:e,tags:O[o].icons[s].concat([s]).toString(),categoryId:o})})});this.controlModel.setProperty("/iconList",t)}},handleIconSearch:function e(t){const o=t.getSource().getValue();const s=[];if(o&&o.length>0){s.push(new I("tags",S.Contains,o))}const n=this.controlMap.get(`${this.getId()}-iconList`);const a=n.getBinding("items");a?.filter(s)},_handleColorSelect:function e(t,o){const s=t?.getParameter("value")||o||"";const n=this.selectedContext.getObject();const a=!n.spaceId;const i=this._convertColorToLegend(s);const l=n?.BGColor?.key;if(a){const e=n;const t=this.keyuserSpaceColorChanges.find(t=>t.spaceId===e.id);if(t){t.BGColor=i;t.applyColorToAllPages=e.applyColorToAllPages;t.oldApplyColorToAllPages=e.persistedApplyColorToAllPages}else{this.keyuserSpaceColorChanges.push({spaceId:e.id,BGColor:i,oldColor:l,applyColorToAllPages:e.applyColorToAllPages,oldApplyColorToAllPages:e.persistedApplyColorToAllPages})}if(e.applyColorToAllPages){this._applyInnerPageColoring(e,i,s,true)}this.controlModel.setProperty("BGColor/key",i,this.selectedContext);this.controlModel.setProperty("BGColor/value",s,this.selectedContext);this.controlModel.setProperty("isSpacePersonalization",true,this.selectedContext)}else{const e=n;const t=this.keyuserPageColorChanges.find(t=>t.pageId===e.id);const o=this.controlModel.getProperty("/spaces").find(t=>t.id===e.spaceId);const a=o?.isSpacePersonalization;const r=this.keyuserSpaceColorChanges.find(e=>e.spaceId===o?.id);if(t){t.BGColor=i}else{this.keyuserPageColorChanges.push({pageId:e.id,spaceId:e.spaceId,BGColor:i,oldColor:a&&!e.isPagePersonalization?r?.oldColor:l})}this.controlModel.setProperty("BGColor/key",i,this.selectedContext);this.controlModel.setProperty("BGColor/value",s,this.selectedContext);this.controlModel.setProperty("isPagePersonalization",true,this.selectedContext)}},_handleIconSelect:function e(t){const o=t.getIcon();const s=this.selectedContext.getObject();const n=!s.spaceId;if(n){const e=s;const t=this.keyuserSpaceIconChanges.find(t=>t.spaceId===e.id);if(t){t.icon=o}else{this.keyuserSpaceIconChanges.push({spaceId:e.id,icon:o,oldIcon:e.icon})}const n=this._getInnerPages(e).filter(e=>!e.page.isPageIconPersonalization);n.forEach(e=>{this.controlModel.setProperty(e.bindingPath+"/icon",o)});this.controlModel.setProperty("icon",o,this.selectedContext);this.controlModel.setProperty("isSpaceIconPersonalization",true,this.selectedContext)}else{const e=s;const t=this.keyuserPageIconChanges.find(t=>t.pageId===e.id);const n=this.controlModel.getProperty("/spaces").find(t=>t.id===e.spaceId);const a=n?.isSpaceIconPersonalization;const i=this.keyuserSpaceIconChanges.find(e=>e.spaceId===n?.id);if(t){t.icon=o}else{this.keyuserPageIconChanges.push({pageId:e.id,spaceId:e.spaceId,icon:o,oldIcon:a&&!e.isPageIconPersonalization?i?.oldIcon:s.icon})}this.controlModel.setProperty("icon",o,this.selectedContext);this.controlModel.setProperty("isPageIconPersonalization",true,this.selectedContext)}},_convertColorToLegend:function e(t){let o=G().find(function(e){return e.value===t});return o?o.key:L().key},_handleSwitchChange:function e(t){const o=this.selectedContext.getObject();const s=t.getParameter("state");const n=this.keyuserSpaceColorChanges.find(e=>e.spaceId===o.id);if(n){n.applyColorToAllPages=o.applyColorToAllPages}else{this._handleColorSelect(null,o.BGColor?.value)}const a=s?o.BGColor?.key:L().key;const i=s?o.BGColor?.value:L().value;this._applyInnerPageColoring(o,a,i,s)},_applyInnerPageColoring:function e(t,o,s,n){const a=this._getInnerPages(t);a.forEach(e=>{if(!n&&e.page.isPagePersonalization){const t=this.keyuserPageColorChanges.find(function(t){return t.pageId===e.page.id});if(t){const o=t.BGColor;this.controlModel.setProperty(e.bindingPath+"/BGColor/key",o);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",y.get({name:o}))}else{this.controlModel.setProperty(e.bindingPath+"/BGColor/key",e.page.oldColor?.key);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",e.page.oldColor?.value)}}else{this.controlModel.setProperty(e.bindingPath+"/BGColor/key",o);this.controlModel.setProperty(e.bindingPath+"/BGColor/value",s)}})},_getInnerPages:function e(t){return t.children.map((e,t)=>({page:e,bindingPath:this.selectedContext.getPath()+"/children/"+t}))},_mergeKeyUserChanges:function e(){const t=this._getPanel();const o=t.getParent();const s=o.getParent();if(this.keyuserSpaceColorChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:$.SPACE_COLOR,content:[...this.keyuserSpaceColorChanges]}};this.addKeyUserChanges(e)}if(this.keyuserPageColorChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:$.PAGE_COLOR,content:[...this.keyuserPageColorChanges]}};this.addKeyUserChanges(e)}if(this.keyuserSpaceIconChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:$.SPACE_ICON,content:[...this.keyuserSpaceIconChanges]}};this.addKeyUserChanges(e)}if(this.keyuserPageIconChanges.length){const e={selectorControl:s,changeSpecificData:{changeType:$.PAGE_ICON,content:[...this.keyuserPageIconChanges]}};this.addKeyUserChanges(e)}},_handleDialogClose:function e(){this._mergeKeyUserChanges();this._eventBus.publish("KeyUserChanges","addNewsPagesChanges",{changes:this.getKeyUserChanges()});const t=`${this.getId()}-keyUserPagesSettingsDialog`;this.controlMap.get(t).close()}});return z});
|
|
147
172
|
/*!
|
|
148
173
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
149
174
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -153,12 +178,12 @@ sap.ui.predefine("sap/cux/home/KeyUserSettingsDialog", ["sap/m/Button","sap/m/Na
|
|
|
153
178
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
154
179
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
155
180
|
*/
|
|
156
|
-
sap.ui.predefine("sap/cux/home/Layout", ["sap/base/Log","sap/ui/core/Element","sap/ushell/api/S4MyHome","sap/ushell/Container","./AdvancedSettingsPanel","./BaseLayout","./BaseLayoutRenderer","./InsightsCardsSettingsPanel","./InsightsTilesSettingsPanel","./KeyUserLayoutSettingsPanel","./KeyUserNewsPagesSettingsPanel","./KeyUserSettingsDialog","./LayoutSettingsPanel","./NewsAndPagesContainer","./NewsSettingsPanel","./NoDataContainer","./PagePanel","./PageSettingsPanel","./SettingsDialog","./ToDosContainer","./utils/Constants","./utils/KeyUserPersonalization","./utils/PerformanceUtils","./utils/PersonalisationUtils"],function(t,e,n,s,i,o,a,r,c,l,g,u,f,h,d,P,p,S,y,_,m,D,v,b){"use strict";function A(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const w=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function C(t,e,n){if(!t.s){if(n instanceof I){if(n.s){if(e&1){e=n.s}n=n.v}else{n.o=C.bind(null,t,e);return}}if(n&&n.then){n.then(C.bind(null,t,e),C.bind(null,t,2));return}t.s=e;t.v=n;const s=t.o;if(s){s(t)}}}const I=function(){function t(){}t.prototype.then=function(e,n){const s=new t;const i=this.s;if(i){const t=i&1?e:n;if(t){try{C(s,1,t(this.v))}catch(t){C(s,2,t)}return s}else{return this}}this.o=function(t){try{const i=t.v;if(t.s&1){C(s,1,e?e(i):i)}else if(n){C(s,1,n(i))}else{C(s,2,i)}}catch(t){C(s,2,t)}};return s};return t}();function k(t){return t instanceof I&&t.s&1}function U(t,e,n){var s=-1,i,o;function a(r){try{while(++s<t.length&&(!n||!n())){r=e(s);if(r&&r.then){if(k(r)){r=r.v}else{r.then(a,o||(o=C.bind(null,i=new I,2)));return}}}if(i){C(i,1,r)}else{i=r}}catch(t){C(i||(i=new I),2,t)}}a();return i}const N=A(i);function T(t,e,n){if(typeof t[w]==="function"){var s=t[w](),i,o,a;function g(t){try{while(!(i=s.next()).done&&(!n||!n())){t=e(i.value);if(t&&t.then){if(k(t)){t=t.v}else{t.then(g,a||(a=C.bind(null,o=new I,2)));return}}}if(o){C(o,1,t)}else{o=t}}catch(t){C(o||(o=new I),2,t)}}g();if(s.return){var r=function(t){try{if(!i.done){s.return()}}catch(t){}return t};if(o&&o.then){return o.then(r,function(t){throw r(t)})}r()}return o}if(!("length"in t)){throw new TypeError("Object is not iterable")}var c=[];for(var l=0;l<t.length;l++){c.push(t[l])}return U(c,function(t){return e(c[t])},n)}const E=A(o);function x(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const B=A(a);const L=A(r);const O=A(c);const $=A(l);const V=A(g);const j=A(u);const H=A(f);const K=A(h);const M=A(d);const R=A(P);const z=A(p);const F=A(S);const G=A(y);const Y=A(_);const q=m["SETTINGS_PANELS_KEYS"];const J=A(D);const Q=v["setupPerformanceTracking"];const W=A(b);const X=E.extend("sap.cux.home.Layout",{renderer:B,metadata:{designtime:"sap/cux/home/designtime/Layout.designtime"},constructor:function t(e,n){E.prototype.constructor.call(this,e,n);this._shellUserActions=[];this._isDefaultSettingsDialog=false;this._customNoDataContainerPresent=true},init:function t(){E.prototype.init.call(this);this.setProperty("enableSettings",true);this.setProperty("enableFullScreen",true);this._keyUserPersonalization=new J(W.getOwnerComponent(this),this._i18nBundle)},_addUserActions:function e(){try{const e=this;return Promise.resolve(x(function(){const t=function(){if(e.getVisible()&&!e._userActionsAdded){e._userActionsAdded=true;const t=[{id:`${e.getId()}-homeSettingsBtn`,icon:"sap-icon://edit",text:e._i18nBundle.getText("myHomeSettings"),tooltip:e._i18nBundle.getText("myHomeSettings"),press:()=>{void e.openSettingsDialog()}}];return Promise.resolve(e._keyUserPersonalization.getRTAUserAction()).then(function(i){if(i){t.push(i)}return Promise.resolve(s.getServiceAsync("Extension")).then(function(s){function i(){const t=t=>{const n=t.getParameter("isMyHomeRoute");e._shellUserActions.forEach(function(t){if(n){t.showOnHome()}else{t.hideOnHome()}})};n.attachRouteMatched({},t,e)}const o=T(t,function(t){return Promise.resolve(s.createUserAction(t,{controlType:"sap.ushell.ui.launchpad.ActionItem"})).then(function(t){t.showOnHome();e._shellUserActions.push(t)})});return o&&o.then?o.then(i):i(o)})})}}();if(t&&t.then)return t.then(function(){})},function(e){t.warning("Unable to add User Actions",e instanceof Error?e.message:"")}))}catch(t){return Promise.reject(t)}},openSettingsDialog:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";let n=arguments.length>1?arguments[1]:undefined;try{const t=this;const s=t.getAggregation("settingsDialog");if(s.getPanels().length!==t._getSettingsPanels().length){t._addPanelsToSettingsDialog()}return Promise.resolve(t._calculateSectionsState()).then(function(){E.prototype.openSettingsDialog.call(t,e,n)})}catch(t){return Promise.reject(t)}},closeSettingsDialog:function t(){const e=this.getAggregation("settingsDialog");e?.close()},onBeforeRendering:function t(e){try{const t=this;E.prototype.onBeforeRendering.call(t,e);return Promise.resolve(Q(t)).then(function(){const e=t.getProperty("persContainerId");if(e){W.setPersContainerId(e)}if(!t._noDataContainer){t._noDataContainer=t.getItems().find(t=>t instanceof R);if(!t._noDataContainer){t._customNoDataContainerPresent=false;t._noDataContainer=new R(`${t.getId()}-noDataContainer`)}t._noDataContainer.setVisible(false)}if(!t._aOrderedSections){setTimeout(t._prepareLayoutData.bind(t))}t._setupSettingsDialog();t._setupKeyUserSettingsDialog();return Promise.resolve(t._addUserActions()).then(function(){})})}catch(t){return Promise.reject(t)}},_setupSettingsDialog:function t(){const e=[];(this.getItems()||[]).forEach(t=>{t.setAssociation("layout",this);t.getContent().forEach(t=>{e.push(t);const n=t.getProperty("enableSettings");t.setProperty("enableSettings",n!==undefined?n:true)})});const n=this.getProperty("enableSettings");const s=this.getAggregation("settingsDialog");if(!s){this._isDefaultSettingsDialog=true;if(n){const t=this._getDefaultSettingsDialog(e);this.setSettingsDialog(t)}}},_getDefaultSettingsDialog:function t(e){const n=new G(`${this.getId()}-settings-dialog`);e.forEach(t=>{const e=this._getDefaultSettingsPanel(t);if(e){n.addPanel(e)}});const s=this._sortPanels(n.getPanels());n.removeAllPanels();s.forEach(t=>n.addPanel(t));n.insertPanel(this._getLayoutSettingsPanel(),0);n.addPanel(this._getAdvancedSettingsPanel());return n},_getDefaultSettingsPanel:function t(e){let n;const s=e.getMetadata().getName();switch(s){case"sap.cux.home.NewsPanel":n=new M(`${e.getId()}-news-settings`);break;case"sap.cux.home.PagePanel":n=new F(`${e.getId()}-page-settings`);break;case"sap.cux.home.TilesPanel":n=new O(`${e.getId()}-tiles-settings`);break;case"sap.cux.home.CardsPanel":n=new L(`${e.getId()}-cards-settings`);break;default:break}n?.setAssociation("panel",e);return n},_addPanelsToSettingsDialog:function t(){const e=this.getAggregation("settingsDialog");const n=this._sortPanels(e.getPanels());e.removeAllPanels();n.forEach(t=>e.addPanel(t));if(this._isDefaultSettingsDialog){e.insertPanel(this._getLayoutSettingsPanel(),0);e.addPanel(this._getAdvancedSettingsPanel())}e.addPanel(this._getAdvancedSettingsPanel());this._addSettingsPanel(e.getPanels(),true)},_sortPanels:function t(e){return Object.keys(q).map(t=>e.find(e=>e?.getProperty("key")===t)).filter(Boolean)},_getAdvancedSettingsPanel:function t(){if(!this._advancedSettingsPanel){this._advancedSettingsPanel=new N(`${this.getId()}-advanced-settings`);this._advancedSettingsPanel.setAssociation("panel",this)}return this._advancedSettingsPanel},_getLayoutSettingsPanel:function t(){if(!this._layoutSettingsPanel){this._layoutSettingsPanel=new H(`${this.getId()}-layout-settings`);this._layoutSettingsPanel.setAssociation("panel",this)}return this._layoutSettingsPanel},_prepareLayoutData:function t(){let n=false;const s=this.getProperty("expanded");const i=this._aOrderedSections?.map(t=>e.getElementById(t.completeId))||[];const o=s&&i.length?i:this.getItems();const a=[];o.forEach(t=>{if(t!==this._noDataContainer){const e=t.getId();let s=t.getProperty("title");if(!s){s=t.getTooltip()}const i=t.getVisible();const o=t.getCustomSettings();a.push({completeId:e,sContainerType:t.getMetadata().getName(),blocked:false,visible:t.getProperty("visible"),title:o.title||s,text:o.text});if(i){n=true}}});this._aOrderedSections=a;if(!this.getProperty("expanded")){this.setNoDataContainerVisibility(!n)}},setNoDataContainerVisibility:function t(e){this._noDataContainer?.setVisible(e);if(!this._customNoDataContainerPresent){if(e){this.insertItem(this._noDataContainer,0)}else{this.removeItem(this._noDataContainer)}}},_calculateSectionsState:function t(){try{const t=this;const e=t.getAggregation("settingsDialog");const n=e.getPanels();t._isCustomNews=false;n.forEach(e=>{if(e instanceof M){t._isCustomNews=true}if(e instanceof N){e.resetImportModel(true)}});return Promise.resolve(t.setSectionDetails()).then(function(){})}catch(t){return Promise.reject(t)}},setSectionDetails:function t(){try{const t=this;const e=t.getItems();const n=T(e,function(e){function n(){t._aOrderedSections?.forEach(t=>{if(t.completeId===i){t.blocked=s;t.visible=e.getVisible()}})}let s=false;const i=e.getId();const o=function(){if(e instanceof K&&e.getVisible()){function n(t){s=t}const i=e.getContent();const o=i.length;return o?Promise.resolve(t.checkPagesBlocked(i)).then(n):n(false)}else if(e instanceof Y){s=t.checkToDoBlocked(e)}}();return o&&o.then?o.then(n):n(o)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},checkPagesBlocked:function t(e){try{const n=this;function s(){return!n._pagesAvailable&&!n._isCustomNews?true:false}const i=T(e,function(t){const e=function(){if(t instanceof z){return Promise.resolve(t.getUserAvailablePages()).then(function(t){if(t.length){n._pagesAvailable=true}})}}();if(e&&e.then)return e.then(function(){})});return Promise.resolve(i&&i.then?i.then(s):s(i))}catch(o){return Promise.reject(o)}},checkToDoBlocked:function t(e){if(!e.getVisible()){const t=e.getContent();if(t.length===0){this._toDoAccessible=false;return true}}return false},_setupKeyUserSettingsDialog:function t(){const e=this.getAggregation("keyUserSettingsDialog");if(!e){const t=new j(`${this.getId()}-keyUser-settings-dialog`);const e=new $(`${this.getId()}-keyUser-layout-settings`);e.setAssociation("panel",this);t.addPanel(e);(this.getItems()||[]).forEach(e=>{if(e instanceof K){const n=new V(`${this.getId()}-keyUser-news-pages-settings`);n.setAssociation("panel",e.getContent()?.[0]);t.addPanel(n)}});this.setAggregation("keyUserSettingsDialog",t)}},getpagesAvailable:function t(){return this._pagesAvailable},isToDoAccessible:function t(){return this._toDoAccessible},customNewAvailable:function t(){return this._isCustomNews},getSections:function t(){return this._aOrderedSections},setSections:function t(e){this._aOrderedSections=e},resetSections:function t(){this._prepareLayoutData()}});return X});
|
|
181
|
+
sap.ui.predefine("sap/cux/home/Layout", ["sap/base/Log","sap/ui/core/Element","sap/ushell/api/S4MyHome","sap/ushell/Container","./AdvancedSettingsPanel","./BaseLayout","./BaseLayoutRenderer","./ContentAdditionDialog","./InsightsCardsSettingsPanel","./InsightsTilesSettingsPanel","./KeyUserLayoutSettingsPanel","./KeyUserNewsPagesSettingsPanel","./KeyUserSettingsDialog","./LayoutSettingsPanel","./NewsAndPagesContainer","./NewsSettingsPanel","./NoDataContainer","./PagePanel","./PageSettingsPanel","./SettingsDialog","./ToDosContainer","./utils/Constants","./utils/KeyUserPersonalization","./utils/PerformanceUtils","./utils/PersonalisationUtils"],function(t,e,n,s,i,o,a,r,c,l,g,u,h,f,d,P,p,S,y,_,m,D,A,v,b){"use strict";function w(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const C=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function I(t,e,n){if(!t.s){if(n instanceof k){if(n.s){if(e&1){e=n.s}n=n.v}else{n.o=I.bind(null,t,e);return}}if(n&&n.then){n.then(I.bind(null,t,e),I.bind(null,t,2));return}t.s=e;t.v=n;const s=t.o;if(s){s(t)}}}const k=function(){function t(){}t.prototype.then=function(e,n){const s=new t;const i=this.s;if(i){const t=i&1?e:n;if(t){try{I(s,1,t(this.v))}catch(t){I(s,2,t)}return s}else{return this}}this.o=function(t){try{const i=t.v;if(t.s&1){I(s,1,e?e(i):i)}else if(n){I(s,1,n(i))}else{I(s,2,i)}}catch(t){I(s,2,t)}};return s};return t}();function U(t){return t instanceof k&&t.s&1}function N(t,e,n){var s=-1,i,o;function a(r){try{while(++s<t.length&&(!n||!n())){r=e(s);if(r&&r.then){if(U(r)){r=r.v}else{r.then(a,o||(o=I.bind(null,i=new k,2)));return}}}if(i){I(i,1,r)}else{i=r}}catch(t){I(i||(i=new k),2,t)}}a();return i}const T=w(i);function E(t,e,n){if(typeof t[C]==="function"){var s=t[C](),i,o,a;function g(t){try{while(!(i=s.next()).done&&(!n||!n())){t=e(i.value);if(t&&t.then){if(U(t)){t=t.v}else{t.then(g,a||(a=I.bind(null,o=new k,2)));return}}}if(o){I(o,1,t)}else{o=t}}catch(t){I(o||(o=new k),2,t)}}g();if(s.return){var r=function(t){try{if(!i.done){s.return()}}catch(t){}return t};if(o&&o.then){return o.then(r,function(t){throw r(t)})}r()}return o}if(!("length"in t)){throw new TypeError("Object is not iterable")}var c=[];for(var l=0;l<t.length;l++){c.push(t[l])}return N(c,function(t){return e(c[t])},n)}const x=w(o);function B(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const L=w(a);const $=w(r);const O=w(c);const V=w(l);const j=w(g);const H=w(u);const K=w(h);const M=w(f);const R=w(d);const z=w(P);const F=w(p);const G=w(S);const Y=w(y);const q=w(_);const J=w(m);const Q=D["SETTINGS_PANELS_KEYS"];const W=w(A);const X=v["setupPerformanceTracking"];const Z=w(b);const tt=x.extend("sap.cux.home.Layout",{renderer:L,metadata:{designtime:"sap/cux/home/designtime/Layout.designtime"},constructor:function t(e,n){x.prototype.constructor.call(this,e,n);this._shellUserActions=[];this._isDefaultSettingsDialog=false;this._customNoDataContainerPresent=true},init:function t(){x.prototype.init.call(this);this.setProperty("enableSettings",true);this.setProperty("enableFullScreen",true);this._keyUserPersonalization=new W(Z.getOwnerComponent(this),this._i18nBundle)},_addUserActions:function e(){try{const e=this;return Promise.resolve(B(function(){const t=function(){if(e.getVisible()&&!e._userActionsAdded){e._userActionsAdded=true;const t=[{id:`${e.getId()}-homeSettingsBtn`,icon:"sap-icon://edit",text:e._i18nBundle.getText("myHomeSettings"),tooltip:e._i18nBundle.getText("myHomeSettings"),press:()=>{void e.openSettingsDialog()}}];return Promise.resolve(e._keyUserPersonalization.getRTAUserAction()).then(function(i){if(i){t.push(i)}return Promise.resolve(s.getServiceAsync("Extension")).then(function(s){function i(){const t=t=>{const n=t.getParameter("isMyHomeRoute");e._shellUserActions.forEach(function(t){if(n){t.showOnHome()}else{t.hideOnHome()}})};n.attachRouteMatched({},t,e)}const o=E(t,function(t){return Promise.resolve(s.createUserAction(t,{controlType:"sap.ushell.ui.launchpad.ActionItem"})).then(function(t){t.showOnHome();e._shellUserActions.push(t)})});return o&&o.then?o.then(i):i(o)})})}}();if(t&&t.then)return t.then(function(){})},function(e){t.warning("Unable to add User Actions",e instanceof Error?e.message:"")}))}catch(t){return Promise.reject(t)}},openSettingsDialog:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";let n=arguments.length>1?arguments[1]:undefined;try{const t=this;const s=t.getAggregation("settingsDialog");if(s.getPanels().length!==t._getSettingsPanels().length){t._addPanelsToSettingsDialog()}return Promise.resolve(t._calculateSectionsState()).then(function(){x.prototype.openSettingsDialog.call(t,e,n)})}catch(t){return Promise.reject(t)}},closeSettingsDialog:function t(){const e=this.getAggregation("settingsDialog");e?.close()},onBeforeRendering:function t(e){try{const t=this;x.prototype.onBeforeRendering.call(t,e);t._setupSettingsDialog();t._setupContentAdditionDialog();const n=t.getProperty("persContainerId");if(n){Z.setPersContainerId(n)}t.getNoDataContainer();if(!t._aOrderedSections){setTimeout(t._prepareLayoutData.bind(t))}t._setupKeyUserSettingsDialog();return Promise.resolve(t._addUserActions()).then(function(){return Promise.resolve(X(t)).then(function(){})})}catch(t){return Promise.reject(t)}},_setupSettingsDialog:function t(){const e=[];(this.getItems()||[]).forEach(t=>{t.setAssociation("layout",this);t.getContent().forEach(t=>{e.push(t);const n=t.getProperty("enableSettings");t.setProperty("enableSettings",n!==undefined?n:true)})});const n=this.getProperty("enableSettings");const s=this.getAggregation("settingsDialog");if(!s){this._isDefaultSettingsDialog=true;if(n){const t=this._getDefaultSettingsDialog(e);this.setSettingsDialog(t)}}},_getDefaultSettingsDialog:function t(e){const n=new q(`${this.getId()}-settings-dialog`);e.forEach(t=>{const e=this._getDefaultSettingsPanel(t);if(e){n.addPanel(e)}});const s=this._sortPanels(n.getPanels());n.removeAllPanels();s.forEach(t=>n.addPanel(t));n.insertPanel(this._getLayoutSettingsPanel(),0);n.addPanel(this._getAdvancedSettingsPanel());return n},_getDefaultSettingsPanel:function t(e){let n;const s=e.getMetadata().getName();switch(s){case"sap.cux.home.NewsPanel":n=new z(`${e.getId()}-news-settings`);break;case"sap.cux.home.PagePanel":n=new Y(`${e.getId()}-page-settings`);break;case"sap.cux.home.TilesPanel":n=new V(`${e.getId()}-tiles-settings`);break;case"sap.cux.home.CardsPanel":n=new O(`${e.getId()}-cards-settings`);break;default:break}n?.setAssociation("panel",e);return n},_addPanelsToSettingsDialog:function t(){const e=this.getAggregation("settingsDialog");const n=this._sortPanels(e.getPanels());e.removeAllPanels();n.forEach(t=>e.addPanel(t));if(this._isDefaultSettingsDialog){e.insertPanel(this._getLayoutSettingsPanel(),0);e.addPanel(this._getAdvancedSettingsPanel())}e.addPanel(this._getAdvancedSettingsPanel());this._addSettingsPanel(e.getPanels(),true)},_sortPanels:function t(e){return Object.keys(Q).map(t=>e.find(e=>e?.getProperty("key")===t)).filter(Boolean)},_getAdvancedSettingsPanel:function t(){if(!this._advancedSettingsPanel){this._advancedSettingsPanel=new T(`${this.getId()}-advanced-settings`);this._advancedSettingsPanel.setAssociation("panel",this)}return this._advancedSettingsPanel},_getLayoutSettingsPanel:function t(){if(!this._layoutSettingsPanel){this._layoutSettingsPanel=new M(`${this.getId()}-layout-settings`);this._layoutSettingsPanel.setAssociation("panel",this)}return this._layoutSettingsPanel},getNoDataContainer:function t(){if(!this._noDataContainer){this._noDataContainer=this.getItems().find(t=>t instanceof F);if(!this._noDataContainer){this._customNoDataContainerPresent=false;this._noDataContainer=new F(`${this.getId()}-noDataContainer`)}this._noDataContainer.setVisible(false)}return this._noDataContainer},_prepareLayoutData:function t(){let n=false;const s=this.getProperty("expanded");const i=this._aOrderedSections?.map(t=>e.getElementById(t.completeId))||[];const o=s&&i.length?i:this.getItems();const a=[];o.forEach(t=>{if(t!==this.getNoDataContainer()){const e=t.getId();let s=t.getProperty("title");if(!s){s=t.getTooltip()}const i=t.getVisible();const o=t.getCustomSettings();a.push({completeId:e,sContainerType:t.getMetadata().getName(),blocked:false,visible:t.getProperty("visible"),title:o.title||s,text:o.text});if(i){n=true}}});this._aOrderedSections=a;if(!this.getProperty("expanded")){this.setNoDataContainerVisibility(!n)}},setNoDataContainerVisibility:function t(e){const n=this.getNoDataContainer();n?.setVisible(e);if(!this._customNoDataContainerPresent){if(e){this.insertItem(n,0)}else{this.removeItem(n)}}},_calculateSectionsState:function t(){try{const t=this;const e=t.getAggregation("settingsDialog");const n=e.getPanels();t._isCustomNews=false;n.forEach(e=>{if(e instanceof z){t._isCustomNews=true}if(e instanceof T){e.resetImportModel(true)}});return Promise.resolve(t.setSectionDetails()).then(function(){})}catch(t){return Promise.reject(t)}},setSectionDetails:function t(){try{const t=this;const e=t.getItems();const n=E(e,function(e){function n(){t._aOrderedSections?.forEach(t=>{if(t.completeId===i){t.blocked=s;t.visible=e.getVisible()}})}let s=false;const i=e.getId();const o=function(){if(e instanceof R&&e.getVisible()){function n(t){s=t}const i=e.getContent();const o=i.length;return o?Promise.resolve(t.checkPagesBlocked(i)).then(n):n(false)}else if(e instanceof J){s=t.checkToDoBlocked(e)}}();return o&&o.then?o.then(n):n(o)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},checkPagesBlocked:function t(e){try{const n=this;function s(){return!n._pagesAvailable&&!n._isCustomNews?true:false}const i=E(e,function(t){const e=function(){if(t instanceof G){return Promise.resolve(t.getUserAvailablePages()).then(function(t){if(t.length){n._pagesAvailable=true}})}}();if(e&&e.then)return e.then(function(){})});return Promise.resolve(i&&i.then?i.then(s):s(i))}catch(o){return Promise.reject(o)}},checkToDoBlocked:function t(e){if(!e.getVisible()){const t=e.getContent();if(t.length===0){this._toDoAccessible=false;return true}}return false},_setupKeyUserSettingsDialog:function t(){const e=this.getAggregation("keyUserSettingsDialog");if(!e){const t=new K(`${this.getId()}-keyUser-settings-dialog`);const e=new j(`${this.getId()}-keyUser-layout-settings`);e.setAssociation("panel",this);t.addPanel(e);(this.getItems()||[]).forEach(e=>{if(e instanceof R){const n=new H(`${this.getId()}-keyUser-news-pages-settings`);n.setAssociation("panel",e.getContent()?.[0]);t.addPanel(n)}});this.setAggregation("keyUserSettingsDialog",t)}},getpagesAvailable:function t(){return this._pagesAvailable},isToDoAccessible:function t(){return this._toDoAccessible},customNewAvailable:function t(){return this._isCustomNews},getSections:function t(){return this._aOrderedSections},setSections:function t(e){this._aOrderedSections=e},resetSections:function t(){this._prepareLayoutData()},_setupContentAdditionDialog:function t(){let e=this.getAggregation("contentAdditionDialog");if(!e){e=new $(`${this.getId()}-content-addition-dialog`);this.setAggregation("contentAdditionDialog",e)}}});return tt});
|
|
157
182
|
/*!
|
|
158
183
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
159
184
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
160
185
|
*/
|
|
161
|
-
sap.ui.predefine("sap/cux/home/LayoutSettingsPanel", ["sap/base/Log","sap/m/Button","sap/m/Column","sap/m/ColumnListItem","sap/m/HBox","sap/m/MessageBox","sap/m/ObjectIdentifier","sap/m/Table","sap/m/Text","sap/m/ToggleButton","sap/m/VBox","sap/ui/core/Element","sap/ui/core/Icon","sap/ui/core/Lib","sap/ui/model/json/JSONModel","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Accessibility","./utils/Constants","./utils/DragDropUtils","./utils/PersonalisationUtils"],function(e,t,n,s,i,o,a,r,l,c,d,u,g,h,m,p,_,f,y,I,S){"use strict";function C(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const x=C(p);const T=_["CHANGE_TYPES"];const E=f["getInvisibleText"];const P=y["SETTINGS_PANELS_KEYS"];const B=I["focusDraggedItem"];const b=C(S);const L=x.extend("sap.cux.home.LayoutSettingsPanel",{metadata:{library:"sap.cux.home"},constructor:function e(t,n){x.prototype.constructor.call(this,t,n);this._isCollapseHandlerAttached=false},init:function e(){x.prototype.init.call(this);this.setProperty("key",P.LAYOUT);this.setProperty("title",this._i18nBundle.getText("layout"));this.setProperty("icon","sap-icon://grid");this._resetActionButton=new t({id:`${this.getId()}-layoutResetBtn`,text:this._i18nBundle.getText("resetButton"),press:()=>this.resetMyhomeSettings()});this.
|
|
186
|
+
sap.ui.predefine("sap/cux/home/LayoutSettingsPanel", ["sap/base/Log","sap/m/Button","sap/m/Column","sap/m/ColumnListItem","sap/m/HBox","sap/m/MessageBox","sap/m/ObjectIdentifier","sap/m/Table","sap/m/Text","sap/m/ToggleButton","sap/m/VBox","sap/ui/core/Element","sap/ui/core/Icon","sap/ui/core/Lib","sap/ui/model/json/JSONModel","./BaseSettingsPanel","./flexibility/Layout.flexibility","./utils/Accessibility","./utils/Constants","./utils/DragDropUtils","./utils/PersonalisationUtils"],function(e,t,n,s,i,o,a,r,l,c,d,u,g,h,m,p,_,f,y,I,S){"use strict";function C(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const x=C(p);const T=_["CHANGE_TYPES"];const E=f["getInvisibleText"];const P=y["SETTINGS_PANELS_KEYS"];const B=I["focusDraggedItem"];const b=C(S);const L=x.extend("sap.cux.home.LayoutSettingsPanel",{metadata:{library:"sap.cux.home"},constructor:function e(t,n){x.prototype.constructor.call(this,t,n);this._isCollapseHandlerAttached=false},init:function e(){x.prototype.init.call(this);this.setProperty("key",P.LAYOUT);this.setProperty("title",this._i18nBundle.getText("layout"));this.setProperty("icon","sap-icon://grid");this._resetActionButton=new t({id:`${this.getId()}-layoutResetBtn`,text:this._i18nBundle.getText("resetButton"),press:()=>this.resetMyhomeSettings()});this.addActionButton(this._resetActionButton);this.addAggregation("content",this._getContent());this.attachPanelNavigated(()=>void this._loadSections());this._manageSectionsChanges=[]},createShowHideChangeFile:function e(t){try{const e=this;const n=t.getSource();const s=!n.getPressed();const i=n.getBindingContext()?.getObject();i.visible=s;e._getPanel().getSections().find(e=>e.completeId===i.completeId).visible=s;const o=s?T.UNHIDE:T.HIDE;const a=u.getElementById(i.completeId);e._manageSectionsChanges.push({selectorElement:a,changeSpecificData:{changeType:o}});return Promise.resolve(e._saveManageSectionsDialog()).then(function(){setTimeout(()=>a.adjustLayout());if(!s){e._switchToCollapsedViewIfRequired([a])}})}catch(e){return Promise.reject(e)}},_switchToCollapsedViewIfRequired:function e(t){const n=this._getPanel();const s=n.getProperty("expanded");if(s){t.forEach(e=>{n.toggleFullScreen(e._getSelectedPanel())})}},_loadSections:function e(){try{const e=this;const t=e._getPanel();return Promise.resolve(t._calculateSectionsState()).then(function(){e._orderedSections=JSON.parse(JSON.stringify(t.getSections()));e._orderedSections.forEach(t=>{if(t.sContainerType==="sap.cux.home.InsightsContainer"&&!t.title){t.title=String(e._i18nBundle?.getText("insights"))}});e._controlModel=new m(e._orderedSections);e._layoutTable.setModel(e._controlModel);e._layoutTable.bindItems({path:"/",factory:t=>{if(!e._dndInvisibleText||e._dndInvisibleText.isDestroyed()){e._dndInvisibleText=E(e.getId()+"--layoutDndText",e._i18nBundle.getText("keyPressAriaText"))}return new s(`${t}--columnListItem`,{type:"Inactive",cells:[new i(`${t}--columnListHBox`,{alignItems:"Center",items:[new g(`${t}--columnListIcon`,{src:"sap-icon://vertical-grip"}).addStyleClass("sapUiSmallMarginEnd"),new i(`${t}--columnListItemHBox`,{justifyContent:"SpaceBetween",alignItems:"Center",width:"100%",items:[new a(`${t}--columnListObjectIdentifier`,{title:"{title}",text:"{text}",tooltip:"{title}"}),new c(`${t}--layoutSettingstoggleButton`,{tooltip:"{= ${visible} ? '"+e._i18nBundle.getText("hideBtn")+"' : '"+e._i18nBundle.getText("showBtn")+"' }",icon:"sap-icon://show",type:"Emphasized",enabled:"{= !${blocked}}",press:t=>{void e.createShowHideChangeFile(t)},pressed:"{= !${visible}}",ariaLabelledBy:["selectLabel"]}).addStyleClass("sapUiTinyMarginEnd sapUiTinyMarginTop")]}),e._dndInvisibleText],width:"100%"})],ariaLabelledBy:[e._dndInvisibleText.getId()]}).addStyleClass("insightsListItem insightsListMargin")}});if(!e._isCollapseHandlerAttached){e._isCollapseHandlerAttached=true;t.attachEvent("onCollapse",()=>e._rearrangeLayoutIfRequired())}})}catch(e){return Promise.reject(e)}},_rearrangeLayoutIfRequired:function e(){const t=this._getPanel();const n=t.getItems();if(Array.isArray(this._allLayoutElements)&&n.length===this._allLayoutElements.length){const e=n.some((e,t)=>e.getId()!==this._allLayoutElements[t].getId());if(e){t.removeAllItems();this._allLayoutElements.forEach(e=>{t.addItem(e)})}}},_getContent:function e(){const t=this._setHeaderIntro();const n=this.setLayoutTable();const s=E(this.getId()+"--titleText",this._i18nBundle.getText("layout"));const i=new d(this.getId()+"--idNewsPageOuterVBoX",{alignItems:"Start",justifyContent:"SpaceBetween",renderType:"Bare",items:[s,t,n]});[s,t].forEach(e=>{this._resetActionButton.addAriaLabelledBy(e.getId())});return i},_setHeaderIntro:function e(){const t=new l(this.getId()+"--idCustLayoutText",{text:this._i18nBundle.getText("layoutIntroMsg")});const n=new d(this.getId()+"--idLayoutIntroText",{backgroundDesign:"Solid",alignItems:"Start",justifyContent:"SpaceBetween",items:[t],renderType:"Bare"}).addStyleClass("sapUiSmallMargin");return n},setLayoutTable:function e(){if(!this._layoutTable){this._layoutTable=new r(this.getId()+"--idManageSectionsTable",{width:"calc(100% - 2rem)",items:[],columns:[new n(this.getId()+"--idSectionTitleColumn",{width:"100%"})]}).addStyleClass("sapContrastPlus sapUiSmallMarginBeginEnd sapUiTinyMarginBottom");this.addDragDropConfigTo(this._layoutTable,e=>void this.onDropManageSections(e))}return this._layoutTable},_saveManageSectionsDialog:function e(){try{const e=this;return Promise.resolve(e._persistUserChanges({changes:e._manageSectionsChanges,appComponent:b.getOwnerComponent(e._getPanel())}).then(()=>{const t=e._layoutTable.getModel();t.refresh();e._controlModel.refresh()}).finally(()=>{e._manageSectionsChanges=[]}))}catch(e){return Promise.reject(e)}},_persistUserChanges:function t(n){return h.load({name:"sap.ui.fl"}).then(function(){return new Promise(function(t,s){sap.ui.require(["sap/ui/fl/write/api/ControlPersonalizationWriteAPI"],function(i){i.add({changes:n.changes,ignoreVariantManagement:true}).then(function(e){return t(i.save({selector:{appComponent:n.appComponent},changes:e}))}).catch(function(t){if(t instanceof Error){e.error("Unable to Save User Change: "+t.message);return s(t)}})})})})},_getActualIndex:function e(t){const n=this._getPanel();this._allLayoutElements=this._allLayoutElements||[...n.getItems()];const s=n.getProperty("expanded");const i=n._getCurrentExpandedElement();if(s&&i){if(!this._allLayoutElements.some(e=>e.getId()===i.targetContainer.getId())){this._allLayoutElements.splice(i.index,0,i.targetContainer)}}return this._allLayoutElements.findIndex(e=>e.getId()===t)},_rearrangeLayoutElements:function e(t,n){const s=this._allLayoutElements.splice(t,1)[0];this._allLayoutElements.splice(n,0,s);const i=this._getPanel();const o=i.getProperty("expanded");const a=i._getCurrentExpandedElement();if(o&&a){const e=a.sourceElements.values().next().value;i.updateFullScreenElement(e,{index:this._allLayoutElements.indexOf(a.targetContainer)})}},onDropManageSections:function e(t){try{const n=this;function s(){B(n._layoutTable,c)}const i=n._getPanel();const o=i.getId();const a=t.getParameter?.("draggedControl")||t.draggedControl;const r=a.getParent()?.indexOfItem(a);const l=t.getParameter?.("droppedControl")||t.droppedControl;const c=a.getParent()?.indexOfItem(l);const d=function(){if(r!==c){const e=n._orderedSections;const t=a.getBindingContext()?.getObject();const s=l.getBindingContext()?.getObject();const d=n._getActualIndex(t.completeId);const g=n._getActualIndex(s.completeId);n._rearrangeLayoutElements(d,g);e.splice(r,1);e.splice(c,0,t);i.setSections(e);n._manageSectionsChanges.push({selectorElement:i,changeSpecificData:{changeType:T.MOVE,movedElements:[{id:t.completeId,sourceIndex:d,targetIndex:g}],source:{id:o,aggregation:"items"},target:{id:o,aggregation:"items"}}});return Promise.resolve(n._saveManageSectionsDialog()).then(function(){const e=u.getElementById(t.completeId);const i=u.getElementById(s.completeId);n._switchToCollapsedViewIfRequired([e,i])})}}();return Promise.resolve(d&&d.then?d.then(s):s(d))}catch(g){return Promise.reject(g)}},resetMyhomeSettings:function e(){const t=this;o.show(this._i18nBundle.getText("reset_cards_confirmation_msg"),{id:"resetCardsConfirmation",icon:o.Icon.QUESTION,title:this._i18nBundle.getText("reset_cards_confirmation_title"),actions:[this._i18nBundle.getText("reset_cards_button"),o.Action.CANCEL],onClose:function(e){try{const n=function(){if(e===t._i18nBundle.getText("reset_cards_button")){const e=[];for(let n of t._orderedSections){const t=u.getElementById(n.completeId);e.push(t)}e.push(t._getPanel());return Promise.resolve(h.load({name:"sap.ui.fl"}).then(()=>{sap.ui.require(["sap/ui/fl/write/api/ControlPersonalizationWriteAPI"],n=>{void n.reset({selectors:e,changeTypes:[T.MOVE,T.UNHIDE,T.HIDE]}).finally(()=>{const e=t._getPanel();e.resetSections();e.closeSettingsDialog()})})})).then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})}});return L});
|
|
162
187
|
/*!
|
|
163
188
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
164
189
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -168,12 +193,17 @@ sap.ui.predefine("sap/cux/home/MenuItem", ["sap/ui/core/Element"],function(i){"u
|
|
|
168
193
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
169
194
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
170
195
|
*/
|
|
171
|
-
sap.ui.predefine("sap/cux/home/NewsAndPagesContainer", ["./BaseContainer","./library","./utils/Device"],function(e,t,n){"use strict";function
|
|
196
|
+
sap.ui.predefine("sap/cux/home/NewsAndPagesContainer", ["./BaseContainer","./NewsAndPagesContainerGenericPlaceholder","./library","./utils/Device"],function(e,t,n,i){"use strict";function s(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const o=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function a(e,t,n){if(!e.s){if(n instanceof r){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=a.bind(null,e,t);return}}if(n&&n.then){n.then(a.bind(null,e,t),a.bind(null,e,2));return}e.s=t;e.v=n;const i=e.o;if(i){i(e)}}}const r=function(){function e(){}e.prototype.then=function(t,n){const i=new e;const s=this.s;if(s){const e=s&1?t:n;if(e){try{a(i,1,e(this.v))}catch(e){a(i,2,e)}return i}else{return this}}this.o=function(e){try{const s=e.v;if(e.s&1){a(i,1,t?t(s):s)}else if(n){a(i,1,n(s))}else{a(i,2,s)}}catch(e){a(i,2,e)}};return i};return e}();function l(e){return e instanceof r&&e.s&1}function c(e,t,n){var i=-1,s,o;function c(u){try{while(++i<e.length&&(!n||!n())){u=t(i);if(u&&u.then){if(l(u)){u=u.v}else{u.then(c,o||(o=a.bind(null,s=new r,2)));return}}}if(s){a(s,1,u)}else{s=u}}catch(e){a(s||(s=new r),2,e)}}c();return s}const u=s(e);function h(e,t,n){if(typeof e[o]==="function"){var i=e[o](),s,u,h;function g(e){try{while(!(s=i.next()).done&&(!n||!n())){e=t(s.value);if(e&&e.then){if(l(e)){e=e.v}else{e.then(g,h||(h=a.bind(null,u=new r,2)));return}}}if(u){a(u,1,e)}else{u=e}}catch(e){a(u||(u=new r),2,e)}}g();if(i.return){var d=function(e){try{if(!s.done){i.return()}}catch(e){}return e};if(u&&u.then){return u.then(d,function(e){throw d(e)})}d()}return u}if(!("length"in e)){throw new TypeError("Object is not iterable")}var f=[];for(var p=0;p<e.length;p++){f.push(e[p])}return c(f,function(e){return t(f[e])},n)}const d=t["getNewsPagesPlaceholder"];const f=n["OrientationType"];const p=i["DeviceType"];const g=u.extend("sap.cux.home.NewsAndPagesContainer",{metadata:{properties:{colorPersonalizations:{type:"array",group:"Misc",defaultValue:[],visibility:"hidden"},iconPersonalizations:{type:"array",group:"Misc",defaultValue:[],visibility:"hidden"},newsFeedVisibility:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"}}},renderer:{...u.renderer,apiVersion:2},constructor:function e(t,n){u.prototype.constructor.call(this,t,n);this.panelLoaded={}},init:function e(){u.prototype.init.call(this);this.panelLoaded={};this.setProperty("orientation",this.getDeviceType()===p.Desktop||this.getDeviceType()===p.LargeDesktop?f.Horizontal:f.Vertical);this.addCustomSetting("title",this._i18nBundle.getText("myInterestMsg"))},load:function e(){try{const e=this;const t=e.getContent();const n=h(t,function(e){return Promise.resolve(e.getData()).then(function(){})});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},setColorPersonalizations:function e(t){const n=this.getProperty("colorPersonalizations")||[];const i=n.concat(t);this.setProperty("colorPersonalizations",i);this.getContent().forEach(e=>{if(e.getMetadata().getName()==="sap.cux.home.PagePanel"){e.applyColorPersonalizations(i)}});return this},setIconPersonalizations:function e(t){const n=this.getProperty("iconPersonalizations")||[];const i=n.concat(t);this.setProperty("iconPersonalizations",i);this.getContent().forEach(e=>{if(e.getMetadata().getName()==="sap.cux.home.PagePanel"){e.applyIconPersonalizations(i)}});return this},newsVisibilityChangeHandler:function e(t){const n=this.getContent();n.forEach(e=>{if(e.getMetadata().getName()==="sap.cux.home.NewsPanel"){let n=e;const i=n.isURLParamEnabled("default-News");if(t.isNewsFeedVisible){this.setProperty("newsFeedVisibility",true);this._getPanelContentWrapper(n).setVisible(true)}else if(!i){this.setProperty("newsFeedVisibility",false);this._getPanelContentWrapper(n).setVisible(false)}}})},newsPersonalization:function e(t){const n=this.getContent();n.forEach(e=>{if(e.getMetadata().getName()==="sap.cux.home.NewsPanel"){let n=e;const i=Boolean(this.getProperty("newsFeedVisibility"));const s=n.isURLParamEnabled("default-News");if(!s){n.setProperty("url",t.newsFeedURL);n.setProperty("showCustom",t.showCustomNewsFeed);n.setProperty("customFeedKey",t.customNewsFeedKey);n.setProperty("customFileName",t.customNewsFeedFileName)}if(i){const e=t.newsFeedURL;this._getPanelContentWrapper(n).setVisible(true);const i=String(n.getProperty("customFeedKey"));const o=Boolean(n.getProperty("showCustom"));if(!s){if(o&&i){n.setProperty("newsAvailable",true);void n.setCustomNewsFeed(i)}else if(!o&&e){void n.setURL(e)}else{this._getPanelContentWrapper(n).setVisible(false);this.setProperty("newsFeedVisibility",false)}}}void n.getData()}})},panelLoadedFn:function e(t,n){const i=this.getContent();i.forEach(e=>{if(e.getMetadata().getName()==="sap.cux.home.PagePanel"){this.pagePanel=e}else if(e.getMetadata().getName()==="sap.cux.home.NewsPanel"){this.newsPanel=e}});this.panelLoaded[t]=n;this.adjustLayout()},adjustStyleLayout:function e(t){const n=this.getDeviceType();const i=this.newsPanel?this._getPanelContentWrapper(this.newsPanel):undefined;const s=this.pagePanel?this._getPanelContentWrapper(this.pagePanel):undefined;const o=this._getInnerControl();if(t){this.newsPanel.adjustLayout()}if(n===p.Desktop||n===p.LargeDesktop){if(t){s?.setWidth("100%")}o.setAlignItems("Center");o.setDirection("Row");i?.setWidth("100%");i?.addStyleClass("newsTileMaxWidth")}else if(n===p.Tablet){s?.setWidth("100%");s?.setJustifyContent("Start");i?.setWidth("calc(100vw - 64px)");i?.removeStyleClass("newsTileMaxWidth");o.setAlignItems("Baseline");o.setDirection("Column")}if(s){setTimeout(this.pagePanel.attachResizeHandler.bind(this.pagePanel,t,this.getDomRef()?.clientWidth||0,s,o))}},adjustLayout:function e(){if(this.pagePanel&&this.newsPanel&&this._getPanelContentWrapper(this.newsPanel).getVisible()){let e=true;if(this.panelLoaded["Page"]?.loaded||this.panelLoaded["News"]?.loaded){if(this.panelLoaded["News"]?.loaded===false){e=false;this.removeContent(this.newsPanel)}else if(this.panelLoaded["Page"]?.loaded===false){this.removeContent(this.pagePanel)}this.adjustStyleLayout(e)}}else if(this.pagePanel&&this.panelLoaded["Page"]?.loaded){this.adjustStyleLayout(false)}},getGenericPlaceholderContent:function e(){return d()}});return g});
|
|
197
|
+
/*!
|
|
198
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
199
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
200
|
+
*/
|
|
201
|
+
sap.ui.predefine("sap/cux/home/NewsAndPagesContainerGenericPlaceholder", [],function(){"use strict";function t(){return`\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plContent plResponsivePadding" style="background-color:transparent">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM" style="width: 225px;">\n </div>\n <div class="plPHPCardContainer plSectionMarginBottom">\n <div class="plPHPCard plPHPCardVersion2 PHPContentCard5 sapUiNoMarginTop" style="background-color:white">\n <div class="plPHPCardHeader">\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop"></div>\n </div>\n <div class="plPHPCardContent">\n <div style="vertical-align: inherit;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentContainer">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightS plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 80%;"></div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignEnd plVerticalAlignBottom">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardFooterText"\n style="width: 80px;"></div>\n </div>\n </div>\n </div>\n <div class="plPHPCardVersion3 PHPContentCard6 sapUiNoMarginTop plSmallestVisibleSizeL">\n <div class="plPHPCardHeader"></div>\n <div class="plPHPCardContent">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignplPHPCardContentContainer plVerticalAlignTop">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignCenter plVerticalAlignTop">\n <div style="vertical-align: inherit; background-color:white;" class="plPHPCard">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit; background-color:white;" class="plPHPCard">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignCenter plVerticalAlignTop">\n <div style="vertical-align: inherit; background-color:white;" class="plPHPCard">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit; background-color:white;" class="plPHPCard">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="plPHPCard plPHPCardVersion3 PHPContentCard7 sapUiNoMarginTop plSmallestVisibleSizeL">\n <div class="plPHPCardHeader"></div>\n <div class="plPHPCardContent">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignplPHPCardContentContainer plVerticalAlignTop">\n <div class="plHorizontalLayout plHorizontalContent plTextAlignCenter plVerticalAlignTop">\n <div style="vertical-align: inherit; background-color:white;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit; background-color:white;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n <div class="plHorizontalLayout plHorizontalContent plTextAlignCenter plVerticalAlignTop">\n <div style="vertical-align: inherit; background-color:white;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n <div style="vertical-align: inherit; background-color:white;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentItemContainer">\n <div\n class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plPHPCardContentTextSquare plVerticalRepeaterItem">\n </div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 100%;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n `}var e={__esModule:true};e.getNewsPagesPlaceholder=t;return e});
|
|
172
202
|
/*!
|
|
173
203
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
174
204
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
175
205
|
*/
|
|
176
|
-
sap.ui.predefine("sap/cux/home/NewsGroup", ["sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/Image","sap/m/Label","sap/m/Link","sap/m/List","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/CustomData","sap/ui/core/Element","./BaseNewsItem"],function(e,t,s,i,n,o,a,l,r,d,
|
|
206
|
+
sap.ui.predefine("sap/cux/home/NewsGroup", ["sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/HBox","sap/m/Image","sap/m/Label","sap/m/Link","sap/m/List","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/CustomData","sap/ui/core/Element","sap/ui/core/HTML","./BaseNewsItem","./utils/Constants","./utils/DataFormatUtils"],function(e,t,s,i,n,o,a,l,r,u,d,w,c,p,g,h,m){"use strict";function I(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const N=I(g);const x=h["DEFAULT_NEWS_URL"];const L=m["recycleId"];const D=N.extend("sap.cux.home.NewsGroup",{metadata:{library:"sap.cux.home",aggregations:{newsItems:{type:"sap.cux.home.NewsItem",singularName:"newsItem",multiple:true}}},constructor:function e(t,s){N.prototype.constructor.call(this,t,s)},init:function e(){N.prototype.init.call(this);this._oTile.attachPress(this,this.pressNewsItem.bind(this));this.createNewsGroupDialog()},pressNewsItem:function e(){void this.openNewsGroupDialog()},openNewsGroupDialog:function e(){try{const t=this;function s(){t.oNewsGroupDialog?.setTitle(t.getTitle());t.oNewsGroupImage?.setSrc(a);t.loadNewsDetails(r)}t.oNewsList?.setBusy(true);const i=t.getParent();const n=i.getProperty("customFileName");const o=n.split(".").pop()?.toLowerCase()==="csv";const a=t.getImageUrl();const l=i.getFavNewsFeed();let r=[];const u=function(){if(i.getUrl()!==x){const e={changeId:i.getCustomFeedKey(),title:t.getTitle(),showAllPreparationRequired:o?false:!l?true:l.showAllPreparationRequired};t.oNewsGroupDialog?.open();const s=i.getNewsFeedDetailsUrl(e);return Promise.resolve(i.getAuthNewsFeed(s,e.title)).then(function(e){r=e})}else{t.oNewsGroupDialog?.open();t.currentDefaultGroup=i.getCurrentNewsGroup(t.getId());r=t.currentDefaultGroup?._group_to_article||[]}}();return Promise.resolve(u&&u.then?u.then(s):s(u))}catch(d){return Promise.reject(d)}},loadNewsDetails:function e(t){this.oNewsList?.destroyAggregation("items",true);(t||[]).forEach((e,t)=>{const s=this.generateNewsListTemplate(e,t);this.oNewsList?.addItem(s)});this.oNewsList?.setBusy(false)},generateNewsListTemplate:function s(n,l){const c=this.getParent();if(c.getUrl()!==x){const s=new d(this.getId()+"--idNewsFieldsBox"+"--"+l).addStyleClass("newsListItemContainer");(n?.expandFields||[]).forEach(e=>{s.addItem(new i("",{items:[new o("",{text:e.label+":",tooltip:e.label}),new r("",{text:e.value})]}).addStyleClass("newsListItemContainer"))});s.setVisible(false);return new t(this.getId()+"--idNewsDetailItem"+"--"+l,{content:[new d(`${this.getId()}--newsList--${l}`,{items:[new u(`${this.getId()}--newsTitle--${l}`,{text:n.Title.value,titleStyle:"H6"}),new r(`${this.getId()}--newsText--${l}`,{text:n.Description.value}),new i(`${this.getId()}--newsHBox--${l}`,{items:[new o(`${this.getId()}--newsLabel--${l}`,{text:n.Type.label+":",tooltip:n.Type.label}),new r(`${this.getId()}--newsItemText--${l}`,{text:n.Type.value})]}).addStyleClass("newsListItemContainer"),new i(`${this.getId()}--newsListItemBox--${l}`,{items:[new o(`${this.getId()}--newsListItemLabel--${l}`,{text:this._i18nBundle.getText("readMoreLink")+":",tooltip:n.Link.value.label+""}),new a(`${this.getId()}--newsListItemLink--${l}`,{href:n.Link.value.value+"",text:n.Link.text,target:"_blank"})]}).addStyleClass("newsListItemContainer"),s,new e(`${this.getId()}--expand--${l}`,{text:this._i18nBundle.getText("expand"),press:this.handleShowNewsFeedDetails.bind(this),customData:new w({key:"index",value:l})})]}).addStyleClass("newsListItemContainer")]}).addStyleClass("newsListItem")}else{return new t(this.getId()+"--idNewsDetailItem"+"--"+l,{content:[new d({items:[new p({content:n.description})]}).addStyleClass("newsListItemContainer")]}).addStyleClass("newsListItem")}},createNewsGroupDialog:function t(){if(!this.oNewsGroupDialog){this.oNewsGroupImage=new n(L(`${this.getId()}-custNewsImage`),{width:"100%",height:"15rem",src:"/resources/sap/cux/home/img/CustomNewsFeed/SupplyChain/3.jpg"});this.oNewsList=new l(L(`${this.getId()}-custNewsList`));this.oNewsGroupDialog=new s(L(`${this.getId()}-custNewsFeedDetailsDialog`),{title:this.getTitle(),contentWidth:"52rem",contentHeight:"100%",content:[this.oNewsGroupImage,this.oNewsList],buttons:[new e(L(`${this.getId()}-custNewsFeedDetailsCloseBtn`),{text:this._i18nBundle.getText("Close"),press:this.closeNewsGroupDialog.bind(this),type:"Transparent"})]});this.addDependent(this.oNewsGroupDialog)}},closeNewsGroupDialog:function e(){if(this.oNewsGroupDialog){this.oNewsGroupDialog.close()}},handleShowNewsFeedDetails:function e(t){const s=t.getSource().data("index");const i=c.getElementById(this.getId()+"--idNewsFieldsBox"+"--"+s);const n=i.getVisible();i.setVisible(!n);const o=n?this._i18nBundle.getText("expand"):this._i18nBundle.getText("collapse");t.getSource().setText(o)}});return D});
|
|
177
207
|
/*!
|
|
178
208
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
179
209
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -183,17 +213,17 @@ sap.ui.predefine("sap/cux/home/NewsItem", ["sap/m/library","./BaseNewsItem"],fun
|
|
|
183
213
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
184
214
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
185
215
|
*/
|
|
186
|
-
sap.ui.predefine("sap/cux/home/NewsPanel", ["sap/base/Log","sap/m/GenericTile","sap/m/SlideTile","sap/ui/core/EventBus","sap/ui/core/format/DateFormat","sap/ui/model/xml/XMLModel","sap/ushell/Container","./BaseNewsPanel","./MenuItem","./NewsGroup","./NewsItem","./library","./utils/Device","./utils/FESRUtil","./utils/HttpHelper","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,s,r,i,o,a,l,u,c,d,h,f,g,m,p){"use strict";function w(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function N(e,t,n){if(!e.s){if(n instanceof v){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=N.bind(null,e,t);return}}if(n&&n.then){n.then(N.bind(null,e,t),N.bind(null,e,2));return}e.s=t;e.v=n;const s=e.o;if(s){s(e)}}}const y=w(a);const v=function(){function e(){}e.prototype.then=function(t,n){const s=new e;const r=this.s;if(r){const e=r&1?t:n;if(e){try{N(s,1,e(this.v))}catch(e){N(s,2,e)}return s}else{return this}}this.o=function(e){try{const r=e.v;if(e.s&1){N(s,1,t?t(r):r)}else if(n){N(s,1,n(r))}else{N(s,2,r)}}catch(e){N(s,2,e)}};return s};return e}();function F(e){return e instanceof v&&e.s&1}function P(e,t,n){var s;for(;;){var r=e();if(F(r)){r=r.v}if(!r){return i}if(r.then){s=0;break}var i=n();if(i&&i.then){if(F(i)){i=i.s}else{s=1;break}}if(t){var o=t();if(o&&o.then&&!F(o)){s=2;break}}}var a=new v;var l=N.bind(null,a,2);(s===0?r.then(c):s===1?i.then(u):o.then(d)).then(void 0,l);return a;function u(s){i=s;do{if(t){o=t();if(o&&o.then&&!F(o)){o.then(d).then(void 0,l);return}}r=e();if(!r||F(r)&&!r.v){N(a,1,i);return}if(r.then){r.then(c).then(void 0,l);return}i=n();if(F(i)){i=i.v}}while(!i||!i.then);i.then(u).then(void 0,l)}function c(e){if(e){i=n();if(i&&i.then){i.then(u).then(void 0,l)}else{u(i)}}else{N(a,1,i)}}function d(){if(r=e()){if(r.then){r.then(c).then(void 0,l)}else{c(r)}}else{N(a,1,i)}}}const C=w(l);function T(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const b=w(u);const E=w(c);const M=d["NewsType"];const A=h["DeviceType"];const I=f["addFESRId"];const S=w(g);const x=w(m);const L=w(p);const D="/sap/opu/odata4/ui2/insights_srv/srvd/ui2/",U=D+"insights_read_srv/0001/"+"NEWS_FEED",_=D+"insights_read_srv/0001/"+"NewsFeedColumnTranslation",R=U+"/$count",B=7,O=function(e,t){return Array.from({length:t},function(t,n){return e+"/"+(n+1)+".jpg"})};const V={TITLE:"LineOfBusiness",LINK:"WhatsNewDocument",VALIDITY:"ValidAsOf",PREPARATION_REQUIRED:"PreparationRequired",EXCLUDE_FIELDS:["ChangeId","LineNumber","LineOfBusiness","SolutionArea","Title","Description","Type","ValidAsOf","WhatsNewDocument","Link"],IMAGE_URL:"sap/cux/home/img/CustomNewsFeed/",FESR_STEP_NAME:"custNewsSlide-press",EMPTY_DATA_ERROR_CODE:"NODATA"},q={"Application Platform and Infrastructure":O("ApplicationPlatformandInfrastructure",3),"Asset Management":O("AssetManagement",3),"Cross Applications":O("CrossApplications",3),Finance:O("Finance",3),Manufacturing:O("Manufacturing",3),"R&D / Engineering":O("RnDandEngineering",3),Sales:O("Sales",3),"Sourcing and Procurement":O("SourcingandProcurement",3),"Supply Chain":O("SupplyChain",3),default:["default.jpg"]};const j=y.extend("sap.cux.home.NewsPanel",{metadata:{library:"sap.cux.home",properties:{url:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},type:{type:"sap.cux.home.NewsType",group:"Misc",visibility:"public",defaultValue:M.RSS},customFeedKey:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},customFileName:{type:"string",group:"Misc",defaultValue:""},showCustom:{type:"boolean",group:"Misc",defaultValue:false},newsAvailable:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"},supportedFileFormats:{type:"FileFormat[]",group:"Misc",defaultValue:["xlsx"],visibility:"hidden"}},aggregations:{newsGroup:{type:"sap.cux.home.NewsGroup",singularName:"newsGroup",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){y.prototype.constructor.call(this,t,n);this.customNewsFeedCache=new Map},init:function e(){y.prototype.init.call(this);this.oNewsTile=new n(this.getId()+"--idNewsSlide",{displayTime:2e4,width:"100%",height:"17rem",tiles:[new t(this.getId()+"--placeholder",{state:"Loading",mode:"ArticleMode",frameType:"Stretch"})]}).addStyleClass("newsTileMaxWidth");I(this.oNewsTile,"newsSlidePress");this.getNewsWrapper().addContent(this.oNewsTile);this.getNewsWrapper().addStyleClass("newsWrapper");this.setProperty("title",this._i18nBundle.getText("newsTitle"));this._eventBus=s.getInstance();this.oManageMenuItem=new C(`${this.getId()}-manageNews`,{title:this._i18nBundle.getText("mngNews"),icon:"sap-icon://edit",press:this.handleEditNews.bind(this)});this.addAggregation("menuItems",this.oManageMenuItem);I(this.oManageMenuItem,"manageNews")},getData:function e(){try{const t=this;function n(){t.fireEvent("loaded");t._adjustLayout()}const s=t.getUrl();const r=function(){if(s&&!t.getProperty("showCustom")){return Promise.resolve(t.initializeXmlModel(s)).then(function(e){t.oNewsModel=e;t.oNewsTile.setModel(t.oNewsModel);t.oManageMenuItem.setVisible(false)})}else{const e=function(){if(t.getProperty("showCustom")){t.bNewsLoad=t.bNewsLoad||false;t.oManageMenuItem.setVisible(true);const e=t.getCustomFeedKey();const n=function(){if(e){return Promise.resolve(t.setCustomNewsFeed(e)).then(function(){})}else{t.handleFeedError()}}();if(n&&n.then)return n.then(function(){})}else{t.handleFeedError()}}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(i){return Promise.reject(i)}},getCustomFeedKey:function e(){return this.getProperty("customFeedKey")},getUrl:function e(){return this.getProperty("url")},initializeXmlModel:function e(t){try{const e=this;const n=e.getParent();return Promise.resolve(new Promise(s=>{const r=new i(t);r.setDefaultBindingMode("OneWay");r.attachRequestCompleted(t=>{void function(){try{if(!e.bNewsLoad){n?.panelLoadedFn("News",{loaded:true,count:B});e.bNewsLoad=true}const i=t.getSource().getData();return Promise.resolve(e.loadNewsFeed(i,0)).then(function(){e._eventBus.publish("KeyUserChanges","newsFeedLoadFailed",{showError:false,date:new Date});s(r)})}catch(e){return Promise.reject(e)}}()});r.attachRequestFailed(()=>{e.handleFeedError();if(!e.bNewsLoad){n?.panelLoadedFn("News",{loaded:false,count:0});e.bNewsLoad=true}e._eventBus.publish("KeyUserChanges","newsFeedLoadFailed",{showError:true,date:new Date});s(r)})}))}catch(e){return Promise.reject(e)}},loadNewsFeed:function e(t,n){try{const s=this;function r(){if(!!t?.querySelector("rss")&&!!t?.querySelector("item")){i={path:"/channel/item/",length:n||B}}else if(!!t?.querySelector("atom")&&!!t?.querySelector("entry")){i={path:"/entry/",length:n||B}}else if(!!t?.querySelector("customFeed")&&!!t?.querySelector("item")){i={path:"/item/",length:n||B}}else{s.handleFeedError();return}s.bindNewsTile(s.oNewsTile,i)}let i;const o=function(){if(!t?.querySelector("customFeed")){return Promise.resolve(s.extractAllImageUrls(t,n||B)).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(r):r(o))}catch(a){return Promise.reject(a)}},handleFeedError:function e(){if(this.getProperty("showCustom")){this.generateErrorMessage().setVisible(true);this.oNewsTile.setVisible(false)}else{(this.getNewsWrapper()?.getParent()).setVisible(false);this.setProperty("newsAvailable",false);this.oManageMenuItem.setVisible(false)}},setURL:function e(t){try{const e=this;e.setProperty("showCustom",false);e.setProperty("newsAvailable",true);e.generateErrorMessage().setVisible(false);(e.getNewsWrapper()?.getParent()).setVisible(true);e.oNewsTile.setVisible(true);e.setProperty("url",t);return Promise.resolve(e.getData()).then(function(){})}catch(e){return Promise.reject(e)}},_adjustLayout:function e(){if(this.getDeviceType()===A.Mobile){this.oNewsTile.setHeight("11rem");this.generateErrorMessage().setWidth("100%")}else{this.oNewsTile.setHeight("17rem");(this.getNewsWrapper()?.getParent()).setWidth("100%");this.oNewsTile.addStyleClass("sapUiSmallMarginTopBottom")}},bindNewsTile:function e(t,n){if(n){t.bindAggregation("tiles",{path:n.path,length:n.length,templateShareable:false,factory:(e,t)=>{const n=t.getObject();let s;if(n.getElementsByTagName("link").length>0){s=new E("",{url:n.getElementsByTagName("link")[0].textContent,title:n.getElementsByTagName("title")[0].textContent,subTitle:n.getElementsByTagName("description")[0].textContent,imageUrl:n.getElementsByTagName("imageUrl")[0].textContent,footer:this.formatDate(n.getElementsByTagName("pubDate")[0].textContent)})}else{s=new b("",{title:n.getElementsByTagName("title")[0].textContent,subTitle:this._i18nBundle.getText("newsFeedDescription"),imageUrl:n.getElementsByTagName("imageUrl")[0].textContent,footer:n.getElementsByTagName("footer")[0].textContent})}this.addAggregation("newsItems",s,true);return s.getTile()}})}},extractAllImageUrls:function e(t,n){try{const e=this;let s=0;const r=P(function(){return s<n},function(){return s++},function(){const n=t?.getElementsByTagName("item")[s];return Promise.resolve(e.extractImage(n.getElementsByTagName("link")[0].textContent)).then(function(e){const s=t.createElement("imageUrl");s.textContent=e;n.appendChild(s)})});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},formatDate:function e(t){const n=r.getDateTimeInstance({style:"medium",relative:true,relativeStyle:"short"});return n.format(new Date(t))},getFavNewsFeed:function e(){return this.aFavNewsFeed},extractImage:function e(t){const n=()=>{const e=sap.ui.require.toUrl("sap/cux/home/utils");this.image=this.image?this.image+1:1;this.image=this.image<9?this.image:1;return`${e}/imgNews/${this.image}.jpg`};return fetch(t).then(e=>e.text()).then(e=>{const t=e.match(/<meta[^>]*property=["']og:image["'][^>]*content=["']([^"']+)["'][^>]*>/i);return Array.isArray(t)&&t[1]?t[1]:n()}).catch(n)},setCustomNewsFeed:function t(n){try{const t=this;return Promise.resolve(T(function(){t.oNewsTile.setVisible(true);t.generateErrorMessage().setVisible(false);return Promise.resolve(t._getUserPersonalization()).then(function(e){return Promise.resolve(e?.read()).then(function(e){t.aFavNewsFeed=e?.favNewsFeed;return Promise.resolve(Promise.all([t.getCustomNewsFeedCount(n),t.getCustomNewsFeed(n,t.aFavNewsFeed?t.aFavNewsFeed.showAllPreparationRequired:true)])).then(function(e){let[n,s]=e;if(s.length===0||n===0){throw new Error}if(t.aFavNewsFeed?.items?.length){s=s.filter(e=>t.aFavNewsFeed?.items.includes(e.title))}else if(t.aFavNewsFeed?.items?.length===0){t.getParent()?.panelLoadedFn("News",{loaded:true,count:0});throw new Error("Error: No news feed available")}(t.getNewsWrapper()?.getParent()).addStyleClass("sapMNewsFlex");t.loadCustomNewsFeed(s)})})})},function(n){e.error(n);t.handleFeedError()}))}catch(e){return Promise.reject(e)}},getCustomNewsFeedCount:function e(t){try{const e=this;let n=encodeURI(R+"?$filter=ChangeId"+" eq "+"'"+t+"'");if(!e.customNewsFeedCache.has(n)){e.customNewsFeedCache.set(n,S.GetJSON(n))}return Promise.resolve(e.customNewsFeedCache.get(n))}catch(e){return Promise.reject(e)}},getCustomNewsFeed:function t(n,s){try{const t=this;return Promise.resolve(T(function(){const e=t.getNewsFeedDetailsUrl({changeId:n,showAllPreparationRequired:s});if(!t.customNewsFeedCache.has(e)){t.customNewsFeedCache.set(e,t.getAuthNewsFeed(e))}return Promise.resolve(t.customNewsFeedCache.get(e)).then(function(e){const n=e;const s={};const r=[];if(n?.length>0){n.forEach(e=>{const n=e[V.TITLE];if(!s[n.value]){r.push({title:n.value,footer:e[V.VALIDITY].value,imageUrl:t.getCustomFeedImage(n.value)});s[n.value]=n.value}})}return r})},function(t){e.error(t);throw new Error(t)}))}catch(e){return Promise.reject(e)}},getNewsFeedDetailsUrl:function e(t){let n=U+"?$filter=ChangeId eq "+"'"+t.changeId+"'";n=t.title?n+" and LineOfBusiness eq "+"'"+encodeURI(t.title)+"'":n;n=t.showAllPreparationRequired?n+" and PreparationRequired eq true":n;return n+"&$top=999"},getAuthNewsFeed:function t(n){try{const t=this;return Promise.resolve(T(function(){return Promise.resolve(Promise.all([t.getAllAvailableApps(),t.getNewsFeedDetails(n)])).then(function(e){let[n,s]=e;return n.length===0?s:t.arrangeNewsFeeds(s,n)})},function(t){e.error(t)}))}catch(e){return Promise.reject(e)}},arrangeNewsFeeds:function e(t,n){const s=[];t.forEach(e=>{if(e.Category.value!=="App"||!e.ImpactedArtifacts.value){s.push(e)}else{const t=e.ImpactedArtifacts.value.split("\n");for(let r of t){const t=r;if(t&&this.isAuthFeed(n,r)){s.push(e);break}}}});return s},isAuthFeed:function e(t,n){const s="|";if(n.includes(s)){const e=n.split(s);const r=(e[e.length-1]||"").trim();if(r){const e=t.findIndex(e=>r===e?.signature?.parameters["sap-fiori-id"]?.defaultValue?.value);return e>-1}}return true},getAllAvailableApps:function t(){try{return Promise.resolve(T(function(){return Promise.resolve(o.getServiceAsync("ClientSideTargetResolution")).then(function(e){return e?._oAdapter._aInbounds||[]})},function(t){if(t instanceof Error){e.error(t.message)}return[]}))}catch(e){return Promise.reject(e)}},getNewsFeedDetails:function e(t){try{const e=this;if(!e.customNewsFeedCache.has(t)){e.customNewsFeedCache.set(t,S.GetJSON(t))}const n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2");return Promise.resolve(Promise.all([e.customNewsFeedCache.get(t),e.getTranslatedText(e.getCustomFeedKey())])).then(function(t){let[s,r]=t;const i=JSON.parse(JSON.stringify(s.value||[]));const o=JSON.parse(JSON.stringify(r.value||[]));return i.map(t=>{const s=Object.keys(t);const r=[];s.forEach(e=>{const s=o.find(t=>t?.ColumnName?.toUpperCase()===e.toUpperCase());const i=s?.TranslatedName||n(e);t[e]={label:i,value:t[e]};if(!V.EXCLUDE_FIELDS.includes(e)){r.push(t[e])}});t.Link={label:e._i18nBundle.getText("readMoreLink"),value:t[V.LINK],text:"Link"};t.expanded=i.length===1;t.expandFields=r;return t})})}catch(e){return Promise.reject(e)}},getTranslatedText:function t(n){try{const e=_+"?$filter=Changeid eq '"+n+"'";if(!this.customNewsFeedCache.has(e)){this.customNewsFeedCache.set(e,S.GetJSON(e))}return this.customNewsFeedCache.get(e)}catch(t){if(t instanceof Error){e.error(t.message)}return[]}},loadCustomNewsFeed:function e(t){const n=this.parseJsonToXml(JSON.parse(JSON.stringify(t)));const s=this.getParent();if(!this.oNewsModel){this.oNewsModel=new i(n);if(!this.bNewsLoad){s?.panelLoadedFn("News",{loaded:true,count:B});this.bNewsLoad=true}this.oNewsTile.setModel(this.oNewsModel)}else{this.oNewsModel.setData(n)}void this.loadNewsFeed(n,t.length)},parseJsonToXml:function e(t){const n=e=>e.map(e=>({item:e}));const s=e=>{let t="";let n;for(n in e){const r=e[n];if(r){if(typeof r==="object"){t+=`<${n}>${s(r)}</${n}>`}else{t+=`<${n}>${r}</${n}>`}}}return t.replace(/<\/?\d+>/g,"")};const r=JSON.parse(JSON.stringify(n(t)));let i="<?xml version='1.0' encoding='UTF-8'?>";const o="customFeed";i+=`<${o}>`;i+=s(r);i+=`</${o}>`;i=i.replaceAll("&","&");const a=new DOMParser;return a.parseFromString(i,"text/xml")},getCustomFeedImage:function e(t){const n=sap.ui.require.toUrl(V.IMAGE_URL);let s=n+q.default[0];const r=q[t]||[];let i=0;if(r.length>0){const e=new window.Uint32Array(1);window.crypto.getRandomValues(e);i=e[0]%3;s=n+r[i]}return s},_getUserPersonalization:function e(){const t=x.getPersContainerId(this);const n=x.getOwnerComponent(this);return L.getInstance(t,n)}});return j});
|
|
216
|
+
sap.ui.predefine("sap/cux/home/NewsPanel", ["sap/base/Log","sap/m/GenericTile","sap/m/SlideTile","sap/ui/core/EventBus","sap/ui/core/format/DateFormat","sap/ui/model/xml/XMLModel","sap/ushell/Container","./BaseNewsPanel","./MenuItem","./NewsGroup","./NewsItem","./library","./utils/Constants","./utils/DataFormatUtils","./utils/Device","./utils/FESRUtil","./utils/HttpHelper","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,s,r,i,o,a,l,u,c,f,d,h,m,g,p,w,N){"use strict";function y(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function v(e,t,n){if(!e.s){if(n instanceof P){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=v.bind(null,e,t);return}}if(n&&n.then){n.then(v.bind(null,e,t),v.bind(null,e,2));return}e.s=t;e.v=n;const s=e.o;if(s){s(e)}}}const F=y(a);const P=function(){function e(){}e.prototype.then=function(t,n){const s=new e;const r=this.s;if(r){const e=r&1?t:n;if(e){try{v(s,1,e(this.v))}catch(e){v(s,2,e)}return s}else{return this}}this.o=function(e){try{const r=e.v;if(e.s&1){v(s,1,t?t(r):r)}else if(n){v(s,1,n(r))}else{v(s,2,r)}}catch(e){v(s,2,e)}};return s};return e}();function T(e){return e instanceof P&&e.s&1}function b(e,t,n){var s;for(;;){var r=e();if(T(r)){r=r.v}if(!r){return i}if(r.then){s=0;break}var i=n();if(i&&i.then){if(T(i)){i=i.s}else{s=1;break}}if(t){var o=t();if(o&&o.then&&!T(o)){s=2;break}}}var a=new P;var l=v.bind(null,a,2);(s===0?r.then(c):s===1?i.then(u):o.then(f)).then(void 0,l);return a;function u(s){i=s;do{if(t){o=t();if(o&&o.then&&!T(o)){o.then(f).then(void 0,l);return}}r=e();if(!r||T(r)&&!r.v){v(a,1,i);return}if(r.then){r.then(c).then(void 0,l);return}i=n();if(T(i)){i=i.v}}while(!i||!i.then);i.then(u).then(void 0,l)}function c(e){if(e){i=n();if(i&&i.then){i.then(u).then(void 0,l)}else{u(i)}}else{v(a,1,i)}}function f(){if(r=e()){if(r.then){r.then(c).then(void 0,l)}else{c(r)}}else{v(a,1,i)}}}const C=y(l);function E(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const _=y(u);const S=y(c);const M=f["NewsType"];const A=d["DEFAULT_NEWS_URL"];const D=h["recycleId"];const I=m["DeviceType"];const U=g["addFESRId"];const L=y(p);const x=y(w);const R=y(N);const B="/sap/opu/odata4/ui2/insights_srv/srvd/ui2/",O=B+"insights_read_srv/0001/"+"NEWS_FEED",V=B+"insights_read_srv/0001/"+"NewsFeedColumnTranslation",j=7,$=function(e,t){return Array.from({length:t},function(t,n){return e+"/"+(n+1)+".jpg"})};const q={TITLE:"LineOfBusiness",LINK:"WhatsNewDocument",VALIDITY:"ValidAsOf",PREPARATION_REQUIRED:"PreparationRequired",EXCLUDE_FIELDS:["ChangeId","LineNumber","LineOfBusiness","SolutionArea","Title","Description","Type","ValidAsOf","WhatsNewDocument","Link"],IMAGE_URL:"sap/cux/home/img/CustomNewsFeed/",FESR_STEP_NAME:"custNewsSlide-press",EMPTY_DATA_ERROR_CODE:"NODATA"},J={"Application Platform and Infrastructure":$("ApplicationPlatformandInfrastructure",3),"Asset Management":$("AssetManagement",3),"Cross Applications":$("CrossApplications",3),Finance:$("Finance",3),Manufacturing:$("Manufacturing",3),"R&D / Engineering":$("RnDandEngineering",3),Sales:$("Sales",3),"Sourcing and Procurement":$("SourcingandProcurement",3),"Supply Chain":$("SupplyChain",3),default:["default.jpg"]};const W=F.extend("sap.cux.home.NewsPanel",{metadata:{library:"sap.cux.home",properties:{url:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},type:{type:"sap.cux.home.NewsType",group:"Misc",visibility:"public",defaultValue:M.RSS},customFeedKey:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},customFileName:{type:"string",group:"Misc",defaultValue:""},showCustom:{type:"boolean",group:"Misc",defaultValue:false},newsAvailable:{type:"boolean",group:"Misc",defaultValue:true,visibility:"hidden"},supportedFileFormats:{type:"FileFormat[]",group:"Misc",defaultValue:["xlsx"],visibility:"hidden"}},aggregations:{newsGroup:{type:"sap.cux.home.NewsGroup",singularName:"newsGroup",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){F.prototype.constructor.call(this,t,n);this._defaultNewsPromise=null;this.customNewsFeedCache=new Map},init:function e(){F.prototype.init.call(this);this.oNewsTile=new n(this.getId()+"--idNewsSlide",{displayTime:2e4,width:"100%",height:"17rem",tiles:[new t(this.getId()+"--placeholder",{state:"Loading",mode:"ArticleMode",frameType:"Stretch"})]}).addStyleClass("newsTileMaxWidth sapUiSmallMarginTop");U(this.oNewsTile,"newsSlidePress");this.getNewsWrapper().addContent(this.oNewsTile);this.getNewsWrapper().addStyleClass("newsWrapper");this.setProperty("title",this._i18nBundle.getText("newsTitle"));this._eventBus=s.getInstance();this.oManageMenuItem=new C(`${this.getId()}-manageNews`,{title:this._i18nBundle.getText("mngNews"),icon:"sap-icon://edit",press:this.handleEditNews.bind(this)});this.addAggregation("menuItems",this.oManageMenuItem);U(this.oManageMenuItem,"manageNews");let r=this.isURLParamEnabled("default-News");if(r){this.setUrl(A);this.setProperty("showCustom",false)}},isURLParamEnabled:function e(t){const n=new URLSearchParams(window.location.search);return n.get(t)?.toUpperCase()==="TRUE"},getData:function e(){try{const t=this;function n(){function e(){t.fireEvent("loaded");t.adjustLayout()}const n=function(){if(s&&s!==A&&!t.getProperty("showCustom")){return Promise.resolve(t.initializeXmlModel(s)).then(function(e){t.oNewsModel=e;t.oNewsTile.setModel(t.oNewsModel);t.oManageMenuItem.setVisible(false)})}else{const e=function(){if(s==A&&!t.getProperty("showCustom")){t.bNewsLoad=t.bNewsLoad||false;t.oManageMenuItem.setVisible(true);void t.setCustomNewsFeed("")}else{const e=function(){if(t.getProperty("showCustom")){t.bNewsLoad=t.bNewsLoad||false;t.oManageMenuItem.setVisible(true);const e=t.getCustomFeedKey();const n=function(){if(e){return Promise.resolve(t.setCustomNewsFeed(e)).then(function(){})}else{t.handleFeedError()}}();if(n&&n.then)return n.then(function(){})}else{t.handleFeedError()}}();if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();return n&&n.then?n.then(e):e(n)}let s=t.getUrl();let r=t.isURLParamEnabled("default-News");t.mandatoryNewsFeed=[];const i=function(){if(!t.favNewsFeed){return Promise.resolve(t.setFavNewsFeed(r)).then(function(){})}}();return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(o){return Promise.reject(o)}},getCurrentNewsGroup:function e(t){let n=this._defaultNews.value;let s=t.split("-");let r=s?.[s.length-1];let i=n.find(e=>e.group_id===r);return i},getCustomFeedKey:function e(){return this.getProperty("customFeedKey")},getUrl:function e(){return this.getProperty("url")},initializeXmlModel:function e(t){try{const e=this;const n=e.getParent();return Promise.resolve(new Promise(s=>{const r=new i(t);r.setDefaultBindingMode("OneWay");r.attachRequestCompleted(t=>{void function(){try{if(!e.bNewsLoad){n?.panelLoadedFn("News",{loaded:true,count:j});e.bNewsLoad=true}const i=t.getSource().getData();return Promise.resolve(e.loadNewsFeed(i,0)).then(function(){e._eventBus.publish("KeyUserChanges","newsFeedLoadFailed",{showError:false,date:new Date});s(r)})}catch(e){return Promise.reject(e)}}()});r.attachRequestFailed(()=>{e.handleFeedError();if(!e.bNewsLoad){n?.panelLoadedFn("News",{loaded:false,count:0});e.bNewsLoad=true}e._eventBus.publish("KeyUserChanges","newsFeedLoadFailed",{showError:true,date:new Date});s(r)})}))}catch(e){return Promise.reject(e)}},loadNewsFeed:function e(t,n){try{const s=this;function r(){if(!!t?.querySelector("rss")&&!!t?.querySelector("item")){i={path:"/channel/item/",length:n||j}}else if(!!t?.querySelector("atom")&&!!t?.querySelector("entry")){i={path:"/entry/",length:n||j}}else if((!!t?.querySelector("customFeed")||!!t?.querySelector("defaultFeed"))&&!!t?.querySelector("item")){s.destroyAggregation("newsItems");i={path:"/item/",length:n||j}}else{s.handleFeedError();return}s.bindNewsTile(s.oNewsTile,i)}let i;const o=function(){if(!t?.querySelector("customFeed")&&!t?.querySelector("defaultFeed")){return Promise.resolve(s.extractAllImageUrls(t,n||j)).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(r):r(o))}catch(a){return Promise.reject(a)}},handleFeedError:function e(){if(this.getProperty("showCustom")||this.getUrl()===A){this.generateErrorMessage().setVisible(true);this.oNewsTile.setVisible(false)}else{(this.getNewsWrapper()?.getParent()).setVisible(false);this.setProperty("newsAvailable",false);this.oManageMenuItem.setVisible(false)}},setURL:function e(t){try{const e=this;e.setProperty("showCustom",false);e.setProperty("newsAvailable",true);e.generateErrorMessage().setVisible(false);(e.getNewsWrapper()?.getParent()).setVisible(true);e.oNewsTile.setVisible(true);e.setProperty("url",t);return Promise.resolve(e.getData()).then(function(){})}catch(e){return Promise.reject(e)}},adjustLayout:function e(){if(this.getDeviceType()===I.Mobile){this.oNewsTile.setHeight("11rem");this.generateErrorMessage().setWidth("100%");this.oNewsTile.removeStyleClass("sapUiSmallMarginTop")}else{this.oNewsTile.setHeight("17rem");(this.getNewsWrapper()?.getParent()).setWidth("100%")}},bindNewsTile:function e(t,n){if(n){if(!t.getBinding("tiles")){t.bindAggregation("tiles",{path:n.path,length:n.length,templateShareable:false,factory:(e,t)=>{const n=t.getObject();let s;if(n.getElementsByTagName("link").length>0){s=new S(D(`${e}-news-item`),{url:n.getElementsByTagName("link")[0].textContent,title:n.getElementsByTagName("title")[0].textContent,subTitle:n.getElementsByTagName("description")[0].textContent,imageUrl:n.getElementsByTagName("imageUrl")[0].textContent,footer:this.formatDate(n.getElementsByTagName("pubDate")[0].textContent)})}else{let t=n.getElementsByTagName("id")?.[0]?.textContent??"";let r=t?e+"-newsgroup-"+t:e+"-newsgroup";let i=n.getElementsByTagName("subTitle")?.[0]?.textContent??"";s=new _(D(r),{title:n.getElementsByTagName("title")[0].textContent,subTitle:i||this._i18nBundle.getText("newsFeedDescription"),imageUrl:n.getElementsByTagName("imageUrl")?.[0]?.textContent,footer:n.getElementsByTagName("footer")?.[0]?.textContent})}this.addAggregation("newsItems",s,true);return s.getTile()}})}}},extractAllImageUrls:function e(t,n){try{const e=this;let s=0;const r=b(function(){return s<n},function(){return s++},function(){const n=t?.getElementsByTagName("item")[s];return Promise.resolve(e.extractImage(n.getElementsByTagName("link")[0].textContent)).then(function(e){const s=t.createElement("imageUrl");s.textContent=e;n.appendChild(s)})});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},formatDate:function e(t){const n=r.getDateTimeInstance({style:"medium",relative:true,relativeStyle:"short"});return n.format(new Date(t))},getFavNewsFeed:function e(){return this.favNewsFeed},extractImage:function e(t){const n=()=>{const e=sap.ui.require.toUrl("sap/cux/home/utils");this.image=this.image?this.image+1:1;this.image=this.image<9?this.image:1;return`${e}/imgNews/${this.image}.jpg`};return fetch(t).then(e=>e.text()).then(e=>{const t=e.match(/<meta[^>]*property=["']og:image["'][^>]*content=["']([^"']+)["'][^>]*>/i);return Array.isArray(t)&&t[1]?t[1]:n()}).catch(n)},isCSVFileFormat:function e(t){return t.split(".").pop()?.toLowerCase()==="csv"},setFavNewsFeed:function e(t){try{const e=this;return Promise.resolve(e._getUserPersonalization()).then(function(n){return Promise.resolve(n?.read()).then(function(n){e.favNewsFeed=t?n?.defaultNewsFeed:n?.favNewsFeed})})}catch(e){return Promise.reject(e)}},setCustomNewsFeed:function t(n){try{const t=this;return Promise.resolve(E(function(){t.oNewsTile.setVisible(true);t.generateErrorMessage().setVisible(false);return Promise.resolve(t.setFavNewsFeed(!n)).then(function(){function e(){if(i.length===0){throw new Error("Error: No news feed available")}if(t.favNewsFeed?.items?.length){i=i.filter(e=>t.favNewsFeed?.items.includes(e.title))}else if(t.favNewsFeed?.items?.length===0){t.getParent()?.panelLoadedFn("News",{loaded:true,count:0});throw new Error("Error: No fav news feed available")}return Promise.resolve(t.loadCustomNewsFeed(i,n?"customFeed":"defaultFeed")).then(function(){})}const s=t.getProperty("customFileName");const r=t.isCSVFileFormat(s)?false:t.favNewsFeed?.showAllPreparationRequired??true;if(t.isCSVFileFormat(s)){q.EXCLUDE_FIELDS.push("PreparationRequired")}let i;const o=function(){if(n){return Promise.resolve(t.getCustomNewsFeed(n,r)).then(function(e){i=e})}else{return Promise.resolve(t.getCustomNewsFeed("",true)).then(function(e){i=e})}}();return o&&o.then?o.then(e):e(o)})},function(n){e.error(n);t.handleFeedError()}))}catch(e){return Promise.reject(e)}},filterMandatoryNews:function e(t){return t.filter(e=>{const t=e.mandatory_text?.toUpperCase()==="TRUE";const n=e._group_to_article?.some(function(t){if(t.mandatory_text?.toUpperCase()==="TRUE"){e.mandatory_text="TRUE";return true}});return t||n})},getDefaultNewsFeedDetails:function e(t){let n=JSON.parse(JSON.stringify(t.value||[]));const s=[];const r={};this.mandatoryNewsFeed=[];if(n?.length>0){this.mandatoryNewsFeed=this.filterMandatoryNews(n).map(e=>e.title);for(const e of n){const t=e.title;let n="";if(!r[t]){n=e.subTitle||e.description||"";s.push({title:t,footer:e.footer_text,imageUrl:this.getDefaultFeedImage(e),id:e.group_id,subTitle:n||""});r[t]=t}}}return s},getMandatoryDefaultNewsFeed:function e(){return this.mandatoryNewsFeed||[]},getDefaultNewsResponse:function e(){if(this._defaultNews){return Promise.resolve(this._defaultNews)}if(!this._defaultNewsPromise){this._defaultNewsPromise=this.fetchDefaultNews()}return this._defaultNewsPromise},fetchDefaultNews:function t(){try{const t=this;return Promise.resolve(E(function(){return Promise.resolve(fetch(A)).then(function(e){if(!e.ok){throw new Error(`HTTP error! status: ${e.status}`)}return Promise.resolve(e.json()).then(function(e){t._defaultNews=e;return t._defaultNews})})},function(n){t._defaultNewsPromise=null;e.error(n);throw n}))}catch(e){return Promise.reject(e)}},getCustomNewsFeed:function e(t,n){try{const e=this;if(!t){return Promise.resolve(e.getDefaultNewsResponse()).then(function(){let t=e.getDefaultNewsFeedDetails(e._defaultNews);return t})}else{return Promise.resolve(e.getCustomFeedData(t,n))}}catch(e){return Promise.reject(e)}},getCustomFeedData:function t(n,s){try{const t=this;return Promise.resolve(E(function(){const e=t.getNewsFeedDetailsUrl({changeId:n,showAllPreparationRequired:s});if(!t.customNewsFeedCache.has(e)){t.customNewsFeedCache.set(e,t.getAuthNewsFeed(e))}return Promise.resolve(t.customNewsFeedCache.get(e)).then(function(e){const n=e;const s={};const r=[];if(n?.length>0){n.forEach(e=>{const n=e[q.TITLE];if(!s[n.value]){r.push({title:n.value,footer:e[q.VALIDITY].value,imageUrl:t.getCustomFeedImage(n.value)});s[n.value]=n.value}})}return r})},function(t){e.error(t);throw new Error(t)}))}catch(e){return Promise.reject(e)}},getNewsFeedDetailsUrl:function e(t){let n=O+"?$filter=ChangeId eq "+"'"+t.changeId+"'";const s=this.getProperty("customFileName");if(!this.isCSVFileFormat(s)&&t.showAllPreparationRequired){n=n+" and PreparationRequired eq true"}return n+"&$top=999"},getAuthNewsFeed:function t(n,s){try{const t=this;return Promise.resolve(E(function(){return Promise.resolve(Promise.all([t.getAllAvailableApps(),t.getNewsFeedDetails(n,s)])).then(function(e){let[n,s]=e;return n.length===0?s:t.arrangeNewsFeeds(s,n)})},function(t){e.error(t)}))}catch(e){return Promise.reject(e)}},arrangeNewsFeeds:function e(t,n){const s=[];t.forEach(e=>{if(e.Category.value!=="App"||!e.ImpactedArtifacts.value){s.push(e)}else{const t=e.ImpactedArtifacts.value.split("\n");for(let r of t){const t=r;if(t&&this.isAuthFeed(n,r)){s.push(e);break}}}});return s},isAuthFeed:function e(t,n){const s="|";if(n.includes(s)){const e=n.split(s);const r=(e[e.length-1]||"").trim();if(r){const e=t.findIndex(e=>r===e?.signature?.parameters["sap-fiori-id"]?.defaultValue?.value);return e>-1}}return true},getAllAvailableApps:function t(){try{return Promise.resolve(E(function(){return Promise.resolve(o.getServiceAsync("ClientSideTargetResolution")).then(function(e){return e?._oAdapter._aInbounds||[]})},function(t){if(t instanceof Error){e.error(t.message)}return[]}))}catch(e){return Promise.reject(e)}},getNewsFeedDetails:function e(t,n){try{let s=false;const r=this;function i(e){if(s)return e;const i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2");return Promise.resolve(Promise.all([L.GetJSON(t),r.getTranslatedText(r.getCustomFeedKey())])).then(function(e){let[t,s]=e;let o=JSON.parse(JSON.stringify(t.value||[]));const a=JSON.parse(JSON.stringify(s.value||[]));o=r.filterNewsOnTitle(o,n);return o.map(e=>{const t=Object.keys(e);const n=[];t.forEach(t=>{const s=a.find(e=>e?.ColumnName?.toUpperCase()===t.toUpperCase());const r=s?.TranslatedName||i(t);e[t]={label:r,value:e[t]};if(!q.EXCLUDE_FIELDS.includes(t)){n.push(e[t])}});e.Link={label:r._i18nBundle.getText("readMoreLink"),value:e[q.LINK],text:"Link"};e.expanded=o.length===1;e.expandFields=n;return e})})}const o=function(){if(r.customNewsFeedCache.has(t)){return Promise.resolve(r.customNewsFeedCache.get(t)).then(function(e){const t=r.filterNewsOnTitle(e,n);s=true;return t})}}();return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(a){return Promise.reject(a)}},filterNewsOnTitle:function e(t,n){if(n){return t.filter(e=>e.LineOfBusiness.value===n)}return t},getTranslatedText:function t(n){try{const e=V+"?$filter=Changeid eq '"+n+"'";if(!this.customNewsFeedCache.has(e)){this.customNewsFeedCache.set(e,L.GetJSON(e))}return this.customNewsFeedCache.get(e)}catch(t){if(t instanceof Error){e.error(t.message)}return[]}},loadCustomNewsFeed:function e(t,n){try{const e=this;const s=e.parseJsonToXml(JSON.parse(JSON.stringify(t)),n);const r=e.getParent();if(!e.oNewsModel){e.oNewsModel=new i(s);if(!e.bNewsLoad){r?.panelLoadedFn("News",{loaded:true,count:j});e.bNewsLoad=true}e.oNewsTile.setModel(e.oNewsModel)}else{e.oNewsTile.unbindAggregation("tiles",false);e.oNewsTile.destroyAggregation("tiles");e.oNewsModel.setData(s)}return Promise.resolve(e.loadNewsFeed(s,t.length)).then(function(){})}catch(e){return Promise.reject(e)}},parseJsonToXml:function e(t,n){const s=e=>e.map(e=>({item:e}));const r=e=>{let t="";let n;for(n in e){const s=e[n];if(s){if(typeof s==="object"){t+=`<${n}>${r(s)}</${n}>`}else{t+=`<${n}>${s}</${n}>`}}}return t.replace(/<\/?\d+>/g,"")};const i=JSON.parse(JSON.stringify(s(t)));let o="<?xml version='1.0' encoding='UTF-8'?>";const a=n;o+=`<${a}>`;o+=r(i);o+=`</${a}>`;o=o.replaceAll("&","&");const l=new DOMParser;return l.parseFromString(o,"text/xml")},getCustomFeedImage:function e(t){const n=sap.ui.require.toUrl(q.IMAGE_URL);let s=n+J.default[0];const r=J[t]||[];let i=0;if(r.length>0){const e=new window.Uint32Array(1);window.crypto.getRandomValues(e);i=e[0]%3;s=n+r[i]}return s},getDefaultFeedImage:function e(t){const n=t?.bg_image_id;const s=t?._group_to_image;if(!s||s.image_id!==n){return""}let r=s.mime_type;const i=s.bg_image;if(!i){return""}if(r==="application/octet-stream"){r="image/jpeg"}if(!this.isValidBase64(i)){const e=this.base64UrlToBase64(i);return`data:${r};base64,${e}`}return`data:${r};base64,${i}`},base64UrlToBase64:function e(t){let n=t?.replace(/_/g,"/").replace(/-/g,"+");while(n.length%4!==0){n+="="}return n},isValidBase64:function e(t){if(!t||t.length===0){return false}const n=/^[A-Za-z0-9+/]*={0,2}$/;if(!n.test(t)){return false}if(t.length%4!==0){return false}if(t.includes("=")){const e=t.indexOf("=");const n=t.lastIndexOf("=");if(e!==t.length-(t.length-e)){return false}if(t.length-e>2){return false}if(e!==n&&n!==e+1){return false}}return true},_getUserPersonalization:function e(){const t=x.getPersContainerId(this);const n=x.getOwnerComponent(this);return R.getInstance(t,n)}});return W});
|
|
187
217
|
/*!
|
|
188
218
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
189
219
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
190
220
|
*/
|
|
191
|
-
sap.ui.predefine("sap/cux/home/NewsSettingsPanel", ["sap/m/HBox","sap/m/Label","sap/m/List","sap/m/StandardListItem","sap/m/Switch","sap/m/Text","sap/m/Title","sap/m/VBox","./BaseSettingsPanel","./utils/Accessibility","./utils/Constants","./utils/FESRUtil","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,s,i,n,o,a,r,
|
|
221
|
+
sap.ui.predefine("sap/cux/home/NewsSettingsPanel", ["sap/m/HBox","sap/m/Label","sap/m/List","sap/m/StandardListItem","sap/m/Switch","sap/m/Text","sap/m/Title","sap/m/VBox","./BaseSettingsPanel","./utils/Accessibility","./utils/Constants","./utils/FESRUtil","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,s,i,n,o,a,l,r,d,h,w,u,c){"use strict";function g(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const S=g(r);const m=d["getInvisibleText"];const N=h["SETTINGS_PANELS_KEYS"];const f=w["addFESRSemanticStepName"];const C=w["FESR_EVENTS"];const p=g(u);const F=g(c);const P=S.extend("sap.cux.home.NewsSettingsPanel",{init:function e(){S.prototype.init.call(this);this.setProperty("key",N.NEWS);this.setProperty("title",this._i18nBundle.getText("news"));this.setProperty("icon","sap-icon://newspaper");this.addAggregation("content",this.getContent());this.attachPanelNavigated(()=>{void this.loadNewsFeedSettings()});this.aFavNewsFeed=[]},getContent:function e(){const t=this.setHeader();const s=this.setTitleMessage();const i=new l(this.getId()+"--idNewsPageOuterVBoX",{alignItems:"Start",justifyContent:"SpaceBetween",items:[t,s,this.setNewsList()]});return i},getPersonalization:function e(){try{const t=this;function s(){return t.oPersonalizer}const i=function(){if(!t.oPersonalizer){return Promise.resolve(F.getInstance(p.getPersContainerId(t._getPanel()),p.getOwnerComponent(t._getPanel()))).then(function(e){t.oPersonalizer=e})}}();return Promise.resolve(i&&i.then?i.then(s):s(i))}catch(n){return Promise.reject(n)}},setHeader:function e(){this.headerText=new o(this.getId()+"--idCustNewsFeedSettingsText",{text:this._i18nBundle.getText("newsFeedSettingsText")});const t=new l(this.getId()+"--idCustNewsFeedSettingsTextContainer",{alignItems:"Start",justifyContent:"SpaceBetween",items:[this.headerText]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBegin");return t},setTitleMessage:function t(){this.title=new a(this.getId()+"--idCustNewsFeedSettignsTitle",{text:this._i18nBundle.getText("newsFeedSettingsHeading"),titleStyle:"H5"});const s=new e(this.getId()+"--idCustNewsFeedSettingsTitleContainer",{alignItems:"Center",justifyContent:"SpaceBetween",items:[this.title]});const i=new l(this.getId()+"--idCustNewsFeedSettingsTitleVBox",{alignItems:"Start",justifyContent:"SpaceBetween",items:[s]}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBegin");return i},setNewsList:function i(){const o=new t(this.getId()+"--idShowAllCustNewsSwitchLabel",{text:this._i18nBundle.getText("showAllPreparationRequiredSwitchLabel")});this.oShowSwitch=new n(`${this.getId()}-showSwitch`,{customTextOn:" ",customTextOff:" ",change:()=>{void this.saveNewsFeedSettings()},state:false,ariaLabelledBy:[`${this.getId()}--idShowAllCustNewsSwitchLabel`]});f(this.oShowSwitch,C.CHANGE,"showPrepRequire");this.oCustNewsSwitchContainer=new e(this.getId()+"--idShowAllCustNewsSwitchContainer",{alignItems:"Center",items:[o,this.oShowSwitch],width:"94%"}).addStyleClass("sapUiSmallMarginTop");const a=new l(this.getId()+"--idShowAllCustNewsSwitchVBox",{items:[this.oCustNewsSwitchContainer],width:"94%"}).addStyleClass("sapUiSmallMarginTop");const r=m(`${this.getId()}--newsTitleText`,this._i18nBundle.getText("newsTitle"));this.oList=new s(this.getId()+"--idCustNewsFeedList",{mode:"MultiSelect",selectionChange:()=>{void this.saveNewsFeedSettings()},ariaLabelledBy:[r.getId(),`${this.getId()}--idCustNewsFeedSettingsText`,`${this.getId()}--idCustNewsFeedSettignsTitle`]});const d=new l(this.getId()+"--idCustNewsFeedListContainer",{direction:"Column",items:[this.oList,a,r],width:"96%"}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBegin");return d},isCSVFileFormat:function e(t){return t.split(".").pop()?.toLowerCase()==="csv"},saveNewsFeedSettings:function e(){try{const e=this;const t=e.oList.getSelectedItems().map(e=>e.getTitle());const s=e.oNewsPanel.getCustomFeedKey();const i=e.oNewsPanel.getProperty("customFileName");let n;if(s){n={items:t,showAllPreparationRequired:e.isCSVFileFormat(i)?false:e.oShowSwitch.getState()}}else{n={items:t}}return Promise.resolve(e.getPersonalization()).then(function(t){return Promise.resolve(t.read()).then(function(i){if(s){i.favNewsFeed=n}else{i.defaultNewsFeed=n}return Promise.resolve(t.write(i)).then(function(){e.oShowSwitch.setState(n.showAllPreparationRequired);return Promise.resolve(e.oNewsPanel.setCustomNewsFeed(s)).then(function(){})})})})}catch(e){return Promise.reject(e)}},setItems:function e(t){this.oList.destroyAggregation("items",true);(t||[]).forEach((e,t)=>{const s=new i(this.getId()+"--idCustNewsFeedItem"+"--"+t,{title:e.title,selected:e.selected});this.oList.addItem(s)})},loadNewsFeedSettings:function e(){try{const e=this;e.oNewsPanel=e._getPanel();const t=e.oNewsPanel.getCustomFeedKey();return Promise.resolve(e.getPersonalization()).then(function(s){return Promise.resolve(s.read()).then(function(s){const i=t?s?.["favNewsFeed"]:s?.["defaultNewsFeed"];let n=false;n=i?.showAllPreparationRequired??!i;const o=e.oNewsPanel.getProperty("customFileName");let a=[];if(e.isCSVFileFormat(o)||!t){e.oCustNewsSwitchContainer.setVisible(false)}return Promise.resolve(e.oNewsPanel.getCustomNewsFeed(t,false)).then(function(s){if(!t){e.headerText.setText(e._i18nBundle.getText("defaultNewsSettingsText"));e.title.setText(e._i18nBundle.getText("defaultNewsSettingsHeading"));a=e.oNewsPanel.getMandatoryDefaultNewsFeed()}else{e.headerText.setText(e._i18nBundle.getText("newsFeedSettingsText"));e.title.setText(e._i18nBundle.getText("newsFeedSettingsHeading"))}if(s&&s.length>0){e.aFavNewsFeed=i&&i.items||s;let t=e.aFavNewsFeed;s=s.map(e=>{const s=t.find(t=>t===e.title)?true:false;e.selected=!i?true:s;e.blocked=!!a.find(t=>t===e.title);return e});e.aFavNewsFeed=s;e.setItems(e.aFavNewsFeed);e.oShowSwitch.setState(!!n);return s}})})})}catch(e){return Promise.reject(e)}}});return P});
|
|
192
222
|
/*!
|
|
193
223
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
194
224
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
195
225
|
*/
|
|
196
|
-
sap.ui.predefine("sap/cux/home/NoDataContainer", ["sap/m/Button","sap/m/IllustratedMessage","sap/m/VBox","./BaseContainer","./BaseContainerRenderer","./BasePanel","./library"],function(t,
|
|
226
|
+
sap.ui.predefine("sap/cux/home/NoDataContainer", ["sap/m/Button","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/VBox","./BaseContainer","./BaseContainerRenderer","./BasePanel","./library"],function(e,t,n,i,s,a,o,r,l){"use strict";function d(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const u=d(a);const p=d(o);const c=d(r);const h=l["OrientationType"];class g extends c{init(){super.init();this.setProperty("enableSettings",false)}}const y=u.extend("sap.cux.home.NoDataContainer",{renderer:{...p,apiVersion:2},metadata:{library:"sap.cux.home",properties:{width:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:"100%",visibility:"hidden"},height:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:"100%",visibility:"hidden"},orientation:{type:"sap.cux.home.OrientationType",group:"Data",defaultValue:h.Vertical,visibility:"hidden"},enableSettings:{type:"boolean",group:"Behavior",defaultValue:false,visibility:"hidden"}}},constructor:function e(t,n){u.prototype.constructor.call(this,t,n)},init:function e(){u.prototype.init.call(this);this.addStyleClass("sapCuxNoDataContainer");this.addStyleClass("sapCuxNoMarginBottom")},onBeforeRendering:function e(){const t=this.getContent();if(t?.length===0){this._setupDefaultContent()}u.prototype.onBeforeRendering.call(this)},_setupDefaultContent:function a(){const o=new t(this.getId()+"-noDataMessage",{illustrationSize:n.Large,illustrationType:i.NoEntries,title:this._i18nBundle.getText("noSectionTitle"),ariaTitleLevel:"H2",description:this._i18nBundle.getText("noSectionDescription")}).addStyleClass("myHomeIllustratedMsg");const r=new e(this.getId()+"-editMyHomeBtn",{text:this._i18nBundle.getText("noSectionButton"),type:"Emphasized",press:()=>{void this.getParent()?.openSettingsDialog()}});o.insertAdditionalContent(r,0);const l=new s(this.getId()+"-noDataWrapper",{alignItems:"Center",justifyContent:"Center",renderType:"Bare",items:[o],visible:true});const d=new g(`${this.getId()}-noDataContent`);d._addContent(l);this.addContent(d)}});return y});
|
|
197
227
|
/*!
|
|
198
228
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
199
229
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -203,27 +233,27 @@ sap.ui.predefine("sap/cux/home/Page", ["sap/ui/core/Element","sap/ushell/Contain
|
|
|
203
233
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
204
234
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
205
235
|
*/
|
|
206
|
-
sap.ui.predefine("sap/cux/home/PagePanel", ["sap/m/Button","sap/m/FlexBox","sap/m/GenericTile","sap/m/IllustratedMessage","sap/m/VBox","sap/m/library","sap/ui/core/EventBus","./BasePagePanel","./MenuItem","./Page","./utils/Constants","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,s,
|
|
236
|
+
sap.ui.predefine("sap/cux/home/PagePanel", ["sap/m/Button","sap/m/FlexBox","sap/m/GenericTile","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/VBox","sap/m/library","sap/ui/core/EventBus","./BasePagePanel","./MenuItem","./Page","./utils/Constants","./utils/DataFormatUtils","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,a,s,o,i,r,l,g,d,c,h,p,u,P,m,f,I,x){"use strict";function v(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const y=r["LoadState"];const _=v(g);const C=v(d);const B=v(c);const F=h["PAGE_SELECTION_LIMIT"];const T=h["SETTINGS_PANELS_KEYS"];const W=p["recycleId"];const M=u["DeviceType"];const b=P["attachKeyboardHandler"];const S=P["focusDraggedItem"];const D=m["addFESRId"];const E=m["addFESRSemanticStepName"];const w=v(f);const A=v(I);const N=v(x);const z={Mobile:{maxWidth:37.5,minWidth:8},Tablet:{maxWidth:37.5,minWidth:10.625},Desktop:{maxWidth:18.75,minWidth:7},LargeDesktop:{maxWidth:18.75,minWidth:7},smallTabletMinWidth:8};const L=3;const O=8;const R=4;const $=t.extend("sap.cux.home.CustomFlexBox",{renderer:{apiVersion:2},metadata:{library:"sap.cux.home",aggregations:{items:{type:"sap.ui.core.Control",multiple:true,singularName:"item",dnd:{draggable:true,droppable:true}}}},constructor:function e(n,a){t.prototype.constructor.call(this,n,a)}});const j=_.extend("sap.cux.home.PagePanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",visibility:"hidden"},key:{type:"string",group:"Misc",visibility:"hidden"}},aggregations:{pages:{type:"sap.cux.home.Page",singularName:"page",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){_.prototype.constructor.call(this,t,n)},init:function e(){const t=this;_.prototype.init.call(this);this._oWrapperFlexBox=new $(`${this.getId()}-pageWrapper`,{justifyContent:"Start",height:"100%",width:"100%",direction:"Row",renderType:"Bare",wrap:"Wrap",items:this.getPlaceholderPageTiles()}).addStyleClass("pagesFlexGap sapUiSmallMarginTop sapCuxPagesWrapper");this.addDragDropConfigTo(this._oWrapperFlexBox,e=>void this._handlePageDnd(e),function(e){try{return Promise.resolve(b(e,true)).then(function(){})}catch(e){return Promise.reject(e)}});this._addContent(this._oWrapperFlexBox);this.setProperty("title",this._i18nBundle.getText("pageTitle"));const n=new C(`${this.getId()}-managePages`,{title:this._i18nBundle.getText("mngPage"),icon:"sap-icon://edit",press:()=>this._handleEditPages()});this.addAggregation("menuItems",n);D(n,"managePages");this.oEventBus=l.getInstance();this.oEventBus.subscribe("importChannel","favPagesImport",function(e,n,a){try{t.aFavPages=a;return Promise.resolve(t.writeFavPagesIntoPers(t.aFavPages)).then(function(){t._getInnerControls();t._importdone()})}catch(e){return Promise.reject(e)}},this);this.oEventBus.subscribe("pageChannel","pageUpdated",()=>{void this.getData(true)},this)},_importdone:function e(){const t={status:true};this.oEventBus.publish("importChannel","favPagesImported",t)},getData:function e(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const n=this;function a(){n.fireEvent("loaded");return n.oPagePromise}const s=function(){if(n.oPagePromise===undefined||n.oPagePromise===null||t){n.oPagePromise=n._getPageManagerInstance().getFavoritePages();return Promise.resolve(n.oPagePromise).then(function(e){n.aFavPages=e;n._getInnerControls();n.oPagePromise=null})}}();return Promise.resolve(s&&s.then?s.then(a):a(s))}catch(o){return Promise.reject(o)}},_handleEditPages:function e(){const t=this.getParent();t?._getLayout().openSettingsDialog(T.PAGES)},getPlaceholderPageTiles:function e(){const t=new Array(F).fill(y.Loading);const a=t.map((e,t)=>new n(`${this.getId()}--${t}`,{sizeBehavior:"Responsive",state:e,frameType:"OneByOne",mode:"IconMode",visible:true,renderOnThemeChange:true,ariaRole:"listitem",dropAreaOffset:8}).addStyleClass("cuxPagesPlaceholder"));return a},attachResizeHandler:function e(t,n,a,s){try{const e=this.aFavPages?.length,o=this.getDeviceType(),i=a.getDomRef();let r=t?i.clientWidth:n;if(!r){return}let l,g,d,c=r/16;const h=1;s.setAlignItems("Start");if(e>0){const s=this.calculatePagesPerRow(e,t);if(s){const e=z[o].maxWidth;let t=z[o].minWidth;if(o===M.Tablet&&n<736){t=z.smallTabletMinWidth}l=(c-(s-1)*h)/s;l=Math.min(l,e);l=Math.max(l,t);d=`${l}rem`;g=`${s*l+(s-1)*h}rem`}else{d="auto";g="100%"}this._setPropertyValues({hBoxWidth:g,pagesTileWidth:d});a.setWidth(g);return}return}catch(e){if(e instanceof Error){}}},getUserAvailablePages:function e(){try{const e=this;return Promise.resolve(e._getPageManagerInstance().fetchAllAvailablePages())}catch(e){return Promise.reject(e)}},calculatePagesPerRow:function e(t,n){let a=0;const s=this.getDeviceType();if(s===M.Desktop||s===M.LargeDesktop){if(n){a=Math.ceil(t>=O?R:t/2)}else{a=t>R?Math.ceil(t/2):R}}else if(s===M.Mobile){a=t<=L?1:2}else if(s===M.Tablet){a=t<=R?t:Math.ceil(t/2)}return a},_getInnerControls:function e(){const t=[];this.oInnerControls=[];const a=this.getParent();if(this.aFavPages){this.aFavPages.forEach((e,n)=>{t.push(new B(W(`${this.getId()}-favPage-${n}`),{title:e.title,subTitle:e.title===e.spaceTitle?"":e.spaceTitle,icon:e.icon,bgColor:e.BGColor,pageId:e.pageId,spaceId:e.spaceId,spaceTitle:e.spaceTitle,url:"#Launchpad-openFLPPage?pageId="+e.pageId+"&spaceId="+e.spaceId}))});t.forEach((e,t)=>{this.oInnerControls.push(new n(W(`${e.getId()}--genericTile--${t}`),{header:e.getTitle(),subheader:e.getSubTitle(),press:()=>void e.onPageTilePress(e),sizeBehavior:"Responsive",state:"Loaded",frameType:"OneByOne",mode:"IconMode",backgroundColor:e.getBgColor(),tileIcon:e.getIcon(),visible:true,renderOnThemeChange:true,ariaRole:"listitem",dropAreaOffset:8,url:e.getProperty("url")}).addStyleClass("sapCuxPageTile"));this.addAggregation("pages",e,true)});this._oWrapperFlexBox.setAlignItems(this.aFavPages.length==1?"Start":"Center");if(this.aFavPages.length){a?.panelLoadedFn("Page",{loaded:true,count:this.aFavPages.length});this._setFavPagesContent()}else{a?.panelLoadedFn("Page",{loaded:true,count:0});this._setNoPageContent()}}else{a?.panelLoadedFn("Page",{loaded:false,count:0});this.removeAggregation("content",this._oWrapperFlexBox)}},_setFavPagesContent:function e(){this._oWrapperFlexBox.removeAllItems();this._oWrapperFlexBox.removeStyleClass("pagesFlexBox");this.oInnerControls.forEach(e=>{this._oWrapperFlexBox.addItem(e)})},_createNoPageContent:function t(){if(!this._oIllusMsg){this._oIllusMsg=new a(this.getId()+"--idNoPages",{illustrationSize:s.Small,illustrationType:o.NoSavedItems,title:this._i18nBundle.getText("noDataPageTitle"),description:this._i18nBundle.getText("noPageDescription")}).addStyleClass("myHomeIllustratedMsg myHomeIllustratedMessageAlign");this.oAddPageBtn=new e(this.getId()+"--idAddPageBtn",{text:this._i18nBundle.getText("addPage"),tooltip:this._i18nBundle.getText("addPage"),type:"Emphasized",press:()=>this._handleEditPages()});E(this.oAddPageBtn,"press","addPages")}},_setNoPageContent:function e(){if(!this.oWrapperNoPageVBox){this.oWrapperNoPageVBox=new i(`${this.getId()}--wrapperNoPageVBox`,{width:"100%",height:"17rem",backgroundDesign:"Solid",justifyContent:"Center"}).addStyleClass("sapUiRoundedBorder noCardsBorder");this._createNoPageContent();this._oIllusMsg.addAdditionalContent(this.oAddPageBtn);this._oWrapperFlexBox.removeAllItems();this._oWrapperFlexBox.addStyleClass("pagesFlexBox");this.oWrapperNoPageVBox.addItem(this._oIllusMsg);this._oWrapperFlexBox.addItem(this.oWrapperNoPageVBox)}},_setPropertyValues:function e(t){const n=Object.keys(t);n.forEach(e=>{if(e==="hBoxWidth"){this._oWrapperFlexBox.setProperty("width",t[e])}else if(e==="pagesTileWidth"&&this.oInnerControls.length){this.oInnerControls.forEach(function(n){n.setProperty("width",t[e])})}})},_handlePageDnd:function e(t){try{const e=this;const n=t.getParameter?.("dropPosition"),a=t?.getParameter?.("draggedControl"),s=t.getParameter("droppedControl"),o=a.getParent()?.indexOfItem(a);let i=a.getParent()?.indexOfItem(s);if(n==="Before"&&o===i-1){i--}else if(n==="After"&&o===i+1){i++}const r=function(){if(o!==i){return Promise.resolve(e._DragnDropPages(o,i,n)).then(function(){})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_DragnDropPages:function e(t,n,a){try{const e=this;if(a==="Before"&&t<n){n--}else if(a==="After"&&t>n){n++}const s=e.aFavPages.splice(t,1)[0];e.aFavPages.splice(n,0,s);e._getInnerControls();return Promise.resolve(e.writeFavPagesIntoPers(e.aFavPages)).then(function(){S(e._oWrapperFlexBox,n)})}catch(e){return Promise.reject(e)}},writeFavPagesIntoPers:function e(t){try{const n=this;function a(){return Promise.resolve(n.oPersonalizer.read()).then(function(e){if(!e)e={favouritePages:[]};e.favouritePages=t;return Promise.resolve(n.oPersonalizer.write(e)).then(function(){})})}const s=function(){if(n.oPersonalizer===undefined){return Promise.resolve(N.getInstance(n.persContainerId,A.getOwnerComponent(n))).then(function(e){n.oPersonalizer=e})}}();return Promise.resolve(s&&s.then?s.then(a):a(s))}catch(o){return Promise.reject(o)}},applyColorPersonalizations:function e(t){void this._getPageManagerInstance()?.applyColorPersonalizations(t)},applyIconPersonalizations:function e(t){void this._getPageManagerInstance()?.applyIconPersonalizations(t)},_getPageManagerInstance:function e(){if(!this.pageManagerInstance){const e=this.getParent();const t=e?.getParent();this.persContainerId=t?.getProperty("persContainerId")||A.getPersContainerId(this);this.pageManagerInstance=w.getInstance(this.persContainerId,A.getOwnerComponent(this))}return this.pageManagerInstance}});return j});
|
|
207
237
|
/*!
|
|
208
238
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
209
239
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
210
240
|
*/
|
|
211
|
-
sap.ui.predefine("sap/cux/home/PageSettingsPanel", ["sap/m/CustomListItem","sap/m/HBox","sap/m/List","sap/m/Panel","sap/m/SearchField","sap/m/Text","sap/m/Title","sap/m/ToggleButton","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","./BaseSettingsPanel","./utils/Accessibility","./utils/Constants","./utils/PageManager","./utils/PersonalisationUtils"],function(e,t,s,a,n,
|
|
241
|
+
sap.ui.predefine("sap/cux/home/PageSettingsPanel", ["sap/m/CustomListItem","sap/m/HBox","sap/m/List","sap/m/Panel","sap/m/SearchField","sap/m/Text","sap/m/Title","sap/m/ToggleButton","sap/m/Toolbar","sap/m/ToolbarSpacer","sap/m/VBox","./BaseSettingsPanel","./utils/Accessibility","./utils/Constants","./utils/DataFormatUtils","./utils/PageManager","./utils/PersonalisationUtils"],function(e,t,s,a,i,n,o,r,l,g,c,d,h,p,u,P,S){"use strict";function m(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const f=m(d);const I=h["getInvisibleText"];const _=p["PAGE_SELECTION_LIMIT"];const x=p["SETTINGS_PANELS_KEYS"];const B=u["recycleId"];const T=m(P);const w=m(S);const y=f.extend("sap.cux.home.PageSettingsPanel",{constructor:function e(){f.prototype.constructor.apply(this,arguments);this._initialNavigation=true},init:function e(){f.prototype.init.call(this);this.setProperty("key",x.PAGES);this.setProperty("title",this._i18nBundle.getText("pages"));this.setProperty("icon","sap-icon://course-book");this.oWrapperVBox=new c(`${this.getId()}--pageSettingsWrapper`,{width:"100%"}).addStyleClass("sapUiNoPadding sapUiNoMarginEnd");this.addAggregation("content",this.oWrapperVBox);this.attachPanelNavigated(()=>{void this.onPanelNavigated()})},onPanelNavigated:function e(){try{const t=this;function s(){if(t.oSearchField?.getValue()){t.oSearchField.setValue("");t.sSearchQuery="";t._renderPages(t.aSpaces)}}const a=function(){if(t._initialNavigation){t._initialNavigation=false;return Promise.resolve(t._initializePanel()).then(function(){})}}();return Promise.resolve(a&&a.then?a.then(s):s(a))}catch(i){return Promise.reject(i)}},_initializePanel:function e(){try{const e=this;if(!e.PageManagerInstance){e.PageManagerInstance=T.getInstance(w.getPersContainerId(e._getPanel()),w.getOwnerComponent(e._getPanel()))}return Promise.resolve(e.PageManagerInstance.fetchAllAvailablePages()).then(function(t){e.aAllPages=t;return Promise.resolve(e.PageManagerInstance.getFavoritePages()).then(function(t){e.aFavPages=t;return Promise.resolve(e.PageManagerInstance.fetchAllAvailableSpaces()).then(function(t){e.aSpaces=t;e._showMessageStrip();e._showToolbar();e._showPagesList()})})})}catch(e){return Promise.reject(e)}},_showMessageStrip:function e(){const t=new c(`${this.getId()}--msgStripContainer`,{width:"100%"}).addStyleClass("sapUiNoPadding sapUiNoMarginEnd");this.oMessage=new n(`${this.getId()}--msgStripText`).addStyleClass("sapUiSmallMargin");this._seHeaderMessage();t.addItem(this.oMessage);this.oWrapperVBox.addItem(t)},_setInvisibleSubHeaderText:function e(){const t=this.aFavPages.length>=_?this._i18nBundle.getText("myInterestwarning"):this._i18nBundle.getText("myInterestinfo");const s=I(this.getId()+"--pageSubHeaderText",t);return s},_seHeaderMessage:function e(){this.oMessage.setText(this.aFavPages.length>=_?this._i18nBundle.getText("myInterestwarning"):this._i18nBundle.getText("myInterestinfo"))},_showToolbar:function e(){const t=I(this.getId()+"--pageTitleText",this._i18nBundle.getText("pages"));const s=this._setInvisibleSubHeaderText();const a=new o(`${this.getId()}--pagesListTitle`,{text:this._i18nBundle.getText("pageGroupHeader"),titleStyle:"H5"}).addStyleClass("sapUiSmallMarginBottom");this.oSearchField=new i(`${this.getId()}--pagesListSearch`,{liveChange:e=>this._onPagesSearch(e),width:"13.75rem",ariaLabelledBy:[t.getId(),s.getId(),a.getId()]}).addStyleClass("sapUiSmallMarginBottom pagesListSearch");const n=new l(`${this.getId()}--pagesListToolbar`,{width:"calc(100% - 2rem)",height:"3rem",design:"Solid",content:[a,new g(`${this.getId()}--pagesHeaderToolbarSpacer`),this.oSearchField,t,s]}).addStyleClass("sapUiSmallMarginBegin pagesToolbarNoPadding");this.oWrapperVBox.addItem(n)},_showPagesList:function e(){this.oPagesListVBox=new c(`${this.getId()}--pagesListVBox`,{width:"calc(100% - 2rem)"}).addStyleClass("sapUiSmallMarginBegin");this._renderPages(this.aSpaces);this.oWrapperVBox.addItem(this.oPagesListVBox)},_createPagesList:function s(a,i,o){const l=new n({text:a.label});const g=new r(B(`${this.getId()}-toggle-${i}--${o}`),{tooltip:a.selected?this._i18nBundle.getText("hideBtn"):this._i18nBundle.getText("showBtn"),icon:"sap-icon://show",type:"Emphasized",pressed:!a.selected,enabled:a.selected||this.aFavPages.length<_,press:e=>void this._pageSelectHandler(a.id,e)});const c=new t(B(`${this.getId()}--customListBox--${i}--${o}`),{justifyContent:"SpaceBetween",alignItems:"Center",items:[l,g]});const d=new e(B(`${this.getId()}--customList--${i}--${o}`),{content:[c]}).addStyleClass("pagesPanelItem");return d},_renderPages:function e(i){const o=this.oPagesListVBox.getParent()?.getParent();const r=o?.getDomRef()?.childNodes[1];const l=r?.scrollTop||0;this.oPagesListVBox.removeAllItems();if(!i.length){if(!this.oNoDataHBox){this.oNoDataHBox=new t(`${this.getId()}--noSpacePageHBox`,{height:"3rem",justifyContent:"Center",alignItems:"Center",items:[new n(`${this.getId()}--noSpacePageItem`,{text:this._i18nBundle.getText("noData")})]}).addStyleClass("pagesBottomBorder");this.oWrapperVBox.addItem(this.oNoDataHBox)}this.oNoDataHBox.setVisible(true)}else if(this.oNoDataHBox){this.oNoDataHBox.setVisible(false)}i.forEach((e,t)=>{const i=[];e.children.forEach((e,s)=>{e.selected=this.aFavPages.find(t=>t.pageId===e.id)?true:false;i.push(this._createPagesList(e,t,s))});const n=this._createHeaderToolbar(e,t);const o=new a(B(`${this.getId()}--panel--${t}`),{expandable:true,expanded:true,width:"auto",headerToolbar:n,content:new s(B(`${this.getId()}--panelContent--${t}`),{items:i})}).addStyleClass("pagesPanel");this.oPagesListVBox.addItem(o)});if(l>=0&&o){setTimeout(()=>{o.scrollTo(l)},0)}},_createHeaderToolbar:function e(t,s){const a=new o(B(`${this.getId()}--headerTitle--${s}`),{wrapping:true,width:"auto",text:t.label}).addStyleClass("dialogPanelTitle");const i=new l(B(`${this.getId()}--headerToolBar--${s}`),{design:"Solid",content:[a]});return i},_pageSelectHandler:function e(t,s){try{const e=this;const a=!s.getSource().getPressed();const i=e.aAllPages.find(e=>e.pageId===t);if(!i){return Promise.resolve(false)}if(a){e.aFavPages.push(i)}else{const s=e.aFavPages.findIndex(e=>e.pageId===t);e.aFavPages.splice(s,1)}e._seHeaderMessage();return Promise.resolve(e.PageManagerInstance.getFavPages(e.aFavPages,true)).then(function(){let t;if(e.sSearchQuery?.length){t=e._filterSpacesPages()}e._renderPages(t||e.aSpaces);void e._getPanel().getData()})}catch(e){return Promise.reject(e)}},_onPagesSearch:function e(t){this.sSearchQuery=t.getSource().getValue().toLowerCase();const s=this._filterSpacesPages();this._renderPages(s)},_filterSpacesPages:function e(){const t=[];this.aSpaces.forEach(e=>{const s=[];const a=e.label;e.children.forEach(e=>{if(e.label?.toLowerCase().includes(this.sSearchQuery)||a?.toLowerCase().includes(this.sSearchQuery)){s.push(e)}});if(s.length){t.push({...e,children:s})}});return t}});return y});
|
|
212
242
|
/*!
|
|
213
243
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
214
244
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
215
245
|
*/
|
|
216
|
-
sap.ui.predefine("sap/cux/home/RecentAppPanel", ["sap/base/Log","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/GroupHeaderListItem","sap/m/library","sap/m/List","sap/m/OverflowToolbar","sap/m/Select","sap/m/StandardListItem","sap/m/ToolbarSpacer","sap/m/VBox","sap/ui/core/EventBus","sap/ui/core/format/DateFormat","sap/ui/core/Item","sap/ushell/Container","sap/ushell/EventHub","./BaseAppPersPanel","./MenuItem","./utils/FESRUtil"],function(t,e,s,n,i,a,r,o,p,c,l,d,h,u,g,m,y,_,A,T){"use strict";function f(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function E(t,e){try{var s=t()}catch(t){return e(t)}if(s&&s.then){return s.then(void 0,e)}return s}const D=a["URLHelper"];const w=f(_);const S=f(A);const I=T["addFESRId"];var L=function(t){t["ALL"]="ALL";t["TODAY"]="TODAY";t["WEEK"]="WEEK";t["TWO_WEEK"]="TWO_WEEK";t["THREE_WEEK"]="THREE_WEEK";return t}(L||{});const v=u.getDateInstance({pattern:"MMMM d, yyyy"});const M={OLDER_DATE_TIMESTAMP:Number.MIN_SAFE_INTEGER};const H=t=>t.setHours(12,0,0,0);const b=t=>{const e=new Date;const s=new Date(e);const n=s.setDate(e.getDate()-e.getDay()-7*t);const i=new Date(s);const a=i.setDate(s.getDate()+6);return{startDate:n,endDate:a}};const x=(t,e)=>{const s=new Date(t);const n=s.setDate(s.getDate()-e);return H(new Date(n))};const B=(t,e,s)=>t>=e&&t<=s;const R=w.extend("sap.cux.home.RecentAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"}}},constructor:function t(e,s){w.prototype.constructor.call(this,e,s);this._recentApps=[];this.setSupported(false)},init:function t(){w.prototype.init.call(this);this.setProperty("key","recentApps");this.setProperty("title",this._i18nBundle.getText("recentlyUsedTab"));this.setProperty("tooltip",this._i18nBundle.getText("recentAppsInfo"));this._attachUserActivityTracking();y.on("userRecentsCleared").do(()=>{void this.refresh()});const e=new S(`${this.getId()}-show-history-btn`,{title:this._i18nBundle.getText("showHistoryBtn"),icon:"sap-icon://history",press:this._openHistoryDialog.bind(this)});I(e,"showHistory");this.insertAggregation("menuItems",e,0);this.oEventBus=h.getInstance();this.oEventBus.subscribe("appsChannel","favAppColorChanged",(t,e,s)=>{const{item:n,color:i}=s;this._applyUngroupedTileColor(n,i)},this)},loadApps:function t(){try{const t=this;return Promise.resolve(t._getRecentApps()).then(function(e){t.destroyAggregation("apps",true);e=e.map((e,s)=>({...e,menuItems:t._getAppActions(e.addedInFavorites,s)}));t.setApps(t.generateApps(e))})}catch(t){return Promise.reject(t)}},_getRecentApps:function e(){try{const e=this;return Promise.resolve(E(function(){return Promise.resolve(m.getServiceAsync("UserRecents")).then(function(t){return Promise.resolve(Promise.all([t?.getRecentActivity().then(t=>t||[]),t?.oRecentActivity._getRecentActivitiesFromLoadedData().then(t=>t||{})])).then(function(t){let[s,n]=t;return Promise.resolve(e.convertActivitiesToVisualizations(s)).then(function(t){e._recentApps=t;let s=new Date(n?.recentDay);e._recentDayTimeStamp=H(s);const i=n?.recentUsageArray||[];const a=new Map;i.forEach(t=>{if(t.oItem?.appId){a.set(t.oItem.appId,t.aUsageArray)}});e._recentApps.forEach(t=>{t.dateStamp=H(new Date(t.timestamp));if(a.size){t.usageArray=a.get(t.orgAppId)}});return e._recentApps||[]})})})},function(e){t.error(e);return[]}))}catch(t){return Promise.reject(t)}},_getAppActions:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;let s=arguments.length>1?arguments[1]:undefined;const n=new S(`${this.getKey()}--${s}--resumeLastActivityItem`,{title:this._i18nBundle.getText("resumeLastActivity"),icon:"sap-icon://past",press:this._resumeAppActivity.bind(this)});I(n,"resumeActivity");const i=[n];if(!e){const t=new S(`${this.getKey()}--${s}--addToFavoritesRecentItem`,{title:this._i18nBundle.getText("addToFavorites"),icon:"sap-icon://add-favorite",press:t=>{void this._addAppToFavorites(t)}});I(t,"addFavFromRecent");i.push(t)}return i},_resumeAppActivity:function t(e){const s=e.getSource();const n=s.getParent();const i=n.getUrl?.();D.redirect(i,false)},_generateHistoryDialog:function t(){const s=`${this.getId()}-history-dialog`;if(!this._controlMap.get(s)){this._controlMap.set(s,new n(s,{title:this._i18nBundle.getText("showHistoryTitle"),content:new d({id:`${s}-container`,height:"100%",items:[this._generateAppHistoryList()]}).addStyleClass("sapUiTinyMargin"),escapeHandler:this._closeHistoryDialog.bind(this),contentHeight:"29rem",contentWidth:"25rem",buttons:[new e({id:`${s}-cancel-btn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeHistoryDialog.bind(this)})]}).addStyleClass("sapContrastPlus"))}return this._controlMap.get(s)},_generateAppHistoryList:function t(){const e=`${this.getId()}-history-dialog-list`;if(!this._controlMap.get(e)){this._controlMap.set(e,new r({id:e,growing:true,growingScrollToLoad:true,headerToolbar:new o({id:`${e}-header-toolbar`,style:"Clear",height:"1.75rem",content:[new l({id:`${e}-header-toolbar-spacer`}),this._generateAppHistoryListFilter()]})}).addStyleClass("sapMListShowSeparatorsNone recentAppList"))}return this._controlMap.get(e)},_generateAppHistoryListFilter:function t(){const e=`${this.getId()}-history-dialog-list-filter`;if(!this._controlMap.get(e)){this._controlMap.set(e,new p({id:e,selectedKey:L.ALL,change:t=>this._onDateFilterChange(t),items:[new g({id:`${e}-month`,key:L.ALL,text:this._i18nBundle.getText("dateThirty")}),new g({id:`${e}-today`,key:L.TODAY,text:this._i18nBundle.getText("dateToday")}),new g({id:`${e}-week`,key:L.WEEK,text:this._i18nBundle.getText("dateWeek")}),new g({id:`${e}-twoWeek`,key:L.TWO_WEEK,text:this._i18nBundle.getText("dateTwoWeek")}),new g({id:`${e}-threeWeek`,key:L.THREE_WEEK,text:this._i18nBundle.getText("dateThreeWeek")})]}))}return this._controlMap.get(e)},_generateAppHistoryListItems:function t(e){const n=this._generateAppHistoryList();n?.destroyItems();e.forEach(t=>{n.addItem(this._getGroupHeader(t.dateStamp));n.addItem(new s({id:`date-${t.dateStamp}-lisItem`,type:"Inactive",content:[new r({id:`date-${t.dateStamp}-appList`,items:(t.apps||[]).map(
|
|
246
|
+
sap.ui.predefine("sap/cux/home/RecentAppPanel", ["sap/base/Log","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/GroupHeaderListItem","sap/m/library","sap/m/List","sap/m/OverflowToolbar","sap/m/Select","sap/m/StandardListItem","sap/m/ToolbarSpacer","sap/m/VBox","sap/ui/core/EventBus","sap/ui/core/format/DateFormat","sap/ui/core/Item","sap/ushell/Container","sap/ushell/EventHub","./BaseAppPersPanel","./MenuItem","./utils/FESRUtil"],function(t,e,s,n,i,a,r,o,p,c,l,d,h,u,g,m,y,_,A,T){"use strict";function f(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function E(t,e){try{var s=t()}catch(t){return e(t)}if(s&&s.then){return s.then(void 0,e)}return s}const D=a["URLHelper"];const w=f(_);const S=f(A);const I=T["addFESRId"];var L=function(t){t["ALL"]="ALL";t["TODAY"]="TODAY";t["WEEK"]="WEEK";t["TWO_WEEK"]="TWO_WEEK";t["THREE_WEEK"]="THREE_WEEK";return t}(L||{});const v=u.getDateInstance({pattern:"MMMM d, yyyy"});const M={OLDER_DATE_TIMESTAMP:Number.MIN_SAFE_INTEGER};const H=t=>t.setHours(12,0,0,0);const b=t=>{const e=new Date;const s=new Date(e);const n=s.setDate(e.getDate()-e.getDay()-7*t);const i=new Date(s);const a=i.setDate(s.getDate()+6);return{startDate:n,endDate:a}};const x=(t,e)=>{const s=new Date(t);const n=s.setDate(s.getDate()-e);return H(new Date(n))};const B=(t,e,s)=>t>=e&&t<=s;const R=w.extend("sap.cux.home.RecentAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"}}},constructor:function t(e,s){w.prototype.constructor.call(this,e,s);this._recentApps=[];this.setSupported(false)},init:function t(){w.prototype.init.call(this);this.setProperty("key","recentApps");this.setProperty("title",this._i18nBundle.getText("recentlyUsedTab"));this.setProperty("tooltip",this._i18nBundle.getText("recentAppsInfo"));this._attachUserActivityTracking();y.on("userRecentsCleared").do(()=>{void this.refresh()});const e=new S(`${this.getId()}-show-history-btn`,{title:this._i18nBundle.getText("showHistoryBtn"),icon:"sap-icon://history",press:this._openHistoryDialog.bind(this)});I(e,"showHistory");this.insertAggregation("menuItems",e,0);this.oEventBus=h.getInstance();this.oEventBus.subscribe("appsChannel","favAppColorChanged",(t,e,s)=>{const{item:n,color:i}=s;this._applyUngroupedTileColor(n,i)},this)},loadApps:function t(){try{const t=this;return Promise.resolve(t._getRecentApps()).then(function(e){t.destroyAggregation("apps",true);e=e.map((e,s)=>({...e,menuItems:t._getAppActions(e.addedInFavorites,s)}));t.setApps(t.generateApps(e))})}catch(t){return Promise.reject(t)}},_getRecentApps:function e(){try{const e=this;return Promise.resolve(E(function(){return Promise.resolve(m.getServiceAsync("UserRecents")).then(function(t){return Promise.resolve(Promise.all([t?.getRecentActivity().then(t=>t||[]),t?.oRecentActivity._getRecentActivitiesFromLoadedData().then(t=>t||{})])).then(function(t){let[s,n]=t;return Promise.resolve(e.convertActivitiesToVisualizations(s)).then(function(t){e._recentApps=t;let s=new Date(n?.recentDay);e._recentDayTimeStamp=H(s);const i=n?.recentUsageArray||[];const a=new Map;i.forEach(t=>{if(t.oItem?.appId){a.set(t.oItem.appId,t.aUsageArray)}});e._recentApps.forEach(t=>{t.dateStamp=H(new Date(t.timestamp));if(a.size){t.usageArray=a.get(t.orgAppId)}});return e._recentApps||[]})})})},function(e){t.error(e);return[]}))}catch(t){return Promise.reject(t)}},_getAppActions:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;let s=arguments.length>1?arguments[1]:undefined;const n=new S(`${this.getKey()}--${s}--resumeLastActivityItem`,{title:this._i18nBundle.getText("resumeLastActivity"),icon:"sap-icon://past",press:this._resumeAppActivity.bind(this)});I(n,"resumeActivity");const i=[n];if(!e){const t=new S(`${this.getKey()}--${s}--addToFavoritesRecentItem`,{title:this._i18nBundle.getText("addToFavorites"),icon:"sap-icon://add-favorite",press:t=>{void this._addAppToFavorites(t)}});I(t,"addFavFromRecent");i.push(t)}return i},_resumeAppActivity:function t(e){const s=e.getSource();const n=s.getParent();const i=n.getUrl?.();D.redirect(i,false)},_generateHistoryDialog:function t(){const s=`${this.getId()}-history-dialog`;if(!this._controlMap.get(s)){this._controlMap.set(s,new n(s,{title:this._i18nBundle.getText("showHistoryTitle"),content:new d({id:`${s}-container`,height:"100%",items:[this._generateAppHistoryList()]}).addStyleClass("sapUiTinyMargin"),escapeHandler:this._closeHistoryDialog.bind(this),contentHeight:"29rem",contentWidth:"25rem",buttons:[new e({id:`${s}-cancel-btn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeHistoryDialog.bind(this)})]}).addStyleClass("sapContrastPlus"))}return this._controlMap.get(s)},_generateAppHistoryList:function t(){const e=`${this.getId()}-history-dialog-list`;if(!this._controlMap.get(e)){this._controlMap.set(e,new r({id:e,growing:true,growingScrollToLoad:true,headerToolbar:new o({id:`${e}-header-toolbar`,style:"Clear",height:"1.75rem",content:[new l({id:`${e}-header-toolbar-spacer`}),this._generateAppHistoryListFilter()]})}).addStyleClass("sapMListShowSeparatorsNone recentAppList"))}return this._controlMap.get(e)},_generateAppHistoryListFilter:function t(){const e=`${this.getId()}-history-dialog-list-filter`;if(!this._controlMap.get(e)){this._controlMap.set(e,new p({id:e,selectedKey:L.ALL,change:t=>this._onDateFilterChange(t),items:[new g({id:`${e}-month`,key:L.ALL,text:this._i18nBundle.getText("dateThirty")}),new g({id:`${e}-today`,key:L.TODAY,text:this._i18nBundle.getText("dateToday")}),new g({id:`${e}-week`,key:L.WEEK,text:this._i18nBundle.getText("dateWeek")}),new g({id:`${e}-twoWeek`,key:L.TWO_WEEK,text:this._i18nBundle.getText("dateTwoWeek")}),new g({id:`${e}-threeWeek`,key:L.THREE_WEEK,text:this._i18nBundle.getText("dateThreeWeek")})]}))}return this._controlMap.get(e)},_generateAppHistoryListItems:function t(e){const n=this._generateAppHistoryList();n?.destroyItems();e.forEach(t=>{n.addItem(this._getGroupHeader(t.dateStamp));n.addItem(new s({id:`date-${t.dateStamp}-lisItem`,type:"Inactive",content:[new r({id:`date-${t.dateStamp}-appList`,items:(t.apps||[]).map((e,s)=>new c({id:`listItem--${t.dateStamp}--${s}`,title:e.name,type:"Inactive"}).addStyleClass("sapUiTinyMarginBeginEnd recentAppList sapUiSmallMarginTop"))}).addStyleClass("sapMListShowSeparatorsNone sapUiTinyMarginBottom")]}))})},_openHistoryDialog:function t(){const e=this._generateHistoryDialog();const s=this._getAppHistory();this._generateAppHistoryListItems(s);e.open()},_closeHistoryDialog:function t(){const e=this._generateHistoryDialog();e.close()},_onDateFilterChange:function t(e){const s=e.getParameter("selectedItem")?.getKey();const n=this._getFilteredAppHistory(s);this._generateAppHistoryListItems(n)},_getGroupHeader:function t(e){let s="";switch(e){case M.OLDER_DATE_TIMESTAMP:s=this._i18nBundle.getText("dateLater");break;case H(new Date):s=this._i18nBundle.getText("dateToday");break;default:s=v.format(new Date(e));break}return new i({title:s}).addStyleClass("sapUiTinyMarginBeginEnd recentAppListHeader")},_getAppHistory:function t(){if(this._recentDayTimeStamp&&this._recentApps?.length){const t={};const e=x(this._recentDayTimeStamp,30);this._recentApps.forEach(s=>{const n=H(new Date(s.dateStamp));if(n<e){if(!t[M.OLDER_DATE_TIMESTAMP]){t[M.OLDER_DATE_TIMESTAMP]={dateStamp:M.OLDER_DATE_TIMESTAMP,apps:[]}}t[M.OLDER_DATE_TIMESTAMP]?.apps.push({name:s.title})}else{const e=s.usageArray||[];e.forEach((n,i)=>{if(n>0){const n=x(this._recentDayTimeStamp,e.length-1-i);if(!t[n]){t[n]={dateStamp:n,apps:[]}}t[n]?.apps.push({name:s.title})}})}});const s=Object.values(t);s.sort((t,e)=>e.dateStamp-t.dateStamp);return s}return[]},_getFilteredAppHistory:function t(e){const s=this._getAppHistory();let n=[];switch(e){case L.TODAY:{n=s.filter(t=>t.dateStamp===H(new Date));break}case L.WEEK:{const{startDate:t,endDate:e}=b(0);n=s.filter(s=>B(s.dateStamp,t,e));break}case L.TWO_WEEK:{const{startDate:t}=b(1);const{endDate:e}=b(0);n=s.filter(s=>B(s.dateStamp,t,e));break}case L.THREE_WEEK:{const{startDate:t}=b(2);const{endDate:e}=b(0);n=s.filter(s=>B(s.dateStamp,t,e));break}default:n=[...s];break}return n},generateIllustratedMessage:function t(){const e=w.prototype.generateIllustratedMessage.call(this);e.setDescription(this._i18nBundle.getText("noRecentAppsDescription"));return e}});return R});
|
|
217
247
|
/*!
|
|
218
248
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
219
249
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
220
250
|
*/
|
|
221
|
-
sap.ui.predefine("sap/cux/home/RecommendedAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/Dialog","sap/m/IllustratedMessageType","sap/m/library","sap/m/Link","sap/m/MessageStrip","sap/m/MessageToast","sap/m/ScrollContainer","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","./BaseAppPersPanel","./MenuItem","./utils/Constants","./utils/FESRUtil","./utils/HttpHelper"],function(e,t,n,s,i,o,r,a,c,d,l,p,u,h,g,m,f,_,A,y,T){"use strict";function S(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const R=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function C(e,t,n){if(!e.s){if(n instanceof v){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=C.bind(null,e,t);return}}if(n&&n.then){n.then(C.bind(null,e,t),C.bind(null,e,2));return}e.s=t;e.v=n;const s=e.o;if(s){s(e)}}}const v=function(){function e(){}e.prototype.then=function(t,n){const s=new e;const i=this.s;if(i){const e=i&1?t:n;if(e){try{C(s,1,e(this.v))}catch(e){C(s,2,e)}return s}else{return this}}this.o=function(e){try{const i=e.v;if(e.s&1){C(s,1,t?t(i):i)}else if(n){C(s,1,n(i))}else{C(s,2,i)}}catch(e){C(s,2,e)}};return s};return e}();function x(e){return e instanceof v&&e.s&1}function M(e,t,n){var s=-1,i,o;function r(a){try{while(++s<e.length&&(!n||!n())){a=t(s);if(a&&a.then){if(x(a)){a=a.v}else{a.then(r,o||(o=C.bind(null,i=new v,2)));return}}}if(i){C(i,1,a)}else{i=a}}catch(e){C(i||(i=new v),2,e)}}r();return i}const B=r["BackgroundDesign"];function P(e,t,n){if(typeof e[R]==="function"){var s=e[R](),i,o,r;function l(e){try{while(!(i=s.next()).done&&(!n||!n())){e=t(i.value);if(e&&e.then){if(x(e)){e=e.v}else{e.then(l,r||(r=C.bind(null,o=new v,2)));return}}}if(o){C(o,1,e)}else{o=e}}catch(e){C(o||(o=new v),2,e)}}l();if(s.return){var a=function(e){try{if(!i.done){s.return()}}catch(e){}return e};if(o&&o.then){return o.then(a,function(e){throw a(e)})}a()}return o}if(!("length"in e)){throw new TypeError("Object is not iterable")}var c=[];for(var d=0;d<e.length;d++){c.push(e[d])}return M(c,function(e){return t(c[e])},n)}const $=S(f);function b(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const w=S(_);function I(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const E=A["REPO_BASE_URL"];const D=A["SETTINGS_PANELS_KEYS"];const U=y["addFESRId"];const H=S(T);const j={USER_PREFERENCE_SRVC_URL:`${E}UserPreference`,KEY:"recommendedApps"};const F=$.extend("sap.cux.home.RecommendedAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){$.prototype.constructor.call(this,t,n);this._selectedApps=[];this.setSupported(false)},init:function e(){$.prototype.init.call(this);this.setProperty("key",j.KEY);this.setProperty("title",this._i18nBundle.getText("recommendedAppsTab"));const t=m.getInstance();t.subscribe("importChannel","recommendationSettingChanged",(e,t,n)=>{const s=n.showRecommendation;this.fireSupported({isSupported:s})});this._createAddToFavouritesMenuItem()},_createAddToFavouritesMenuItem:function e(){const t=new w(`${this.getId()}-addtofavouritesmenuitem`,{title:this._i18nBundle.getText("addToFavoritesRecommended"),icon:"sap-icon://add-favorite",press:this._openAddRecommendedDialog.bind(this),visible:false});U(t,"addToFavouritesMenuItem");this.insertAggregation("menuItems",t,0)},_openAddRecommendedDialog:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=this._generateAddRecommendedDialog(t);n.open()},_generateAddRecommendedDialog:function e(t){if(!this._controlMap.get(t)){this._createAddRecommendedDialogControls(t)}const n=this._generateAppsScrollContainer()?.getContent()?.[0];n.destroyAggregation("items");this._selectedApps=[...this.getApps()];const s=this._selectedApps.map(e=>this._createAppTile(e));this._setAggregation(n,s);this._updateSelectedAppCount();const i=this._controlMap.get(t);return i},_createAddRecommendedDialogControls:function e(t){const n=this;this._selectedApps=[...this.getApps()];this._controlMap.set(`${t}-mainTitle`,new u({id:`${t}-mainTitle`,text:this._i18nBundle.getText("addToFavoritesRecommended")}));this._controlMap.set(`${t}-headerContainer-count`,new p({id:`${t}-headerContainer-count`}));this._controlMap.set(`${t}-selectedAppsTitle`,new u({id:`${t}-selectedAppsTitle`,text:`${this._i18nBundle.getText("recommendedAppsTab")} (0 ${this._i18nBundle.getText("selected")})`,level:"H3"}));this._controlMap.set(`${t}-subtitleText`,new p({id:`${t}-subtitleText`,text:this._i18nBundle.getText("selectAtLeastOneApp")}));const o=new s({id:`${t}-addBtn`,text:this._i18nBundle.getText("addButton"),type:"Emphasized",press:function(){try{return Promise.resolve(n._addSelectedApps()).then(function(){n._closeAddRecommendedDialog(t)})}catch(e){return Promise.reject(e)}},enabled:this._selectedApps.length>0});const r=new s({id:`${t}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:()=>this._closeAddRecommendedDialog(t)});const a=this._controlMap.get(`${t}-mainTitle`).getText();this._controlMap.set(t,new i(t,{title:a,content:[new h({id:`${t}-headerContainer`,items:[this._controlMap.get(`${t}-selectedAppsTitle`),this._controlMap.get(`${t}-subtitleText`)],justifyContent:"Start",alignItems:"Start"}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),this._generateAppsScrollContainer()],contentHeight:"25rem",contentWidth:"41.75rem",buttons:[o,r],escapeHandler:()=>this._closeAddRecommendedDialog(t)}).addStyleClass("sapCuxRecommendedAppsDialog sapContrastPlus"))},_createAppTile:function e(t){const n=t.clone();const s=this.getParent()._getAppTile(n);s.addStyleClass("sapCuxHighlightApp");n._onPress=e=>this._highlightApp(e,n);return s},_generateAppsScrollContainer:function e(){const s=`${this.getId()}-addRecommendedDialog-appsPage-scrollContainer`;if(!this._controlMap.get(s)){this._controlMap.set(`${s}-apps`,new t({id:`${s}-apps`,layout:new n({columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsGridContainerPadding"));this._controlMap.set(s,new l(s,{id:s,vertical:true,visible:true,height:"20rem",content:[this._controlMap.get(`${s}-apps`)]}).addStyleClass("sapUiSmallMarginBeginEnd sapUiTinyMarginTop"))}return this._controlMap.get(s)},_updateAddButtonState:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=g.getElementById(`${t}-addBtn`);if(n){n.setEnabled(this._selectedApps.length>0)}},_closeAddRecommendedDialog:function e(t){this.toggleAppTileHighlight(true);const n=this._controlMap.get(t);if(n){n.close()}this._resetAddRecommendedDialog()},toggleAppTileHighlight:function e(t){const n=this._generateAppsScrollContainer();const s=n.getContent()[0];if(s){s.getItems().forEach(e=>{if(e){if(t){e.addStyleClass("sapCuxHighlightApp")}else{if(e.hasStyleClass("sapCuxHighlightApp")){e.removeStyleClass("sapCuxHighlightApp")}}}})}},_resetAddRecommendedDialog:function e(){this._selectedApps=[...this.getApps()];this._updateSelectedAppCount();this._updateAddButtonState()},_addSelectedApps:function t(){try{const t=this;t.setBusy(true);return Promise.resolve(I(function(){return b(function(){function e(){return Promise.resolve((t.getParent?.())._refreshAllPanels()).then(function(){const e=t._i18nBundle.getText("moveRecommendedMessage");d.show(e)})}const n=P(t._selectedApps,function(e){const n=e.getVizId?.();const s=function(){if(n){return Promise.resolve(t.appManagerInstance.addVisualization(n)).then(function(){})}}();if(s&&s.then)return s.then(function(){})});return n&&n.then?n.then(e):e(n)},function(t){e.error(t)})},function(e,n){t.setBusy(false);t._selectedApps=[];t._closeAddRecommendedDialog(`${t.getId()}-addRecommendedDialog-appsPage`);if(e)throw n;return n}))}catch(e){return Promise.reject(e)}},_highlightApp:function e(t,n){const s=t.getSource();const i=!s.hasStyleClass("sapCuxHighlightApp");this._selectedApps=this._selectedApps||[];if(i){this._selectedApps.push(n)}else{this._selectedApps.splice(this._selectedApps.findIndex(e=>n.getUrl()===e.getUrl()),1)}s.toggleStyleClass("sapCuxHighlightApp",i);this._updateSelectedAppCount();this._updateAddButtonState()},_updateSelectedAppCount:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=this._controlMap.get(`${t}-selectedAppsTitle`);const s=this._selectedApps.length;n.setText(`${this._i18nBundle.getText("recommendedAppsTab")} (${s} ${this._i18nBundle.getText("selected")})`)},_generateWrapper:function e(){const t=`${this.getId()}-recommendedPanelWrapper`;if(!this._controlMap.get(t)){this._controlMap.set(t,new h(t,{items:[this._generateMessageStrip(),$.prototype._generateWrapper.call(this)],backgroundDesign:B.Transparent}))}return this._controlMap.get(t)},loadApps:function e(){try{const e=this;return Promise.resolve(e.appManagerInstance.getRecommendedVisualizations(true)).then(function(t){e.destroyAggregation("apps",true);t=t.map((t,n)=>({...t,menuItems:e._getActions(n)}));const n=e.generateApps(t);e.setApps(n);const s=g.getElementById(`${e.getId()}-addtofavouritesmenuitem`);if(s){s.setVisible(n.length>0)}})}catch(e){return Promise.reject(e)}},_generateMessageStrip:function e(){const t=`${this.getId()}-messageStrip`;if(!this._controlMap.get(t)){this._controlMap.set(t,new c(t,{text:this._i18nBundle.getText("recommendationMessageStrip"),showIcon:true,showCloseButton:true,link:new a(`${t}-settings`,{text:this._i18nBundle.getText("settings"),press:()=>this.getParent()?._getLayout()?.openSettingsDialog(D.ADVANCED)}).addStyleClass("sapUiNoMargin")}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom"))}return this._controlMap.get(t)},_getActions:function e(t){const n=new w(`${this.getKey()}--addToFavoritesItem--${t}`,{title:this._i18nBundle.getText("addToFavorites"),icon:"sap-icon://add-favorite",press:e=>{void this._addAppToFavorites(e)}});U(n,"acceptRecommendation");const s=new w(`${this.getKey()}--notRelevantItem--${t}`,{title:this._i18nBundle.getText("notRelevantRecommendation"),icon:"sap-icon://decline",press:e=>{void this._rejectRecommendation(e)}});U(s,"rejectRecommendation");const i=[n,s];return i},_rejectRecommendation:function t(n){try{const t=this;t.setBusy(true);const s=I(function(){return b(function(){const e=n.getSource();const s=e.getParent();const i=s.getTitle();return Promise.resolve(t.appManagerInstance.getRecommendedVisualizations()).then(function(e){const n=e.find(e=>e.url===s.getUrl());const o=n?.fioriId;const r=function(){if(o){const e={AppId:o,Decision:1};return Promise.resolve(H.Post(j.USER_PREFERENCE_SRVC_URL,e)).then(function(){return Promise.resolve(t.refresh()).then(function(){const e=t._i18nBundle.getText("rejectRecommendationMsg",[i]);d.show(e)})})}}();if(r&&r.then)return r.then(function(){})})},function(t){e.error(t)})},function(e,n){t.setBusy(false);if(e)throw n;return n});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_isRecommendationEnabled:function e(){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(e){return e?.showRecommendation??true})}catch(e){return Promise.reject(e)}},_enableRecommendationTab:function e(){try{const e=this;return Promise.resolve(e._isRecommendationEnabled()).then(function(t){e.setSupported(t);e.fireSupported({isSupported:t})})}catch(e){return Promise.reject(e)}},generateIllustratedMessage:function e(){const t=$.prototype.generateIllustratedMessage.call(this);t.setIllustrationType(o.Tent);t.setTitle(this._i18nBundle.getText("noRecommendationsTitle"));t.setDescription(this._i18nBundle.getText("noRecommendationsDescription"));t.addAdditionalContent(new s({text:this._i18nBundle.getText("settings"),tooltip:this._i18nBundle.getText("settings"),press:()=>this.getParent()?._getLayout()?.openSettingsDialog(D.ADVANCED),type:"Emphasized"}));return t}});return F});
|
|
251
|
+
sap.ui.predefine("sap/cux/home/RecommendedAppPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/Dialog","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/library","sap/m/Link","sap/m/MessageStrip","sap/m/MessageToast","sap/m/ScrollContainer","sap/m/Text","sap/m/Title","sap/m/VBox","sap/ui/core/Element","sap/ui/core/EventBus","./BaseAppPersPanel","./MenuItem","./utils/Constants","./utils/FESRUtil","./utils/HttpHelper"],function(e,t,n,s,i,o,r,a,c,l,d,p,u,h,g,m,f,_,A,S,y,T){"use strict";function R(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const C=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function v(e,t,n){if(!e.s){if(n instanceof M){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=v.bind(null,e,t);return}}if(n&&n.then){n.then(v.bind(null,e,t),v.bind(null,e,2));return}e.s=t;e.v=n;const s=e.o;if(s){s(e)}}}const M=function(){function e(){}e.prototype.then=function(t,n){const s=new e;const i=this.s;if(i){const e=i&1?t:n;if(e){try{v(s,1,e(this.v))}catch(e){v(s,2,e)}return s}else{return this}}this.o=function(e){try{const i=e.v;if(e.s&1){v(s,1,t?t(i):i)}else if(n){v(s,1,n(i))}else{v(s,2,i)}}catch(e){v(s,2,e)}};return s};return e}();function x(e){return e instanceof M&&e.s&1}function B(e,t,n){var s=-1,i,o;function r(a){try{while(++s<e.length&&(!n||!n())){a=t(s);if(a&&a.then){if(x(a)){a=a.v}else{a.then(r,o||(o=v.bind(null,i=new M,2)));return}}}if(i){v(i,1,a)}else{i=a}}catch(e){v(i||(i=new M),2,e)}}r();return i}const P=a["BackgroundDesign"];function $(e,t,n){if(typeof e[C]==="function"){var s=e[C](),i,o,r;function d(e){try{while(!(i=s.next()).done&&(!n||!n())){e=t(i.value);if(e&&e.then){if(x(e)){e=e.v}else{e.then(d,r||(r=v.bind(null,o=new M,2)));return}}}if(o){v(o,1,e)}else{o=e}}catch(e){v(o||(o=new M),2,e)}}d();if(s.return){var a=function(e){try{if(!i.done){s.return()}}catch(e){}return e};if(o&&o.then){return o.then(a,function(e){throw a(e)})}a()}return o}if(!("length"in e)){throw new TypeError("Object is not iterable")}var c=[];for(var l=0;l<e.length;l++){c.push(e[l])}return B(c,function(e){return t(c[e])},n)}const b=R(_);function I(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const w=R(A);function E(e,t){try{var n=e()}catch(e){return t(true,e)}if(n&&n.then){return n.then(t.bind(null,false),t.bind(null,true))}return t(false,n)}const D=S["REPO_BASE_URL"];const U=S["SETTINGS_PANELS_KEYS"];const H=y["addFESRId"];const j=R(T);const F={USER_PREFERENCE_SRVC_URL:`${D}UserPreference`,KEY:"recommendedApps"};const z=b.extend("sap.cux.home.RecommendedAppPanel",{metadata:{library:"sap.cux.home",defaultAggregation:"apps",aggregations:{apps:{type:"sap.cux.home.App",singularName:"app",multiple:true,visibility:"hidden"}}},constructor:function e(t,n){b.prototype.constructor.call(this,t,n);this._selectedApps=[];this.setSupported(false)},init:function e(){b.prototype.init.call(this);this.setProperty("key",F.KEY);this.setProperty("title",this._i18nBundle.getText("recommendedAppsTab"));const t=f.getInstance();t.subscribe("importChannel","recommendationSettingChanged",(e,t,n)=>{const s=n.showRecommendation;this.fireSupported({isSupported:s})});this._createAddToFavouritesMenuItem()},_createAddToFavouritesMenuItem:function e(){const t=new w(`${this.getId()}-addtofavouritesmenuitem`,{title:this._i18nBundle.getText("addToFavoritesRecommended"),icon:"sap-icon://add-favorite",press:this._openAddRecommendedDialog.bind(this),visible:false});H(t,"addToFavouritesMenuItem");this.insertAggregation("menuItems",t,0)},_openAddRecommendedDialog:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=this._generateAddRecommendedDialog(t);n.open()},_generateAddRecommendedDialog:function e(t){if(!this._controlMap.get(t)){this._createAddRecommendedDialogControls(t)}const n=this._generateAppsScrollContainer()?.getContent()?.[0];n.destroyAggregation("items");this._selectedApps=[...this.getApps()];const s=this._selectedApps.map(e=>this._createAppTile(e));this._setAggregation(n,s);this._updateSelectedAppCount();const i=this._controlMap.get(t);return i},_createAddRecommendedDialogControls:function e(t){const n=this;this._selectedApps=[...this.getApps()];this._controlMap.set(`${t}-mainTitle`,new h({id:`${t}-mainTitle`,text:this._i18nBundle.getText("addToFavoritesRecommended")}));this._controlMap.set(`${t}-headerContainer-count`,new u({id:`${t}-headerContainer-count`}));this._controlMap.set(`${t}-selectedAppsTitle`,new h({id:`${t}-selectedAppsTitle`,text:`${this._i18nBundle.getText("recommendedAppsTab")} (0 ${this._i18nBundle.getText("selected")})`,level:"H3"}));this._controlMap.set(`${t}-subtitleText`,new u({id:`${t}-subtitleText`,text:this._i18nBundle.getText("selectAtLeastOneApp")}));const o=new s({id:`${t}-addBtn`,text:this._i18nBundle.getText("addButton"),type:"Emphasized",press:function(){try{return Promise.resolve(n._addSelectedApps()).then(function(){n._closeAddRecommendedDialog(t)})}catch(e){return Promise.reject(e)}},enabled:this._selectedApps.length>0});const r=new s({id:`${t}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:()=>this._closeAddRecommendedDialog(t)});const a=this._controlMap.get(`${t}-mainTitle`).getText();this._controlMap.set(t,new i(t,{title:a,content:[new g({id:`${t}-headerContainer`,items:[this._controlMap.get(`${t}-selectedAppsTitle`),this._controlMap.get(`${t}-subtitleText`)],justifyContent:"Start",alignItems:"Start"}).addStyleClass("sapUiSmallMarginTop sapUiSmallMarginBeginEnd sapUiTinyMarginBottom"),this._generateAppsScrollContainer()],contentHeight:"25rem",contentWidth:"41.75rem",buttons:[o,r],escapeHandler:()=>this._closeAddRecommendedDialog(t)}).addStyleClass("sapCuxRecommendedAppsDialog sapContrastPlus"))},_createAppTile:function e(t){const n=t.clone();const s=this.getParent()._getAppTile(n);s.addStyleClass("sapCuxHighlightApp");n._onPress=e=>this._highlightApp(e,n);return s},_generateAppsScrollContainer:function e(){const s=`${this.getId()}-addRecommendedDialog-appsPage-scrollContainer`;if(!this._controlMap.get(s)){this._controlMap.set(`${s}-apps`,new t({id:`${s}-apps`,layout:new n(`${s}-apps-containerSettings`,{columnSize:"19rem",gap:"0.5rem"})}).addStyleClass("sapCuxAppsGridContainerPadding"));this._controlMap.set(s,new p(s,{id:s,vertical:true,visible:true,height:"20rem",content:[this._controlMap.get(`${s}-apps`)]}).addStyleClass("sapUiSmallMarginBeginEnd sapUiTinyMarginTop"))}return this._controlMap.get(s)},_updateAddButtonState:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=m.getElementById(`${t}-addBtn`);if(n){n.setEnabled(this._selectedApps.length>0)}},_closeAddRecommendedDialog:function e(t){this.toggleAppTileHighlight(true);const n=this._controlMap.get(t);if(n){n.close()}this._resetAddRecommendedDialog()},toggleAppTileHighlight:function e(t){const n=this._generateAppsScrollContainer();const s=n.getContent()[0];if(s){s.getItems().forEach(e=>{if(e){if(t){e.addStyleClass("sapCuxHighlightApp")}else{if(e.hasStyleClass("sapCuxHighlightApp")){e.removeStyleClass("sapCuxHighlightApp")}}}})}},_resetAddRecommendedDialog:function e(){this._selectedApps=[...this.getApps()];this._updateSelectedAppCount();this._updateAddButtonState()},_addSelectedApps:function t(){try{const t=this;t.setBusy(true);return Promise.resolve(E(function(){return I(function(){function e(){return Promise.resolve((t.getParent?.())._refreshAllPanels()).then(function(){const e=t._i18nBundle.getText("moveRecommendedMessage");d.show(e)})}const n=$(t._selectedApps,function(e){const n=e.getVizId?.();const s=function(){if(n){return Promise.resolve(t.appManagerInstance.addVisualization(n)).then(function(){})}}();if(s&&s.then)return s.then(function(){})});return n&&n.then?n.then(e):e(n)},function(t){e.error(t)})},function(e,n){t.setBusy(false);t._selectedApps=[];t._closeAddRecommendedDialog(`${t.getId()}-addRecommendedDialog-appsPage`);if(e)throw n;return n}))}catch(e){return Promise.reject(e)}},_highlightApp:function e(t,n){const s=t.getSource();const i=!s.hasStyleClass("sapCuxHighlightApp");this._selectedApps=this._selectedApps||[];if(i){this._selectedApps.push(n)}else{this._selectedApps.splice(this._selectedApps.findIndex(e=>n.getUrl()===e.getUrl()),1)}s.toggleStyleClass("sapCuxHighlightApp",i);this._updateSelectedAppCount();this._updateAddButtonState()},_updateSelectedAppCount:function e(){const t=`${this.getId()}-addRecommendedDialog-appsPage`;const n=this._controlMap.get(`${t}-selectedAppsTitle`);const s=this._selectedApps.length;n.setText(`${this._i18nBundle.getText("recommendedAppsTab")} (${s} ${this._i18nBundle.getText("selected")})`)},_generateWrapper:function e(){const t=`${this.getId()}-recommendedPanelWrapper`;if(!this._controlMap.get(t)){this._controlMap.set(t,new g(t,{items:[this._generateMessageStrip(),b.prototype._generateWrapper.call(this)],backgroundDesign:P.Transparent}))}return this._controlMap.get(t)},loadApps:function e(){try{const e=this;return Promise.resolve(e.appManagerInstance.getRecommendedVisualizations(true)).then(function(t){e.destroyAggregation("apps",true);t=t.map((t,n)=>({...t,menuItems:e._getActions(n)}));const n=e.generateApps(t);e.setApps(n);const s=m.getElementById(`${e.getId()}-addtofavouritesmenuitem`);if(s){s.setVisible(n.length>0)}})}catch(e){return Promise.reject(e)}},_generateMessageStrip:function e(){const t=`${this.getId()}-messageStrip`;if(!this._controlMap.get(t)){this._controlMap.set(t,new l(t,{text:this._i18nBundle.getText("recommendationMessageStrip"),showIcon:true,showCloseButton:true,link:new c(`${t}-settings`,{text:this._i18nBundle.getText("settings"),press:()=>this.getParent()?._getLayout()?.openSettingsDialog(U.ADVANCED)}).addStyleClass("sapUiNoMargin")}).addStyleClass("sapUiNoMarginBegin sapUiTinyMarginBottom"))}return this._controlMap.get(t)},_getActions:function e(t){const n=new w(`${this.getKey()}--addToFavoritesItem--${t}`,{title:this._i18nBundle.getText("addToFavorites"),icon:"sap-icon://add-favorite",press:e=>{void this._addAppToFavorites(e)}});H(n,"acceptRecommendation");const s=new w(`${this.getKey()}--notRelevantItem--${t}`,{title:this._i18nBundle.getText("notRelevantRecommendation"),icon:"sap-icon://decline",press:e=>{void this._rejectRecommendation(e)}});H(s,"rejectRecommendation");const i=[n,s];return i},_rejectRecommendation:function t(n){try{const t=this;t.setBusy(true);const s=E(function(){return I(function(){const e=n.getSource();const s=e.getParent();const i=s.getTitle();return Promise.resolve(t.appManagerInstance.getRecommendedVisualizations()).then(function(e){const n=e.find(e=>e.url===s.getUrl());const o=n?.fioriId;const r=function(){if(o){const e={AppId:o,Decision:1};return Promise.resolve(j.Post(F.USER_PREFERENCE_SRVC_URL,e)).then(function(){return Promise.resolve(t.refresh()).then(function(){const e=t._i18nBundle.getText("rejectRecommendationMsg",[i]);d.show(e)})})}}();if(r&&r.then)return r.then(function(){})})},function(t){e.error(t)})},function(e,n){t.setBusy(false);if(e)throw n;return n});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_isRecommendationEnabled:function e(){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(e){return e?.showRecommendation??true})}catch(e){return Promise.reject(e)}},_enableRecommendationTab:function e(){try{const e=this;return Promise.resolve(e._isRecommendationEnabled()).then(function(t){e.setSupported(t);e.fireSupported({isSupported:t})})}catch(e){return Promise.reject(e)}},generateIllustratedMessage:function e(){const t=b.prototype.generateIllustratedMessage.call(this);t.setIllustrationSize(o.Small);t.setIllustrationType(r.NoData);t.setTitle(this._i18nBundle.getText("noRecommendationsTitle"));t.setDescription(this._i18nBundle.getText("noRecommendationsDescription"));t.addAdditionalContent(new s({text:this._i18nBundle.getText("settings"),tooltip:this._i18nBundle.getText("settings"),press:()=>this.getParent()?._getLayout()?.openSettingsDialog(U.ADVANCED),type:"Emphasized"}));return t}});return z});
|
|
222
252
|
/*!
|
|
223
253
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
224
254
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
225
255
|
*/
|
|
226
|
-
sap.ui.predefine("sap/cux/home/SettingsDialog", ["sap/m/Bar","sap/m/Button","sap/m/library","sap/m/List","sap/m/Page","sap/m/SplitApp","sap/m/StandardListItem","sap/m/Title","sap/ui/core/Element","sap/ui/Device","./BaseSettingsDialog","./utils/Device"],function(t,e,i,
|
|
256
|
+
sap.ui.predefine("sap/cux/home/SettingsDialog", ["sap/m/Bar","sap/m/Button","sap/m/library","sap/m/List","sap/m/Page","sap/m/SplitApp","sap/m/StandardListItem","sap/m/Title","sap/ui/core/Element","sap/ui/Device","./BaseSettingsDialog","./utils/Constants","./utils/Device"],function(t,e,s,i,n,o,a,l,r,g,p,d,h){"use strict";function c(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const u=s["SplitAppMode"];const _=c(p);const m=d["DEFAULT_NEWS_URL"];const f=h["calculateDeviceType"];const y=h["DeviceType"];const P=_.extend("sap.cux.home.SettingsDialog",{renderer:{apiVersion:2},init:function t(){_.prototype.init.call(this);this._controlMap=new Map;this.setContentWidth("72rem");this.setStretch(false);this.setCustomHeader(this._setCustomHeader());this.addButton(new e(`${this.getId()}-close-btn`,{text:this._i18nBundle.getText("closeSettings"),type:"Transparent",press:()=>this.close()}));this.addContent(new n(`${this.getId()}-settingsPage`,{title:this._i18nBundle.getText("myHomeSettings"),showHeader:false,content:this._getPageContent()}));this._attachResizeHandler()},_attachResizeHandler:function t(){g.resize.attachHandler(()=>{const t=f();this._splitApp.setMode(t===y.Desktop||t===y.LargeDesktop?"ShowHideMode":"HideMode");const e=this._splitApp.isMasterShown();this._updateHeaderButtonVisibility(e)})},_setCustomHeader:function s(){this._menuBtn=new e(`${this.getId()}-menu-btn`,{icon:"sap-icon://menu2",tooltip:this._i18nBundle.getText("showMenu"),press:()=>this._toggleMasterPage(),visible:false});return new t(`${this.getId()}-header`,{contentLeft:[this._menuBtn],contentMiddle:[new l(`${this.getId()}-dialog-title`,{text:this._i18nBundle.getText("myHomeSettings")})]})},_toggleMasterPage:function t(){const e=this._splitApp.isMasterShown();const s=this._deviceType||f();if(s!==y.Tablet){this._splitApp.toMaster(this._masterPage.getId(),"slide")}else{if(e){this._splitApp.hideMaster()}else{this._splitApp.showMaster()}}this._updateHeaderButtonVisibility(!e)},_updateHeaderButtonVisibility:function t(e){const s=this._deviceType||f();if(s===y.Mobile){this._menuBtn.setVisible(!e)}else if(s===y.Tablet){if(g.orientation?.portrait){const t=this._i18nBundle.getText(e?"ToggleButtonHide":"ToggleButtonShow");this._menuBtn.setVisible(true);if(t){this._menuBtn.setTooltip(t)}}else{this._menuBtn.setVisible(e)}}else{this._menuBtn.setVisible(false)}},_getPageContent:function t(){this._menuList=new i(`${this.getId()}-master-pages-list`,{mode:"SingleSelectMaster",itemPress:t=>this._navigateToDetailPage(t)}).addStyleClass("sapCuxMasterPageList");this._masterPage=new n(`${this.getId()}-master-page`,{title:this._i18nBundle.getText("myHomeSettings"),showHeader:false,content:[this._menuList]});this._splitApp=new o(`${this.getId()}-settingsApp`,{mode:"ShowHideMode",masterPages:[this._masterPage],masterButton:t=>this._hideNavigationButton(t)});return this._splitApp},_navigateToDetailPage:function t(e,s){const i=typeof e==="string"?e:e.getParameter?.("listItem");const n=this.getPanels()[0];const o=i?.data?.("key")||e||n?.getProperty("key");this.setProperty("selectedKey",o,true);const a=r.getElementById(`${o}-detail-page`);this._splitApp.toDetail(a.getId(),"slide");this._splitApp.hideMaster();if(this._splitApp.getMode()===u.ShowHideMode){this._updateHeaderButtonVisibility(false)}const l=this.getPanels().find(t=>t.getProperty("key")===o);l?.firePanelNavigated({context:s});this._menuList.removeSelections(true);const g=r.getElementById(`${o}-page-item`);setTimeout(()=>{this._menuList.setSelectedItem(g);g.focus()},0)},_hideNavigationButton:function t(e){const s=r.getElementById(`${e.getSource().getId()}-MasterBtn`);s?.destroy()},onBeforeRendering:function t(e){_.prototype.onBeforeRendering.call(this,e);this.getPanels().forEach(t=>{this._menuList.addItem(this._getPageListItem(t));this._splitApp.addDetailPage(this._getDetailPage(t))});const s=this.getProperty("selectedKey");const i=this.getProperty("context");this._navigateToDetailPage(s,i)},_getPageListItem:function t(e){const s=`${e.getProperty("key")}-page-item`;const i=e.getPanel();const n=i?r.getElementById(i):null;const o=s==="NEWS-page-item"&&n?.getShowCustom()===false&&n?.getUrl()!==m;let l=this._controlMap.get(s);if(!l){l=new a(s,{title:e.getProperty("title"),icon:e.getProperty("icon"),type:"Navigation",iconDensityAware:false,visible:!o});l.data("key",e.getProperty("key"));this._controlMap.set(s,l)}else if(o){l.setVisible(false)}return l},_getDetailPage:function t(e){const s=`${e.getProperty("key")}-detail-page`;if(!this._controlMap.get(s)){const t=new n(s,{title:e.getProperty("title"),backgroundDesign:"List",showHeader:e.getProperty("showHeader")});e.getActionButtons().forEach(e=>{t.addHeaderContent(e)});this._controlMap.set(s,t)}e.getAggregation("content").forEach(t=>this._controlMap.get(s).addContent(t));return this._controlMap.get(s)}});return P});
|
|
227
257
|
/*!
|
|
228
258
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
229
259
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -233,22 +263,27 @@ sap.ui.predefine("sap/cux/home/SituationPanel", ["sap/base/i18n/Formatting","sap
|
|
|
233
263
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
234
264
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
235
265
|
*/
|
|
236
|
-
sap.ui.predefine("sap/cux/home/TaskPanel", ["sap/base/Log","sap/m/ActionTile","sap/m/ActionTileContent","sap/m/Button","sap/m/ContentConfig","sap/m/Link","sap/m/List","sap/m/MessageBox","sap/m/Popover","sap/m/StandardListItem","sap/m/TileAttribute","sap/m/library","sap/ui/core/format/NumberFormat","./MenuItem","./ToDoPanel","./utils/DecisionDialog","./utils/Device","./utils/FESRUtil","./utils/TaskUtils"],function(t,e,n,o,i,s,r,a,c,u,l,p,f,d,h,g,_,m,y){"use strict";function T(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function b(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const P=p["ButtonType"];const I=p["ContentConfigType"];const A=p["LoadState"];const D=p["PlacementType"];const C=p["URLHelper"];const v=T(d);const E=T(h);const S=T(g);const x=g["getIconFrameBadge"];const k=g["getIconFrameBadgeValueState"];const w=_["DeviceType"];const R=_["fetchElementProperties"];const B=m["addFESRId"];const M=m["addFESRSemanticStepName"];const O=m["FESR_EVENTS"];const L=y["fetchUserDetails"];const U=y["formatDate"];const V=y["getPriority"];const $=y["getTaskUrl"];var W=function(t){t["CURRENCYVALUE"]="CURRENCYVALUE";t["CURRENCYCODE"]="CURRENCYCODE";t["USER"]="USER";return t}(W||{});var H=function(t){t["TextFirst"]="TextFirst";t["TextLast"]="TextLast";t["TextOnly"]="TextOnly";t["TextSeparate"]="TextSeparate";return t}(H||{});const N={GRID_VIEW_MIN_ROWS:1,GRID_VIEW_MAX_ROWS:2,GRID_VIEW_MIN_WIDTH:384,GRID_VIEW_MAX_WIDTH:448,MOBILE_VIEW_MIN_WIDTH:320,MOBILE_VIEW_MAX_WIDTH:400,CARD_HEIGHT:{1:220,2:272,3:324,4:376}};function j(t,e){const n=[];for(let o=0;o<t.length;o+=e){n.push(t.slice(o,o+e))}return n}const G=E.extend("sap.cux.home.TaskPanel",{metadata:{library:"sap.cux.home",properties:{enableActions:{type:"boolean",group:"Data",defaultValue:false,visibility:"public"},customAttributeUrl:{type:"string",group:"Data",defaultValue:"",visibility:"public"}}},constructor:function t(e,n){E.prototype.constructor.call(this,e,n)},init:function t(){E.prototype.init.call(this);this._customAttributeMap={};this._taskDefinitionMap={};this.setProperty("key","tasks");this.setProperty("title",this._i18nBundle.getText("tasksTabTitle"));this._viewAllTasksMenuItem=new v(`${this.getId()}-view-tasks-btn`,{title:this._i18nBundle.getText("viewAllTasksTitle"),icon:"sap-icon://inbox",visible:false,press:this._onPressViewAll.bind(this)});this.insertAggregation("menuItems",this._viewAllTasksMenuItem,0);B(this._viewAllTasksMenuItem,"goToTaskSitution")},generateRequestUrls:function t(e){const n=[this.getCountUrl(),`${this.getDataUrl()},CustomAttributeData&$expand=CustomAttributeData&$skip=0&$top=${e}`];const o=this.getCustomAttributeUrl();if(o){n.push(o)}return n},generateCardTemplate:function t(r,a){const c=a.getObject().attributes?.map((t,e)=>new l(`${r}-${e}-attribute`,{label:t.label,contentConfig:new i(`${r}-${e}-contentConfig`,{type:t.type,text:t.text,href:t.href})}));return new e(`${r}-actionTile`,{mode:"ActionMode",frameType:"TwoByOne",pressEnabled:true,enableIconFrame:true,enableDynamicHeight:true,enableNavigationButton:true,headerImage:"sap-icon://workflow-tasks",badgeIcon:x(a.getProperty("Priority")),badgeValueState:k(a.getProperty("Priority")),header:a.getProperty("TaskTitle"),state:a.getProperty("loadState"),priority:V(a.getProperty("Priority")),priorityText:this._toPriorityText(V(a.getProperty("Priority"))),press:t=>this._onPressTask(t),tileContent:[new n(`${r}-actionTileContent`,{headerLink:(()=>{const t=new s({text:a.getProperty("CreatedByName"),press:t=>{void this._onClickCreatedBy(t)}});M(t,O.PRESS,"MST:ContactDetails");return t})(),attributes:c})],actionButtons:[(()=>{const t=new o(`${r}-view-btn`,{text:this._i18nBundle.getText("viewButton"),press:t=>t.getSource().getParent().firePress(),visible:a.getProperty("actions/length")===0});M(t,O.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-approve-btn`,{text:a.getProperty("actions/0/text"),type:a.getProperty("actions/0/type"),press:()=>this._onActionButtonPress(a.getProperty("actions/0/pressHandler")),visible:a.getProperty("actions/0")!==undefined}).addStyleClass("sapUiTinyMarginEnd");M(t,O.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-reject-btn`,{text:a.getProperty("actions/1/text"),type:a.getProperty("actions/1/type"),press:()=>this._onActionButtonPress(a.getProperty("actions/1/pressHandler")),visible:a.getProperty("actions/1")!==undefined}).addStyleClass("sapUiTinyMarginEnd");M(t,O.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-overflow-btn`,{icon:"sap-icon://overflow",type:P.Transparent,press:t=>this._onOverflowButtonPress(t,a),visible:a.getProperty("actions/length")>=3});M(t,O.PRESS,"todoActBtnOverflow");return t})()]})},_onOverflowButtonPress:function t(e,n){const o=n.getProperty("actions").slice(2);this._getOverflowButtonPopover(o).openBy(e.getSource())},_getOverflowButtonPopover:function t(e){if(!this._overflowPopover){this._overflowList=new r(`${this.getId()}-overflowList`);this._overflowPopover=new c(`${this.getId()}-overflowPopover`,{showHeader:false,content:this._overflowList,placement:D.VerticalPreferredBottom})}this._setupOverflowList(e);return this._overflowPopover},_setupOverflowList:function t(e){this._overflowList.destroyItems();e.forEach((t,e)=>{const n=new u(`action-${e}`,{title:t.text,type:"Active",press:()=>this._onActionButtonPress(t.pressHandler)});M(n,O.PRESS,"todoActionBtn");this._overflowList.addItem(n)})},_onActionButtonPress:function t(e){e(this._loadCards.bind(this))},_getCustomAttributes:function t(e){const n=[];const o=4;const i=this._customAttributeMap[e.TaskDefinitionID]||[];for(let t of i){const o=t;const i=e.CustomAttributeData?.results;const s=i.find(t=>t.Name===o.name);let r="";if(s&&!o.referenced){const t={label:o.label+":",type:I.Text};if(o.format){r=this._formatCustomAttribute(o,i)}else if(o.textArrangement){r=this._arrangeText(s,o.textArrangement)}else{r=o.type==="Edm.DateTime"?U(s.Value):s.Value}t.text=r||"-";n.push(t)}}this._addCommonAttributes(n,e);return n.slice(0,o)},_arrangeText:function t(e,n){const o=e.Value.trim();const i=e.ValueText.trim();let s="";switch(n){case H.TextFirst:s=`${i} (${o})`;break;case H.TextLast:s=`${o} (${i})`;break;case H.TextOnly:s=`${i}`;break;case H.TextSeparate:s=`${o}`;break;default:s=`${i} ${o})`;break}return s},_formatCustomAttribute:function t(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];const o=t=>n.find(e=>e.Name===t);const i=e.format?.toUpperCase();const s=o(e.name);let r=s?.Value;if(i===W.CURRENCYVALUE&&e.reference){const t=o(e.reference);if(t){const e=f.getCurrencyInstance();r=e.format(parseFloat(s?.Value),t.Value)}}else if(i===W.USER){r=s?.FormattedValue||s?.Value}return r},_addCommonAttributes:function t(e,n){if(n.CompletionDeadline){e.push({label:this._i18nBundle.getText("dueDate")+":",text:U(n.CompletionDeadline,"MMM dd, YYYY hh:mm a"),type:I.Text})}if(n.CreatedOn){e.push({label:this._i18nBundle.getText("createdOn")+":",text:U(n.CreatedOn),type:I.Text})}},_onPressTask:function t(e){if(this.getTargetAppUrl()){const t=e.getSource();const n=t.getBindingContext();const o=n?.getProperty("loadState");const i=$(n?.getProperty("SAP__Origin"),n?.getProperty("InstanceID"),this.getTargetAppUrl());if(o!==A.Loading){C.redirect(i,false)}}},_onClickCreatedBy:function e(n){try{const e=this;const o=n.getSource();const{SAP__Origin:i,CreatedBy:s,TaskTitle:r,CreatedByName:c,InstanceID:u}=n.getSource().getBindingContext()?.getObject();const l=$(i,u,e.getTargetAppUrl());const p=(t,e)=>{let{subject:n,body:o}=e;C.triggerEmail(t,n,o)};const f=new URL(window.location.href);f.hash=l;const d=f.toString();return Promise.resolve(L(i,s)).then(function(n){if(n.Email){sap.ui.require(["sap/suite/ui/commons/collaboration/ServiceContainer"],function(e){try{return Promise.resolve(e.getServiceAsync()).then(function(e){const i=function(){if(e.enableContactsCollaboration){const i=b(function(){return Promise.resolve(e.enableContactsCollaboration(n.Email,{subject:r,body:encodeURIComponent(d)})).then(function(t){const e=t;e.openBy(o)})},function(e){t.error(e instanceof Error?e.message:String(e));p(n.Email,{subject:r,body:d})});if(i&&i.then)return i.then(function(){})}else{p(n.Email,{subject:r,body:d})}}();if(i&&i.then)return i.then(function(){})})}catch(t){return Promise.reject(t)}})}else{a.warning(e._i18nBundle.getText("noEmail",[c]))}})}catch(t){return Promise.reject(t)}},onDataReceived:function t(e,n){try{const t=this;const[o,i]=e;t._extractCustomAttributes(i);const s=function(){if(!n||n&&!n.onlyCount){return Promise.resolve(t._updateTasks(o)).then(function(e){t._oData.displayTiles=t._oData.tiles=e})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_updateTasks:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];try{const t=this;let n=t._addCustomAttributes(e);const o=function(){if(t.getEnableActions()){const e=t._getTaskDefintions(n);return Promise.resolve(t._downloadDecisionOptions(e)).then(function(){n=t._addActions(n)})}}();return Promise.resolve(o&&o.then?o.then(function(){return n}):n)}catch(t){return Promise.reject(t)}},_addCustomAttributes:function t(e){return e.map(t=>({...t,attributes:this._getCustomAttributes(t)}))},_addActions:function t(e){return e.map(t=>{const e=t.SAP__Origin+t.TaskDefinitionID;return{...t,actions:this._taskDefinitionMap[e]?S.getTaskActions(t,this.getBaseUrl(),this._taskDefinitionMap,this._i18nBundle):[]}})},_downloadDecisionOptions:function t(e){try{const t=this;const n=[];const o=Object.keys(e).reduce((o,i)=>{if(!Object.keys(t._taskDefinitionMap).includes(i)){n.push(i);t._taskDefinitionMap[i]=[];const{SAP__Origin:s,InstanceID:r}=e[i];o.push(`DecisionOptions?SAP__Origin='${s}'&InstanceID='${r}'`)}return o},[]);const i=function(){if(o.length){t._clearRequests();t.requests.push({baseURL:t.getBaseUrl(),requestURLs:o,success:e=>{e.forEach((e,o)=>{t._taskDefinitionMap[n[o]]=e});return Promise.resolve()}});return Promise.resolve(t._submitBatch()).then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_getTaskDefintions:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];const n={};e.forEach(t=>{const e=t.SAP__Origin+t.TaskDefinitionID;if(!n[e]){n[e]={SAP__Origin:t.SAP__Origin,InstanceID:t.InstanceID,TaskDefinitionID:t.TaskDefinitionID}}});return n},_extractCustomAttributes:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];e.forEach(t=>{const e=t.CustomAttributeDefinitionData?.results||[];this._customAttributeMap[t.TaskDefinitionID]=e.filter(t=>t.Rank>0).sort((t,e)=>e.Rank-t.Rank).map(t=>({name:t.Name,label:t.Label,type:t.Type,format:t.Format,reference:t.Reference,referenced:t.Referenced,textArrangement:t.TextArrangement}))})},getNoDataText:function t(){return this._i18nBundle.getText("noTaskTitle")},getVerticalCardCount:function t(e,n){const o=R(e,["padding-top"]);const i=R(e.parentElement,["height"]);const s=this.calculateTitleHeight();const r=i.height-o["padding-top"]*2-s;const a=this.getHorizontalCardCount(e);const c=n?.isPlaceholder;const u=16;let l=0;let p=0;if(this._isLoaded()){const t=j(this._oData.tiles,a);const e=t.map(t=>{const e=t.reduce(function(t,e){e.attributes=e.attributes||[];return e.attributes.length>t?e.attributes.length:t},1);let n=Math.min(e,4);if(this._isGridLayoutAllowed()){n=n>N.GRID_VIEW_MAX_ROWS?N.GRID_VIEW_MAX_ROWS:N.GRID_VIEW_MIN_ROWS}return N.CARD_HEIGHT[n]+u});for(let t of e){if(l+t<r){l+=t;p++}else{break}}}else{p=Math.floor(r/N.CARD_HEIGHT[c?"4":"1"])}return Math.max(p,2)},_adjustLayout:function t(){E.prototype._adjustLayout.call(this);const e=this._isGridLayoutAllowed();this.setProperty("minCardWidth",e?N.GRID_VIEW_MIN_WIDTH:N.MOBILE_VIEW_MIN_WIDTH);this.setProperty("maxCardWidth",e?N.GRID_VIEW_MAX_WIDTH:N.MOBILE_VIEW_MAX_WIDTH);this._getContent()?.[0]?.toggleStyleClass("sapUiGridTaskLayout",e)},_isGridLayoutAllowed:function t(){const e=this.getDeviceType();return e===w.LargeDesktop},setTargetAppUrl:function t(e){this._viewAllTasksMenuItem.setVisible(!!e);this.setProperty("targetAppUrl",e);return this}});return G});
|
|
266
|
+
sap.ui.predefine("sap/cux/home/TaskPanel", ["sap/base/Log","sap/m/ActionTile","sap/m/ActionTileContent","sap/m/Button","sap/m/ContentConfig","sap/m/Link","sap/m/List","sap/m/MessageBox","sap/m/Popover","sap/m/StandardListItem","sap/m/TileAttribute","sap/m/library","sap/ui/core/format/NumberFormat","./MenuItem","./ToDoPanel","./utils/DecisionDialog","./utils/Device","./utils/FESRUtil","./utils/TaskUtils"],function(t,e,n,o,i,s,r,a,c,u,l,p,f,d,h,g,_,m,y){"use strict";function T(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function b(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const P=p["ButtonType"];const C=p["ContentConfigType"];const D=p["LoadState"];const A=p["PlacementType"];const I=p["URLHelper"];const v=T(d);const S=T(h);const k=T(g);const E=g["getIconFrameBadge"];const x=g["getIconFrameBadgeValueState"];const R=_["calculateDeviceType"];const w=_["DeviceType"];const B=_["fetchElementProperties"];const O=m["addFESRId"];const M=m["addFESRSemanticStepName"];const L=m["FESR_EVENTS"];const U=y["fetchUserDetails"];const V=y["formatDate"];const $=y["getPriority"];const W=y["getTaskUrl"];var N=function(t){t["CURRENCYVALUE"]="CURRENCYVALUE";t["CURRENCYCODE"]="CURRENCYCODE";t["USER"]="USER";return t}(N||{});var H=function(t){t["TextFirst"]="TextFirst";t["TextLast"]="TextLast";t["TextOnly"]="TextOnly";t["TextSeparate"]="TextSeparate";return t}(H||{});const G={GRID_VIEW_MIN_ROWS:1,GRID_VIEW_MAX_ROWS:2,GRID_VIEW_MIN_WIDTH:304,GRID_VIEW_TWO_COL_MIN_WIDTH:374,GRID_VIEW_MAX_WIDTH:583,CARD_HEIGHT:{1:220,2:272,3:324,4:376}};function j(t,e){const n=[];for(let o=0;o<t.length;o+=e){n.push(t.slice(o,o+e))}return n}const F=S.extend("sap.cux.home.TaskPanel",{metadata:{library:"sap.cux.home",properties:{enableActions:{type:"boolean",group:"Data",defaultValue:false,visibility:"public"},customAttributeUrl:{type:"string",group:"Data",defaultValue:"",visibility:"public"}}},constructor:function t(e,n){S.prototype.constructor.call(this,e,n)},init:function t(){S.prototype.init.call(this);this._customAttributeMap={};this._taskDefinitionMap={};this.setProperty("key","tasks");this.setProperty("title",this._i18nBundle.getText("tasksTabTitle"));this._viewAllTasksMenuItem=new v(`${this.getId()}-view-tasks-btn`,{title:this._i18nBundle.getText("viewAllTasksTitle"),icon:"sap-icon://inbox",visible:false,press:this._onPressViewAll.bind(this)});this.insertAggregation("menuItems",this._viewAllTasksMenuItem,0);O(this._viewAllTasksMenuItem,"goToTaskSitution")},generateRequestUrls:function t(e){const n=[this.getCountUrl(),`${this.getDataUrl()},CustomAttributeData&$expand=CustomAttributeData&$skip=0&$top=${e}`];const o=this.getCustomAttributeUrl();if(o){n.push(o)}return n},generateCardTemplate:function t(r,a){const c=a.getObject().attributes?.map((t,e)=>new l(`${r}-${e}-attribute`,{label:t.label,contentConfig:new i(`${r}-${e}-contentConfig`,{type:t.type,text:t.text,href:t.href})}));return new e(`${r}-actionTile`,{mode:"ActionMode",frameType:"TwoByOne",pressEnabled:true,enableIconFrame:true,enableDynamicHeight:true,enableNavigationButton:true,headerImage:"sap-icon://workflow-tasks",badgeIcon:E(a.getProperty("Priority")),badgeValueState:x(a.getProperty("Priority")),header:a.getProperty("TaskTitle"),state:a.getProperty("loadState"),priority:$(a.getProperty("Priority")),priorityText:this._toPriorityText($(a.getProperty("Priority"))),press:t=>this._onPressTask(t),tileContent:[new n(`${r}-actionTileContent`,{headerLink:(()=>{const t=new s(`${r}-actionTileContentLink`,{text:a.getProperty("CreatedByName"),press:t=>{void this._onClickCreatedBy(t)}});M(t,L.PRESS,"MST:ContactDetails");return t})(),attributes:c})],actionButtons:[(()=>{const t=new o(`${r}-view-btn`,{text:this._i18nBundle.getText("viewButton"),press:t=>t.getSource().getParent().firePress(),visible:a.getProperty("actions/length")===0});M(t,L.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-approve-btn`,{text:a.getProperty("actions/0/text"),type:a.getProperty("actions/0/type"),press:()=>this._onActionButtonPress(a.getProperty("actions/0/pressHandler")),visible:a.getProperty("actions/0")!==undefined}).addStyleClass("sapUiTinyMarginEnd");M(t,L.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-reject-btn`,{text:a.getProperty("actions/1/text"),type:a.getProperty("actions/1/type"),press:()=>this._onActionButtonPress(a.getProperty("actions/1/pressHandler")),visible:a.getProperty("actions/1")!==undefined}).addStyleClass("sapUiTinyMarginEnd");M(t,L.PRESS,"todoActionBtn");return t})(),(()=>{const t=new o(`${r}-overflow-btn`,{icon:"sap-icon://overflow",type:P.Transparent,press:t=>this._onOverflowButtonPress(t,a),visible:a.getProperty("actions/length")>=3});M(t,L.PRESS,"todoActBtnOverflow");return t})()]})},_onOverflowButtonPress:function t(e,n){const o=n.getProperty("actions").slice(2);this._getOverflowButtonPopover(o).openBy(e.getSource())},_getOverflowButtonPopover:function t(e){if(!this._overflowPopover){this._overflowList=new r(`${this.getId()}-overflowList`);this._overflowPopover=new c(`${this.getId()}-overflowPopover`,{showHeader:false,content:this._overflowList,placement:A.VerticalPreferredBottom})}this._setupOverflowList(e);return this._overflowPopover},_setupOverflowList:function t(e){this._overflowList.destroyItems();e.forEach((t,e)=>{const n=new u(`action-${e}`,{title:t.text,type:"Active",press:()=>this._onActionButtonPress(t.pressHandler)});M(n,L.PRESS,"todoActionBtn");this._overflowList.addItem(n)})},_onActionButtonPress:function t(e){e(this._loadCards.bind(this))},_getCustomAttributes:function t(e){const n=[];const o=4;const i=this._customAttributeMap[e.TaskDefinitionID]||[];for(let t of i){const o=t;const i=e.CustomAttributeData?.results;const s=i.find(t=>t.Name===o.name);let r="";if(s&&!o.referenced){const t={label:o.label+":",type:C.Text};if(o.format){r=this._formatCustomAttribute(o,i)}else if(o.textArrangement){r=this._arrangeText(s,o.textArrangement)}else{r=o.type==="Edm.DateTime"?V(s.Value):s.Value}t.text=r||"-";n.push(t)}}this._addCommonAttributes(n,e);return n.slice(0,o)},_arrangeText:function t(e,n){const o=e.Value.trim();const i=e.ValueText.trim();let s="";switch(n){case H.TextFirst:s=`${i} (${o})`;break;case H.TextLast:s=`${o} (${i})`;break;case H.TextOnly:s=`${i}`;break;case H.TextSeparate:s=`${o}`;break;default:s=`${i} ${o})`;break}return s},_formatCustomAttribute:function t(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];const o=t=>n.find(e=>e.Name===t);const i=e.format?.toUpperCase();const s=o(e.name);let r=s?.Value;if(i===N.CURRENCYVALUE&&e.reference){const t=o(e.reference);if(t){const e=f.getCurrencyInstance();r=e.format(parseFloat(s?.Value),t.Value)}}else if(i===N.USER){r=s?.FormattedValue||s?.Value}return r},_addCommonAttributes:function t(e,n){if(n.CompletionDeadline){e.push({label:this._i18nBundle.getText("dueDate")+":",text:V(n.CompletionDeadline,"MMM dd, YYYY hh:mm a"),type:C.Text})}if(n.CreatedOn){e.push({label:this._i18nBundle.getText("createdOn")+":",text:V(n.CreatedOn),type:C.Text})}},_onPressTask:function t(e){if(this.getTargetAppUrl()){const t=e.getSource();const n=t.getBindingContext();const o=n?.getProperty("loadState");const i=W(n?.getProperty("SAP__Origin"),n?.getProperty("InstanceID"),this.getTargetAppUrl());if(o!==D.Loading){I.redirect(i,false)}}},_onClickCreatedBy:function e(n){try{const e=this;const o=n.getSource();const{SAP__Origin:i,CreatedBy:s,TaskTitle:r,CreatedByName:c,InstanceID:u}=n.getSource().getBindingContext()?.getObject();const l=W(i,u,e.getTargetAppUrl());const p=(t,e)=>{let{subject:n,body:o}=e;I.triggerEmail(t,n,o)};const f=new URL(window.location.href);f.hash=l;const d=f.toString();return Promise.resolve(U(i,s)).then(function(n){if(n.Email){sap.ui.require(["sap/suite/ui/commons/collaboration/ServiceContainer"],function(e){try{return Promise.resolve(e.getServiceAsync()).then(function(e){const i=function(){if(e.enableContactsCollaboration){const i=b(function(){return Promise.resolve(e.enableContactsCollaboration(n.Email,{subject:r,body:encodeURIComponent(d)})).then(function(t){const e=t;e.openBy(o)})},function(e){t.error(e instanceof Error?e.message:String(e));p(n.Email,{subject:r,body:d})});if(i&&i.then)return i.then(function(){})}else{p(n.Email,{subject:r,body:d})}}();if(i&&i.then)return i.then(function(){})})}catch(t){return Promise.reject(t)}})}else{a.warning(e._i18nBundle.getText("noEmail",[c]))}})}catch(t){return Promise.reject(t)}},onDataReceived:function t(e,n){try{const t=this;const[o,i]=e;t._extractCustomAttributes(i);const s=function(){if(!n||n&&!n.onlyCount){return Promise.resolve(t._updateTasks(o)).then(function(e){t._oData.displayTiles=t._oData.tiles=e})}}();return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_updateTasks:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];try{const t=this;let n=t._addCustomAttributes(e);const o=function(){if(t.getEnableActions()){const e=t._getTaskDefintions(n);return Promise.resolve(t._downloadDecisionOptions(e)).then(function(){n=t._addActions(n)})}}();return Promise.resolve(o&&o.then?o.then(function(){return n}):n)}catch(t){return Promise.reject(t)}},_addCustomAttributes:function t(e){return e.map(t=>({...t,attributes:this._getCustomAttributes(t)}))},_addActions:function t(e){return e.map(t=>{const e=t.SAP__Origin+t.TaskDefinitionID;return{...t,actions:this._taskDefinitionMap[e]?k.getTaskActions(t,this.getBaseUrl(),this._taskDefinitionMap,this._i18nBundle):[]}})},_downloadDecisionOptions:function t(e){try{const t=this;const n=[];const o=Object.keys(e).reduce((o,i)=>{if(!Object.keys(t._taskDefinitionMap).includes(i)){n.push(i);t._taskDefinitionMap[i]=[];const{SAP__Origin:s,InstanceID:r}=e[i];o.push(`DecisionOptions?SAP__Origin='${s}'&InstanceID='${r}'`)}return o},[]);const i=function(){if(o.length){t._clearRequests();t.requests.push({baseURL:t.getBaseUrl(),requestURLs:o,success:e=>{e.forEach((e,o)=>{t._taskDefinitionMap[n[o]]=e});return Promise.resolve()}});return Promise.resolve(t._submitBatch()).then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},_getTaskDefintions:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];const n={};e.forEach(t=>{const e=t.SAP__Origin+t.TaskDefinitionID;if(!n[e]){n[e]={SAP__Origin:t.SAP__Origin,InstanceID:t.InstanceID,TaskDefinitionID:t.TaskDefinitionID}}});return n},_extractCustomAttributes:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];e.forEach(t=>{const e=t.CustomAttributeDefinitionData?.results||[];this._customAttributeMap[t.TaskDefinitionID]=e.filter(t=>t.Rank>0).sort((t,e)=>e.Rank-t.Rank).map(t=>({name:t.Name,label:t.Label,type:t.Type,format:t.Format,reference:t.Reference,referenced:t.Referenced,textArrangement:t.TextArrangement}))})},getNoDataText:function t(){return this._i18nBundle.getText("noTaskTitle")},getVerticalCardCount:function t(e,n){const o=B(e,["padding-top"]);const i=B(e.parentElement,["height"]);const s=this.calculateTitleHeight();const r=i.height-o["padding-top"]*2-s;const a=this.getHorizontalCardCount(e);const c=n?.isPlaceholder;const u=16;let l=0;let p=0;if(this._isLoaded()){const t=j(this._oData.tiles,a);const e=t.map(t=>{const e=t.reduce(function(t,e){e.attributes=e.attributes||[];return e.attributes.length>t?e.attributes.length:t},1);let n=Math.min(e,4);if(this._isGridLayoutAllowed()){n=n>G.GRID_VIEW_MAX_ROWS?G.GRID_VIEW_MAX_ROWS:G.GRID_VIEW_MIN_ROWS}return G.CARD_HEIGHT[n]+u});for(let t of e){if(l+t<r){l+=t;p++}else{break}}}else{p=Math.floor(r/G.CARD_HEIGHT[c?"4":"1"])}return Math.max(p,2)},_adjustLayout:function t(){S.prototype._adjustLayout.call(this);this.setProperty("minCardWidth",this._isGridLayoutAllowed()?G.GRID_VIEW_TWO_COL_MIN_WIDTH:G.GRID_VIEW_MIN_WIDTH);this.setProperty("maxCardWidth",G.GRID_VIEW_MAX_WIDTH);const e=this._getContent()?.[0];if(e&&!e.hasStyleClass("sapUiGridTaskLayout")&&R()!==w.Mobile){e.addStyleClass("sapUiGridTaskLayout")}},_isGridLayoutAllowed:function t(){const e=R();return e===w.LargeDesktop},setTargetAppUrl:function t(e){this._viewAllTasksMenuItem.setVisible(!!e);this.setProperty("targetAppUrl",e);return this}});return F});
|
|
237
267
|
/*!
|
|
238
268
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
239
269
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
240
270
|
*/
|
|
241
|
-
sap.ui.predefine("sap/cux/home/TilesPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerItemLayoutData","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/GenericTile","sap/m/HBox","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/Label","sap/m/List","sap/m/ObjectIdentifier","sap/m/Title","sap/m/VBox","sap/m/library","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/Lib","sap/ui/model/json/JSONModel","sap/ushell/Config","sap/ushell/Container","sap/ushell/api/S4MyHome","./BasePanel","./MenuItem","./utils/Accessibility","./utils/AppManager","./utils/Constants","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/InsightsUtils"],function(t,e,i,n,s,o,a,r,l,c,d,h,u,g,p,f,m,_,I,v,M,A,T,S,y,P,D,F,C,B,E,x){"use strict";function $(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function b(t,e){try{var i=t()}catch(t){return e(t)}if(i&&i.then){return i.then(void 0,e)}return i}const w=f["ButtonType"];function z(t,e){try{var i=t()}catch(t){return e(true,t)}if(i&&i.then){return i.then(e.bind(null,false),e.bind(null,true))}return e(false,i)}const H=f["LoadState"];const R=$(S);const L=$(y);const O=P["checkPanelExists"];const V=$(D);const W=F["DEFAULT_BG_COLOR"];const k=F["END_USER_COLORS"];const N=F["MYHOME_PAGE_ID"];const U=F["MYINSIGHT_SECTION_ID"];const j=F["SETTINGS_PANELS_KEYS"];const G=C["DeviceType"];const Y=C["fetchElementProperties"];const J=B["focusDraggedItem"];const K=E["addFESRId"];const q=E["addFESRSemanticStepName"];const Q=E["FESR_EVENTS"];const X=x["createShowMoreActionButton"];const Z=x["createShowMoreMenuItem"];const tt=x["getAssociatedFullScreenMenuItem"];const et=x["sortMenuItems"];var it=function(t){t["REFRESH"]="tiles-refresh";t["ADD_APPS"]="tiles-addSmartApps";t["EDIT_TILES"]="tiles-editTiles";return t}(it||{});var nt=function(t){t["REFRESH"]="container-tiles-refresh";t["ADD_APPS"]="container-tiles-addSmartApps";t["EDIT_TILES"]="container-tiles-editTiles";t["SHOW_MORE"]="tilesContainerFullScreenMenuItem";return t}(nt||{});var st=function(t){t["ADD_TILES"]="tiles-addTilesButton";return t}(st||{});var ot=function(t){t["ADD_TILES"]="container-tiles-addTilesButton";t["SHOW_MORE"]="tilesContanerFullScreenActionButton";return t}(ot||{});var at=function(t){t["Standard"]="standard";t["StandardWide"]="standardWide";return t}(at||{});const rt="sap.cux.home.FavAppPanel";const lt="sap.cux.home.AppsContainer";const ct=[it.REFRESH,it.ADD_APPS,it.EDIT_TILES,"showMore","settings"];const dt=()=>M.last("/core/shell/enablePersonalization")||M.last("/core/catalog/enabled");const ht=176;const ut=368;const gt=16;const pt=R.extend("sap.cux.home.TilesPanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},key:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",defaultValue:"SI1",visibility:"hidden"}},defaultAggregation:"tiles",aggregations:{tiles:{type:"sap.cux.home.App",multiple:true,singularName:"tile",visibility:"hidden"}},events:{handleHidePanel:{parameters:{}},handleUnhidePanel:{parameters:{}}}},constructor:function t(e,i){R.prototype.constructor.call(this,e,i);this._insightsSectionTitle=this._i18nBundle.getText("insights");this._addFromFavDialogId=`${this.getId()}-addFromFavDialog`;this._headerVisible=false},init:function e(){const i=this;R.prototype.init.call(this);this._controlMap=new Map;this._oData={tiles:[],activateInsightsTiles:true,activateInsightsTilesOnPhone:false,activateInsightsTilesOnDesktop:false};this._controlModel=new v(this._oData);this.appManagerInstance=V.getInstance();this.setProperty("key","tiles");this.setProperty("enableFullScreen",true);const n=this._createRefreshMenuItem(it.REFRESH,"tilesRefresh");const s=this._createEditTilesMenuItem(it.EDIT_TILES,"manageTiles");const o=[n,s];o.forEach(t=>this.addAggregation("menuItems",t));this._sortMenuItems(ct);const a=this._createAddTilesButton(st.ADD_TILES,"addTiles");const r=[a];r.forEach(t=>this.addAggregation("actionButtons",t));this._createTilesFlexWrapper();A.getServiceAsync("VisualizationInstantiation").then(t=>{this.VizInstantiationService=t}).catch(e=>{t.error(e instanceof Error?e.message:String(e))});this.oEventBus=m.getInstance();this.oEventBus.subscribe("importChannel","tilesImport",function(t,e,n){try{return Promise.resolve(i.appManagerInstance.createInsightSection(i._i18nBundle.getText("insightsTiles"))).then(function(){return Promise.resolve(i._addSectionViz(n,U)).then(function(){return Promise.resolve(i.refreshData()).then(function(){i._adjustLayout();i._importdone()})})})}catch(t){return Promise.reject(t)}},this);this._toggleTileActivity()},_toggleTileActivity:function e(){const i=this;const n=function(t){try{const e=t.getParameter("isMyHomeRoute");i._controlModel.setProperty("/activateInsightsTiles",e);const n=function(){if(e){const t=function(){if(i._appSwitched){return Promise.resolve(i.refreshData(true)).then(function(){i._appSwitched=false})}}();if(t&&t.then)return t.then(function(){})}else{i._appSwitched=true}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}};try{T.attachRouteMatched({},n,this)}catch(e){t.warning(e instanceof Error?e.message:String(e))}},_addSectionViz:function t(e,i){return e.reduce((t,e)=>t.then(()=>{if(e.isBookmark){return this.appManagerInstance.addBookMark(e)}else{return i?this.appManagerInstance.addVisualization(e.vizId,i):this.appManagerInstance.addVisualization(e.vizId)}}),Promise.resolve())},_importdone:function t(){const e={status:true};this.oEventBus.publish("importChannel","tilesImported",e)},_showPlaceHolders:function t(){const e=new Array(this._calculatePlaceholderTileCount()).fill(H.Loading);this.aInsightsApps=e.map(t=>new a({sizeBehavior:"Responsive",state:t,frameType:"OneByOne",mode:"IconMode",visible:true,renderOnThemeChange:true,ariaRole:"listitem",dropAreaOffset:8}).setLayoutData?.(new i({columns:2})));this._controlModel.setProperty("/tiles",this.aInsightsApps)},_clearPlaceHolders:function t(){this._controlModel.setProperty("/tiles",[])},renderPanel:function t(){try{let e=false;const i=this;function n(t){return e?t:Promise.resolve()}const s=z(function(){return b(function(){const t=i.getParent();if(O(t,lt,rt)){const t=i._createAddFromFavMenuItem(it.ADD_APPS,"smartAppsDialog");i.addAggregation("menuItems",t);i._sortMenuItems(ct)}return Promise.resolve(i.refreshData()).then(function(t){e=true;return t})},function(t){i.fireHandleHidePanel()})},function(t,e){i.fireEvent("loaded");if(t)throw e;return e});return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(o){return Promise.reject(o)}},_sortMenuItems:function t(e){const i=this.getAggregation("menuItems");let n=et(e,i);this.removeAllAggregation("menuItems");n?.forEach(t=>this.addAggregation("menuItems",t))},refreshData:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;const i=t.getMetadata().getName();return Promise.resolve(t.appManagerInstance.fetchInsightApps(true,t._insightsSectionTitle)).then(function(n){function s(){t._clearPlaceHolders();t._controlModel.setProperty("/tiles",t.aInsightsApps);if(t.aInsightsApps?.length){t.fireHandleUnhidePanel();if(e){const e=t.getDeviceType()===G.Mobile;const i=e?t.tilesMobileContainer:t.tilesContainer;const n=i.getMetadata().getDefaultAggregationName();const s=i.getAggregation(n)||[];s.forEach(t=>t.refresh?.())}t._getInsightsContainer().updatePanelsItemCount(t.aInsightsApps.length,i);if(t._headerVisible){t.setProperty("title",`${t._i18nBundle?.getText("insights")} ${t._i18nBundle.getText("insightsTilesTitle")} (${t.aInsightsApps.length})`)}}else{t.fireHandleHidePanel()}}t.aInsightsApps=n;const o=t.aInsightsApps.some(t=>t.isSmartBusinessTile);const a=function(){if(o){return Promise.resolve(I.load({name:"sap.cloudfnd.smartbusiness.lib.reusetiles"})).then(function(){})}}();return a&&a.then?a.then(s):s(a)})}catch(t){return Promise.reject(t)}},_createTilesFlexWrapper:function t(){if(!this._tilesWrapper){this._tilesWrapper=new p(`${this.getId()}-tilesWrapper`,{renderType:"Bare",width:"100%",items:[this._createMobileFlexWrapper(),this._createWrapperFlexBox()]});this._showPlaceHolders();this._tilesWrapper.setModel(this._controlModel);this._addContent(this._tilesWrapper)}},_createMobileFlexWrapper:function t(){if(!this.tilesMobileContainer){this.tilesMobileContainer=new l(`${this.getId()}-insightsTilesMobileContainer`,{scrollStep:0,scrollStepByItem:1,gridLayout:true,scrollTime:1e3,showDividers:false,visible:"{/isPhone}"}).addStyleClass("sectionMarginTopTilesInsight sapMHeaderContainerAlign sapMHeaderContainerMarginBottom tilesBoxShadow");this._attachAggregationToContainer(this.tilesMobileContainer)}return this.tilesMobileContainer},_createWrapperFlexBox:function t(){if(!this.tilesContainer){this.tilesContainer=new e(`${this.getId()}-insightsTilesContainer`,{visible:"{= !${/isPhone}}"}).addStyleClass("insightTiles sapUiSmallMarginTop sapUiSmallMarginBottom");this._attachAggregationToContainer(this.tilesContainer)}return this.tilesContainer},_updateTilesActivity:function t(){const e=this.getDeviceType()===G.Mobile;const i=Boolean(this._controlModel.getProperty("/activateInsightsTiles"));this._controlModel.setProperty("/activateInsightsTilesOnPhone",i&&e);this._controlModel.setProperty("/activateInsightsTilesOnDesktop",i&&!e)},_attachAggregationToContainer:function t(e){e.setModel(this._controlModel);const n=e.getMetadata().getDefaultAggregationName();const s=this.getDeviceType()===G.Mobile;e.bindAggregation(n,{path:"/tiles",factory:(t,e)=>{const n=e.getObject();if(n instanceof a){return n}const o=this.VizInstantiationService.instantiateVisualization(n.visualization);o.setLayoutData?.(new i({minRows:2,columns:o.getDisplayFormat?.()===at.Standard?2:4}));o?.bindProperty?.("active",s?"/activateInsightsTilesOnPhone":"/activateInsightsTilesOnDesktop");this._setDropAreaRectFunction(o);return o}});this.addDragDropConfigTo(e,t=>this._handleTilesDnd(t))},_setDropAreaRectFunction:function t(e){const i=8;Object.defineProperty(e,"getDropAreaRect",{value:function(){const t=this.getDomRef();if(!t)return null;const e=t.getBoundingClientRect();return{left:e.left-i,right:e.right+i,top:e.top,bottom:e.bottom,width:e.width,height:e.height}}})},_handleTilesDnd:function t(e){const i=e.getParameter?.("dropPosition"),n=e?.getParameter?.("draggedControl"),s=e.getParameter("droppedControl"),o=n.getParent()?.indexOfItem(n);let a=n.getParent()?.indexOfItem(s);if(i==="Before"&&o===a-1){a--}else if(i==="After"&&o===a+1){a++}if(o!==a){void this._DragnDropTiles(o,a,i)}},_DragnDropTiles:function t(e,i,n){try{const t=this;if(n==="Before"&&e<i){i--}else if(n==="After"&&e>i){i++}const s=t.aInsightsApps[i],o=t.aInsightsApps.splice(e,1)[0];t.aInsightsApps.splice(i,0,o);const a={pageId:N,sourceSectionIndex:o.persConfig?.sectionIndex,sourceVisualizationIndex:o.persConfig?.visualizationIndex,targetSectionIndex:s.persConfig?.sectionIndex,targetVisualizationIndex:s.persConfig?.visualizationIndex};t._controlModel.setProperty("/tiles",t.aInsightsApps);return Promise.resolve(t.appManagerInstance.moveVisualization(a)).then(function(){return Promise.resolve(t.refreshData(true)).then(function(){setTimeout(()=>{J(t.tilesContainer,i)},0)})})}catch(t){return Promise.reject(t)}},handleEditTiles:function t(e){let i=e.getSource().getParent()||this;if(i?.isA("sap.cux.home.TilesPanel")){i=i.getParent()}i?._getLayout().openSettingsDialog(j.INSIGHTS_TILES)},handleHideHeader:function t(){this._headerVisible=false;this.setProperty("title","");this._toggleHeaderActions(false)},handleAddHeader:function t(){this._headerVisible=true;this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsTilesTitle")} (${this.aInsightsApps.length})`);this._toggleHeaderActions(true)},_closeAddFromFavDialog:function t(){const e=this._controlMap.get(`${this._addFromFavDialogId}-list`);e?.removeSelections();this._controlMap.get(this._addFromFavDialogId)?.close()},navigateToAppFinder:function t(e){try{return Promise.resolve(A.getServiceAsync("Navigation")).then(function(t){const i={pageID:N,sectionID:U};if(e){i.sectionID=e}return Promise.resolve(t.navigate({target:{shellHash:`Shell-appfinder?&/catalog/${JSON.stringify(i)}`}})).then(function(){})})}catch(t){return Promise.reject(t)}},_getLegendColor:function t(e){return k().find(t=>t.value===e)||W()},_handleAddFromFavApps:function t(){try{const t=this;return Promise.resolve(t._getFavToAdd()).then(function(e){const i=t._generateAddFromFavAppsDialog();t._controlMap.get(`${t._addFromFavDialogId}-errorMessage`)?.setVisible(e.length===0);t._generateAddFromFavAppsListItems(e);i.open()})}catch(t){return Promise.reject(t)}},_getFavToAdd:function t(){try{const t=this;return Promise.resolve(t.appManagerInstance.fetchFavVizs(false,true)).then(function(e){const i=e.filter(function(t){return t.isCount||t.isSmartBusinessTile});const n=i.filter(e=>{const i=t.aInsightsApps.findIndex(function(t){return!e.visualization?.isBookmark&&t.visualization?.vizId===e.visualization?.vizId||e.visualization?.isBookmark&&t.visualization?.targetURL===e.visualization?.targetURL});return i===-1});return n})}catch(t){return Promise.reject(t)}},_getSelectedInsights:function t(){const e=this._controlMap.get(`${this._addFromFavDialogId}-list`);return e.getSelectedItems()||[]},_generateAddFromFavAppsListItems:function t(e){const i=this._addFromFavDialogId;const n=this._controlMap.get(`${i}-list`);if(e.length){n.destroyItems();const t=e.map((t,e)=>new s({id:`${i}-listItem-${e}`,content:[new r({id:`${i}-listItem-${e}-content`,alignItems:"Center",items:[new _({id:`${i}-listItem-${e}-content-icon`,src:t.icon,backgroundColor:this._getLegendColor(t.BGColor??"").value,color:"white",width:"2.25rem",height:"2.25rem",size:"1.25rem"}).addStyleClass("sapUiRoundedBorder sapUiTinyMargin"),new u({id:`${i}-listItem-${e}-content-identifier`,title:t.title,text:t.subtitle,tooltip:t.title}).addStyleClass("sapUiTinyMargin")]})]}).addStyleClass("sapUiContentPadding").data("app",t));t.forEach(t=>n.addItem(t))}n?.setVisible(e.length!==0)},_generateAddFromFavAppsDialog:function t(){const e=this._addFromFavDialogId;const i=()=>{const t=this._getSelectedInsights();this._controlMap.get(`${e}-addBtn`).setEnabled(t.length>0)};if(!this._controlMap.get(e)){const t=(t,e)=>{const i=new n(t,{icon:"sap-icon://action",text:this._i18nBundle.getText("appFinderBtn"),press:()=>{this._closeAddFromFavDialog();void this.navigateToAppFinder()},visible:dt(),type:e??w.Default});q(i,Q.PRESS,"tilesAppFinder");return i};this._controlMap.set(`${e}-list`,new h({id:`${e}-list`,mode:"MultiSelect",selectionChange:i}));const s=new n({id:`${e}-addBtn`,text:this._i18nBundle.getText("addBtn"),type:"Emphasized",press:()=>{void this._addFromFavApps()},enabled:false});q(s,Q.PRESS,"addSmartApps");this._controlMap.set(`${e}-addBtn`,s);this._controlMap.set(`${e}-errorMessage`,new c({id:`${e}-errorMessage`,illustrationSize:"Spot",illustrationType:"sapIllus-AddDimensions",title:this._i18nBundle.getText("noAppsTitle"),description:this._i18nBundle.getText("tilesSectionNoDataDescription"),visible:true}).addStyleClass("sapUiLargeMarginTop"));this._controlMap.set(e,new o(e,{title:this._i18nBundle.getText("addSmartApps"),content:[new d({id:`${e}-label`,text:this._i18nBundle.getText("suggTileDialogLabel"),wrapping:true}).addStyleClass("sapMTitleAlign sapUiTinyMarginTopBottom sapUiSmallMarginBeginEnd"),new r({id:`${e}-textContainer`,justifyContent:"SpaceBetween",alignItems:"Center",items:[new g({id:`${e}-text`,text:this._i18nBundle.getText("suggTileDialogTitle")}),t(`${e}-addAppsBtn`,w.Transparent)]}).addStyleClass("sapUiTinyMarginTop dialogHeader sapUiSmallMarginBeginEnd"),this._controlMap.get(`${e}-list`),this._controlMap.get(`${e}-errorMessage`)],contentWidth:"42.75rem",contentHeight:"32.5rem",endButton:new n({id:`${e}-addFromFavDialogCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeAddFromFavDialog.bind(this)}),escapeHandler:this._closeAddFromFavDialog.bind(this),buttons:[this._controlMap.get(`${e}-addBtn`),new n({id:`${e}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeAddFromFavDialog.bind(this)})]}).addStyleClass("sapContrastPlus sapCuxAddFromInsightsDialog"))}i();return this._controlMap.get(e)},_addFromFavApps:function t(){try{const t=this;const e=t._controlMap.get(t._addFromFavDialogId);e.setBusy(true);const i=t._getSelectedInsights();return Promise.resolve(i.reduce(function(e,i){return Promise.resolve(e).then(function(){const e=i.data("app");const n={pageId:N,sourceSectionIndex:e.persConfig?.sectionIndex,sourceVisualizationIndex:e.persConfig?.visualizationIndex,targetSectionIndex:t.appManagerInstance.insightsSectionIndex,targetVisualizationIndex:-1};if(e.visualization?.displayFormatHint!=="standard"&&e.visualization?.displayFormatHint!=="standardWide"){if(e.visualization?.supportedDisplayFormats?.includes("standard")){e.visualization.displayFormatHint="standard"}else if(e.visualization?.supportedDisplayFormats?.includes("standardWide")){e.visualization.displayFormatHint="standardWide"}}if(!e.visualization?.vizId){e.visualization.vizId=e.visualization?.targetURL??""}const s=function(){if(e.visualization?.isBookmark===true){return Promise.resolve(t.appManagerInstance.addBookMark(e.visualization,n)).then(function(){})}else{return Promise.resolve(t.appManagerInstance.addVisualization(e.visualization?.vizId,U)).then(function(){})}}();if(s&&s.then)return s.then(function(){})})},Promise.resolve())).then(function(){return Promise.resolve(t.refreshData()).then(function(){e.setBusy(false);e.close()})})}catch(t){return Promise.reject(t)}},_calculateVisibleTileCount:function t(e){const i=this._getInsightsContainer()?._getLayout();const n=i?.getDomRef();const s=e||[];let o=0;if(n&&s.length){const t=i.getProperty("showHeader");const e=t?1:0;const a=n.childNodes[e];const r=Y(a,["width","padding-left","padding-right"]);let l=r.width-r["padding-left"]-r["padding-right"];const c={};c[at.Standard]=ht+gt;c[at.StandardWide]=ut+gt;let d=c[s[o].visualization?.displayFormatHint??at.Standard];do{l-=d;++o;d=c[s[o]?.visualization?.displayFormatHint??at.Standard]}while(l>d)}return o||1},_calculatePlaceholderTileCount:function t(){const e=this._getInsightsContainer()?._getLayout()?.getDomRef();let i=0;if(e){const t=e.childNodes[0];const n=Y(t,["width","padding-left","padding-right"]);let s=n.width-n["padding-left"]-n["padding-right"];const o=ht+gt;i=Math.floor(s/o)}return i||1},_adjustLayout:function t(){const e=this._getInsightsContainer()?._getLayout();const i=this.getDeviceType()===G.Mobile;if(e){const t=i?this.aInsightsApps?.length:this._calculateVisibleTileCount(this.aInsightsApps);const n=e._getCurrentExpandedElementName()===this.getProperty("fullScreenName");this._controlModel.setProperty("/tiles",n?this.aInsightsApps:this.aInsightsApps?.slice(0,t));this._controlModel.setProperty("/isPhone",i);this._updateTilesActivity();const s=n||this.aInsightsApps.length>t;if(this._headerVisible){if(!i){this.getAggregation("actionButtons")?.forEach(t=>{if(t.getId().includes(st.ADD_TILES)){this._getInsightsContainer().toggleActionButton(t,true)}})}this._getInsightsContainer()?.toggleFullScreenElements(this,s)}else{const t=tt(this);const e=t?.getTitle()??"";this._getInsightsContainer()?.updateMenuItem(this._controlMap.get(`${this.getId()}-${nt.SHOW_MORE}`),s,e);this._getInsightsContainer()?.updateActionButton(this._controlMap.get(`${this.getId()}-${ot.SHOW_MORE}`),s,e)}}},_getInsightsContainer:function t(){if(!this.insightsContainer){this.insightsContainer=this.getParent()}return this.insightsContainer},getContainerMenuItems:function t(){if(!this._containerMenuItems){const t=this._createRefreshMenuItem(nt.REFRESH,"containerTilesRefresh");const e=this._createEditTilesMenuItem(nt.EDIT_TILES,"containerManageTiles");const i=Z(this,nt.SHOW_MORE,"containerTilesShowMore");const n=this.getParent();this._controlMap.set(`${this.getId()}-${nt.SHOW_MORE}`,i);this._containerMenuItems=[t,e,i];if(O(n,lt,rt)){const t=this._createAddFromFavMenuItem(nt.ADD_APPS,"containerSmartAppsDialog");this._containerMenuItems.splice(1,0,t)}}return this._containerMenuItems},getContainerActionButtons:function t(){if(!this._containerActionButtons){this._containerActionButtons=[];this._containerActionButtons.push(this._createAddTilesButton(ot.ADD_TILES,"containerSmartAppsDialog"));const t=X(this,ot.SHOW_MORE,"containerTilesShowMore");if(t){this._controlMap.set(`${this.getId()}-${ot.SHOW_MORE}`,t);this._containerActionButtons.push(t)}}return this._containerActionButtons},_createRefreshMenuItem:function t(e,i){const n=new L(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",visible:false,press:()=>void this.refreshData(true)});this._controlMap.set(`${this.getId()}-${e}`,n);if(i){K(n,i)}return n},_createAddFromFavMenuItem:function t(e,i){if(!this._controlMap.get(`${this.getId()}-${e}`)){const t=new L(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("addSmartApps"),icon:"sap-icon://duplicate",visible:false,press:()=>void this._handleAddFromFavApps()});this._controlMap.set(`${this.getId()}-${e}`,t);if(i){K(t,i)}}return this._controlMap.get(`${this.getId()}-${e}`)},_createEditTilesMenuItem:function t(e,i){const n=new L(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("editLinkTiles"),icon:"sap-icon://edit",visible:false,press:t=>this.handleEditTiles(t)});this._controlMap.set(`${this.getId()}-${e}`,n);if(i){K(n,i)}return n},_createAddTilesButton:function t(e,i){const s=this;const o=new n(`${this.getId()}-${e}`,{text:this._i18nBundle.getText("appFinderLink"),press:function(){try{const t=s.getParent();const e=function(){if(O(t,lt,rt)){void s._handleAddFromFavApps()}else{return Promise.resolve(s.navigateToAppFinder()).then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(t){return Promise.reject(t)}}});this._controlMap.set(`${this.getId()}-${e}`,o);if(i){K(o,i)}return o},_toggleHeaderActions:function t(e){this.getAggregation("menuItems")?.forEach(t=>{this._getInsightsContainer()?.toggleMenuListItem(t,e)});this.getAggregation("actionButtons")?.forEach(t=>this._getInsightsContainer()?.toggleActionButton(t,e))}});pt.tilesMenuItems=it;pt.tilesContainerMenuItems=nt;pt.tilesActionButtons=st;pt.tilesContainerActionButtons=ot;pt.DisplayFormat=at;return pt});
|
|
271
|
+
sap.ui.predefine("sap/cux/home/TilesPanel", ["sap/base/Log","sap/f/GridContainer","sap/f/GridContainerItemLayoutData","sap/m/Button","sap/m/CustomListItem","sap/m/Dialog","sap/m/GenericTile","sap/m/HBox","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/IllustratedMessageSize","sap/m/IllustratedMessageType","sap/m/Label","sap/m/List","sap/m/ObjectIdentifier","sap/m/Title","sap/m/VBox","sap/m/library","sap/ui/core/EventBus","sap/ui/core/Icon","sap/ui/core/Lib","sap/ui/model/json/JSONModel","sap/ushell/Config","sap/ushell/Container","sap/ushell/api/S4MyHome","./BasePanel","./MenuItem","./utils/Accessibility","./utils/AppManager","./utils/Constants","./utils/DataFormatUtils","./utils/Device","./utils/DragDropUtils","./utils/FESRUtil","./utils/InsightsUtils"],function(t,e,i,n,s,o,a,r,l,c,d,h,u,g,p,f,m,_,I,v,M,T,A,S,y,D,P,F,C,B,E,$,x,b,w){"use strict";function z(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function H(t,e){try{var i=t()}catch(t){return e(t)}if(i&&i.then){return i.then(void 0,e)}return i}const R=_["ButtonType"];function L(t,e){try{var i=t()}catch(t){return e(true,t)}if(i&&i.then){return i.then(e.bind(null,false),e.bind(null,true))}return e(false,i)}const O=_["LoadState"];const V=z(D);const W=z(P);const k=F["checkPanelExists"];const U=z(C);const N=B["DEFAULT_BG_COLOR"];const j=B["END_USER_COLORS"];const G=B["MYHOME_PAGE_ID"];const Y=B["MYINSIGHT_SECTION_ID"];const J=B["SETTINGS_PANELS_KEYS"];const K=E["recycleId"];const q=$["DeviceType"];const Q=$["fetchElementProperties"];const X=x["focusDraggedItem"];const Z=b["addFESRId"];const tt=b["addFESRSemanticStepName"];const et=b["FESR_EVENTS"];const it=w["createShowMoreActionButton"];const nt=w["createShowMoreMenuItem"];const st=w["getAssociatedFullScreenMenuItem"];const ot=w["sortMenuItems"];var at=function(t){t["REFRESH"]="tiles-refresh";t["ADD_APPS"]="tiles-addSmartApps";t["EDIT_TILES"]="tiles-editTiles";return t}(at||{});var rt=function(t){t["REFRESH"]="container-tiles-refresh";t["ADD_APPS"]="container-tiles-addSmartApps";t["EDIT_TILES"]="container-tiles-editTiles";t["SHOW_MORE"]="tilesContainerFullScreenMenuItem";return t}(rt||{});var lt=function(t){t["ADD_TILES"]="tiles-addTilesButton";return t}(lt||{});var ct=function(t){t["ADD_TILES"]="container-tiles-addTilesButton";t["SHOW_MORE"]="tilesContanerFullScreenActionButton";return t}(ct||{});var dt=function(t){t["Standard"]="standard";t["StandardWide"]="standardWide";return t}(dt||{});const ht="sap.cux.home.FavAppPanel";const ut="sap.cux.home.AppsContainer";const gt=[at.REFRESH,at.ADD_APPS,at.EDIT_TILES,"showMore","settings"];const pt=()=>A.last("/core/shell/enablePersonalization")||A.last("/core/catalog/enabled");const ft=176;const mt=368;const _t=16;const It=V.extend("sap.cux.home.TilesPanel",{metadata:{library:"sap.cux.home",properties:{title:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},key:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"},fullScreenName:{type:"string",group:"Misc",defaultValue:"SI1",visibility:"hidden"}},defaultAggregation:"tiles",aggregations:{tiles:{type:"sap.cux.home.App",multiple:true,singularName:"tile",visibility:"hidden"}},events:{handleHidePanel:{parameters:{}},handleUnhidePanel:{parameters:{}}}},constructor:function t(e,i){V.prototype.constructor.call(this,e,i);this._insightsSectionTitle=this._i18nBundle.getText("insights");this._addFromFavDialogId=`${this.getId()}-addFromFavDialog`;this._headerVisible=false},init:function e(){const i=this;V.prototype.init.call(this);this._controlMap=new Map;this._oData={tiles:[],activateInsightsTiles:true,activateInsightsTilesOnPhone:false,activateInsightsTilesOnDesktop:false};this._controlModel=new T(this._oData);this.appManagerInstance=U.getInstance();this.setProperty("key","tiles");this.setProperty("enableFullScreen",true);const n=this._createRefreshMenuItem(at.REFRESH,"tilesRefresh");const s=this._createEditTilesMenuItem(at.EDIT_TILES,"manageTiles");const o=[n,s];o.forEach(t=>this.addAggregation("menuItems",t));this._sortMenuItems(gt);const a=this._createAddTilesButton(lt.ADD_TILES,"addTiles");const r=[a];r.forEach(t=>this.addAggregation("actionButtons",t));this._createTilesFlexWrapper();S.getServiceAsync("VisualizationInstantiation").then(t=>{this.VizInstantiationService=t}).catch(e=>{t.error(e instanceof Error?e.message:String(e))});this.oEventBus=I.getInstance();this.oEventBus.subscribe("importChannel","tilesImport",function(t,e,n){try{return Promise.resolve(i.appManagerInstance.createInsightSection(i._i18nBundle.getText("insightsTiles"))).then(function(){return Promise.resolve(i._addSectionViz(n,Y)).then(function(){return Promise.resolve(i.refreshData()).then(function(){i._adjustLayout();i._importdone()})})})}catch(t){return Promise.reject(t)}},this);this._toggleTileActivity()},_toggleTileActivity:function e(){const i=this;const n=function(t){try{const e=t.getParameter("isMyHomeRoute");i._controlModel.setProperty("/activateInsightsTiles",e);const n=function(){if(e){const t=function(){if(i._appSwitched){return Promise.resolve(i.refreshData(true)).then(function(){i._appSwitched=false})}}();if(t&&t.then)return t.then(function(){})}else{i._appSwitched=true}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}};try{y.attachRouteMatched({},n,this)}catch(e){t.warning(e instanceof Error?e.message:String(e))}},_addSectionViz:function t(e,i){return e.reduce((t,e)=>t.then(()=>{if(e.isBookmark){return this.appManagerInstance.addBookMark(e)}else{return i?this.appManagerInstance.addVisualization(e.vizId,i):this.appManagerInstance.addVisualization(e.vizId)}}),Promise.resolve())},_importdone:function t(){const e={status:true};this.oEventBus.publish("importChannel","tilesImported",e)},_showPlaceHolders:function t(){const e=new Array(this._calculatePlaceholderTileCount()).fill(O.Loading);this.aInsightsApps=e.map((t,e)=>new a(K(`${this.getId()}--placeHolderTile--${e}`),{sizeBehavior:"Responsive",state:t,frameType:"OneByOne",mode:"IconMode",visible:true,renderOnThemeChange:true,ariaRole:"listitem",dropAreaOffset:8}).setLayoutData?.(new i(K(`${this.getId()}--placeHolderTileLayoutData--${e}`),{columns:2})));this._controlModel.setProperty("/tiles",this.aInsightsApps)},_clearPlaceHolders:function t(){this._controlModel.setProperty("/tiles",[])},renderPanel:function t(){try{let e=false;const i=this;function n(t){return e?t:Promise.resolve()}const s=L(function(){return H(function(){const t=i.getParent();if(k(t,ut,ht)){const t=i._createAddFromFavMenuItem(at.ADD_APPS,"smartAppsDialog");i.addAggregation("menuItems",t);i._sortMenuItems(gt)}return Promise.resolve(i.refreshData()).then(function(t){e=true;return t})},function(t){i.fireHandleHidePanel()})},function(t,e){i.fireEvent("loaded");if(t)throw e;return e});return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(o){return Promise.reject(o)}},_sortMenuItems:function t(e){const i=this.getAggregation("menuItems");let n=ot(e,i);this.removeAllAggregation("menuItems");n?.forEach(t=>this.addAggregation("menuItems",t))},refreshData:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;const i=t.getMetadata().getName();return Promise.resolve(t.appManagerInstance.fetchInsightApps(true,t._insightsSectionTitle)).then(function(n){function s(){t._clearPlaceHolders();t._controlModel.setProperty("/tiles",t.aInsightsApps);if(t.aInsightsApps?.length){t.fireHandleUnhidePanel();if(e){const e=t.getDeviceType()===q.Mobile;const i=e?t.tilesMobileContainer:t.tilesContainer;const n=i.getMetadata().getDefaultAggregationName();const s=i.getAggregation(n)||[];s.forEach(t=>t.refresh?.())}t._getInsightsContainer().updatePanelsItemCount(t.aInsightsApps.length,i);if(t._headerVisible){t.setProperty("title",`${t._i18nBundle?.getText("insights")} ${t._i18nBundle.getText("insightsTilesTitle")} (${t.aInsightsApps.length})`)}}else{t.fireHandleHidePanel()}}t.aInsightsApps=n;const o=t.aInsightsApps.some(t=>t.isSmartBusinessTile);const a=function(){if(o){return Promise.resolve(M.load({name:"sap.cloudfnd.smartbusiness.lib.reusetiles"})).then(function(){})}}();return a&&a.then?a.then(s):s(a)})}catch(t){return Promise.reject(t)}},_createTilesFlexWrapper:function t(){if(!this._tilesWrapper){this._tilesWrapper=new m(`${this.getId()}-tilesWrapper`,{renderType:"Bare",width:"100%",items:[this._createMobileFlexWrapper(),this._createWrapperFlexBox()]});this._showPlaceHolders();this._tilesWrapper.setModel(this._controlModel);this._addContent(this._tilesWrapper)}},_createMobileFlexWrapper:function t(){if(!this.tilesMobileContainer){this.tilesMobileContainer=new l(`${this.getId()}-insightsTilesMobileContainer`,{scrollStep:0,scrollStepByItem:1,gridLayout:true,scrollTime:1e3,showDividers:false,visible:"{/isPhone}"}).addStyleClass("sectionMarginTopTilesInsight sapMHeaderContainerAlign sapMHeaderContainerMarginBottom tilesBoxShadow");this._attachAggregationToContainer(this.tilesMobileContainer)}return this.tilesMobileContainer},_createWrapperFlexBox:function t(){if(!this.tilesContainer){this.tilesContainer=new e(`${this.getId()}-insightsTilesContainer`,{visible:"{= !${/isPhone}}"}).addStyleClass("insightTiles sapUiSmallMarginTop sapUiSmallMarginBottom");this._attachAggregationToContainer(this.tilesContainer)}return this.tilesContainer},_updateTilesActivity:function t(){const e=this.getDeviceType()===q.Mobile;const i=Boolean(this._controlModel.getProperty("/activateInsightsTiles"));this._controlModel.setProperty("/activateInsightsTilesOnPhone",i&&e);this._controlModel.setProperty("/activateInsightsTilesOnDesktop",i&&!e)},_attachAggregationToContainer:function t(e){e.setModel(this._controlModel);const n=e.getMetadata().getDefaultAggregationName();const s=this.getDeviceType()===q.Mobile;e.bindAggregation(n,{path:"/tiles",factory:(t,e)=>{const n=e.getObject();if(n instanceof a){return n}const o=this.VizInstantiationService.instantiateVisualization(n.visualization);o.setLayoutData?.(new i(`${this.getId()}-itemLayoutData-${t}`,{minRows:2,columns:o.getDisplayFormat?.()===dt.Standard?2:4}));o?.bindProperty?.("active",s?"/activateInsightsTilesOnPhone":"/activateInsightsTilesOnDesktop");this._setDropAreaRectFunction(o);return o}});this.addDragDropConfigTo(e,t=>this._handleTilesDnd(t))},_setDropAreaRectFunction:function t(e){const i=8;Object.defineProperty(e,"getDropAreaRect",{value:function(){const t=this.getDomRef();if(!t)return null;const e=t.getBoundingClientRect();return{left:e.left-i,right:e.right+i,top:e.top,bottom:e.bottom,width:e.width,height:e.height}}})},_handleTilesDnd:function t(e){const i=e.getParameter?.("dropPosition"),n=e?.getParameter?.("draggedControl"),s=e.getParameter("droppedControl"),o=n.getParent()?.indexOfItem(n);let a=n.getParent()?.indexOfItem(s);if(i==="Before"&&o===a-1){a--}else if(i==="After"&&o===a+1){a++}if(o!==a){void this._DragnDropTiles(o,a,i)}},_DragnDropTiles:function t(e,i,n){try{const t=this;if(n==="Before"&&e<i){i--}else if(n==="After"&&e>i){i++}const s=t.aInsightsApps[i],o=t.aInsightsApps.splice(e,1)[0];t.aInsightsApps.splice(i,0,o);const a={pageId:G,sourceSectionIndex:o.persConfig?.sectionIndex,sourceVisualizationIndex:o.persConfig?.visualizationIndex,targetSectionIndex:s.persConfig?.sectionIndex,targetVisualizationIndex:s.persConfig?.visualizationIndex};t._controlModel.setProperty("/tiles",t.aInsightsApps);return Promise.resolve(t.appManagerInstance.moveVisualization(a)).then(function(){return Promise.resolve(t.refreshData(true)).then(function(){setTimeout(()=>{X(t.tilesContainer,i)},0)})})}catch(t){return Promise.reject(t)}},handleEditTiles:function t(e){let i=e.getSource().getParent()||this;if(i?.isA("sap.cux.home.TilesPanel")){i=i.getParent()}i?._getLayout().openSettingsDialog(J.INSIGHTS_TILES)},handleHideHeader:function t(){this._headerVisible=false;this.setProperty("title","");this._toggleHeaderActions(false)},handleAddHeader:function t(){this._headerVisible=true;this.setProperty("title",`${this._i18nBundle?.getText("insights")} ${this._i18nBundle.getText("insightsTilesTitle")} (${this.aInsightsApps.length})`);this._toggleHeaderActions(true)},_closeAddFromFavDialog:function t(){const e=this._controlMap.get(`${this._addFromFavDialogId}-list`);e?.removeSelections();this._controlMap.get(this._addFromFavDialogId)?.close()},navigateToAppFinder:function t(e){try{return Promise.resolve(S.getServiceAsync("Navigation")).then(function(t){const i={pageID:G,sectionID:Y};if(e){i.sectionID=e}return Promise.resolve(t.navigate({target:{shellHash:`Shell-appfinder?&/catalog/${JSON.stringify(i)}`}})).then(function(){})})}catch(t){return Promise.reject(t)}},_getLegendColor:function t(e){return j().find(t=>t.value===e)||N()},_handleAddFromFavApps:function t(){try{const t=this;return Promise.resolve(t._getFavToAdd()).then(function(e){const i=t._generateAddFromFavAppsDialog();t._controlMap.get(`${t._addFromFavDialogId}-errorMessage`)?.setVisible(e.length===0);t._generateAddFromFavAppsListItems(e);i.open()})}catch(t){return Promise.reject(t)}},_getFavToAdd:function t(){try{const t=this;return Promise.resolve(t.appManagerInstance.fetchFavVizs(false,true)).then(function(e){const i=e.filter(function(t){return t.isCount||t.isSmartBusinessTile});const n=i.filter(e=>{const i=t.aInsightsApps.findIndex(function(t){return!e.visualization?.isBookmark&&t.visualization?.vizId===e.visualization?.vizId||e.visualization?.isBookmark&&t.visualization?.targetURL===e.visualization?.targetURL});return i===-1});return n})}catch(t){return Promise.reject(t)}},_getSelectedInsights:function t(){const e=this._controlMap.get(`${this._addFromFavDialogId}-list`);return e.getSelectedItems()||[]},_generateAddFromFavAppsListItems:function t(e){const i=this._addFromFavDialogId;const n=this._controlMap.get(`${i}-list`);if(e.length){n.destroyItems();const t=e.map((t,e)=>new s({id:`${i}-listItem-${e}`,content:[new r({id:`${i}-listItem-${e}-content`,alignItems:"Center",items:[new v({id:`${i}-listItem-${e}-content-icon`,src:t.icon,backgroundColor:this._getLegendColor(typeof t.BGColor==="object"?t.BGColor.key:t.BGColor??"").value,color:"white",width:"2.25rem",height:"2.25rem",size:"1.25rem"}).addStyleClass("sapUiRoundedBorder sapUiTinyMargin"),new p({id:`${i}-listItem-${e}-content-identifier`,title:t.title,text:t.subtitle,tooltip:t.title}).addStyleClass("sapUiTinyMargin")]})]}).addStyleClass("sapUiContentPadding").data("app",t));t.forEach(t=>n.addItem(t))}n?.setVisible(e.length!==0)},_generateAddFromFavAppsDialog:function t(){const e=this._addFromFavDialogId;const i=()=>{const t=this._getSelectedInsights();this._controlMap.get(`${e}-addBtn`).setEnabled(t.length>0)};if(!this._controlMap.get(e)){const t=(t,e)=>{const i=new n(t,{icon:"sap-icon://action",text:this._i18nBundle.getText("appFinderBtn"),press:()=>{this._closeAddFromFavDialog();void this.navigateToAppFinder()},visible:pt(),type:e??R.Default});tt(i,et.PRESS,"tilesAppFinder");return i};this._controlMap.set(`${e}-list`,new g({id:`${e}-list`,mode:"MultiSelect",selectionChange:i}));const s=new n({id:`${e}-addBtn`,text:this._i18nBundle.getText("addBtn"),type:"Emphasized",press:()=>{void this._addFromFavApps()},enabled:false});tt(s,et.PRESS,"addSmartApps");this._controlMap.set(`${e}-addBtn`,s);this._controlMap.set(`${e}-errorMessage`,new c({id:`${e}-errorMessage`,illustrationSize:d.Small,illustrationType:h.AddDimensions,title:this._i18nBundle.getText("noAppsTitle"),description:this._i18nBundle.getText("tilesSectionNoDataDescription"),visible:true}).addStyleClass("sapUiLargeMarginTop"));this._controlMap.set(e,new o(e,{title:this._i18nBundle.getText("addSmartApps"),content:[new u({id:`${e}-label`,text:this._i18nBundle.getText("suggTileDialogLabel"),wrapping:true}).addStyleClass("sapMTitleAlign sapUiTinyMarginTopBottom sapUiSmallMarginBeginEnd"),new r({id:`${e}-textContainer`,justifyContent:"SpaceBetween",alignItems:"Center",items:[new f({id:`${e}-text`,text:this._i18nBundle.getText("suggTileDialogTitle")}),t(`${e}-addAppsBtn`,R.Transparent)]}).addStyleClass("sapUiTinyMarginTop dialogHeader sapUiSmallMarginBeginEnd"),this._controlMap.get(`${e}-list`),this._controlMap.get(`${e}-errorMessage`)],contentWidth:"42.75rem",contentHeight:"32.5rem",endButton:new n({id:`${e}-addFromFavDialogCloseBtn`,text:this._i18nBundle.getText("closeBtn"),press:this._closeAddFromFavDialog.bind(this)}),escapeHandler:this._closeAddFromFavDialog.bind(this),buttons:[this._controlMap.get(`${e}-addBtn`),new n({id:`${e}-cancelBtn`,text:this._i18nBundle.getText("cancelBtn"),press:this._closeAddFromFavDialog.bind(this)})]}).addStyleClass("sapContrastPlus sapCuxAddFromInsightsDialog"))}i();return this._controlMap.get(e)},_addFromFavApps:function t(){try{const t=this;const e=t._controlMap.get(t._addFromFavDialogId);e.setBusy(true);const i=t._getSelectedInsights();return Promise.resolve(i.reduce(function(e,i){return Promise.resolve(e).then(function(){const e=i.data("app");const n={pageId:G,sourceSectionIndex:e.persConfig?.sectionIndex,sourceVisualizationIndex:e.persConfig?.visualizationIndex,targetSectionIndex:t.appManagerInstance.insightsSectionIndex,targetVisualizationIndex:-1};if(e.visualization?.displayFormatHint!=="standard"&&e.visualization?.displayFormatHint!=="standardWide"){if(e.visualization?.supportedDisplayFormats?.includes("standard")){e.visualization.displayFormatHint="standard"}else if(e.visualization?.supportedDisplayFormats?.includes("standardWide")){e.visualization.displayFormatHint="standardWide"}}if(!e.visualization?.vizId){e.visualization.vizId=e.visualization?.targetURL??""}const s=function(){if(e.visualization?.isBookmark===true){return Promise.resolve(t.appManagerInstance.addBookMark(e.visualization,n)).then(function(){})}else{return Promise.resolve(t.appManagerInstance.addVisualization(e.visualization?.vizId,Y)).then(function(){})}}();if(s&&s.then)return s.then(function(){})})},Promise.resolve())).then(function(){return Promise.resolve(t.refreshData()).then(function(){e.setBusy(false);e.close()})})}catch(t){return Promise.reject(t)}},_calculateVisibleTileCount:function t(e){const i=this._getInsightsContainer()?._getLayout();const n=i?.getDomRef();const s=e||[];let o=0;if(n&&s.length){const t=i.getProperty("showHeader");const e=t?1:0;const a=n.childNodes[e];const r=Q(a,["width","padding-left","padding-right"]);let l=r.width-r["padding-left"]-r["padding-right"];const c={};c[dt.Standard]=ft+_t;c[dt.StandardWide]=mt+_t;let d=c[s[o].visualization?.displayFormatHint??dt.Standard];do{l-=d;++o;d=c[s[o]?.visualization?.displayFormatHint??dt.Standard]}while(l>d)}return o||1},_calculatePlaceholderTileCount:function t(){const e=this._getInsightsContainer()?._getLayout()?.getDomRef();let i=0;if(e){const t=e.childNodes[0];const n=Q(t,["width","padding-left","padding-right"]);let s=n.width-n["padding-left"]-n["padding-right"];const o=ft+_t;i=Math.floor(s/o)}return i||1},_adjustLayout:function t(){const e=this._getInsightsContainer()?._getLayout();const i=this.getDeviceType()===q.Mobile;if(e){const t=i?this.aInsightsApps?.length:this._calculateVisibleTileCount(this.aInsightsApps);const n=e._getCurrentExpandedElementName()===this.getProperty("fullScreenName");this._controlModel.setProperty("/tiles",n?this.aInsightsApps:this.aInsightsApps?.slice(0,t));this._controlModel.setProperty("/isPhone",i);this._updateTilesActivity();const s=n||this.aInsightsApps.length>t;if(this._headerVisible){if(!i){this.getAggregation("actionButtons")?.forEach(t=>{if(t.getId().includes(lt.ADD_TILES)){this._getInsightsContainer().toggleActionButton(t,true)}})}this._getInsightsContainer()?.toggleFullScreenElements(this,s)}else{const t=st(this);const e=t?.getTitle()??"";this._getInsightsContainer()?.updateMenuItem(this._controlMap.get(`${this.getId()}-${rt.SHOW_MORE}`),s,e);this._getInsightsContainer()?.updateActionButton(this._controlMap.get(`${this.getId()}-${ct.SHOW_MORE}`),s,e)}}},_getInsightsContainer:function t(){if(!this.insightsContainer){this.insightsContainer=this.getParent()}return this.insightsContainer},getContainerMenuItems:function t(){if(!this._containerMenuItems){const t=this._createRefreshMenuItem(rt.REFRESH,"containerTilesRefresh");const e=this._createEditTilesMenuItem(rt.EDIT_TILES,"containerManageTiles");const i=nt(this,rt.SHOW_MORE,"containerTilesShowMore");const n=this.getParent();this._controlMap.set(`${this.getId()}-${rt.SHOW_MORE}`,i);this._containerMenuItems=[t,e,i];if(k(n,ut,ht)){const t=this._createAddFromFavMenuItem(rt.ADD_APPS,"containerSmartAppsDialog");this._containerMenuItems.splice(1,0,t)}}return this._containerMenuItems},getContainerActionButtons:function t(){if(!this._containerActionButtons){this._containerActionButtons=[];this._containerActionButtons.push(this._createAddTilesButton(ct.ADD_TILES,"containerSmartAppsDialog"));const t=it(this,ct.SHOW_MORE,"containerTilesShowMore");if(t){this._controlMap.set(`${this.getId()}-${ct.SHOW_MORE}`,t);this._containerActionButtons.push(t)}}return this._containerActionButtons},_createRefreshMenuItem:function t(e,i){const n=new W(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",visible:false,press:()=>void this.refreshData(true)});this._controlMap.set(`${this.getId()}-${e}`,n);if(i){Z(n,i)}return n},_createAddFromFavMenuItem:function t(e,i){if(!this._controlMap.get(`${this.getId()}-${e}`)){const t=new W(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("addSmartApps"),icon:"sap-icon://duplicate",visible:false,press:()=>void this._handleAddFromFavApps()});this._controlMap.set(`${this.getId()}-${e}`,t);if(i){Z(t,i)}}return this._controlMap.get(`${this.getId()}-${e}`)},_createEditTilesMenuItem:function t(e,i){const n=new W(`${this.getId()}-${e}`,{title:this._i18nBundle.getText("editLinkTiles"),icon:"sap-icon://edit",visible:false,press:t=>this.handleEditTiles(t)});this._controlMap.set(`${this.getId()}-${e}`,n);if(i){Z(n,i)}return n},_createAddTilesButton:function t(e,i){const s=this;const o=new n(`${this.getId()}-${e}`,{text:this._i18nBundle.getText("appFinderLink"),press:function(){try{const t=s.getParent();const e=function(){if(k(t,ut,ht)){void s._handleAddFromFavApps()}else{return Promise.resolve(s.navigateToAppFinder()).then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(t){return Promise.reject(t)}}});this._controlMap.set(`${this.getId()}-${e}`,o);if(i){Z(o,i)}return o},_toggleHeaderActions:function t(e){this.getAggregation("menuItems")?.forEach(t=>{this._getInsightsContainer()?.toggleMenuListItem(t,e)});this.getAggregation("actionButtons")?.forEach(t=>this._getInsightsContainer()?.toggleActionButton(t,e))}});It.tilesMenuItems=at;It.tilesContainerMenuItems=rt;It.tilesActionButtons=lt;It.tilesContainerActionButtons=ct;It.DisplayFormat=dt;return It});
|
|
242
272
|
/*!
|
|
243
273
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
244
274
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
245
275
|
*/
|
|
246
|
-
sap.ui.predefine("sap/cux/home/ToDoPanel", ["sap/base/Log","sap/f/Card","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/GenericTile","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/Text","sap/m/TileContent","sap/m/VBox","sap/m/library","sap/ui/Device","sap/ui/core/Element","sap/ui/core/format/DateFormat","sap/ui/model/json/JSONModel","./BasePanel","./MenuItem","./ToDosContainer","./utils/BatchHelper","./utils/Device","./utils/FESRUtil"],function(t,e,n,r,i,o,s,a,l,u,c,h,d,f,_,p,g,y,D,m,C,T){"use strict";function P(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function E(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const I=h["Priority"];function v(t,e){try{var n=t()}catch(t){return e(true,t)}if(n&&n.then){return n.then(e.bind(null,false),e.bind(null,true))}return e(false,n)}const b=h["URLHelper"];const R=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function L(t,e,n){if(!t.s){if(n instanceof M){if(n.s){if(e&1){e=n.s}n=n.v}else{n.o=L.bind(null,t,e);return}}if(n&&n.then){n.then(L.bind(null,t,e),L.bind(null,t,2));return}t.s=e;t.v=n;const r=t.o;if(r){r(t)}}}const M=function(){function t(){}t.prototype.then=function(e,n){const r=new t;const i=this.s;if(i){const t=i&1?e:n;if(t){try{L(r,1,t(this.v))}catch(t){L(r,2,t)}return r}else{return this}}this.o=function(t){try{const i=t.v;if(t.s&1){L(r,1,e?e(i):i)}else if(n){L(r,1,n(i))}else{L(r,2,i)}}catch(t){L(r,2,t)}};return r};return t}();function S(t){return t instanceof M&&t.s&1}function w(t,e,n){var r=-1,i,o;function s(a){try{while(++r<t.length&&(!n||!n())){a=e(r);if(a&&a.then){if(S(a)){a=a.v}else{a.then(s,o||(o=L.bind(null,i=new M,2)));return}}}if(i){L(i,1,a)}else{i=a}}catch(t){L(i||(i=new M),2,t)}}s();return i}const x=P(g);function O(t,e,n){if(typeof t[R]==="function"){var r=t[R](),i,o,s;function c(t){try{while(!(i=r.next()).done&&(!n||!n())){t=e(i.value);if(t&&t.then){if(S(t)){t=t.v}else{t.then(c,s||(s=L.bind(null,o=new M,2)));return}}}if(o){L(o,1,t)}else{o=t}}catch(t){L(o||(o=new M),2,t)}}c();if(r.return){var a=function(t){try{if(!i.done){r.return()}}catch(t){}return t};if(o&&o.then){return o.then(a,function(t){throw a(t)})}a()}return o}if(!("length"in t)){throw new TypeError("Object is not iterable")}var l=[];for(var u=0;u<t.length;u++){l.push(t[u])}return w(l,function(t){return e(l[t])},n)}const H=P(y);const A=P(D);const B=P(m);const U=C["DeviceType"];const $=C["fetchElementProperties"];const N=T["addFESRId"];const V={SITUATION_ICON:"sap-icon://message-warning",PLACEHOLDER_ITEMS_COUNT:5,TODO_CARDS_LIMIT:100,TODO_SECTION_LIMIT:6,TODOS_REFRESH_INTERVAL:65e3,MOBILE_DEVICE_MAX_WIDTH:600,DEFAULT_TITLE_HEIGHT:33,DEFAULT_CARD_HEIGHT:168,DEFAULT_TAB_HEADER_HEIGHT:44};const F=x.extend("sap.cux.home.ToDoPanel",{metadata:{library:"sap.cux.home",properties:{baseUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},countUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},dataUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},targetAppUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},minCardWidth:{type:"int",group:"Misc",defaultValue:320,visibility:"hidden"},maxCardWidth:{type:"int",group:"Misc",defaultValue:400,visibility:"hidden"}}},constructor:function t(e,n){x.prototype.constructor.call(this,e,n);this.batchHelper=new B},init:function t(){const e=this;x.prototype.init.call(this);this._oData={length:0,isLoaded:false,hasError:false,cardWidth:"20rem",getSupported:false,isExpandedOnce:false,isCountCalledOnce:false,illustrationType:"sapIllus-NoTasks",refreshInfo:this._toRelativeDateTime(new Date),horizontalCardCount:V.PLACEHOLDER_ITEMS_COUNT,illustrationTitle:this._i18nBundle.getText("noToDoTitle"),illustrationDescription:this._i18nBundle.getText("noToDoDesc"),isPhone:d.resize.width<V.MOBILE_DEVICE_MAX_WIDTH||d.system.phone,tiles:new Array(V.PLACEHOLDER_ITEMS_COUNT).fill({loadState:"Loading"}),displayTiles:new Array(V.PLACEHOLDER_ITEMS_COUNT).fill({loadState:"Loading"})};this._controlModel=new p(this._oData);this.requests=[];this._toDoWrapper=new c(`${this.getId()}-toDosWrapper`,{renderType:"Bare",items:[this._generateCardContainer(),this._generateMobileCardContainer(),this._generateErrorMessage()]});this._toDoWrapper.setModel(this._controlModel);this._addContent(this._toDoWrapper);const n=new H(`${this.getId()}-refresh`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",press:()=>this._onPressRefresh()});this.addAggregation("menuItems",n);N(n,"todosRefresh");this._refreshBtn=new i(`${this.getId()}-refreshBtn`,{icon:"sap-icon://refresh",text:this._toRelativeDateTime(new Date),press:()=>this._onPressRefresh()});N(this._refreshBtn,"manualTodoRefresh");this.addAggregation("actionButtons",this._refreshBtn);this.setProperty("enableFullScreen",true);this.attachEvent("onExpand",function(){try{return Promise.resolve(e._beforePanelExpand()).then(function(){})}catch(t){return Promise.reject(t)}})},_generateCardContainer:function t(){if(!this._cardContainer){this._cardContainer=new n(`${this.getId()}-flexContainer`,{inlineBlockLayout:true,snapToRow:true,visible:"{= !${/isPhone} && !${/hasError} && (!${/isLoaded} || ${/length} > 0) }",layout:new r(`${this.getId()}-layout`,{columns:"{/horizontalCardCount}",columnSize:"{/cardWidth}",gap:"1rem"})}).addStyleClass("sapCuxToDoCardsContainer")}return this._cardContainer},_generateMobileCardContainer:function t(){if(!this._mobileCardContainer){this._mobileCardContainer=new s(`${this.getId()}-headerContainer`,{visible:"{/isPhone}",scrollStep:0,gridLayout:true,scrollTime:1e3,showDividers:false});this._mobileCardContainer.addStyleClass("sapMHeaderContainerAlign sapMHeaderContainerToDoAlign toDoCardHeight")}return this._mobileCardContainer},_generateErrorMessage:function t(){if(!this._errorCard){this._errorMessage=new a(`${this.getId()}-errorMessage`,{illustrationSize:"Base",title:"{/illustrationTitle}",description:"{/illustrationDescription}",illustrationType:"{/illustrationType}"});this._errorCard=new e(`${this.getId()}-errorCard`,{content:this._errorMessage,visible:"{= ${/tiles/length} === 0 || ${/hasError} === true }"})}return this._errorCard},_onPressRefresh:function t(){void this.getParent()?._getSelectedPanel()?._loadCards(true)},_loadCards:function e(n){try{const e=this;if(e._loadToDos!==undefined&&!n){return Promise.resolve(e._loadToDos)}else{e._bindInnerControls();e._loadToDos=new Promise(n=>{const r=e.getParent()?._getSelectedPanel()?.getProperty("key");const i=[];e._oData.isLoaded=false;e._oData.isCountCalledOnce=false;e._oData.isExpandedOnce=e._isElementExpanded();e._setCount();if(e._getSupported()){setTimeout(()=>{e._generatePlaceHolderTiles();i.push(e._generateRequestObject({type:r,onlyCount:r!==e.getProperty("key")}));e.requests=e.requests.concat(i);e._submitBatch().then(function(){try{e._oData.isLoaded=r===e.getProperty("key");e.fireEvent("loaded");e._oData.isCountCalledOnce=true;e._setCount(e._oData.length);e._setSectionRefreshInterval();e._oData.refreshInfo=e._toRelativeDateTime(new Date);e._oData.lastRefreshedTime=new Date;e._updateRefreshInformation();return Promise.resolve(e._switchTabIfRequired()).then(function(){e._updateHeaderIfExclusive()})}catch(t){return Promise.reject(t)}}).catch(e=>{t.error(e instanceof Error?e.message:"")}).finally(()=>{e._controlModel.refresh();e._adjustLayout();n()})})}else{e._handleError(`User not authorized to access: + ${e.getTargetAppUrl()}`);e.getParent()?.removeContent(e);n()}})}return Promise.resolve(e._loadToDos)}catch(t){return Promise.reject(t)}},_updateHeaderIfExclusive:function t(){if(this._isExclusivePanel()){this.getParent()._setTitle(`${this._i18nBundle.getText("toDosTitle")} (${String(this._oData.length)})`)}},_bindInnerControls:function t(){if(!this._innerControlsBound){this._cardContainer.bindAggregation("items",{path:"/displayTiles",length:V.TODO_CARDS_LIMIT,factory:(t,e)=>this.generateCardTemplate(t,e)?.bindProperty?.("width",{path:"/cardWidth"})});this._mobileCardContainer.bindAggregation("content",{path:"/displayTiles",length:V.TODO_CARDS_LIMIT,factory:this.generateCardTemplate.bind(this)});this._innerControlsBound=true}},generateCardTemplate:function t(e,n){return new o(`${e}-tile`,{mode:"ActionMode",frameType:"TwoByOne",pressEnabled:true,header:n.getProperty("title"),width:n.getProperty("/cardWidth"),state:n.getProperty("loadState"),tileContent:[new u(`${e}-tileContent`,{priority:n.getProperty("priority"),priorityText:this._toPriorityText(n.getProperty("priority")),footer:n.getProperty("footerText"),content:new l(`${e}-situationContent`,{text:n.getProperty("message")})})]})},_toPriorityText:function t(e){let n;if(e===I.VeryHigh){n="veryHighPriority"}else if(e===I.High){n="highPriority"}else if(e===I.Medium){n="mediumPriority"}else if(e===I.Low){n="lowPriority"}else{n="nonePriority"}return this._i18nBundle.getText(n)},_generatePlaceHolderTiles:function t(){this._cardCount=this._getVisibleCardCount({isPlaceholder:true});this._oData.displayTiles=this._oData.tiles=new Array(this._cardCount).fill({loadState:"Loading"});this._oData.isLoaded=this._oData.hasError=false;this._controlModel.refresh()},_getVisibleCardCount:function t(e){const n=this.getParent()?._getLayout();let r=false;let i=this._toDoWrapper?.getDomRef();if(n){r=this._isElementExpanded();const t=n.getProperty("showHeader");const e=(r?n._getFullScreenContainer():n).getDomRef();const o=t&&!r?1:0;i=e?.childNodes[o]}const o=this._controlModel.getProperty("/isPhone");let s=o?V.TODO_SECTION_LIMIT:1;if(i&&!o){s=this.getHorizontalCardCount(i,e);if(r){s*=this.getVerticalCardCount(i,e)}s=s>V.TODO_CARDS_LIMIT?V.TODO_CARDS_LIMIT:s}return s},_isElementExpanded:function t(){const e=this.getParent();const n=e._getLayout();return n?._getCurrentExpandedElementName()===e.getProperty("fullScreenName")},calculateCardWidth:function t(e){const n=this.getProperty("minCardWidth");const r=this.getProperty("maxCardWidth");const i=14.5;let o=1;let s=n;while(e/o>=n+i){s=e/o;o+=1}return Math.min(s-i,r)},getHorizontalCardCount:function t(e){const n=$(e,["width","padding-left","padding-right","margin-left","margin-right"]);const r=Object.values(n).slice(1).reduce((t,e)=>t-e,n["width"]);const i=this.calculateCardWidth(r);let o=Math.max(Math.floor(r/i),1);this._controlModel.setProperty("/cardWidth",`${i/16}rem`);this._controlModel.setProperty("/horizontalCardCount",o);return o},getVerticalCardCount:function t(e){const n=$(e,["padding-top"]);const r=$(e.parentElement,["height"]);const i=this.calculateTitleHeight();const o=r.height-n["padding-top"]*2-i;const s=14;const a=V.DEFAULT_CARD_HEIGHT+s;const l=Math.max(Math.floor(o/a),2);return l},calculateTitleHeight:function t(){const e=this.getParent();const n=f.getElementById(`${e.getId()}-header`)?.getDomRef();const r=f.getElementById(`${e._getInnerControl().getId()}--header`)?.getDomRef();const i=V.DEFAULT_TITLE_HEIGHT+V.DEFAULT_TAB_HEADER_HEIGHT;let o=0;if(n&&r){o=n.clientHeight+r.clientHeight}return Math.max(o,i)},_generateRequestObject:function t(e){const n=this;const r=this._getVisibleCardCount();const i=this.generateRequestUrls?.(r);if(e?.onlyCount){i.splice(1)}return{baseURL:this.getBaseUrl(),requestURLs:i,success:function(t){try{return Promise.resolve(n.onDataReceived(t.splice(1),e)).then(function(){n._oData.length=Number(t[0]);n._handleEmptyCards()})}catch(t){return Promise.reject(t)}}}},generateRequestUrls:function t(e){const n=`$skip=0&$top=${e}`;let r=this.getDataUrl();r=r.includes("?")?`${r}&${n}`:`${r}?${n}`;return[this.getCountUrl(),r]},onDataReceived:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];let n=arguments.length>1?arguments[1]:undefined;try{const t=this;if(!n||n&&!n.onlyCount){t._oData.displayTiles=t._oData.tiles=e[0]||[]}return Promise.resolve(Promise.resolve()).then(function(){})}catch(t){return Promise.reject(t)}},_handleEmptyCards:function t(){if(Number(this._oData.length)===0){this._oData.illustrationType="sapIllus-EmptyPlanningCalendar";this._oData.illustrationTitle=this._isExclusivePanel()?this._i18nBundle.getText("noToDoTitle"):this._i18nBundle.getText(this.getNoDataText());this._oData.illustrationDescription=this._isExclusivePanel()?this._i18nBundle.getText("noToDoDesc"):this._i18nBundle.getText("emptyToDoDesc")}},_isExclusivePanel:function t(){const e=this.getParent().getContent();const n=e.filter(t=>t._getSupported());return n.length===1||e.length===1&&this._getSupported()},_setSectionRefreshInterval:function t(){clearInterval(this._oData.refreshFn);this._oData.refreshFn=setInterval(()=>{this._oData.lastRefreshedTime=this._oData.lastRefreshedTime||new Date;this._oData.refreshInfo=this._toRelativeDateTime(this._oData.lastRefreshedTime);this._updateRefreshInformation()},V.TODOS_REFRESH_INTERVAL)},_updateRefreshInformation:function t(){const e=this.getParent();if(e.getProperty("selectedKey")===this.getProperty("key")){this._refreshBtn.setProperty("text",this._oData.refreshInfo,true);e._updateContainerHeader(this)}this._adjustLayout()},_adjustLayout:function t(){const e=this._getVisibleCardCount();if(this._oData.tiles.length&&!this._oData.hasError){const t=this._oData.tiles.slice(0,e);this._controlModel.setProperty("/displayTiles",t)}this._controlModel.setProperty("/isPhone",this.getDeviceType()===U.Mobile);this.getParent()?.toggleFullScreenElements(this,this._isElementExpanded()||Number(this._oData.length)>e)},_toRelativeDateTime:function t(e){const n=new Date(e);return isNaN(Number(n))?"":F.relativeDateFormatter.format(n)},getNoDataText:function t(){return this._i18nBundle.getText("noData")},_parseResponse:function t(e){const{d:n={},value:r}=e||{};const i=n?.results;const o=!isNaN(+n)&&+n;const s=!isNaN(+e)&&+e;return i||o||s||r||0},_submitBatch:function t(){const e=this;return Promise.all(this.requests.map(function(t){try{return Promise.resolve(v(function(){return E(function(){return Promise.resolve(e.batchHelper.createMultipartRequest(t.baseURL,t.requestURLs)).then(function(n){if(n.length){const r=n.map(t=>{if(typeof t==="string"){t=JSON.parse(t)}return e._parseResponse(t)});const i=function(){if(t.success&&typeof t.success==="function"){return Promise.resolve(t.success(r)).then(function(){})}}();return i&&i.then?i.then(function(){return r}):r}else{throw new Error("Invalid response")}})},function(t){e._handleError(t)})},function(t,n){e._clearRequests();if(t)throw n;return n}))}catch(t){return Promise.reject(t)}}))},_handleError:function e(n){this._oData.displayTiles=this._oData.tiles=[];this._oData.getSupported=this._oData.isLoaded=this._oData.hasError=true;this._oData.illustrationType="sapIllus-UnableToLoad";this._oData.illustrationTitle=this._oData.illustrationDescription="";t.error(n);this._controlModel.refresh()},_clearRequests:function t(){this.requests=[]},_isLoaded:function t(){const e=this.getParent();const n=e?._getLayout()?.getProperty("expanded");const{isLoaded:r,isExpandedOnce:i}=this._oData;if(!n){return r}return i&&r},_setLoaded:function t(e){this._oData.isLoaded=e},_getSupported:function t(){return this._oData.getSupported},_setSupported:function t(e){this._oData.getSupported=e},_getAppIntent:function t(){const e=/#([^?-]+)-([^?#]+)(?:\?([^#]+))?(?:#.*)?/;const n=this.getTargetAppUrl().match(e);if(n){const t={semanticObject:n[1],action:n[2]};const e={};if(n[3]){const t=n[3].split("&");for(const n of t){const[t,r]=n.split("=");e[t]=r}}return{target:t,params:e}}else{return null}},_switchTabIfRequired:function t(){try{const t=this;const e=t.getParent();const n=e?.getProperty("selectedKey");return Promise.resolve(function(){if(n===t.getProperty("key")&&(t._oData.length===0||t._oData.hasError)){let r=false;function i(){const n=function(){if(o){e?.setProperty("selectedKey",o.getProperty("key"));A.cardCount=t._cardCount;return Promise.resolve(o._loadCards(true)).then(function(){A.cardCount=undefined})}}();if(n&&n.then)return n.then(function(){})}let o;const s=e?.getAggregation("content");const a=O(s,function(e){const n=function(){if(e!==t){return Promise.resolve(e._loadCards()).then(function(){if(e._getSupported()&&!e._isLoaded()&&e._getCardCount()>0){o=e;r=true}})}}();if(n&&n.then)return n.then(function(){})},function(){return r});return a&&a.then?a.then(i):i(a)}}())}catch(t){return Promise.reject(t)}},_onPressViewAll:function t(){b.redirect(this.getTargetAppUrl(),false)},_getCardCount:function t(){return Number(this._oData.length)},_beforePanelExpand:function t(){try{const t=this;const e=function(){if(!t._oData.isExpandedOnce){t._oData.isExpandedOnce=true;return Promise.resolve(t._loadCards(true)).then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(t){return Promise.reject(t)}}});F.relativeDateFormatter=_.getDateTimeInstance({style:"medium",relative:true,relativeStyle:"short"});return F});
|
|
276
|
+
sap.ui.predefine("sap/cux/home/ToDoPanel", ["sap/base/Log","sap/f/Card","sap/f/GridContainer","sap/f/GridContainerSettings","sap/m/Button","sap/m/GenericTile","sap/m/HeaderContainer","sap/m/IllustratedMessage","sap/m/Text","sap/m/TileContent","sap/m/VBox","sap/m/library","sap/ui/Device","sap/ui/core/Element","sap/ui/core/format/DateFormat","sap/ui/model/json/JSONModel","./BasePanel","./MenuItem","./ToDosContainer","./utils/BatchHelper","./utils/Device","./utils/FESRUtil"],function(t,e,n,r,i,o,s,a,l,u,c,h,d,f,_,p,g,y,T,D,C,m){"use strict";function P(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}function E(t,e){try{var n=t()}catch(t){return e(t)}if(n&&n.then){return n.then(void 0,e)}return n}const I=h["Priority"];function v(t,e){try{var n=t()}catch(t){return e(true,t)}if(n&&n.then){return n.then(e.bind(null,false),e.bind(null,true))}return e(false,n)}const b=h["URLHelper"];const R=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function L(t,e,n){if(!t.s){if(n instanceof S){if(n.s){if(e&1){e=n.s}n=n.v}else{n.o=L.bind(null,t,e);return}}if(n&&n.then){n.then(L.bind(null,t,e),L.bind(null,t,2));return}t.s=e;t.v=n;const r=t.o;if(r){r(t)}}}const S=function(){function t(){}t.prototype.then=function(e,n){const r=new t;const i=this.s;if(i){const t=i&1?e:n;if(t){try{L(r,1,t(this.v))}catch(t){L(r,2,t)}return r}else{return this}}this.o=function(t){try{const i=t.v;if(t.s&1){L(r,1,e?e(i):i)}else if(n){L(r,1,n(i))}else{L(r,2,i)}}catch(t){L(r,2,t)}};return r};return t}();function M(t){return t instanceof S&&t.s&1}function w(t,e,n){var r=-1,i,o;function s(a){try{while(++r<t.length&&(!n||!n())){a=e(r);if(a&&a.then){if(M(a)){a=a.v}else{a.then(s,o||(o=L.bind(null,i=new S,2)));return}}}if(i){L(i,1,a)}else{i=a}}catch(t){L(i||(i=new S),2,t)}}s();return i}const x=P(g);function O(t,e,n){if(typeof t[R]==="function"){var r=t[R](),i,o,s;function c(t){try{while(!(i=r.next()).done&&(!n||!n())){t=e(i.value);if(t&&t.then){if(M(t)){t=t.v}else{t.then(c,s||(s=L.bind(null,o=new S,2)));return}}}if(o){L(o,1,t)}else{o=t}}catch(t){L(o||(o=new S),2,t)}}c();if(r.return){var a=function(t){try{if(!i.done){r.return()}}catch(t){}return t};if(o&&o.then){return o.then(a,function(t){throw a(t)})}a()}return o}if(!("length"in t)){throw new TypeError("Object is not iterable")}var l=[];for(var u=0;u<t.length;u++){l.push(t[u])}return w(l,function(t){return e(l[t])},n)}const H=P(y);const A=P(T);const B=P(D);const U=C["calculateCardWidth"];const N=C["DeviceType"];const $=C["fetchElementProperties"];const W=m["addFESRId"];const V={SITUATION_ICON:"sap-icon://message-warning",PLACEHOLDER_ITEMS_COUNT:5,TODO_CARDS_LIMIT:100,TODO_SECTION_LIMIT:6,TODOS_REFRESH_INTERVAL:65e3,MOBILE_DEVICE_MAX_WIDTH:600,DEFAULT_TITLE_HEIGHT:33,DEFAULT_CARD_HEIGHT:168,DEFAULT_TAB_HEADER_HEIGHT:44};const F=x.extend("sap.cux.home.ToDoPanel",{metadata:{library:"sap.cux.home",properties:{baseUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},countUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},dataUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},targetAppUrl:{type:"string",group:"Misc",defaultValue:"",visibility:"public"},minCardWidth:{type:"int",group:"Misc",defaultValue:304,visibility:"hidden"},maxCardWidth:{type:"int",group:"Misc",defaultValue:583,visibility:"hidden"}}},constructor:function t(e,n){x.prototype.constructor.call(this,e,n);this.batchHelper=new B},init:function t(){const e=this;x.prototype.init.call(this);this._oData={length:0,isLoaded:false,hasError:false,cardWidth:"20rem",getSupported:false,isExpandedOnce:false,isCountCalledOnce:false,illustrationType:"sapIllus-NoTasks",refreshInfo:this._toRelativeDateTime(new Date),horizontalCardCount:V.PLACEHOLDER_ITEMS_COUNT,illustrationTitle:this._i18nBundle.getText("noToDoTitle"),illustrationDescription:this._i18nBundle.getText("noToDoDesc"),isPhone:d.resize.width<V.MOBILE_DEVICE_MAX_WIDTH||d.system.phone,tiles:new Array(V.PLACEHOLDER_ITEMS_COUNT).fill({loadState:"Loading"}),displayTiles:new Array(V.PLACEHOLDER_ITEMS_COUNT).fill({loadState:"Loading"})};this._controlModel=new p(this._oData);this.requests=[];this._toDoWrapper=new c(`${this.getId()}-toDosWrapper`,{renderType:"Bare",items:[this._generateCardContainer(),this._generateMobileCardContainer(),this._generateErrorMessage()]});this._toDoWrapper.setModel(this._controlModel);this._addContent(this._toDoWrapper);const n=new H(`${this.getId()}-refresh`,{title:this._i18nBundle.getText("refresh"),icon:"sap-icon://refresh",press:()=>this._onPressRefresh()});this.addAggregation("menuItems",n);W(n,"todosRefresh");this._refreshBtn=new i(`${this.getId()}-refreshBtn`,{icon:"sap-icon://refresh",text:this._toRelativeDateTime(new Date),press:()=>this._onPressRefresh()});W(this._refreshBtn,"manualTodoRefresh");this.addAggregation("actionButtons",this._refreshBtn);this.setProperty("enableFullScreen",true);this.attachEvent("onExpand",function(){try{return Promise.resolve(e._beforePanelExpand()).then(function(){})}catch(t){return Promise.reject(t)}})},_generateCardContainer:function t(){if(!this._cardContainer){this._cardContainer=new n(`${this.getId()}-flexContainer`,{inlineBlockLayout:true,snapToRow:true,visible:"{= !${/isPhone} && !${/hasError} && (!${/isLoaded} || ${/length} > 0) }",layout:new r(`${this.getId()}-layout`,{columns:"{/horizontalCardCount}",columnSize:"{/cardWidth}",gap:"1rem"})}).addStyleClass("sapCuxToDoCardsContainer")}return this._cardContainer},_generateMobileCardContainer:function t(){if(!this._mobileCardContainer){this._mobileCardContainer=new s(`${this.getId()}-headerContainer`,{visible:"{/isPhone}",scrollStep:0,gridLayout:true,scrollTime:1e3,showDividers:false,snapToRow:true});this._mobileCardContainer.addStyleClass("sapMHeaderContainerAlign sapMHeaderContainerToDoAlign toDoCardHeight")}return this._mobileCardContainer},_generateErrorMessage:function t(){if(!this._errorCard){this._errorMessage=new a(`${this.getId()}-errorMessage`,{illustrationSize:"Base",title:"{/illustrationTitle}",description:"{/illustrationDescription}",illustrationType:"{/illustrationType}"});this._errorCard=new e(`${this.getId()}-errorCard`,{content:this._errorMessage,visible:"{= ${/tiles/length} === 0 || ${/hasError} === true }"})}return this._errorCard},_onPressRefresh:function t(){void this.getParent()?._getSelectedPanel()?._loadCards(true)},_loadCards:function e(n){try{const e=this;if(e._loadToDos!==undefined&&!n){return Promise.resolve(e._loadToDos)}else{e._bindInnerControls();e._loadToDos=new Promise(n=>{const r=e.getParent()?._getSelectedPanel()?.getProperty("key");const i=[];e._oData.isLoaded=false;e._oData.isCountCalledOnce=false;e._oData.isExpandedOnce=e._isElementExpanded();e._setCount();if(e._getSupported()){setTimeout(()=>{e._generatePlaceHolderTiles();i.push(e._generateRequestObject({type:r,onlyCount:r!==e.getProperty("key")}));e.requests=e.requests.concat(i);e._submitBatch().then(function(){try{e._oData.isLoaded=r===e.getProperty("key");e.fireEvent("loaded");e._oData.isCountCalledOnce=true;e._setCount(e._oData.length);e._setSectionRefreshInterval();e._oData.refreshInfo=e._toRelativeDateTime(new Date);e._oData.lastRefreshedTime=new Date;e._updateRefreshInformation();return Promise.resolve(e._switchTabIfRequired()).then(function(){e._updateHeaderIfExclusive()})}catch(t){return Promise.reject(t)}}).catch(e=>{t.error(e instanceof Error?e.message:"")}).finally(()=>{e._controlModel.refresh();e._adjustLayout();const t=e._getContent()?.[0];if(t&&!t.hasStyleClass("sapUiGridTaskLayout")){t.addStyleClass("sapUiGridTaskLayout")}n()})})}else{e._handleError(`User not authorized to access: + ${e.getTargetAppUrl()}`);e.getParent()?.removeContent(e);n()}})}return Promise.resolve(e._loadToDos)}catch(t){return Promise.reject(t)}},_updateHeaderIfExclusive:function t(){if(this._isExclusivePanel()){this.getParent()._setTitle(`${this._i18nBundle.getText("toDosTitle")} (${String(this._oData.length)})`)}},_bindInnerControls:function t(){if(!this._innerControlsBound){this._cardContainer.bindAggregation("items",{path:"/displayTiles",length:V.TODO_CARDS_LIMIT,factory:(t,e)=>this.generateCardTemplate(t,e)?.bindProperty?.("width",{path:"/cardWidth"})});this._mobileCardContainer.bindAggregation("content",{path:"/displayTiles",length:V.TODO_CARDS_LIMIT,factory:(t,e)=>this.generateCardTemplate(t,e)?.bindProperty?.("width",{path:"/cardWidth"})});this._innerControlsBound=true}},generateCardTemplate:function t(e,n){return new o(`${e}-tile`,{mode:"ActionMode",frameType:"TwoByOne",pressEnabled:true,header:n.getProperty("title"),width:n.getProperty("/cardWidth"),state:n.getProperty("loadState"),tileContent:[new u(`${e}-tileContent`,{priority:n.getProperty("priority"),priorityText:this._toPriorityText(n.getProperty("priority")),footer:n.getProperty("footerText"),content:new l(`${e}-situationContent`,{text:n.getProperty("message")})})]})},_toPriorityText:function t(e){let n;if(e===I.VeryHigh){n="veryHighPriority"}else if(e===I.High){n="highPriority"}else if(e===I.Medium){n="mediumPriority"}else if(e===I.Low){n="lowPriority"}else{n="nonePriority"}return this._i18nBundle.getText(n)},_generatePlaceHolderTiles:function t(){this._cardCount=this._getVisibleCardCount({isPlaceholder:true});this._oData.displayTiles=this._oData.tiles=new Array(this._cardCount).fill({loadState:"Loading"});this._oData.isLoaded=this._oData.hasError=false;this._controlModel.refresh()},_getVisibleCardCount:function t(e){const n=this.getParent()?._getLayout();let r=false;let i=this._toDoWrapper?.getDomRef();if(n){r=this._isElementExpanded();const t=n.getProperty("showHeader");const e=(r?n._getFullScreenContainer():n).getDomRef();const o=t&&!r?1:0;i=e?.childNodes[o]}const o=this._controlModel.getProperty("/isPhone");let s=o?V.TODO_SECTION_LIMIT:1;if(i){s=this.getHorizontalCardCount(i,e);if(r){s*=this.getVerticalCardCount(i,e)}s=s>V.TODO_CARDS_LIMIT?V.TODO_CARDS_LIMIT:s}return s},_isElementExpanded:function t(){const e=this.getParent();const n=e._getLayout();return n?._getCurrentExpandedElementName()===e.getProperty("fullScreenName")},getHorizontalCardCount:function t(e){const n=$(e,["width","padding-left","padding-right","margin-left","margin-right"]);const r=Object.values(n).slice(1).reduce((t,e)=>t-e,n["width"]);const i=this._oData.length;const o=this._controlModel.getProperty("/isPhone");let s;const a=this.getProperty("minCardWidth");const l=this.getProperty("maxCardWidth");const u={containerWidth:r,totalCards:i,minWidth:a,maxWidth:l};const c=U(u);if(o){s=V.TODO_SECTION_LIMIT}else{s=Math.max(Math.floor(r/c),1)}this._controlModel.setProperty("/cardWidth",`${c/16}rem`);this._controlModel.setProperty("/horizontalCardCount",s);return s},getVerticalCardCount:function t(e){const n=$(e,["padding-top"]);const r=$(e.parentElement,["height"]);const i=this.calculateTitleHeight();const o=r.height-n["padding-top"]*2-i;const s=14;const a=V.DEFAULT_CARD_HEIGHT+s;const l=Math.max(Math.floor(o/a),2);return l},calculateTitleHeight:function t(){const e=this.getParent();const n=f.getElementById(`${e.getId()}-header`)?.getDomRef();const r=f.getElementById(`${e._getInnerControl().getId()}--header`)?.getDomRef();const i=V.DEFAULT_TITLE_HEIGHT+V.DEFAULT_TAB_HEADER_HEIGHT;let o=0;if(n&&r){o=n.clientHeight+r.clientHeight}return Math.max(o,i)},_generateRequestObject:function t(e){const n=this;const r=this._getVisibleCardCount();const i=this.generateRequestUrls?.(r);if(e?.onlyCount){i.splice(1)}return{baseURL:this.getBaseUrl(),requestURLs:i,success:function(t){try{return Promise.resolve(n.onDataReceived(t.splice(1),e)).then(function(){n._oData.length=Number(t[0]);n._handleEmptyCards()})}catch(t){return Promise.reject(t)}}}},generateRequestUrls:function t(e){const n=`$skip=0&$top=${e}`;let r=this.getDataUrl();r=r.includes("?")?`${r}&${n}`:`${r}?${n}`;return[this.getCountUrl(),r]},onDataReceived:function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];let n=arguments.length>1?arguments[1]:undefined;try{const t=this;if(!n||n&&!n.onlyCount){t._oData.displayTiles=t._oData.tiles=e[0]||[]}return Promise.resolve(Promise.resolve()).then(function(){})}catch(t){return Promise.reject(t)}},_handleEmptyCards:function t(){if(Number(this._oData.length)===0){this._oData.illustrationType="sapIllus-EmptyPlanningCalendar";this._oData.illustrationTitle=this._isExclusivePanel()?this._i18nBundle.getText("noToDoTitle"):this._i18nBundle.getText(this.getNoDataText());this._oData.illustrationDescription=this._isExclusivePanel()?this._i18nBundle.getText("noToDoDesc"):this._i18nBundle.getText("emptyToDoDesc")}},_isExclusivePanel:function t(){const e=this.getParent().getContent();const n=e.filter(t=>t._getSupported());return n.length===1||e.length===1&&this._getSupported()},_setSectionRefreshInterval:function t(){clearInterval(this._oData.refreshFn);this._oData.refreshFn=setInterval(()=>{this._oData.lastRefreshedTime=this._oData.lastRefreshedTime||new Date;this._oData.refreshInfo=this._toRelativeDateTime(this._oData.lastRefreshedTime);this._updateRefreshInformation()},V.TODOS_REFRESH_INTERVAL)},_updateRefreshInformation:function t(){const e=this.getParent();if(e.getProperty("selectedKey")===this.getProperty("key")){this._refreshBtn.setProperty("text",this._oData.refreshInfo,true);e._updateContainerHeader(this)}this._adjustLayout()},_adjustLayout:function t(){const e=this._getVisibleCardCount();if(this._oData.tiles.length&&!this._oData.hasError){const t=this._oData.tiles.slice(0,e);this._controlModel.setProperty("/displayTiles",t)}this._controlModel.setProperty("/isPhone",this.getDeviceType()===N.Mobile);this.getParent()?.toggleFullScreenElements(this,this._isElementExpanded()||Number(this._oData.length)>e)},_toRelativeDateTime:function t(e){const n=new Date(e);return isNaN(Number(n))?"":F.relativeDateFormatter.format(n)},getNoDataText:function t(){return this._i18nBundle.getText("noData")},_parseResponse:function t(e){const{d:n={},value:r}=e||{};const i=n?.results;const o=!isNaN(+n)&&+n;const s=!isNaN(+e)&&+e;return i||o||s||r||0},_submitBatch:function t(){const e=this;return Promise.all(this.requests.map(function(t){try{return Promise.resolve(v(function(){return E(function(){return Promise.resolve(e.batchHelper.createMultipartRequest(t.baseURL,t.requestURLs)).then(function(n){if(n.length){const r=n.map(t=>{if(typeof t==="string"){t=JSON.parse(t)}return e._parseResponse(t)});const i=function(){if(t.success&&typeof t.success==="function"){return Promise.resolve(t.success(r)).then(function(){})}}();return i&&i.then?i.then(function(){return r}):r}else{throw new Error("Invalid response")}})},function(t){e._handleError(t)})},function(t,n){e._clearRequests();if(t)throw n;return n}))}catch(t){return Promise.reject(t)}}))},_handleError:function e(n){this._oData.displayTiles=this._oData.tiles=[];this._oData.getSupported=this._oData.isLoaded=this._oData.hasError=true;this._oData.illustrationType="sapIllus-UnableToLoad";this._oData.illustrationTitle=this._oData.illustrationDescription="";t.error(n);this._controlModel.refresh()},_clearRequests:function t(){this.requests=[]},_isLoaded:function t(){const e=this.getParent();const n=e?._getLayout()?.getProperty("expanded");const{isLoaded:r,isExpandedOnce:i}=this._oData;if(!n){return r}return i&&r},_setLoaded:function t(e){this._oData.isLoaded=e},_getSupported:function t(){return this._oData.getSupported},_setSupported:function t(e){this._oData.getSupported=e},_getAppIntent:function t(){const e=/#([^?-]+)-([^?#]+)(?:\?([^#]+))?(?:#.*)?/;const n=this.getTargetAppUrl().match(e);if(n){const t={semanticObject:n[1],action:n[2]};const e={};if(n[3]){const t=n[3].split("&");for(const n of t){const[t,r]=n.split("=");e[t]=r}}return{target:t,params:e}}else{return null}},_switchTabIfRequired:function t(){try{const t=this;const e=t.getParent();const n=e?.getProperty("selectedKey");return Promise.resolve(function(){if(n===t.getProperty("key")&&(t._oData.length===0||t._oData.hasError)){let r=false;function i(){const n=function(){if(o){e?.setProperty("selectedKey",o.getProperty("key"));A.cardCount=t._cardCount;return Promise.resolve(o._loadCards(true)).then(function(){A.cardCount=undefined})}}();if(n&&n.then)return n.then(function(){})}let o;const s=e?.getAggregation("content");const a=O(s,function(e){const n=function(){if(e!==t){return Promise.resolve(e._loadCards()).then(function(){if(e._getSupported()&&!e._isLoaded()&&e._getCardCount()>0){o=e;r=true}})}}();if(n&&n.then)return n.then(function(){})},function(){return r});return a&&a.then?a.then(i):i(a)}}())}catch(t){return Promise.reject(t)}},_onPressViewAll:function t(){b.redirect(this.getTargetAppUrl(),false)},_getCardCount:function t(){return Number(this._oData.length)},_beforePanelExpand:function t(){try{const t=this;const e=function(){if(!t._oData.isExpandedOnce){t._oData.isExpandedOnce=true;return Promise.resolve(t._loadCards(true)).then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(t){return Promise.reject(t)}}});F.relativeDateFormatter=_.getDateTimeInstance({style:"medium",relative:true,relativeStyle:"short"});return F});
|
|
247
277
|
/*!
|
|
248
278
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
249
279
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
250
280
|
*/
|
|
251
|
-
sap.ui.predefine("sap/cux/home/ToDosContainer", ["sap/base/Log","sap/ushell/Container","./BaseContainer","./utils/Device"],function(e,t,n,r){"use strict";function
|
|
281
|
+
sap.ui.predefine("sap/cux/home/ToDosContainer", ["sap/base/Log","sap/ushell/Container","./BaseContainer","./ToDosContainerGenericPlaceholder","./utils/Device"],function(e,t,n,r,o){"use strict";function i(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function s(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const c=i(n);const u=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function l(e,t,n){if(!e.s){if(n instanceof a){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=l.bind(null,e,t);return}}if(n&&n.then){n.then(l.bind(null,e,t),l.bind(null,e,2));return}e.s=t;e.v=n;const r=e.o;if(r){r(e)}}}const a=function(){function e(){}e.prototype.then=function(t,n){const r=new e;const o=this.s;if(o){const e=o&1?t:n;if(e){try{l(r,1,e(this.v))}catch(e){l(r,2,e)}return r}else{return this}}this.o=function(e){try{const o=e.v;if(e.s&1){l(r,1,t?t(o):o)}else if(n){l(r,1,n(o))}else{l(r,2,o)}}catch(e){l(r,2,e)}};return r};return e}();function f(e){return e instanceof a&&e.s&1}function h(e,t,n){var r=-1,o,i;function s(c){try{while(++r<e.length&&(!n||!n())){c=t(r);if(c&&c.then){if(f(c)){c=c.v}else{c.then(s,i||(i=l.bind(null,o=new a,2)));return}}}if(o){l(o,1,c)}else{o=c}}catch(e){l(o||(o=new a),2,e)}}s();return o}const d=r["getTodosPlaceholder"];function y(e,t,n){if(typeof e[u]==="function"){var r=e[u](),o,i,s;function p(e){try{while(!(o=r.next()).done&&(!n||!n())){e=t(o.value);if(e&&e.then){if(f(e)){e=e.v}else{e.then(p,s||(s=l.bind(null,i=new a,2)));return}}}if(i){l(i,1,e)}else{i=e}}catch(e){l(i||(i=new a),2,e)}}p();if(r.return){var c=function(e){try{if(!o.done){r.return()}}catch(e){}return e};if(i&&i.then){return i.then(c,function(e){throw c(e)})}c()}return i}if(!("length"in e)){throw new TypeError("Object is not iterable")}var d=[];for(var y=0;y<e.length;y++){d.push(e[y])}return h(d,function(e){return t(d[e])},n)}const p=o["DeviceType"];const g=c.extend("sap.cux.home.ToDosContainer",{renderer:{...c.renderer,apiVersion:2},metadata:{library:"sap.cux.home",properties:{fullScreenName:{type:"string",group:"Misc",defaultValue:"ST1",visibility:"hidden"}}},constructor:function e(t,n){c.prototype.constructor.call(this,t,n)},init:function e(){c.prototype.init.call(this);this.setProperty("title",this._i18nBundle?.getText("toDosTitle"));this.addStyleClass("sapCuxToDosContainer");this._isAuthCheckRequired=true;this.addCustomSetting("title",this._i18nBundle.getText("toDosTitle"));this.addCustomSetting("text",this._i18nBundle.getText("forMeTodayMsg"))},load:function e(){try{const e=this;e._iconTabBarControl=e._getInnerControl();const t=s(function(){return Promise.resolve(e._performAuthCheck()).then(function(){const t=e.getContent()||[];const n=t.filter(e=>!e._getSupported());const r=function(){if(n.length===t.length){e._handleToDoUnauthorizedAccess()}else{const r=t.length-n.length===1;e._iconTabBarControl?.toggleStyleClass("sapUiITBHide",r);return Promise.resolve(e._loadAllPanels()).then(function(){})}}();if(r&&r.then)return r.then(function(){})})},function(t){e._handleToDoUnauthorizedAccess(t)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_performAuthCheck:function e(){try{const e=this;return Promise.resolve(s(function(){if(!e._isAuthCheckRequired){return Promise.resolve()}else{return Promise.resolve(t.getServiceAsync("Navigation")).then(function(t){const n=e.getContent()||[];const r=n.map(e=>e.getTargetAppUrl()?e._getAppIntent():"#");return Promise.resolve(t.isNavigationSupported(r)).then(function(t){const r=t;n.forEach((e,t)=>e._setSupported(r[t].supported));e._isAuthCheckRequired=false;return Promise.resolve()})})}},function(e){return Promise.reject(e)}))}catch(e){return Promise.reject(e)}},_handleToDoUnauthorizedAccess:function t(n){e.error(n?.message||"User has no access to any available panels");this.getContent()?.forEach(e=>{e.fireEvent("loaded");this.removeContent(e)});this.setVisible(false)},_loadAllPanels:function e(t){try{const e=this;const n=e.getProperty("selectedKey");const r=e.getContent()||[];const o=[...r].sort((e,t)=>{if(e.getProperty("key")===n){return-1}if(t.getProperty("key")===n){return 1}return 0});return Promise.resolve(y(o,function(e){const n=function(){if(!e._isLoaded?.()){return Promise.resolve(e._loadCards(t)).then(function(){})}}();if(n&&n.then)return n.then(function(){})}))}catch(e){return Promise.reject(e)}},_onPanelSelect:function e(t){try{const n=this;function r(){o._updateRefreshInformation()}c.prototype._onPanelSelect.call(n,t);const o=n._getSelectedPanel();const i=function(){if(!o._isLoaded()){return Promise.resolve(o._loadCards(true)).then(function(){})}}();return Promise.resolve(i&&i.then?i.then(r):r(i))}catch(s){return Promise.reject(s)}},refreshData:function e(){try{const e=this;e.getContent()?.forEach(e=>e._setLoaded(false));return Promise.resolve(e._loadAllPanels(true))}catch(e){return Promise.reject(e)}},getSelectedKey:function e(){if(!this.getProperty("selectedKey")){this.setProperty("selectedKey",this._getDefaultKey())}return this.getProperty("selectedKey")},_getDefaultKey:function e(){return this.getContent()?.[0]?.getProperty("key")},adjustLayout:function e(){this.toggleActionButtons(this.getDeviceType()!==p.Mobile);this.getContent()?.forEach(e=>e._adjustLayout())},getGenericPlaceholderContent:function e(){return d()}});return g});
|
|
282
|
+
/*!
|
|
283
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
284
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
285
|
+
*/
|
|
286
|
+
sap.ui.predefine("sap/cux/home/ToDosContainerGenericPlaceholder", [],function(){"use strict";function e(){return`\n <div class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plContent plResponsivePadding" style="background-color:transparent">\n <div class="plText sapMGTLoadingShimmer plTextWeightL plTextWidthM plPHPCardHeaderText" style="width: 225px;">\n </div>\n <div class="plPHPCardContainer plPHPCardContainerOverflowHidden plSectionMarginBottom">\n <div class="plPHPCard plPHPCardVersion1 PHPContentCard1" style="background-color:white">\n <div class="plPHPCardHeader">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardHeaderText"\n style="width: 100%;"></div>\n </div>\n <div class="plPHPCardContent">\n <div style="vertical-align: inherit;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentContainer">\n <div class="plText sapMGTLoadingShimmer plTextWeightS plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 80%;"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="plPHPCard plPHPCardVersion1 PHPContentCard2" style="background-color:white">\n <div class="plPHPCardHeader">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardHeaderText"\n style="width: 100%;"></div>\n </div>\n <div class="plPHPCardContent">\n <div style="vertical-align: inherit;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentContainer">\n <div class="plText sapMGTLoadingShimmer plTextWeightS plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 80%;"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="plPHPCard plPHPCardVersion1 PHPContentCard3 plSmallestVisibleSizeL" style="background-color:white">\n <div class="plPHPCardHeader">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardHeaderText"\n style="width: 100%;"></div>\n </div>\n <div class="plPHPCardContent">\n <div style="vertical-align: inherit;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentContainer">\n <div class="plText sapMGTLoadingShimmer plTextWeightS plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 80%;"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="plPHPCard plPHPCardVersion1 PHPContentCard4 plSmallestVisibleSizeXL" style="background-color:white">\n <div class="plPHPCardHeader">\n <div class="plText sapMGTLoadingShimmer plTextWeightM plTextWidthM plPHPCardHeaderText"\n style="width: 100%;"></div>\n </div>\n <div class="plPHPCardContent">\n <div style="vertical-align: inherit;">\n <div\n class="plVerticalLayout plVerticalContent plTextAlignStart plVerticalAlignTop plVerticalRepeater plPHPCardContentContainer">\n <div class="plText sapMGTLoadingShimmer plTextWeightS plTextWidthM plPHPCardContentText plVerticalRepeaterItem"\n style="width: 80%;"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n `}var t={__esModule:true};t.getTodosPlaceholder=e;return t});
|
|
252
287
|
/*!
|
|
253
288
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
254
289
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -284,6 +319,11 @@ sap.ui.predefine("sap/cux/home/flexibility/BaseContainer.flexibility", ["sap/ui/
|
|
|
284
319
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
285
320
|
*/
|
|
286
321
|
sap.ui.predefine("sap/cux/home/flexibility/Layout.flexibility", ["sap/ui/fl/changeHandler/MoveControls","../changeHandler/NewsFeedVisibilityChange","../changeHandler/SetNewsFeedUrl","../changeHandler/SpacePageColorHandler","../changeHandler/SpacePageIconHandler"],function(e,a,n,r,l){"use strict";function E(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const t=E(a);const c=E(n);const d=E(r);const o=E(l);var C=function(e){e["HIDE"]="hideControl";e["UNHIDE"]="unhideControl";e["MOVE"]="moveControls";e["PAGE_COLOR"]="applyPageColor";e["SPACE_COLOR"]="applySpaceColor";e["PAGE_ICON"]="applyPageIcon";e["SPACE_ICON"]="applySpaceIcon";e["NEWS_FEED_URL"]="changeNewsFeedURL";e["NEWS_FEED_VISIBILITY"]="setNewsFeedVisibility";return e}(C||{});var s={[C.MOVE]:{layers:{USER:true},changeHandler:e},[C.HIDE]:"default",[C.UNHIDE]:"default",[C.SPACE_COLOR]:{layers:{CUSTOMER:true},changeHandler:d},[C.PAGE_COLOR]:{layers:{CUSTOMER:true},changeHandler:d},[C.SPACE_ICON]:{layers:{CUSTOMER:true},changeHandler:o},[C.PAGE_ICON]:{layers:{CUSTOMER:true},changeHandler:o},[C.NEWS_FEED_URL]:{layers:{CUSTOMER:true},changeHandler:c},[C.NEWS_FEED_VISIBILITY]:{layers:{CUSTOMER:true},changeHandler:t}};s.CHANGE_TYPES=C;return s});
|
|
322
|
+
/*!
|
|
323
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
324
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
325
|
+
*/
|
|
326
|
+
sap.ui.predefine("sap/cux/home/interface/CardsInterface", [],function(){"use strict";var a=function(a){a["SapSemantics"]="sap:semantics";a["UITextArrangement"]="com.sap.vocabularies.UI.v1.TextArrangement";a["UIHidden"]="com.sap.vocabularies.UI.v1.Hidden";a["CommonLabel"]="com.sap.vocabularies.Common.v1.Label";a["UIHeaderInfo"]="com.sap.vocabularies.UI.v1.HeaderInfo";a["UISelectionPresentationVariant"]="com.sap.vocabularies.UI.v1.SelectionPresentationVariant";a["UILineItem"]="com.sap.vocabularies.UI.v1.LineItem";a["UIPresentationVariant"]="com.sap.vocabularies.UI.v1.PresentationVariant";a["UIChart"]="com.sap.vocabularies.UI.v1.Chart";a["MeasuresISOCurrency"]="Org.OData.Measures.V1.ISOCurrency";a["MeasuresUnit"]="Org.OData.Measures.V1.Unit";a["CommonFieldControl"]="com.sap.vocabularies.Common.v1.FieldControl";a["UIIsImageURL"]="com.sap.vocabularies.UI.v1.IsImageURL";a["CommonText"]="com.sap.vocabularies.Common.v1.Text";a["CommonSemanticKey"]="com.sap.vocabularies.Common.v1.SemanticKey";return a}(a||{});var e={__esModule:true};e.UIAnnotations=a;return e});
|
|
287
327
|
/*!
|
|
288
328
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
289
329
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -303,7 +343,7 @@ sap.ui.predefine("sap/cux/home/utils/AnalyticalCardSkeleton", [],function(){"use
|
|
|
303
343
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
304
344
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
305
345
|
*/
|
|
306
|
-
sap.ui.predefine("sap/cux/home/utils/AppManager", ["sap/base/Log","sap/base/i18n/Formatting","sap/base/i18n/ResourceBundle","sap/ui/VersionInfo","sap/ui/base/Object","sap/ui/model/odata/v2/ODataModel","sap/ushell/Config","sap/ushell/Container","./AnalyticalCardSkeleton","./CardSkeleton","./Constants","./DataFormatUtils","./HttpHelper"],function(e,t,n,i,r,s,o,a,c,u,l,f,d){"use strict";function p(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const m=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function h(e,t,n){if(!e.s){if(n instanceof g){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=h.bind(null,e,t);return}}if(n&&n.then){n.then(h.bind(null,e,t),h.bind(null,e,2));return}e.s=t;e.v=n;const i=e.o;if(i){i(e)}}}const g=function(){function e(){}e.prototype.then=function(t,n){const i=new e;const r=this.s;if(r){const e=r&1?t:n;if(e){try{h(i,1,e(this.v))}catch(e){h(i,2,e)}return i}else{return this}}this.o=function(e){try{const r=e.v;if(e.s&1){h(i,1,t?t(r):r)}else if(n){h(i,1,n(r))}else{h(i,2,r)}}catch(e){h(i,2,e)}};return i};return e}();function v(e){return e instanceof g&&e.s&1}function P(e,t,n){var i=-1,r,s;function o(a){try{while(++i<e.length&&(!n||!n())){a=t(i);if(a&&a.then){if(v(a)){a=a.v}else{a.then(o,s||(s=h.bind(null,r=new g,2)));return}}}if(r){h(r,1,a)}else{r=a}}catch(e){h(r||(r=new g),2,e)}}o();return r}const y=c["AnalyticalCardSkeleton"];function I(e,t,n){if(typeof e[m]==="function"){var i=e[m](),r,s,o;function l(e){try{while(!(r=i.next()).done&&(!n||!n())){e=t(r.value);if(e&&e.then){if(v(e)){e=e.v}else{e.then(l,o||(o=h.bind(null,s=new g,2)));return}}}if(s){h(s,1,e)}else{s=e}}catch(e){h(s||(s=new g),2,e)}}l();if(i.return){var a=function(e){try{if(!r.done){i.return()}}catch(e){}return e};if(s&&s.then){return s.then(a,function(e){throw a(e)})}a()}return s}if(!("length"in e)){throw new TypeError("Object is not iterable")}var c=[];for(var u=0;u<e.length;u++){c.push(e[u])}return P(c,function(e){return t(c[e])},n)}const S=u["CardSkeleton"];function _(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const b=l["DEFAULT_BG_COLOR"];const C=l["FALLBACK_ICON"];const z=l["FEATURE_TOGGLES"];const V=l["FEATURE_TOGGLE_SRVC_URL"];const D=l["MYHOME_PAGE_ID"];const O=l["MYHOME_SPACE_ID"];const A=l["MYINSIGHT_SECTION_ID"];const M=l["RECOMMENDATION_SRVC_URL"];const E=l["RECOMMENDED_CARD_LIMIT"];const T=f["createBookMarkData"];const j=f["getLeanURL"];const R=f["sortCollectionByImportance"];const x=p(d);const L={MUST_INCLUDE_RECOMMEDED_APPS:["F0862","F1823"]};const U=t=>{let n={};if(t){if(typeof t==="object"){n=t}else{try{n=JSON.parse(t)}catch(t){e.error(t instanceof Error?t.message:String(t));n=undefined}}}return n};const F=e=>{let t={};if(e?._instantiationData?.chip?.configuration){const n=U(e._instantiationData.chip.configuration);if(n?.tileConfiguration){const e=U(n.tileConfiguration);if(e){t=U(e.TILE_PROPERTIES)}}}return t};const N=e=>{let t="";let n={};if(e?.target?.semanticObject&&e?.target?.action){t=`#${e.target.semanticObject}-${e.target.action}`}else if(e?._instantiationData?.chip?.configuration){n=F(e);if(n?.semanticObject&&n?.semanticAction){t=`#${n?.semanticObject}-${n?.semanticAction}`}}return t};const B=e=>{let t=N(e)||"";const n=F(e);if(n?.evaluationId){t+="?EvaluationId="+n.evaluationId}return t};const k=e=>e.vizType?.startsWith("X-SAP-UI2-CHIP:SSB");const w=(e,t)=>{const n=t?._instantiationData?.chip?.bags?.sb_tileProperties?.texts;return{title:e.title?e.title:n?.title||"",subtitle:e.subtitle?e.subtitle:n?.description||""}};const $=e=>{e.forEach(t=>{e.filter(e=>e.appId===t.appId&&e?.visualization?.id!==t?.visualization?.id&&e.persConfig?.sectionIndex===t.persConfig?.sectionIndex).forEach(e=>{e?.persConfig?.duplicateApps?.push(t)})});return e};const G=e=>e?.target?.parameters?.["sap-ui-tech-hint"]?.value?.value==="GUI";const H=e=>e.fioriId&&L.MUST_INCLUDE_RECOMMEDED_APPS.includes(e.fioriId);const q=(e,t)=>!t.some(t=>t.visualization?.target?.semanticObject===e.visualization?.target?.semanticObject&&t.visualization?.target?.action===e.visualization?.target?.action);class J extends r{aRequestQueue=[];bInsightsSectionPresent=false;vizDataModified=false;_oVizCacheData={};_favPageVisualizations=[];constructor(){super()}static getInstance(){if(!J.Instance){J.Instance=new J}return J.Instance}_fetchRequestFromQueue(e){try{const t=this;return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(n){let i;t.aRequestQueue=t.aRequestQueue||[];const r=t.aRequestQueue.find(e=>e.pageId===D);if(!r||e===true||t.vizDataModified===true){t.vizDataModified=false;i=n.getPage(D);if(r){r.pageLoadPromise=i}else{t.aRequestQueue.push({pageId:D,pageLoadPromise:i})}}else{i=r.pageLoadPromise}return i})}catch(e){return Promise.reject(e)}}_fetchDynamicVizs(e){return this.fetchFavVizs(e,true).then(e=>e.filter(e=>e.isCount||e.isSmartBusinessTile))}_getSections(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;return Promise.resolve(t._fetchRequestFromQueue(e)).then(function(e){const n=e&&e.sections||[],i=n.findIndex(e=>e.default);if(i>0){function r(){return t._getSections(true)}const s=function(){if(t._oMoveAppsPromise!==undefined){t._oMoveAppsPromise=t.moveSection(i,0);return Promise.resolve(t._oMoveAppsPromise).then(function(){})}}();return s&&s.then?s.then(r):r(s)}else{return n}})}catch(e){return Promise.reject(e)}}_fetchMyHomeVizs(e){try{const t=this;const n=[];t._oVizCacheData=t._oVizCacheData||{};return Promise.resolve(t._getSections(e)).then(function(e){return Promise.resolve(a.getServiceAsync("VisualizationInstantiation")).then(function(i){e.forEach((e,r)=>{e?.visualizations?.forEach((s,o)=>{const a=s.vizConfig,c=a?.["sap.app"]||{title:"?"},u={};u.oldAppId=N(a?.["sap.flp"]);u.appId=s?.targetURL;u.url=s?.targetURL;if(!u.url&&k(s)){u.url=B(a?.["sap.flp"])}u.leanURL=j(u.url);u.title=s?.title||w(c,s)?.title;u.subtitle=s.subtitle||w(c,s).subtitle;u.BGColor=b().key;u.isFav=true;u.isSection=false;u.icon=a?.["sap.ui"]?.icons?.icon||C;if(s?.indicatorDataSource){u.isCount=true;u.indicatorDataSource=s.indicatorDataSource.path;u.contentProviderId=s.contentProviderId}u.isSmartBusinessTile=k(s);if(u.isSmartBusinessTile){if(!t._oVizCacheData[u.appId]){t._oVizCacheData[u.appId]=i.instantiateVisualization(s);t._oVizCacheData[u.appId].setActive(true)}u.vizInstance=t._oVizCacheData[u.appId]}u.persConfig={pageId:D,sectionTitle:e.title,sectionId:e.id,sectionIndex:r,visualizationIndex:o,isDefaultSection:e.default,isPresetSection:e.preset,duplicateApps:[]};u.visualization=s;u.visualization.title=u.title;u.visualization.subtitle=u.subtitle;n.push(u)})});return n})})}catch(e){return Promise.reject(e)}}_copyDynamicVizs(){try{const e=this;return Promise.resolve(e._fetchDynamicVizs(true)).then(function(t){return Promise.all(t.map(t=>e.addVisualization(t.visualization.vizId,A)))})}catch(e){return Promise.reject(e)}}fetchFavVizs(e,t){try{const n=this;return Promise.resolve(n._fetchMyHomeVizs(e)).then(function(e){const i=e.filter(e=>e.persConfig&&e.persConfig.sectionId!==A&&e.url&&e.title);if(t){return n._filterDuplicateVizs($(i),false)}else{return n._addGroupInformation(i)}})}catch(e){return Promise.reject(e)}}fetchInsightApps(e,t){try{const n=this;function i(){return Promise.resolve(r())}const r=function(){try{return Promise.resolve(n._fetchMyHomeVizs(e)).then(function(e){return e.filter(e=>e.persConfig?.sectionId===A&&e.url&&e.title)})}catch(e){return Promise.reject(e)}};const s=function(){if(!n.bInsightsSectionPresent){return Promise.resolve(n._getSections(e)).then(function(e){n.insightsSectionIndex=e.findIndex(function(e){return e.id===A});const i=function(){if(n.insightsSectionIndex===-1&&(o.last("/core/shell/enablePersonalization")||o.last("/core/catalog/enabled"))&&n.bInsightsSectionPresent===false){n.bInsightsSectionPresent=true;return Promise.resolve(n.addSection({sectionIndex:e?.length,sectionProperties:{id:A,title:t}})).then(function(){return Promise.resolve(n._copyDynamicVizs()).then(function(){})})}else{n.bInsightsSectionPresent=true}}();if(i&&i.then)return i.then(function(){})})}}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(a){return Promise.reject(a)}}addVisualization(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;try{return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(n){return Promise.resolve(n.addVisualization(D,t,e)).then(function(){})})}catch(e){return Promise.reject(e)}}removeVisualizations(e){let{sectionId:t,vizIds:n}=e;try{const e=this;return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(i){const r=I(n,function(n){return Promise.resolve(e._getSections(true)).then(function(e){const r=e.findIndex(e=>e.id===t);const s=r>-1?e[r]:null;const o=s?.visualizations?.findIndex(e=>e.id===n)??-1;const a=function(){if(o>-1){return Promise.resolve(i.deleteVisualization(D,r,o)).then(function(){})}}();if(a&&a.then)return a.then(function(){})})});if(r&&r.then)return r.then(function(){})})}catch(e){return Promise.reject(e)}}updateVisualizations(e){let{pageId:t,sourceSectionIndex:n,sourceVisualizationIndex:i,oVisualizationData:r}=e;try{return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(e){return e.updateVisualization(t,n,i,r)})}catch(e){return Promise.reject(e)}}createInsightSection(e){try{let t=false;const n=this;function i(e){return t?e:Promise.resolve()}const r=function(){if(!n.bInsightsSectionPresent){return Promise.resolve(n._getSections()).then(function(i){const r=i.findIndex(function(e){return e.id===A});if(r===-1&&(o.last("/core/shell/enablePersonalization")||o.last("/core/catalog/enabled"))){const r=n.addSection({sectionIndex:i.length,sectionProperties:{id:A,title:e,visible:true}});t=true;return r}})}}();return Promise.resolve(r&&r.then?r.then(i):i(r))}catch(s){return Promise.reject(s)}}addSection(e){try{const{sectionIndex:t,sectionProperties:n}=e;return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(e){return Promise.resolve(e.addSection(D,t,{...n,visible:true})).then(function(){})})}catch(e){return Promise.reject(e)}}getSectionVisualizations(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const n=this;return Promise.resolve(n.fetchFavVizs(t)).then(function(t){if(e){return t.find(t=>t.isSection&&t.id===e)?.apps||[]}else{return t.filter(e=>!e.isSection)}})}catch(e){return Promise.reject(e)}}addBookMark(e,t){try{const n=this;return Promise.resolve(a.getServiceAsync("BookmarkV2")).then(function(i){return Promise.resolve(i.getContentNodes()).then(function(r){const s=r.find(e=>e.id===O);const o=s?.children?.find(e=>e.id===D);return Promise.resolve(i.addBookmark(T(e),o)).then(function(){return t?n.moveVisualization(t):Promise.resolve()})})})}catch(e){return Promise.reject(e)}}getVisualization(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;try{const i=this;return Promise.resolve(i.getSectionVisualizations(t,n)).then(function(t){return t.find(t=>t.appId===e)})}catch(e){return Promise.reject(e)}}moveVisualization(e){try{const t=this;return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(n){t.vizDataModified=true;return n.moveVisualization(D,e.sourceSectionIndex,e.sourceVisualizationIndex,e.targetSectionIndex,e.targetVisualizationIndex)})}catch(e){return Promise.reject(e)}}_filterDuplicateVizs(e,t){return e.filter((e,n,i)=>{const r=i.findIndex(t=>t.appId===e.appId);return t?r!==n:r===n})}_addGroupInformation(e){const t=[],n=[];let i;$(e).forEach(e=>{if(e.persConfig?.isDefaultSection){t.push(e)}else{i=n.find(t=>t.isSection&&t.id===e.persConfig?.sectionId);if(!i){n.push({id:e.persConfig?.sectionId,index:e.persConfig?.sectionIndex,title:e.persConfig?.sectionTitle||"",badge:"1",BGColor:b().key,icon:"sap-icon://folder-full",isSection:true,isPresetSection:e.persConfig?.isPresetSection,apps:[e]})}else{i.apps?.push(e);i.badge=i.apps?.length.toString()}}});return[...n,...this._filterDuplicateVizs(t,false)]}moveSection(e,t){try{return Promise.resolve(a.getServiceAsync("Pages").then(function(n){const i=n.getPageIndex(D);return n.moveSection(i,e,t)}))}catch(e){return Promise.reject(e)}}_getFeatureToggles(){try{let e=V+"?$filter=";const t=Object.keys(z);const n=t.map(e=>"ToggleId eq '"+z[e]+"'").join(" or ");e=e+"("+n+")";return Promise.resolve(x.GetJSON(e)).then(function(e){const t=e;if(t?.error){throw new Error(t.error.message)}return t?.value||[]})}catch(e){return Promise.reject(e)}}isFeatureEnabled(t){try{const n=this;return Promise.resolve(_(function(){return Promise.resolve(n._getFeatureToggles()).then(function(e){const n=e.find(e=>e.ToggleId===t);return!n||n.State===""?false:true})},function(t){e.error("Unable to load feature toggles: "+t.message);return false}))}catch(e){return Promise.reject(e)}}_getRecommenedFioriIds(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{let n=false;const i=this;function r(e){return n?e:i.recommendedFioriIds}const s=function(){if(!i.recommendedFioriIds||t){return _(function(){return Promise.resolve(x.GetJSON(M)).then(function(e){const t=e;i.recommendedFioriIds=t?.value?.map(e=>e.app_id)||[]})},function(t){e.error("Unable to load recommendations: "+t.message);const i=Promise.resolve([]);n=true;return i})}}();return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(o){return Promise.reject(o)}}_getCatalogApps(){try{return Promise.resolve(_(function(){return Promise.resolve(a.getServiceAsync("SearchableContent")).then(function(e){return e.getApps({includeAppsWithoutVisualizations:false})})},function(t){e.error("Error while fetching catalog apps: "+t.message);return[]}))}catch(e){return Promise.reject(e)}}_isListReport(e){return e?.component?.name==="sap.suite.ui.generic.template.ListReport"}isAddCardToInsightsHidden(e){return e?.component?.settings?.tableSettings?.addCardtoInsightsHidden}_checkValidManifests(e){const t=e["sap.ui.generic.app"]&&e["sap.app"]?.dataSources?.mainService;if(!t){return false}const n=e["sap.ui.generic.app"]?.pages;if(Array.isArray(n)){return this._isListReport(n[0])&&!this.isAddCardToInsightsHidden(n[0])}else if(Object.keys(n).length){return Object.keys(n).some(e=>{if(n[e]){return this._isListReport(n[e])&&!this.isAddCardToInsightsHidden(n[e])}})}return false}_getOdataModel(e){return new Promise(function(t){const n=e?.["sap.app"]?.dataSources;const i=n?.mainService;const r=i?.settings?.annotations.map(e=>{if(n&&n[e]){return n[e]?.uri}}).filter(e=>e!==undefined);const o=new s(i?.uri,{annotationURI:r,loadAnnotationsJoined:true});o.attachMetadataLoaded(()=>{t(o)});o.attachMetadataFailed(()=>{t(o)})})}_getEntitySet(e){const t=e["sap.ui.generic.app"]?.pages;if(Array.isArray(t)){return t[0].entitySet}else if(t){for(const e in t){const n=t[e];if(n.component&&n.component?.name==="sap.suite.ui.generic.template.ListReport"){return n.entitySet}}}return undefined}_hasMandatoryProperties(e,t){if(e?.["Org.OData.Capabilities.V1.FilterRestrictions"]?.["RequiredProperties"]?.length){return true}else if(t?.length){return t.some(e=>Object.keys(e).length&&(e["sap:parameter"]==="mandatory"||e["sap:required-in-filter"]==="true"))}}_getParametersisedEntitySetParams(e,t,n){if(!e){throw new Error("OData Model needs to be passed as an argument")}const i={entitySetName:null,parameters:[],navPropertyName:null};const r=e.getODataEntitySet(t);const s=e.getODataEntityType(r.entityType);const o=s.navigationProperty;if(!o){return i}o.forEach(function(t){const o=e.getODataAssociationEnd(s,t.name);const a=o&&e.getODataEntityType(o.type);if(a?.["sap:semantics"]!=="parameters"||!a.key){return}i.entitySetName=e.getODataAssociationSetEnd(s,t.name)?.entitySet;for(let r of a.key.propertyRef){if(n){const n=a.property;for(let o of n){if(o.name===r.name){i.parameters.push(o);i.entitySetName=e.getODataAssociationSetEnd(s,t.name)?.entitySet}}}else{i.parameters.push(r.name)}}const c=a.navigationProperty;const u=c?.some(function(t){const n=e.getODataAssociationEnd(a,t.name)?.type;i.navPropertyName=n===r.entityType?t.name:null;return i.navPropertyName});return u&&i.navPropertyName&&i.entitySetName});return i}_getColumnDetail(e,t,n){let i,r={};if(n.Value?.Path){i=t.getODataProperty(e,n.Value.Path)}if(!i||i["com.sap.vocabularies.UI.v1.Hidden"]?.Bool||n["com.sap.vocabularies.UI.v1.Hidden"]?.Bool){return r}if(i["com.sap.vocabularies.Common.v1.FieldControl"]?.Path){return undefined}let s=i["com.sap.vocabularies.Common.v1.Text"]?.Path||"";s="{"+s+"}";let o="{"+i.name+"}";let a="";const c=e["com.sap.vocabularies.Common.v1.SemanticKey"];const u=!!c&&c.some(function(e){return e.PropertyPath===i.name});if(i["Org.OData.Measures.V1.ISOCurrency"]?.Path){o=o.concat(" "+"{"+a+i["Org.OData.Measures.V1.ISOCurrency"].Path+"}")}if(i["Org.OData.Measures.V1.Unit"]?.Path){o=o.concat(" "+"{"+a+i["Org.OData.Measures.V1.Unit"].Path+"}")}if(i["com.sap.vocabularies.Common.v1.Text"]?.Path){let t=i["com.sap.vocabularies.Common.v1.Text"]["com.sap.vocabularies.UI.v1.TextArrangement"];if(!t){t=e["com.sap.vocabularies.UI.v1.TextArrangement"]}this._setColumnTextValue(t,r,s,o)}else{r["value"]=o;if(u){r.identifier=u}}r.path=i["com.sap.vocabularies.Common.v1.Text"]?i["com.sap.vocabularies.Common.v1.Text"].Path:i.name;r.importance=n["com.sap.vocabularies.UI.v1.Importance"];r.type=i.type;return r}_setColumnTextValue(e,t,n,i){const r=e?.EnumMember.split("/")[1];if(r==="TextOnly"){t["value"]="{= $"+n+" === '' ? '' : $"+n+"}"}else if(r==="TextLast"){t["value"]="{= $"+i+" === '' ? '' : $"+i+"}"+"{= $"+n+" === '' ? '' : ' (' + ($"+n+") + ')'}"}else if(r==="TextSeparate"){t["value"]="{= $"+i+" === '' ? '' : $"+i+"}"}else{t["value"]="{= $"+n+" === '' ? '' : $"+n+"}"+"{= $"+i+" === '' ? '' : ' (' + ($"+i+") + ')'}"}}_getManifestCardData(e,t,n,i,r,s){const o=e?.["sap.app"]?.dataSources.mainService.uri;const a=o?.[o.length-1]==="/"?o+i:o+"/"+i;const c=n?.map(e=>this._getColumnDetail(t,s,e)).filter(function(e){return e!==undefined&&e.path.split("/").length<=1});const u=R(c).map(e=>({path:e.path,type:e.type,value:e.value})).splice(0,4);return{cardTitle:e?.["sap.app"]?.title,subTitle:t["com.sap.vocabularies.Common.v1.Label"]?"Top 5 "+t["com.sap.vocabularies.Common.v1.Label"].String:"",url:a+"?$top=5&skip=0",semanticObject:r.semanticObject,action:r.action,id:e?.["sap.app"]?.id,columns:u}}loadI18n(e,t){try{const i=this;function r(){return i._RBManifestMap[o]}const s=e?.["sap.app"]?.["i18n"]["bundleUrl"];const o=new URL(s,t).href;i._RBManifestMap=i._RBManifestMap||{};const a=function(){if(!i._RBManifestMap[o]){return Promise.resolve(n.create({bundleUrl:o,async:true,terminologies:e["sap.app"]?.["i18n"]["terminologies"]})).then(function(e){i._RBManifestMap[o]=e})}}();return Promise.resolve(a&&a.then?a.then(r):r(a))}catch(c){return Promise.reject(c)}}getI18nValueOrDefaultString(e,t){let n="";if(e&&e.startsWith("{{")){n=e.substring(2,e.length-2)}else if(e&&e.startsWith("{")){n=e.substring(1,e.length-1)}return n?t.getText(n):e}_getAttributeValue(e){let n=!e.value.startsWith("{")?"{= extension.formatters.stringFormatter(${"+e.path+"}) }":e.value;if(e.type==="Edm.Date"||e.type==="Edm.DateTime"){const i=JSON.stringify({pattern:t.getDatePattern("short")});n="{=${"+e.path+"}?format.dateTime(${"+e.path+"}, "+i+") : ''}"}return n}_getAnalyticalCardManifest(){return JSON.parse(JSON.stringify(y))}_getListCardManifest(e){const t=JSON.parse(JSON.stringify(S));const n=t["sap.app"];const i=t["sap.card"];if(n){n.id="user."+e.id+"."+Date.now();n.title=i.header.title=e.cardTitle;n.subTitle=i.header.subTitle=e.subTitle}const r=i.content;r.item.title=this._getAttributeValue(e.columns[0]);r.item.description=this._getAttributeValue(e.columns[1]);r.item.attributes[0]={value:this._getAttributeValue(e.columns[2]),visible:"{= !!${"+e.columns[2].path+"} }"};r.data.request.url=e.url;r.item.actions=i.header.actions=[{type:"Navigation",parameters:{ibnTarget:{semanticObject:e.semanticObject,action:e.action}}}];t["sap.insights"]={parentAppId:e.id,cardType:"RT",versions:{ui5:this.versionInfo.version+"-"+this.versionInfo.buildTimestamp},visible:true};return t}_getCardMainfest(t){try{const n=this;return Promise.resolve(Promise.all([n._getInboundApps(),n._getCatalogApps()])).then(function(r){let[s,o]=r;return Promise.resolve(i.load()).then(function(i){n.versionInfo=i;let r=t.map(e=>{const t=s.find(t=>t?.signature?.parameters?.["sap-fiori-id"]?.defaultValue?.value===e);if(t){const e=o.find(e=>t.semanticObject===e.target?.semanticObject&&t.action===e.target?.action);return e&&t?.resolutionResult?.applicationDependencies?.manifest}return undefined}).filter(e=>e!==undefined);const a=r.map(function(e){try{return Promise.resolve(fetch(String(e))).then(function(e){return Promise.resolve(e.json()).then(function(t){const n=t;return{url:e.url,manifest:n}})})}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(a)).then(function(t){const i=t.filter(e=>n._checkValidManifests(e.manifest));const r=i.map(e=>n._getOdataModel(e.manifest).then(e=>e.getMetaModel()));return Promise.resolve(Promise.all(r)).then(function(t){const r=i.map(function(i,r){try{let o=false;return Promise.resolve(_(function(){function e(e){return o?e:n._getListCardManifest(m)}const a=t[r];const c=n._getEntitySet(i.manifest);if(!c){return undefined}const u=a.getODataEntitySet(c);const l=a.getODataEntityType(u.entityType);const f=l["com.sap.vocabularies.UI.v1.LineItem"];if(!f||n._hasMandatoryProperties(u,l.property)){return undefined}const d=n._getParametersisedEntitySetParams(a,c,true);if(d&&d.entitySetName&&d.parameters.length){const e=a.getODataEntitySet(d.entitySetName);if(n._hasMandatoryProperties(e,d.parameters)){return undefined}}const p=s.find(function(e){return e.resolutionResult&&e.resolutionResult.ui5ComponentName===i?.manifest?.["sap.app"]?.id});const m=n._getManifestCardData(i.manifest,l,f,c,p,a);if(m.columns.length<3){return undefined}const h=function(){if(typeof i?.manifest?.["sap.app"]?.i18n==="object"){const e=i.manifest["sap.app"].i18n.bundleUrl;return function(){if(e&&(i.manifest["sap.app"].title.startsWith("i18n>")||i.manifest["sap.app"].title.startsWith("{"))){return Promise.resolve(n.loadI18n(i.manifest,i.url)).then(function(e){m.cardTitle=n.getI18nValueOrDefaultString(m.cardTitle,e);const t=n._getListCardManifest(m);o=true;return t})}}()}}();return h&&h.then?h.then(e):e(h)},function(t){e.error(t);return undefined}))}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(r)).then(function(e){return e.filter(e=>e!==undefined)})})})})})}catch(e){return Promise.reject(e)}}_removeDuplicateCards(e){const t={};const n=[];e.forEach(e=>{const i=e?.descriptorContent?.["sap.card"]?.header?.title||"";if(!t[i]){n.push(e);t[i]=true}});return n}getRecommenedCards(){try{const t=this;return Promise.resolve(_(function(){return Promise.resolve(t._getRecommenedFioriIds()).then(function(e){return Promise.resolve(t._getCardMainfest(e)).then(function(e){const n=e.slice(0,E);const i=n.map(e=>{let t;if(e){e["sap.card"].rec=true;t=e["sap.app"]?.id}return{id:t,descriptorContent:e}});return t._removeDuplicateCards(i)})})},function(t){e.error("Error while fetching recommended cards: "+t.message);return[]}))}catch(e){return Promise.reject(e)}}getRecommendedVisualizations(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;function n(){return t._recommendedVisualizations}const i=function(){if(!t._recommendedVisualizations||e){return Promise.resolve(t._getRecommenedFioriIds(e)).then(function(n){const i=function(){if(n.length){let i=[];let r=[];return Promise.resolve(Promise.all([t._getVisualizationsByFioriIds(n),t._fetchMyHomeVizs(e)])).then(function(e){let[n,s]=e;n=n.filter(e=>q(e,s));n.forEach(e=>{if(H(e)){r.push(e)}else{i.push(e)}});t._recommendedVisualizations=i.slice(0,10-r.length).concat(r)})}else{t._recommendedVisualizations=[]}}();if(i&&i.then)return i.then(function(){})})}}();return Promise.resolve(i&&i.then?i.then(n):n(i))}catch(r){return Promise.reject(r)}}_getInboundApps(){try{return Promise.resolve(_(function(){return Promise.resolve(a.getServiceAsync("ClientSideTargetResolution")).then(function(e){return e?._oAdapter?._aInbounds||[]})},function(t){e.error("Error while fetching inbound apps: "+t.message);return[]}))}catch(e){return Promise.reject(e)}}_getVisualizationsByFioriIds(e){try{const t=this;const n=[];const i=new Map;return Promise.resolve(Promise.all([t._getInboundApps(),t._getCatalogApps()])).then(function(t){let[r,s]=t;e.forEach(e=>{const t=r.filter(function(t){return t?.signature.parameters["sap-fiori-id"]?.defaultValue?.value===e});t.forEach(t=>{let r=s.filter(e=>e?.target?.semanticObject===t.semanticObject&&e.target.action===t.action);const o=r.filter(e=>G(e));const a=r.filter(e=>!G(e));if(o.length>0&&a.length>0){r=[...a]}r.forEach(t=>{let r=t.visualizations[0];let s={title:r.title,subtitle:r.subtitle,icon:r.icon,url:r.targetURL,vizId:r.vizId,fioriId:e,visualization:r};if(!i.has(s.url)||!i.has(s.title)){i.set(s.url,true);i.set(s.title,true);n.push(s)}})})});return n})}catch(e){return Promise.reject(e)}}_getAllFavPageApps(t,n){try{let i=false;const r=this;return Promise.resolve(_(function(){function e(e){return i?e:[]}const s=function(){if(t){r._favPageVisualizations=r._favPageVisualizations||[];const e=r._favPageVisualizations.reduce((e,t)=>{if(t.pageId&&!e.includes(t.pageId)){e.push(t.pageId)}return e},[]);const s=t.map(e=>e.pageId);const o=e.length===0||!e.every(e=>s.includes(e));if(!n&&!o){const e=r._favPageVisualizations;i=true;return e}else{return Promise.resolve(r._loadAllPageVisualizations(t)).then(function(e){r._favPageVisualizations=e;const t=r._favPageVisualizations;i=true;return t})}}}();return s&&s.then?s.then(e):e(s)},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}}_loadAllPageVisualizations(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const i=e=>t.find(t=>t.pageId===e)?.BGColor??b().key;return Promise.resolve(_(function(){const e=[];return Promise.resolve(a.getServiceAsync("SpaceContent")).then(function(r){return Promise.resolve(r.getPages(t.map(e=>e.pageId))).then(function(t){const r=Object.values(t);for(const t of r){const r=t.sections||[];for(const s of r){const r=s.visualizations||[];for(const s of r){const r={appId:s.targetURL,vizId:s.vizId,icon:s.icon,BGColor:i(t.id),pageId:t.id};if(!n||!e.some(e=>e.appId===r.appId)){e.push(r)}}}}return e})})},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}}}return J});
|
|
346
|
+
sap.ui.predefine("sap/cux/home/utils/AppManager", ["sap/base/Log","sap/base/i18n/ResourceBundle","sap/ui/VersionInfo","sap/ui/base/Object","sap/ui/model/odata/v2/ODataModel","sap/ushell/Config","sap/ushell/Container","./AnalyticalCardSkeleton","./Constants","./DataFormatUtils","./HttpHelper","./RecommendedCardUtil"],function(e,t,n,r,i,o,s,a,c,u,l,f){"use strict";function d(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}const h=typeof Symbol!=="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function p(e,t,n){if(!e.s){if(n instanceof m){if(n.s){if(t&1){t=n.s}n=n.v}else{n.o=p.bind(null,e,t);return}}if(n&&n.then){n.then(p.bind(null,e,t),p.bind(null,e,2));return}e.s=t;e.v=n;const r=e.o;if(r){r(e)}}}const m=function(){function e(){}e.prototype.then=function(t,n){const r=new e;const i=this.s;if(i){const e=i&1?t:n;if(e){try{p(r,1,e(this.v))}catch(e){p(r,2,e)}return r}else{return this}}this.o=function(e){try{const i=e.v;if(e.s&1){p(r,1,t?t(i):i)}else if(n){p(r,1,n(i))}else{p(r,2,i)}}catch(e){p(r,2,e)}};return r};return e}();function g(e){return e instanceof m&&e.s&1}function v(e,t,n){var r=-1,i,o;function s(a){try{while(++r<e.length&&(!n||!n())){a=t(r);if(a&&a.then){if(g(a)){a=a.v}else{a.then(s,o||(o=p.bind(null,i=new m,2)));return}}}if(i){p(i,1,a)}else{i=a}}catch(e){p(i||(i=new m),2,e)}}s();return i}const P=a["AnalyticalCardSkeleton"];function I(e,t,n){if(typeof e[h]==="function"){var r=e[h](),i,o,s;function l(e){try{while(!(i=r.next()).done&&(!n||!n())){e=t(i.value);if(e&&e.then){if(g(e)){e=e.v}else{e.then(l,s||(s=p.bind(null,o=new m,2)));return}}}if(o){p(o,1,e)}else{o=e}}catch(e){p(o||(o=new m),2,e)}}l();if(r.return){var a=function(e){try{if(!i.done){r.return()}}catch(e){}return e};if(o&&o.then){return o.then(a,function(e){throw a(e)})}a()}return o}if(!("length"in e)){throw new TypeError("Object is not iterable")}var c=[];for(var u=0;u<e.length;u++){c.push(e[u])}return v(c,function(e){return t(c[e])},n)}const S=c["COLUMN_LENGTH"];function _(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const y=c["DEFAULT_BG_COLOR"];const z=c["FALLBACK_ICON"];const b=c["FEATURE_TOGGLES"];const C=c["FEATURE_TOGGLE_SRVC_URL"];const D=c["MYHOME_PAGE_ID"];const M=c["MYHOME_SPACE_ID"];const A=c["MYINSIGHT_SECTION_ID"];const E=c["RECOMMENDATION_SRVC_URL"];const V=c["RECOMMENDED_CARD_LIMIT"];const j=u["createBookMarkData"];const R=u["getLeanURL"];const O=d(l);const U=d(f);const T={MUST_INCLUDE_RECOMMEDED_APPS:["F0862","F1823"]};const L=t=>{let n={};if(t){if(typeof t==="object"){n=t}else{try{n=JSON.parse(t)}catch(t){e.error(t instanceof Error?t.message:String(t));n=undefined}}}return n};const w=e=>{let t={};if(e?._instantiationData?.chip?.configuration){const n=L(e._instantiationData.chip.configuration);if(n?.tileConfiguration){const e=L(n.tileConfiguration);if(e){t=L(e.TILE_PROPERTIES)}}}return t};const x=e=>{let t="";let n={};if(e?.target?.semanticObject&&e?.target?.action){t=`#${e.target.semanticObject}-${e.target.action}`}else if(e?._instantiationData?.chip?.configuration){n=w(e);if(n?.semanticObject&&n?.semanticAction){t=`#${n?.semanticObject}-${n?.semanticAction}`}}return t};const F=e=>{let t=x(e)||"";const n=w(e);if(n?.evaluationId){t+="?EvaluationId="+n.evaluationId}return t};const B=e=>e.vizType?.startsWith("X-SAP-UI2-CHIP:SSB");const N=(e,t)=>{const n=t?._instantiationData?.chip?.bags?.sb_tileProperties?.texts;return{title:e.title?e.title:n?.title||"",subtitle:e.subtitle?e.subtitle:n?.description||""}};const k=e=>{e.forEach(t=>{e.filter(e=>e.appId===t.appId&&e?.visualization?.id!==t?.visualization?.id&&e.persConfig?.sectionIndex===t.persConfig?.sectionIndex).forEach(e=>{e?.persConfig?.duplicateApps?.push(t)})});return e};const G=e=>e?.target?.parameters?.["sap-ui-tech-hint"]?.value?.value==="GUI";const H=e=>e.fioriId&&T.MUST_INCLUDE_RECOMMEDED_APPS.includes(e.fioriId);const q=(e,t)=>!t.some(t=>t.visualization?.target?.semanticObject===e.visualization?.target?.semanticObject&&t.visualization?.target?.action===e.visualization?.target?.action);class Q extends r{aRequestQueue=[];bInsightsSectionPresent=false;vizDataModified=false;_oVizCacheData={};_favPageVisualizations=[];componentData={};fioriAppData={};constructor(){super();this.recommendedUtilInstance=U.getInstance()}static getInstance(){if(!Q.Instance){Q.Instance=new Q}return Q.Instance}_fetchRequestFromQueue(e){try{const t=this;return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(n){let r;t.aRequestQueue=t.aRequestQueue||[];const i=t.aRequestQueue.find(e=>e.pageId===D);if(!i||e===true||t.vizDataModified===true){t.vizDataModified=false;r=n.getPage(D);if(i){i.pageLoadPromise=r}else{t.aRequestQueue.push({pageId:D,pageLoadPromise:r})}}else{r=i.pageLoadPromise}return r})}catch(e){return Promise.reject(e)}}_fetchDynamicVizs(e){return this.fetchFavVizs(e,true).then(e=>e.filter(e=>e.isCount||e.isSmartBusinessTile))}_getSections(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;return Promise.resolve(t._fetchRequestFromQueue(e)).then(function(e){const n=e&&e.sections||[],r=n.findIndex(e=>e.default);if(r>0){function i(){return t._getSections(true)}const o=function(){if(t._oMoveAppsPromise!==undefined){t._oMoveAppsPromise=t.moveSection(r,0);return Promise.resolve(t._oMoveAppsPromise).then(function(){})}}();return o&&o.then?o.then(i):i(o)}else{return n}})}catch(e){return Promise.reject(e)}}_fetchMyHomeVizs(e){try{const t=this;const n=[];t._oVizCacheData=t._oVizCacheData||{};return Promise.resolve(t._getSections(e)).then(function(e){return Promise.resolve(s.getServiceAsync("VisualizationInstantiation")).then(function(r){e.forEach((e,i)=>{e?.visualizations?.forEach((o,s)=>{const a=o.vizConfig,c=a?.["sap.app"]||{title:"?"},u={};u.oldAppId=x(a?.["sap.flp"]);u.appId=o?.targetURL;u.url=o?.targetURL;if(!u.url&&B(o)){u.url=F(a?.["sap.flp"])}u.leanURL=R(u.url);u.title=o?.title||N(c,o)?.title;u.subtitle=o.subtitle||N(c,o).subtitle;u.BGColor=y().key;u.isFav=true;u.isSection=false;u.icon=a?.["sap.ui"]?.icons?.icon||z;if(o?.indicatorDataSource){u.isCount=true;u.indicatorDataSource=o.indicatorDataSource.path;u.contentProviderId=o.contentProviderId}u.isSmartBusinessTile=B(o);if(u.isSmartBusinessTile){if(!t._oVizCacheData[u.appId]){t._oVizCacheData[u.appId]=r.instantiateVisualization(o);t._oVizCacheData[u.appId].setActive(true)}u.vizInstance=t._oVizCacheData[u.appId]}u.persConfig={pageId:D,sectionTitle:e.title,sectionId:e.id,sectionIndex:i,visualizationIndex:s,isDefaultSection:e.default,isPresetSection:e.preset,duplicateApps:[]};u.visualization=o;u.visualization.title=u.title;u.visualization.subtitle=u.subtitle;n.push(u)})});return n})})}catch(e){return Promise.reject(e)}}_copyDynamicVizs(){try{const e=this;return Promise.resolve(e._fetchDynamicVizs(true)).then(function(t){return Promise.all(t.map(t=>e.addVisualization(t.visualization.vizId,A)))})}catch(e){return Promise.reject(e)}}fetchFavVizs(e,t){try{const n=this;return Promise.resolve(n._fetchMyHomeVizs(e)).then(function(e){const r=e.filter(e=>e.persConfig&&e.persConfig.sectionId!==A&&e.url&&e.title);if(t){return n._filterDuplicateVizs(k(r),false)}else{return n._addGroupInformation(r)}})}catch(e){return Promise.reject(e)}}fetchInsightApps(e,t){try{const n=this;function r(){return Promise.resolve(i())}const i=function(){try{return Promise.resolve(n._fetchMyHomeVizs(e)).then(function(e){return e.filter(e=>e.persConfig?.sectionId===A&&e.url&&e.title)})}catch(e){return Promise.reject(e)}};const s=function(){if(!n.bInsightsSectionPresent){return Promise.resolve(n._getSections(e)).then(function(e){n.insightsSectionIndex=e.findIndex(function(e){return e.id===A});const r=function(){if(n.insightsSectionIndex===-1&&(o.last("/core/shell/enablePersonalization")||o.last("/core/catalog/enabled"))&&n.bInsightsSectionPresent===false){n.bInsightsSectionPresent=true;return Promise.resolve(n.addSection({sectionIndex:e?.length,sectionProperties:{id:A,title:t}})).then(function(){return Promise.resolve(n._copyDynamicVizs()).then(function(){})})}else{n.bInsightsSectionPresent=true}}();if(r&&r.then)return r.then(function(){})})}}();return Promise.resolve(s&&s.then?s.then(r):r(s))}catch(a){return Promise.reject(a)}}addVisualization(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;try{return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(n){return Promise.resolve(n.addVisualization(D,t,e)).then(function(){})})}catch(e){return Promise.reject(e)}}removeVisualizations(e){let{sectionId:t,vizIds:n}=e;try{const e=this;return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(r){const i=I(n,function(n){return Promise.resolve(e._getSections(true)).then(function(e){const i=e.findIndex(e=>e.id===t);const o=i>-1?e[i]:null;const s=o?.visualizations?.findIndex(e=>e.id===n)??-1;const a=function(){if(s>-1){return Promise.resolve(r.deleteVisualization(D,i,s)).then(function(){})}}();if(a&&a.then)return a.then(function(){})})});if(i&&i.then)return i.then(function(){})})}catch(e){return Promise.reject(e)}}updateVisualizations(e){let{pageId:t,sourceSectionIndex:n,sourceVisualizationIndex:r,oVisualizationData:i}=e;try{return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(e){return e.updateVisualization(t,n,r,i)})}catch(e){return Promise.reject(e)}}createInsightSection(e){try{let t=false;const n=this;function r(e){return t?e:Promise.resolve()}const i=function(){if(!n.bInsightsSectionPresent){return Promise.resolve(n._getSections()).then(function(r){const i=r.findIndex(function(e){return e.id===A});if(i===-1&&(o.last("/core/shell/enablePersonalization")||o.last("/core/catalog/enabled"))){const i=n.addSection({sectionIndex:r.length,sectionProperties:{id:A,title:e,visible:true}});t=true;return i}})}}();return Promise.resolve(i&&i.then?i.then(r):r(i))}catch(s){return Promise.reject(s)}}addSection(e){try{const{sectionIndex:t,sectionProperties:n}=e;return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(e){return Promise.resolve(e.addSection(D,t,{...n,visible:true})).then(function(){})})}catch(e){return Promise.reject(e)}}getSectionVisualizations(e){let t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const n=this;return Promise.resolve(n.fetchFavVizs(t)).then(function(t){if(e){return t.find(t=>t.isSection&&t.id===e)?.apps||[]}else{return t.filter(e=>!e.isSection)}})}catch(e){return Promise.reject(e)}}addBookMark(e,t){try{const n=this;return Promise.resolve(s.getServiceAsync("BookmarkV2")).then(function(r){return Promise.resolve(r.getContentNodes()).then(function(i){const o=i.find(e=>e.id===M);const s=o?.children?.find(e=>e.id===D);return Promise.resolve(r.addBookmark(j(e),s)).then(function(){return t?n.moveVisualization(t):Promise.resolve()})})})}catch(e){return Promise.reject(e)}}getVisualization(e,t){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;try{const r=this;return Promise.resolve(r.getSectionVisualizations(t,n)).then(function(t){return t.find(t=>t.appId===e)})}catch(e){return Promise.reject(e)}}moveVisualization(e){try{const t=this;return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(n){t.vizDataModified=true;return n.moveVisualization(D,e.sourceSectionIndex,e.sourceVisualizationIndex,e.targetSectionIndex,e.targetVisualizationIndex)})}catch(e){return Promise.reject(e)}}_filterDuplicateVizs(e,t){return e.filter((e,n,r)=>{const i=r.findIndex(t=>t.appId===e.appId);return t?i!==n:i===n})}_addGroupInformation(e){const t=[],n=[];let r;k(e).forEach(e=>{if(e.persConfig?.isDefaultSection){t.push(e)}else{r=n.find(t=>t.isSection&&t.id===e.persConfig?.sectionId);if(!r){n.push({id:e.persConfig?.sectionId,index:e.persConfig?.sectionIndex,title:e.persConfig?.sectionTitle||"",badge:"1",BGColor:y().key,icon:"sap-icon://folder-full",isSection:true,isPresetSection:e.persConfig?.isPresetSection,apps:[e]})}else{r.apps?.push(e);r.badge=r.apps?.length.toString()}}});return[...n,...this._filterDuplicateVizs(t,false)]}moveSection(e,t){try{return Promise.resolve(s.getServiceAsync("Pages").then(function(n){const r=n.getPageIndex(D);return n.moveSection(r,e,t)}))}catch(e){return Promise.reject(e)}}_getFeatureToggles(){try{let e=C+"?$filter=";const t=Object.keys(b);const n=t.map(e=>"ToggleId eq '"+b[e]+"'").join(" or ");e=e+"("+n+")";return Promise.resolve(O.GetJSON(e)).then(function(e){const t=e;if(t?.error){throw new Error(t.error.message)}return t?.value||[]})}catch(e){return Promise.reject(e)}}isFeatureEnabled(t){try{const n=this;return Promise.resolve(_(function(){return Promise.resolve(n._getFeatureToggles()).then(function(e){const n=e.find(e=>e.ToggleId===t);return!n||n.State===""?false:true})},function(t){e.error("Unable to load feature toggles: "+t.message);return false}))}catch(e){return Promise.reject(e)}}isURLParamEnabled(e){const t=new URLSearchParams(window.location.search);return t?.get(e)?.toLowerCase()==="true"||false}_getRecommenedFioriIds(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{let n=false;const r=this;function i(e){return n?e:r.recommendedFioriIds}const o=function(){if(!r.recommendedFioriIds||t){return _(function(){return Promise.resolve(O.GetJSON(E)).then(function(e){const t=e;r.recommendedFioriIds=t?.value?.map(e=>e.app_id)||[]})},function(t){e.error("Unable to load recommendations: "+t.message);const r=Promise.resolve([]);n=true;return r})}}();return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}}_getCatalogApps(){try{let t=false;const n=this;function r(e){return t?e:Promise.resolve(n.catalogAppData)}const i=function(){if(!n.catalogAppData){return _(function(){return Promise.resolve(s.getServiceAsync("SearchableContent")).then(function(e){n.catalogAppData=e.getApps({includeAppsWithoutVisualizations:false});const r=n.catalogAppData;t=true;return r})},function(r){n.catalogAppData=undefined;e.error(r instanceof Error?"Error while fetching catalog apps:"+r.message:String(r));const i=[];t=true;return i})}}();return Promise.resolve(i&&i.then?i.then(r):r(i))}catch(o){return Promise.reject(o)}}isAddCardToInsightsHidden(e){return e?.component?.settings?.tableSettings?.addCardtoInsightsHidden}_checkValidManifests(e){const t=e["sap.app"]?.dataSources;const n=e["sap.ui.generic.app"]&&t?.mainService;if(!n){return false}const r=e["sap.ui.generic.app"]?.pages;if(Array.isArray(r)){return this.recommendedUtilInstance._isListReport(r[0])&&!this.isAddCardToInsightsHidden(r[0])}const i=Object.values(r);if(i.length>0){return i.some(e=>typeof e==="object"&&this.recommendedUtilInstance._isListReport(e)&&!this.isAddCardToInsightsHidden(e))}return false}_getOdataModel(e){return new Promise(function(t){const n=e?.["sap.app"]?.dataSources;const r=n?.mainService;let o=(r?.settings?.annotations||[]).map(e=>n?.[e]?.uri||"").filter(Boolean);const s=new i(r?.uri,{annotationURI:o,loadAnnotationsJoined:true});s.attachMetadataLoaded(()=>{t(s)});s.attachMetadataFailed(()=>{t(s)})})}_getEntitySet(e){const t=e["sap.ui.generic.app"]?.pages;if(Array.isArray(t)){return t[0].entitySet}else if(t){for(const e in t){const n=t[e];if(this.recommendedUtilInstance._isListReport(n)){return n.entitySet}}}return undefined}loadI18n(e,n){try{const r=this;function i(){return r._RBManifestMap[s]}const o=e?.["sap.app"]?.["i18n"]?.["bundleUrl"];const s=new URL(o,n).href;r._RBManifestMap=r._RBManifestMap||{};const a=function(){if(!r._RBManifestMap[s]){return Promise.resolve(t.create({bundleUrl:s,async:true,terminologies:e["sap.app"]?.["i18n"]?.["terminologies"]})).then(function(e){r._RBManifestMap[s]=e})}}();return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(c){return Promise.reject(c)}}getI18nValueOrDefaultString(e,t){let n="";if(e&&e.startsWith("{{")){n=e.substring(2,e.length-2)}else if(e&&e.startsWith("{")){n=e.substring(1,e.length-1)}return n?t.getText(n):e}_getAnalyticalCardManifest(){return JSON.parse(JSON.stringify(P))}getProcessedManifest(t,n,r,i){try{const o=this;return Promise.resolve(_(function(){function e(){return o.recommendedUtilInstance._createCardManifest(m,i,s,h)}const s=n.manifest;const a=o._getEntitySet(s);if(!a){return undefined}const c=t.getODataEntitySet(a);const u=o.recommendedUtilInstance.getLineItemDetails(t,s,a);if(!u?.lineItem){return undefined}const l=u.entitySet||a;const f=l===a?c:t.getODataEntitySet(l);const d=t.getODataEntityType(f.entityType);const h=u?.lrSettings?.["bSupressCardRowNavigation"];if(o.recommendedUtilInstance.hasMandatoryProperties(f,d?.property)){return undefined}const p=o.recommendedUtilInstance._getParametersisedEntitySetParams(t,l,true);if(p?.entitySetName&&p?.parameters?.length){const e=t.getODataEntitySet(p.entitySetName);if(o.recommendedUtilInstance.hasMandatoryProperties(e,p.parameters)){return undefined}}const m=o.recommendedUtilInstance._getManifestCardData(s,u,r,t);if(m.columns.length<S){return undefined}const g=u?.headerInfo;const v=g.TypeNamePlural?.String||"";m.cardTitle=v||m.cardTitle;const P=function(){if(!v&&s["sap.app"]?.i18n){const e=s["sap.app"].i18n.bundleUrl;const t=s["sap.app"].title;const r=function(){if(e&&(t.startsWith("i18n>")||t.startsWith("{"))){return Promise.resolve(o.loadI18n(s,n.url)).then(function(e){m.cardTitle=o.getI18nValueOrDefaultString(m.cardTitle,e)})}}();if(r&&r.then)return r.then(function(){})}}();return P&&P.then?P.then(e):e(P)},function(t){e.error("Error while processing manifest",t instanceof Error?t.message:String(t));return undefined}))}catch(e){return Promise.reject(e)}}fetchMetaModels(t){try{const n=this;const r=t.map(function(t){try{return Promise.resolve(_(function(){return Promise.resolve(n._getOdataModel(t.manifest)).then(function(e){return e?.getMetaModel()})},function(t){e.error("Error while fetching metamodel",t instanceof Error?t.message:String(t));return undefined}))}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(r))}catch(e){return Promise.reject(e)}}combineManifestsAndMetaModels(e,t){return e.reduce((e,n,r)=>{const i=t[r];if(i){e.push({manifest:n,metaModel:i})}return e},[])}processManifests(e,t){try{const n=this;return Promise.all(e.map(e=>{const r=t.find(t=>t.resolutionResult?.ui5ComponentName===e.manifest.manifest?.["sap.app"]?.id);return n.getProcessedManifest(e.metaModel,e.manifest,r,n.versionInfo)}))}catch(e){return Promise.reject(e)}}processAppList(e,t,n){if(!e&&t&&t.length){return t.reduce((e,t)=>{const r=n?.[t.id]||[];const i=r.find(e=>e.semanticObject===t.target?.semanticObject&&e.action===t.target?.action);return i?[...e,i.fioriId]:e},[])}return e||[]}_getCardManifest(t,r){try{const i=this;return Promise.resolve(_(function(){return Promise.resolve(Promise.all([i._getCatalogApps(),i.getFioriAppData()])).then(function(e){let[o,s]=e;return Promise.resolve(n.load()).then(function(e){i.versionInfo=e;const n=Object.values(s).flat();const a=i.componentData;const c=i.processAppList(t,r,a);return Promise.resolve(i.fetchManifests(c,s,o)).then(function(e){const t=e.filter(e=>i._checkValidManifests(e.manifest));return Promise.resolve(i.fetchMetaModels(t)).then(function(e){const r=i.combineManifestsAndMetaModels(t,e);return Promise.resolve(i.processManifests(r,n)).then(function(e){return e.filter(e=>e!==undefined)})})})})})},function(t){e.error("Error while fetching card manifest",t instanceof Error?t.message:String(t));return[]}))}catch(e){return Promise.reject(e)}}fetchManifests(t,n,r){try{return Promise.resolve(_(function(){const i=t.map(function(t){try{let i=false;const o=n[t]||[];const s=I(o,function(t){const n=r.find(e=>t.semanticObject===e.target?.semanticObject&&t.action===e.target?.action);const o=t?.resolutionResult?.applicationDependencies?.manifest;return function(){if(n&&o){return _(function(){return Promise.resolve(fetch(o)).then(function(e){return Promise.resolve(e.json()).then(function(t){const n=t;const r={url:e.url,manifest:n};i=true;return r})})},function(t){e.error("Error while fetching manifest",t instanceof Error?t.message:String(t));i=true;return undefined})}}()},function(){return i});return Promise.resolve(s&&s.then?s.then(function(e){return i?e:undefined}):i?s:undefined)}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(i)).then(function(e){return e.filter(e=>e!==undefined)})},function(t){e.error("Error while processing manifests",t instanceof Error?t.message:String(t));return[]}))}catch(e){return Promise.reject(e)}}_removeDuplicateCards(e){const t={};const n=[];e.forEach(e=>{const r=e?.descriptorContent?.["sap.card"]?.header?.title||"";if(!t[r]){n.push(e);t[r]=true}});return n}getRecommenedCards(){try{const t=this;return Promise.resolve(_(function(){return Promise.resolve(t._getRecommenedFioriIds()).then(function(e){return Promise.resolve(t._getCardManifest(e)).then(function(e){const n=e?.slice(0,V);const r=n?.map(e=>{let t;if(e?.["sap.card"]){e["sap.card"].rec=true;t=e["sap.app"]?.id}return{id:t,descriptorContent:e}});return t._removeDuplicateCards(r)})})},function(t){e.error("Error while fetching recommended cards:",t instanceof Error?t.message:String(t));return[]}))}catch(e){return Promise.reject(e)}}getRecommendedVisualizations(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;try{const t=this;function n(){return t._recommendedVisualizations}const r=function(){if(!t._recommendedVisualizations||e){return Promise.resolve(t._getRecommenedFioriIds(e)).then(function(n){const r=function(){if(n.length){let r=[];let i=[];return Promise.resolve(Promise.all([t._getVisualizationsByFioriIds(n),t._fetchMyHomeVizs(e)])).then(function(e){let[n,o]=e;n=n.filter(e=>q(e,o));n.forEach(e=>{if(H(e)){i.push(e)}else{r.push(e)}});t._recommendedVisualizations=r.slice(0,10-i.length).concat(i)})}else{t._recommendedVisualizations=[]}}();if(r&&r.then)return r.then(function(){})})}}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(i){return Promise.reject(i)}}_getInboundApps(){try{return Promise.resolve(_(function(){return Promise.resolve(s.getServiceAsync("ClientSideTargetResolution")).then(function(e){return e?._oAdapter?._aInbounds||[]})},function(t){e.error("Error while fetching inbound apps: "+t.message);return[]}))}catch(e){return Promise.reject(e)}}getFioriAppData(){try{const t=this;return Promise.resolve(_(function(){function e(){return t.fioriAppData}const n=function(){if(!Object.keys(t.componentData).length){t.componentData={};t.fioriAppData={};return Promise.resolve(t._getInboundApps()).then(function(e){e.forEach(e=>{const n=e?.signature?.parameters?.["sap-fiori-id"]?.defaultValue?.value;const r=e?.resolutionResult?.ui5ComponentName;if(n){const i={action:e.action,semanticObject:e.semanticObject,resolutionResult:e.resolutionResult};t.fioriAppData[n]=t.fioriAppData[n]||[];t.fioriAppData[n].push(i);if(r){const e={...i,fioriId:n};t.componentData[r]=t.componentData[r]||[];t.componentData[r].push(e)}}})})}}();return n&&n.then?n.then(e):e(n)},function(t){e.error(t instanceof Error?t.message:String(t));return{}}))}catch(e){return Promise.reject(e)}}_getVisualizationsByFioriIds(e){try{const t=this;const n=[];const r=new Map;return Promise.resolve(Promise.all([t._getInboundApps(),t._getCatalogApps()])).then(function(t){let[i,o]=t;e.forEach(e=>{const t=i.filter(function(t){return t?.signature.parameters["sap-fiori-id"]?.defaultValue?.value===e});t.forEach(t=>{let i=o.filter(e=>e?.target?.semanticObject===t.semanticObject&&e.target.action===t.action);const s=i.filter(e=>G(e));const a=i.filter(e=>!G(e));if(s.length>0&&a.length>0){i=[...a]}i.forEach(t=>{let i=t.visualizations[0];let o={title:i.title,subtitle:i.subtitle,icon:i.icon,url:i.targetURL,vizId:i.vizId,fioriId:e,visualization:i};if(!r.has(o.url)||!r.has(o.title)){r.set(o.url,true);r.set(o.title,true);n.push(o)}})})});return n})}catch(e){return Promise.reject(e)}}_getAllFavPageApps(t,n){try{let r=false;const i=this;return Promise.resolve(_(function(){function e(e){return r?e:[]}const o=function(){if(t){i._favPageVisualizations=i._favPageVisualizations||[];const e=i._favPageVisualizations.reduce((e,t)=>{if(t.pageId&&!e.includes(t.pageId)){e.push(t.pageId)}return e},[]);const o=t.map(e=>e.pageId);const s=e.length===0||!e.every(e=>o.includes(e));if(!n&&!s){const e=i._favPageVisualizations;r=true;return e}else{return Promise.resolve(i._loadAllPageVisualizations(t)).then(function(e){i._favPageVisualizations=e;const t=i._favPageVisualizations;r=true;return t})}}}();return o&&o.then?o.then(e):e(o)},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}}_loadAllPageVisualizations(t){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const r=e=>t.find(t=>t.pageId===e)?.BGColor??y().key;return Promise.resolve(_(function(){const e=[];return Promise.resolve(s.getServiceAsync("SpaceContent")).then(function(i){return Promise.resolve(i.getPages(t.map(e=>e.pageId))).then(function(t){const i=Object.values(t);for(const t of i){const i=t.sections||[];for(const o of i){const i=o.visualizations||[];for(const o of i){const i={appId:o.targetURL,vizId:o.vizId,icon:o.icon,BGColor:r(t.id),pageId:t.id};if(!n||!e.some(e=>e.appId===i.appId)){e.push(i)}}}}return e})})},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}}}return Q});
|
|
307
347
|
/*!
|
|
308
348
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
309
349
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -323,7 +363,7 @@ sap.ui.predefine("sap/cux/home/utils/ColorUtils", ["./Constants"],function(t){"u
|
|
|
323
363
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
324
364
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
325
365
|
*/
|
|
326
|
-
sap.ui.predefine("sap/cux/home/utils/Constants", ["sap/ui/core/theming/Parameters"],function(
|
|
366
|
+
sap.ui.predefine("sap/cux/home/utils/Constants", ["sap/ui/core/theming/Parameters"],function(_){"use strict";const E=E=>({key:E,value:_.get({name:E}),assigned:false});const o="/sap/opu/odata4/ui2/insights_srv/srvd/ui2/";const e=o+"insights_read_srv/0001/";const s="SAP_BASIS_PG_UI_MYHOME";const A="3WO90XZ1DX1AS32M7ZM9NBXEF";const S="sap-icon://document";const n="sap-icon://product";const a="AZHJGRIT78TG7Y65RF6EPFJ9U";const I="SAP_BASIS_SP_UI_MYHOME";const T=()=>E("sapLegendColor9");const r=8;const t=()=>["sapLegendColor6","sapLegendColor3","sapLegendColor1","sapLegendColor10","sapLegendColor12","sapLegendColor7","sapLegendColor5","sapLegendColor8","sapLegendColor18","sapLegendColor9"].map(E);const L=()=>["sapLegendColor19","sapLegendColor13","sapLegendColor11","sapLegendColor20","sapLegendColor2","sapLegendColor17","sapLegendColor15","sapLegendColor14","sapLegendColor16","sapLegendColor4"].map(E);const p={FAVORITE:"FAVORITE",RECENT:"RECENT",FREQUENT:"FREQUENT"};const N=5;const R=4;const C=e+"RecommendedApps";const d={TASK_ACTIONS:"/UI2/S4HOME_FEATURE_TOGGLE",AI_GENERATED_CARD:"AIU_SMART_PERSONALIZATION",AI_SMART_APPFINDER:"AIU_SMART_APPFINDER"};const c=e+"FeatureToggle";const P=o+"insights_cards_repo_srv/0001/";const O="/sap/opu/odata4/sap/sui_flp_aps_ui_usernews/srvd_a2x/sap/sui_flp_aps_ui_usernews/0001/NewsGroup?$expand=_group_to_image,_group_to_article&$format=json";var i=function(_){_["LAYOUT"]="LAYOUT";_["NEWS"]="NEWS";_["PAGES"]="PAGES";_["INSIGHTS_TILES"]="INSIGHTS_TILES";_["INSIGHTS_CARDS"]="INSIGHTS_CARDS";_["ADVANCED"]="ADVANCED";return _}(i||{});var u=function(_){_["LAYOUT"]="KEYUSER_LAYOUT";_["NEWS_PAGES"]="KEYUSER_NEWS_PAGES";_["NEWS"]="KEYUSER_NEWS";_["PAGES"]="KEYUSER_PAGES";return _}(u||{});var l=function(_){_["AI_APP_FINDER"]="AI_APP_FINDER";_["AI_INSIGHTS_CARDS"]="AI_INSIGHTS_CARDS";return _}(l||{});const D={GRID:"GridTable",TREE:"TreeTable",ANALYTICAL:"AnalyticalTable",RESPONSIVE:"ResponsiveTable",STANDARD_LIST:"StandardList",OBJECT_LIST:"ObjectList"};const g=3;const G="/sap/opu/odata4/sap/aiu_ui_prompt/srvd/sap/aiu_ui_prompt/0001/";const U=G+"SmartAppFinder/SAP__self.ExecuteAppFinderFromUserInput";var F={__esModule:true};F.fnFetchLegendColor=E;F.MYHOME_PAGE_ID=s;F.MYAPPS_SECTION_ID=A;F.FALLBACK_ICON=S;F.DEFAULT_APP_ICON=n;F.MYINSIGHT_SECTION_ID=a;F.MYHOME_SPACE_ID=I;F.DEFAULT_BG_COLOR=T;F.PAGE_SELECTION_LIMIT=r;F.LEGEND_COLORS=t;F.END_USER_COLORS=L;F.AppTypes=p;F.PLACEHOLDER_ITEMS_COUNT=N;F.RECOMMENDED_CARD_LIMIT=R;F.RECOMMENDATION_SRVC_URL=C;F.FEATURE_TOGGLES=d;F.FEATURE_TOGGLE_SRVC_URL=c;F.REPO_BASE_URL=P;F.DEFAULT_NEWS_URL=O;F.SETTINGS_PANELS_KEYS=i;F.KEYUSER_SETTINGS_PANELS_KEYS=u;F.CONTENT_ADDITION_PANEL_TYPES=l;F.TABLE_TYPES=D;F.COLUMN_LENGTH=g;F.AI_APP_FINDER_BASE_URL=G;F.AI_APP_FINDER_API=U;return F});
|
|
327
367
|
/*!
|
|
328
368
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
329
369
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -338,7 +378,7 @@ sap.ui.predefine("sap/cux/home/utils/DecisionDialog", ["sap/base/Log","sap/m/Mes
|
|
|
338
378
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
339
379
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
340
380
|
*/
|
|
341
|
-
sap.ui.predefine("sap/cux/home/utils/Device", ["sap/ui/Device"],function(
|
|
381
|
+
sap.ui.predefine("sap/cux/home/utils/Device", ["sap/ui/Device"],function(t){"use strict";const e={Mobile:624,Tablet:1024,Desktop:1135};var i=function(t){t["Mobile"]="Mobile";t["Tablet"]="Tablet";t["Desktop"]="Desktop";t["LargeDesktop"]="LargeDesktop";return t}(i||{});function n(){let n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:t.resize.width;if(n<e.Mobile||t.system.phone){return i.Mobile}else if(n<e.Tablet){return i.Tablet}else if(n<e.Desktop){return i.Desktop}else{return i.LargeDesktop}}function a(t,e){const i={};e.forEach(e=>{i[e]=parseFloat(window.getComputedStyle(t).getPropertyValue(e))});return i}function r(t){const e=16;if(n()===i.Mobile){const e=76;if(t.totalCards===1){return Math.max(t.minWidth,Math.min(t.containerWidth,t.maxWidth))}else{const i=t.containerWidth-e;return Math.max(t.minWidth,Math.min(i,t.maxWidth))}}let a;if(n()===i.Tablet&&t.totalCards>1){const i=e;const n=(t.containerWidth-i)/2;if(n>=t.minWidth&&n<=t.maxWidth){a=2}else{a=1}}else{let i=1;while(t.containerWidth/i>=t.minWidth+e){i++}i--;a=Math.max(Math.min(i,t.totalCards),Math.min(t.totalCards,3))}if(a<=0)return t.minWidth;const r=(a-1)*e;const o=(t.containerWidth-r)/a;return Math.min(Math.max(o,t.minWidth),t.maxWidth)}var o={__esModule:true};o.DeviceType=i;o.calculateDeviceType=n;o.fetchElementProperties=a;o.calculateCardWidth=r;return o});
|
|
342
382
|
/*!
|
|
343
383
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
344
384
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -363,7 +403,7 @@ sap.ui.predefine("sap/cux/home/utils/IconList", [],function(){"use strict";const
|
|
|
363
403
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
364
404
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
365
405
|
*/
|
|
366
|
-
sap.ui.predefine("sap/cux/home/utils/InsightsUtils", ["sap/ui/core/Element","./FESRUtil"],function(e,t){"use strict";const n=t["addFESRId"];const
|
|
406
|
+
sap.ui.predefine("sap/cux/home/utils/InsightsUtils", ["sap/ui/core/Element","./FESRUtil"],function(e,t){"use strict";const n=t["addFESRId"];const c=t=>e.getElementById(t.getAssociation("fullScreenMenuItem",null));const s=t=>e.getElementById(t.getAssociation("fullScreenButton",null));const o=(e,t,s)=>{const o=c(e);const r=o?.clone(t);if(s){n(r,s)}return r};const r=(e,t,c)=>{const o=s(e);const r=o?o.clone(t):null;if(c&&r){n(r,c)}return r};const u=(e,t)=>t?.sort((t,n)=>{const c=t.getId();const s=n.getId();const o=e.findIndex(e=>c.includes(e));const r=e.findIndex(e=>s.includes(e));return o-r});const l=(e,t)=>{if(e&&t){if(Object.keys(e).length===0&&Object.keys(t).length===0){return true}else if(Object.keys(e).length&&Object.keys(t).length){return e.semanticObject===t.semanticObject&&e.action===t.action}}return false};var i={__esModule:true};i.getAssociatedFullScreenMenuItem=c;i.getAssociatedFullScreenButton=s;i.createShowMoreMenuItem=o;i.createShowMoreActionButton=r;i.sortMenuItems=u;i.targetsAreEqual=l;return i});
|
|
367
407
|
/*!
|
|
368
408
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
369
409
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -383,7 +423,7 @@ sap.ui.predefine("sap/cux/home/utils/PagesIconsConstants", [],function(){"use st
|
|
|
383
423
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
384
424
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
385
425
|
*/
|
|
386
|
-
sap.ui.predefine("sap/cux/home/utils/PerformanceUtils", ["sap/ushell/Container","sap/ushell/utils"],function(e,t){"use strict";const
|
|
426
|
+
sap.ui.predefine("sap/cux/home/utils/PerformanceUtils", ["sap/ushell/Container","sap/ushell/EventHub","sap/ushell/utils"],function(e,t,n){"use strict";const o=function(e){try{if(!e||f)return Promise.resolve();const t=e.getItems();t.forEach(e=>{e.getContent().forEach(t=>{t.attachEventOnce("loaded",function(){try{const t=e.getMetadata().getName();const n=l.filter(e=>e.control?.getVisible())[0].name;const o=function(){if(t===n){return Promise.resolve(r()).then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})})});const n=l.filter(n=>{n.control=n.name===i?e:t.find(e=>e.getMetadata().getName()===n.name);return n.control?.getVisible()});f=true;return Promise.resolve(s()).then(function(){const e=function(){if(n.length===1){return Promise.resolve(r()).then(function(){})}}();if(e&&e.then)return e.then(function(){})})}catch(e){return Promise.reject(e)}};const r=function(){return Promise.resolve(c()).then(function(e){if(e){P(i,u);t.emit("CustomHomeRendered")}})};const s=function(){return Promise.resolve(c()).then(function(e){if(e){g(i,a)}})};const c=function(){try{return Promise.resolve(e.getServiceAsync("AppLifeCycle")).then(function(e){return e.getCurrentApplication()?.homePage})}catch(e){return Promise.reject(e)}};const i="sap.cux.home.Layout";const a="FLP-TTI-Homepage-Custom-Start";const u="FLP-TTI-Homepage-Custom";let f=false;const m={"sap.cux.home.AppsContainer":"Apps","sap.cux.home.InsightsContainer":"Insights","sap.cux.home.NewsAndPagesContainer":"News","sap.cux.home.ToDosContainer":"ToDos",[i]:"Layout"};let l=Object.keys(m).map(e=>({name:e,startMarked:false,endMarked:false}));function h(e){return l.find(t=>t.name===e)}function d(e){n.setPerformanceMark(e,{bUseUniqueMark:true,bUseLastMark:true})}function p(e,t,n){const o=h(e);const r=n?"Start":"End";const s=n?"startMarked":"endMarked";if(o&&!o[s]&&o.control?.getVisible()){o[s]=true;d(t||`FLP-Homepage-Section-${r}[${m[e]}]`)}}function g(e,t){p(e,t,true)}function P(e,t){p(e,t,false)}var v={__esModule:true};v.UIElements=m;v.setupPerformanceTracking=o;v.recordElementLoadStart=g;v.recordElementLoadEnd=P;return v});
|
|
387
427
|
/*!
|
|
388
428
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
389
429
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -393,7 +433,12 @@ sap.ui.predefine("sap/cux/home/utils/PersonalisationUtils", ["sap/ui/base/Object
|
|
|
393
433
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
394
434
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
395
435
|
*/
|
|
396
|
-
sap.ui.predefine("sap/cux/home/utils/SituationUtils", ["sap/base/i18n/Formatting","sap/base/Log","sap/fe/navigation/NavigationHandler","sap/fe/navigation/SelectionVariant","sap/ui/core/format/DateFormat","sap/ui/core/format/NumberFormat","sap/ui/model/odata/v4/ODataModel"],function(t,e,a,n,i,r,o){"use strict";let c;let s;let u;const m=()=>{if(!c){const e=t.getDatePattern("medium")||"dd/MM/yyyy";c=i.getDateInstance({pattern:e})}return c};const S=()=>{if(!s){s=r.getFloatInstance({decimalSeparator:t.getNumberSymbol("decimal")||".",groupingSeparator:t.getNumberSymbol("group")||",",groupingEnabled:true})}return s};const l=function(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!t?.split){return t}let a=t.replaceAll("\n"," ");e.forEach(t=>{if(t.SitnInstceAttribName?.length>0){const e=`0${t.SitnInstceAttribSource}`;const n=`${e}.${t.SitnInstceAttribName}`;const i=t._InstanceAttributeValue.reduce(function(e,a){if(a.SitnInstceAttribSource===t.SitnInstceAttribSource&&a.SitnInstceAttribName===t.SitnInstceAttribName){e.push(a)}return e},[]);const r=[];i.forEach(e=>{let a=e?.SitnInstceAttribValue?.trim()||"";let n;switch(t.SitnInstceAttribEntityType){case"Edm.DateTime":n=m().format(m().parse(a));break;case"Edm.Decimal":if(a.endsWith("-")){a=`-${a.substring(0,a.length-1)}`}n=S().format(Number(a));break;default:n=a}r.push(n)});a=a.split(`{${n}}`).join(r.join(", "))}});return a};function f(t,e){return new Promise((i,r)=>{const o=new a(e);const c=new n;t._NavigationParam?.map(function(t){if(t.SituationNotifParamName){c.addSelectOption(t.SituationNotifParamName,"I","EQ",t.SituationNotifParameterVal)}});const s=c.toJSONString();o.navigate(t.SitnSemanticObject,t.SitnSemanticObjectAction,s,i,t=>r(t))})}function b(t,a){try{if(a==="1"){const e=g().bindContext(`/Navigation(${t})`,undefined,{$expand:{_NavigationParam:{$select:["SituationNotifParamName","SituationNotifParameterVal"]}},$select:["SitnInstanceID","SitnSemanticObject","SitnSemanticObjectAction"]});return e.requestObject()}else{return Promise.resolve({SitnInstanceID:t,SitnSemanticObject:"SituationInstance",SitnSemanticObjectAction:"display",_NavigationParam:[{SituationNotifParamName:"ui-type",SituationNotifParameterVal:"extended"},{SituationNotifParamName:"SitnInstceKey",SituationNotifParameterVal:t}]})}}catch(t){e.error(t instanceof Error?t.message:"")}}function g(){if(!u){u=new o({serviceUrl:"/sap/opu/odata4/sap/a_sitn2mblinstce_v4/srvd/sap/a_sitn2mblinstce_srv/0002/"})}return u}var d={__esModule:true};d.getSituationMessage=l;d.executeNavigation=f;d.fetchNavigationTargetData=b;return d});
|
|
436
|
+
sap.ui.predefine("sap/cux/home/utils/RecommendedCardUtil", ["sap/base/i18n/Formatting","sap/base/Log","sap/base/security/encodeURL","sap/base/strings/formatMessage","sap/base/util/deepExtend","sap/ui/base/Object","sap/ui/core/library","../interface/CardsInterface","./Constants","./DataFormatUtils"],function(t,e,a,i,n,r,s,o,l,c){"use strict";const p=o["UIAnnotations"];const u=l["TABLE_TYPES"];const d=c["sortCollectionByImportance"];const f=3;const h=s.ValueState;var g=function(t){t["DataField"]="com.sap.vocabularies.UI.v1.DataField";t["Importance"]="com.sap.vocabularies.UI.v1.Importance";t["DataFieldWithNavigationPath"]="com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath";t["DataFieldWithIntentBasedNavigation"]="com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation";t["DataFieldForIntentBasedNavigation"]="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation";t["Chart"]="@com.sap.vocabularies.UI.v1.Chart";t["FieldGroup"]="@com.sap.vocabularies.UI.v1.FieldGroup";t["DataPoint"]="@com.sap.vocabularies.UI.v1.DataPoint";t["Contact"]="@com.sap.vocabularies.Communication.v1.Contact";t["DataFieldForAction"]="com.sap.vocabularies.UI.v1.DataFieldForAction";t["DataFieldForAnnotation"]="com.sap.vocabularies.UI.v1.DataFieldForAnnotation";t["DataFieldWithUrl"]="com.sap.vocabularies.UI.v1.DataFieldWithUrl";t["CriticalityRepresentationTypeWithoutIcon"]="com.sap.vocabularies.UI.v1.CriticalityRepresentationType/WithoutIcon";t["FieldControlHiddenType"]="com.sap.vocabularies.Common.v1.FieldControlType/Hidden";return t}(g||{});var y=function(t){t["DataFieldWithNavigationPath"]="DataFieldWithNavigationPath";t["DataFieldWithIntentBasedNavigation"]="DataFieldWithIntentBasedNavigation";t["DataFieldForIntentBasedNavigation"]="DataFieldForIntentBasedNavigation";t["DataFieldForAction"]="DataFieldForAction";t["DataFieldForAnnotation"]="DataFieldForAnnotation";return t}(y||{});class m extends r{static getInstance(){if(!m.Instance){m.Instance=new m}return m.Instance}getLineItemDetails(t,e,a){const i=t.getODataEntitySet(a);const n=this.getLineItemFromVariant(t,i.entityType);const r=n.lineItem;const s=e["sap.ui.generic.app"]?.pages;const o=this.getSettingsForPage(s);if(!o.quickVariantSelectionX){return this.createDefaultLineItemDetails(t,n,o,a,r)}const l=o.quickVariantSelectionX.variants||{};const{firstAvailableKey:c,sEntitySet:p,oVariant:u}=this.findFirstNonSmartChartVariant(t,l,a);if(u.isSmartChart){return this.createDefaultLineItemDetails(t,n,o,a,r)}delete o.requestAtLeastFields;const d=this.getNormalizedTableSettings(t,o,a);const f=t?.getODataEntitySet(p);const h=this.getLineItemFromVariant(t,f.entityType,u.annotationPath?.split("#")[1]);const g=h.lineItem;const y=h.presentationVariant;o.requestAtLeastFields=y?.RequestAtLeast?.length?y.RequestAtLeast:this._getRequestAtLeastFields(y);u.tableSettings=this.getNormalizedTableSettings(t,{...u,tableSettings:u.tableSettings||d},p);this.validateResponsiveTable(o,u,c);delete o.tableSettings;o.isResponsiveTable=o.isResponsiveTable===undefined||o.isResponsiveTable;const m={quickVariant:u,lrSettings:o,lineItem:g,entitySet:p,headerInfo:u?.tableSettings?.headerInfo||""};return g?m:this.createDefaultLineItemDetails(t,n,o,a,r)}findFirstNonSmartChartVariant(t,e,a){let i=null;let n=a;let r={};for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;r=e[s];n=r.entitySet||a;const o=t.getODataEntitySet(n);if(o){r.isSmartChart=this.checkIfSmartChart(t,n,r);if(!r.isSmartChart){i=s;break}}else{r.isSmartChart=true}}return{firstAvailableKey:i,sEntitySet:n,oVariant:r}}validateResponsiveTable(t,a,i){const n=a.tableSettings?.type===u.RESPONSIVE;if(t.isResponsiveTable===undefined){t.isResponsiveTable=n}else if(t.isResponsiveTable!==n){e.error(`Variant with key ${i} resulted in invalid Table Type combination.`)}}createDefaultLineItemDetails(t,e,a,i,n){a.tableSettings=this.getNormalizedTableSettings(t,a,i);a.isResponsiveTable=a.tableSettings.type===u.RESPONSIVE;if(e?.presentationVariant?.RequestAtLeast?.length){a.requestAtLeastFields=e.presentationVariant.RequestAtLeast}return{quickVariant:{},lrSettings:a,lineItem:n,entitySet:i,headerInfo:a?.tableSettings?.headerInfo||""}}getLineItemFromVariant(t,e,a){const i=this.getAnnotation(t,e,p.UISelectionPresentationVariant,a);let n;if(i?.PresentationVariant){n=this.getPresentationVariant(t,e,i.PresentationVariant)}else{n=this.getAnnotation(t,e,p.UIPresentationVariant,a)}const r=n?this.getLineItem(t,e,n):null;const s=r?.lineItem||this.getAnnotation(t,e,p.UILineItem,"");return{presentationVariant:n,lineItem:s,qualifierPath:r?.annotationPath||""}}getAnnotation(t,e,a,i){const n=`${a}${i?`#${i}`:""}`;const r=t.getODataEntityType(e);return r?.[n]}getPresentationVariant(t,e,a){const i=a?.PresentationVariant;if(i?.Path){return this.getObject(t,e,i.Path)}return i}getLineItem(t,e,a){let i=a.Visualizations?.find(function(t){return t.AnnotationPath?.includes(p.UILineItem)});return i?{lineItem:this.getObject(t,e,i.AnnotationPath),annotationPath:i.AnnotationPath,sQualifier:i.AnnotationPath?.split("#")[1]}:null}_getRelevantColumnPaths(t){t=Array.isArray(t)?t:[];const e=new Set;const a=new Set;t.forEach(t=>{if(t){const i=t["leadingProperty"];const n=t["additionalProperty"];const r=t["navigationProperty"];if(i){e.add(i)}this.extractPathAndInsertToSet(n,e);this.extractPathAndInsertToSet(r,a)}});return{select:Array.from(e),expand:Array.from(a)}}extractPathAndInsertToSet(t,e){t?.split(",").forEach(t=>{if(t){e.add(t)}})}extractAndExpandNavigationProperty(t,e,a,i){const n={};for(const r of e){let e=r.lastIndexOf("/");let s;if(e<0){if(!this.getNavigationProperty(t,r,i,n)){continue}s=r}else{s=r.substring(0,e)}if(!a.includes(s)){a.push(s)}}}getNavigationProperty(t,e,a,i){let n=i?.[t];if(!n){n={};i[t]=n;const e=a.getODataEntitySet(t);if(e){const t=a.getODataEntityType(e.entityType);if(t){const e=t.navigationProperty||[];e.forEach(t=>{const e=t.name;n[e]=t})}}}return n?.[e]||undefined}_addNecessaryFields(t,e,a){let i=a.getODataEntitySet(e.entitySet);let n=a.getODataEntityType(i.entityType);let r=[];if(t.length>0){if(e.lineItem&&typeof e.lineItem!=="string"){e.lineItem.forEach(t=>{if(t.RecordType===g.DataFieldWithIntentBasedNavigation||t.RecordType===g.DataFieldWithNavigationPath){const e=this.getDataFieldsWithNavigation(t,a,n);if(e?.length){r=r.concat(e)}}})}this.getFieldControlsPath(t,a,n,r)}r.forEach(e=>{this.ensureSelectionProperty(e,t)})}getFieldControlsPath(t,e,a,i){t.forEach(t=>{if(t){let n=e.getODataProperty(a,t)||{};if(p.CommonFieldControl in n){let t=n[p.CommonFieldControl];if(t?.Path){i.push(t.Path)}}}})}getDataFieldsWithNavigation(t,e,a){const i=[];const n=t.Value?.Path;if(n){const t=e.getODataProperty(a,n);const r=t?.[p.CommonText]?.Path;const s=t?.["sap:text"];i.push(s||r||n)}if(t.SemanticObject?.Path){i.push(t.SemanticObject.Path)}if(t.Action?.Path){i.push(t.Action.Path)}return i}getParameters(t,e,a,i){let n=i.select||[];let r=i.expand||[];let s=t?.lrSettings?.requestAtLeastFields||[];if(s.length>0){n=this._ensureSelectionProperties(n,s)}this._handleMandatorySelectionFields(a,n,e);this._addNecessaryFields(n,t,e);this.extractAndExpandNavigationProperty(a,n,r,e);return{expand:r.join(",")||undefined,select:n.join(",")||undefined}}_ensureSelectionProperties(t,e){for(const a of e){if(typeof a==="object"&&a?.PropertyPath&&!t.includes(a.PropertyPath)){t.push(a.PropertyPath)}}return t}_handleMandatorySelectionFields(t,e,a){const i=a.getODataEntitySet(t,false);const n=a.getODataEntityType(i.entityType,false);n.key.propertyRef.forEach(t=>{this.ensureSelectionProperty(t.name,e)})}ensureSelectionProperty(t,e){t?.split(",").forEach(function(t){if(t&&!e.includes(t)){e.push(t)}})}_createCardManifest(t,e,a,i){let n=a["sap.ui"];let r=a["sap.app"];let s=0;if(r?.["crossNavigation"]){delete r["crossNavigation"]}if(r){Object.assign(r,{type:"card",id:`user.${t.id}.${Date.now()}`,title:t.cardTitle||"",subTitle:t.subTitle})}let o={"sap.ui":n,"sap.app":this.createManifestSapApp(r),"sap.card":this.createManifestSapCard(a,t),"sap.ui5":this.createSapui5()};const l=o?.["sap.card"]?.content;t.columns.slice(0,f).forEach(t=>{const e=this._getAttributeValue(t);if(t.identifier&&l?.item){l.item.title={value:e,identifier:true}}else if(l?.item?.attributes){l.item.attributes[s]={value:e,visible:true,...t.state&&{state:t.state,showStateIcon:t.showStateIcon}};s++}});if(i&&l?.item){l.item.actions=[]}return{...o,"sap.insights":{parentAppId:t.id,cardType:"RT",versions:{ui5:`${e.version}-${e.buildTimestamp}`},visible:true}}}_getAttributeValue(e){let a=!e.value.startsWith("{")?"{= extension.formatters.stringFormatter(${"+e.path+"}) }":e.value;if(e.type==="Edm.Date"||e.type==="Edm.DateTime"){const i=JSON.stringify({pattern:t.getDatePattern("short")});a="{=${"+e.path+"}?format.dateTime(${"+e.path+"}, "+i+") : ''}"}return a}createManifestSapApp(t){const e=n({},t);if(e?.dataSources?.mainService){e.dataSources["filterService"]=e.dataSources.mainService;if(e.dataSources["filterService"]?.settings){e.dataSources["filterService"].settings["odataVersion"]="2.0"}}return e}createManifestSapCard(t,e){const a=t["sap.app"]?.dataSources;const i=a?.mainService?.uri;const n=e.entitySet;const r="__count";const s={text:"{= ${"+r+"} === '0' ? '' : ${"+r+"} }"};let o={type:"List"};o["configuration"]=this.createManifestSapCardConfig(i||"",n);o["data"]=this.createManifestSapCardData(i||"",e.url);o["header"]={title:e.cardTitle,subTitle:"",actions:[],status:s,data:{path:"/content/d"}};o["extension"]="module:sap/insights/CardExtension";o["content"]={data:{path:"/content/d/results"},maxItems:5,item:{actions:[],attributesLayoutType:"OneColumn",attributes:[]}};this.addCardActions(o,e.semanticObject,e.action);return o}addCardActions(t,e,a){let i={ibnTarget:{semanticObject:e,action:a},sensitiveProps:[],ibnParams:{}};let n=[{type:"Navigation",parameters:"{= extension.formatters.getNavigationContext(${parameters>/headerState/value})}"}];let r=JSON.parse(JSON.stringify(i));let s=[{type:"Navigation",parameters:"{= extension.formatters.getNavigationContext(${parameters>/contentState/value}, ${})}"}];if(t.configuration?.parameters){t.configuration.parameters.headerState={value:JSON.stringify(i)};t.configuration.parameters.contentState={value:JSON.stringify(r)}}if(t.header){t.header.actions=n}if(t?.content?.item){t.content.item.actions=s}}createManifestSapCardConfig(t,e){const a={parameters:{_relevantODataFilters:{value:[]},_relevantODataParameters:{value:[]},_entitySet:{value:e},_urlSuffix:{value:"/Results"}},destinations:{service:{name:"(default)",defaultUrl:"/"}},csrfTokens:{token1:{data:{request:{url:"{{destinations.service}}"+t,method:"HEAD",headers:{"X-CSRF-Token":"Fetch"}}}}}};return a}createSapui5(){return{_version:"1.1.0",contentDensities:{compact:true,cozy:true},dependencies:{libs:{"sap.insights":{lazy:false}}}}}createManifestSapCardData(t,e){const a={content:{method:"GET",url:e,headers:{Accept:"application/json"}}};const i={request:{url:"{{destinations.service}}"+t+"/$batch",method:"POST",headers:{"X-CSRF-Token":"{{csrfTokens.token1}}"},batch:a}};return i}_getManifestCardData(t,e,a,i){const n=t["sap.app"];const r=n?.dataSources;const s=r?.mainService?.uri||"";const o=e.lineItem;const l=e.entitySet;const c=i.getODataEntitySet(l);const u=i.getODataEntityType(c?.entityType);const f=`${s.replace(/\/$/,"")}/${l}`;const h=o?.map(t=>this._getColumnDetail(l,i,t)).filter(t=>t!==undefined);const g=this._getRelevantColumnPaths(h);const y=this.getParameters(e,i,l,g);const m=this.createCustomParams(y);const S=m?`${f}?$top=5&skip=0&${m}&$inlinecount=allpages`:`${f}?$top=5&skip=0`;const P=d(h).map(t=>({path:t?.path,type:t?.type,value:t?.value,identifier:t?.identifier,state:t?.state,showStateIcon:t?.showStateIcon})).slice(0,4);return{cardTitle:t?.["sap.app"]?.title,subTitle:u[p.CommonLabel]?`Top 5 ${u[p.CommonLabel].String}`:"",url:S,semanticObject:a?.semanticObject||"",action:a?.action||"",id:t?.["sap.app"]?.id,columns:P,entitySet:l}}_getColumnDetail(t,e,a){let i;let n=e.getODataEntitySet(t);let r=e.getODataEntityType(n.entityType);if(a.Value?.Path){i=e.getODataProperty(r,a.Value.Path);let t=i[p.UIHidden];if(t?.Bool==="true"||t?.Bool===true){return undefined}if(this.isPropertyHidden(a)||!i||Object.keys(i).length===0){return undefined}}let s=this.createP13N(n,i,a,e);s=s.replace(/\\/g,"");let o=s?JSON.parse(s):{};if(!this.isSupportedColumn(o,a,e,n)){return undefined}if(i){o=this.getColumnObjectDetails(o,i,r,a);if(a?.[g.Importance]!==undefined){const t=a[g.Importance];o.importance=t}}return o}getColumnObjectDetails(t,e,a,i){let n=e[p.CommonText]?.Path||"";n="{"+n+"}";let r=e.name?"{"+e.name+"}":"";let s="";const o=a[p.CommonSemanticKey];const l=!!o&&o.some(function(t){return t.PropertyPath===e.name});let c=false;let u=undefined;if((i?.Criticality&&i?.Value?.Path)===e.name){u=i;c=true}if(e[p.MeasuresISOCurrency]?.Path){r=r.concat(" "+"{"+s+e[p.MeasuresISOCurrency]?.Path+"}")}if(e[p.MeasuresUnit]?.Path){r=r.concat(" "+"{"+s+e[p.MeasuresUnit]?.Path+"}")}if(e[p.CommonText]?.Path){let i=e[p.CommonText]?.[p.UITextArrangement];if(!i){i=a[p.UITextArrangement]}this._setColumnTextValue(i,t,n,r)}else{t["value"]=r;if(l){t["identifier"]=l}}if(c){t["state"]=this.buildExpressionForCriticalityColor(u);t["showStateIcon"]=u?.CriticalityRepresentation?.EnumMember!==g.CriticalityRepresentationTypeWithoutIcon||true}t["path"]=e[p.CommonText]?.Path||e.name;t["type"]=e.type;return t}buildExpressionForCriticalityColor(t){let a=h.None;let n;let r=t?.Criticality;let s=function(t){t["Negative"]="com.sap.vocabularies.UI.v1.CriticalityType/Negative";t["Critical"]="com.sap.vocabularies.UI.v1.CriticalityType/Critical";t["Positive"]="com.sap.vocabularies.UI.v1.CriticalityType/Positive";return t}({});if(r){n="'{'= ({0} === ''"+s.Negative+"'') || ({0} === ''1'') || ({0} === 1) ? ''"+h.Error+"'' : "+"({0} === ''"+s.Critical+"'') || ({0} === ''2'') || ({0} === 2) ? ''"+h.Warning+"'' : "+"({0} === ''"+s.Positive+"'') || ({0} === ''3'') || ({0} === 3) ? ''"+h.Success+"'' : "+"''"+h.None+"'' '}'";if(r?.Path){const t="${"+r.Path+"}";a=i(n,[t])}else if(r?.EnumMember){const t="'"+r.EnumMember+"'";a=i(n,[t])}else{e.warning("Case not supported, returning the default sap.ui.core.ValueState.None")}}else{e.warning("Case not supported, returning the default sap.ui.core.ValueState.None")}return a}_setColumnTextValue(t,e,a,i){let n=function(t){t["TextOnly"]="TextOnly";t["TextLast"]="TextLast";t["TextSeparate"]="TextSeparate";return t}({});const r=t?.EnumMember?.split("/")[1];let s;switch(r){case n.TextOnly:s=`{= $${a} === '' ? '' : $${a} }`;break;case n.TextLast:s=`{= $${i} === '' ? '' : $${i} }`+`{= $${a} === '' ? '' : ' (' + ($${a}) + ')' }`;break;case n.TextSeparate:s=`{= $${i} === '' ? '' : $${i} }`;break;default:s=`{= $${a} === '' ? '' : $${a} }`+`{= $${i} === '' ? '' : ' (' + ($${i}) + ')' }`;break}e["value"]=s}_getRequestAtLeastFields(t){return t&&Array.isArray(t.requestAtLeastFields)?t.requestAtLeastFields:[]}createCustomParams(t){const e=[];if(t?.expand){e.push("$expand="+a(t["expand"]))}if(t?.select){e.push("$select="+a(t["select"]))}return e.join("&")}getObject(t,e,a){if(a[0]!=="/"){a=t.getODataEntityType(e,true)+"/"+a}return t.getObject(a.replace(/@/g,""))}_isListReport(t){return t?.component?.name==="sap.suite.ui.generic.template.ListReport"}getSettingsForPage(t){if(!t){return{}}let e={};if(Array.isArray(t)&&this._isListReport(t[0])){const a=t[0];if(a?.component){const t=a.component;e=t?.settings||{};e.bSupressCardRowNavigation=this.shouldSuppressCardRowNavigation(a)}}else if(Object.keys(t).length){const a=Object.keys(t).find(e=>this._isListReport(t[e]));if(a){const i=t[a];if(i?.component){const t=i.component;e=t?.settings??{};e.bSupressCardRowNavigation=this.shouldSuppressCardRowNavigation(i)}}}return e}shouldSuppressCardRowNavigation(t){if(t.pages){if(Array.isArray(t.pages)){if(t.pages.length===0||t.pages[0]?.navigation){return true}}else{const e=Object.keys(t.pages);if(e.length===0||e.length&&t.pages[e[0]]?.navigation){return true}}}else{return true}if(t?.component?.settings?.quickVariantSelectionX){return true}return false}getNormalizedTableSettings(t,e,a){const i=n({},e);if(i&&!i.tableType){if(i.gridTable){i.tableType=u.GRID}else if(i.treeTable){i.tableType=u.TREE}}i.tableSettings=i.tableSettings||{};i.tableSettings.type=i.tableSettings.type||i.tableType;const r=t.getODataEntitySet(a);const s=t.getODataEntityType(r.entityType);if(i.tableSettings.type!==u.STANDARD_LIST&&i.tableSettings.type!==u.OBJECT_LIST&&a){i.tableSettings.type=i.tableSettings.type||(s[p.SapSemantics]==="aggregate"?u.ANALYTICAL:u.RESPONSIVE);if(i.tableSettings.type===u.ANALYTICAL&&!(s[p.SapSemantics]==="aggregate")){i.tableSettings.type=u.GRID}}if(s[p.UIHeaderInfo]){i.tableSettings.headerInfo=s[p.UIHeaderInfo]}delete i.gridTable;delete i.treeTable;delete i.tableType;return i.tableSettings}checkIfSmartChart(t,e,a){let i=t.getODataEntitySet(e);let n=t.getODataEntityType(i.entityType);let r,s,o;s=a.annotationPath;o=s?n[s]:undefined;if(o?.PresentationVariant){if(o.PresentationVariant.Visualizations){r=o.PresentationVariant.Visualizations[0].AnnotationPath}else if(o.PresentationVariant.Path){let t=o.PresentationVariant.Path.split("@")[1];let e=t&&n[t];r=e?e?.Visualizations?.[0].AnnotationPath:""}}else if(o?.Visualizations){r=o.Visualizations[0].AnnotationPath}return!!((r??"").indexOf(p.UIChart)>-1)}hasMandatoryProperties(t,e){if(t?.["Org.OData.Capabilities.V1.FilterRestrictions"]?.["RequiredProperties"]?.length){return true}else if(e?.length){return e.some(t=>Object.keys(t).length&&(t["sap:parameter"]==="mandatory"||t["sap:required-in-filter"]==="true"))}return false}_getParametersisedEntitySetParams(t,e,a){if(!t){throw new Error("OData Model needs to be passed as an argument")}const i={entitySetName:null,parameters:[],navPropertyName:null};const n=t.getODataEntitySet(e);const r=t.getODataEntityType(n.entityType);const s=r.navigationProperty;if(!s){return i}s.forEach(function(e){const s=t.getODataAssociationEnd(r,e.name);const o=s&&t.getODataEntityType(s.type);if(o?.[p.SapSemantics]!=="parameters"||!o.key){return false}i.entitySetName=t.getODataAssociationSetEnd(r,e.name)?.entitySet;for(let t of o.key.propertyRef){if(a){const e=o.property;for(let a of e){if(a.name===t.name){i.parameters.push(a)}}}else{i.parameters.push(t.name)}}const l=o.navigationProperty;const c=l?.some(function(e){const a=t.getODataAssociationEnd(o,e?.name)?.type;i.navPropertyName=a===n.entityType?e?.name:null;return i.navPropertyName});return c&&i.navPropertyName&&i.entitySetName});return i}isPropertyHidden(t){let e=t[p.CommonFieldControl];let a=t[p.UIHidden];if(e?.EnumMember===g.FieldControlHiddenType){return true}if(a){if(Object.prototype.hasOwnProperty.call(a,"Bool")){return a?.Bool==="true"}else if(Object.prototype.hasOwnProperty.call(a,"Path")){return false}else{return true}}return false}createP13N(t,e,a,i){let n="";let r=[];let s="";let o=a?.RecordType;let l=a?.Value;let c=l?.Path||"";if(o===g.DataField||o===g.DataFieldForAnnotation||o===g.DataFieldWithUrl){if(c){let e=this.createP13NColumnKey(a);n='\\{"columnKey":"'+e+'", "leadingProperty":"'+c;s=this.getNavigationPrefixPath(i,t,c)}else if(l?.Apply?.Name==="odata.concat"){l?.Apply?.Parameters.forEach(function(t){if(t.Type==="Path"){if(!n){n='\\{"columnKey":"'+t?.Value+'", "leadingProperty":"'+t?.Value}else{r.push(t.Value)}}})}n+=this.processAdditionalProperties(e,a,s,r);if(o===g.DataFieldWithUrl&&a?.Url){this.processDataFieldWithUrl(a,r)}if(n&&r.length){n+='", "additionalProperty":"'+r.join()}if(n){n+='"\\}'}}return n}processDataFieldWithUrl(t,e){const a=t.Url;if(a?.Apply?.Parameters){a.Apply.Parameters.forEach(t=>{if(t.Type==="LabeledElement"&&t.Value?.Path){e.push(t.Value.Path)}})}if(a?.Path){e.push(a.Path)}}createP13NColumnKey(t){let e="",a="template",i="::";let n=t.RecordType;let r=t?.Value;let s=t.SemanticObject?.String||"";let o=t.Action?.String||"";let l=r?.Path||"";let c="",p=null;let u=function(t){return a+i+t.join(i)};switch(n){case g.DataField:e=l;break;case g.DataFieldWithIntentBasedNavigation:e=u([y.DataFieldWithIntentBasedNavigation,s,o,l]);break;case g.DataFieldWithNavigationPath:e=u([y.DataFieldWithNavigationPath,l]);break;case g.DataFieldForIntentBasedNavigation:e=u([y.DataFieldForIntentBasedNavigation,s,o]);break;case g.DataFieldForAction:e=u([y.DataFieldForAction,o]);break;case g.DataFieldForAnnotation:c=t.Target?.AnnotationPath;p=c&&(c.indexOf(g.Contact)>=0||c.indexOf(g.DataPoint)>=0||c.indexOf(g.FieldGroup)>=0||c.indexOf(g.Chart)>=0);if(p){e=u([y.DataFieldForAnnotation,c]);e=e.replace("@","")}break;default:e="";break}return e}getNavigationPrefixPath(t,e,a){let i="";if(t){let n=t.getODataEntityType(e.entityType);if(n){i=this._getNavigationPrefix(t,n,a);if(i){i+="/"}}}return i}_getNavigationPrefix(t,e,a){let i="";let n=a.split("/");if(n.length>1){for(let a=0;a<n.length-1;a++){let r=t.getODataAssociationEnd(e,n[a]);if(!r){return i}if(r){e=t.getODataEntityType(r.type);i+=(i?"/":"")+n[a]}}}return i}processAdditionalProperties(t,e,a,i){let n="";if(t?.type==="Edm.DateTime"&&t?.["sap:display-format"]==="Date"){n+='", "type":"date'}else if(t?.type==="Edm.String"){n+='", "type":"string'}if(e?.Criticality?.Path){i.push(e?.Criticality.Path)}let r=t?.[p.CommonText];if(r?.Path){i.push(a+r?.Path)}const s=t?t[p.MeasuresISOCurrency]||t[p.MeasuresUnit]:null;if(s?.Path){i.push(s.Path);n+='", "unit":"'+s.Path}if(t?.[p.CommonFieldControl]?.Path){i.push(a+t[p.CommonFieldControl].Path)}return n}isSupportedColumn(t,e,a,i){let n=e.RecordType;if(n===g.DataFieldForAnnotation||n===g.DataFieldForAction||n===g.DataFieldForIntentBasedNavigation||!t){return false}let r=a.getODataEntityType(i.entityType);let s=a.getODataProperty(r,t.leadingProperty);let o=t.columnKey;if(this.checkMultiplicityForDataFieldAssociation(a,i,e)||o&&(o.indexOf(y.DataFieldForAnnotation)>-1||o.indexOf(y.DataFieldForAction)>-1||o.indexOf(y.DataFieldForIntentBasedNavigation)>-1||s?.[p.UIIsImageURL]?.Bool==="true")){return false}return true}checkMultiplicityForDataFieldAssociation(t,e,a){if(a?.Value?.Path){let i=a.Value.Path;let n=t&&t.getODataEntityType(e.entityType);let r;if(!(i.indexOf("/")>-1)||!n){return false}while(i.indexOf("/")>-1){let e=i.split("/")[0];i=i.split("/").slice(1).join("/");n=t.getODataEntityType(r?.type)||n;r=t.getODataAssociationEnd(n,e)}if(r&&r.multiplicity==="*"){return true}}return false}}m.FieldTypes=y;return m});
|
|
437
|
+
/*!
|
|
438
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
439
|
+
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
440
|
+
*/
|
|
441
|
+
sap.ui.predefine("sap/cux/home/utils/SituationUtils", ["sap/base/i18n/Formatting","sap/base/Log","sap/fe/navigation/NavigationHandler","sap/fe/navigation/SelectionVariant","sap/ui/core/format/DateFormat","sap/ui/core/format/NumberFormat","sap/ui/model/odata/v4/ODataModel"],function(t,e,a,n,i,r,o){"use strict";let c;let s;let u;const m=()=>{if(!c){const e=t.getDatePattern("medium")||"dd/MM/yyyy";c=i.getDateInstance({pattern:e})}return c};const S=()=>{if(!s){s=r.getFloatInstance({decimalSeparator:t.getNumberSymbol("decimal")||".",groupingSeparator:t.getNumberSymbol("group")||",",groupingEnabled:true})}return s};const l=function(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!t?.split){return t}let a=t.replaceAll("\n"," ");e.forEach(t=>{if(t.SitnInstceAttribName?.length>0){const e=`0${t.SitnInstceAttribSource}`;const n=`${e}.${t.SitnInstceAttribName}`;const i=t._InstanceAttributeValue.reduce(function(e,a){if(a.SitnInstceAttribSource===t.SitnInstceAttribSource&&a.SitnInstceAttribName===t.SitnInstceAttribName){e.push(a)}return e},[]);const r=[];i.forEach(e=>{let a=e?.SitnInstceAttribValue?.trim()||"";let n;switch(t.SitnInstceAttribEntityType){case"Edm.DateTime":n=m().format(m().parse(a));break;case"Edm.Decimal":if(a.endsWith("-")){a=`-${a.substring(0,a.length-1)}`}n=S().format(Number(a));break;default:n=a}r.push(n)});a=a.split(`{${n}}`).join(r.join(", "))}});return a};function f(t,e){return new Promise((i,r)=>{const o=new a(e);const c=new n;t._NavigationParam?.map(function(t){if(t.SituationNotifParamName){c.addSelectOption(t.SituationNotifParamName,"I","EQ",t.SituationNotifParameterVal)}});const s=c.toJSONString();o.navigate(t.SitnSemanticObject,t.SitnSemanticObjectAction,s,i,t=>r(t))})}function b(t,a){try{if(a==="1"){const e=g().bindContext(`/Navigation/${t}`,undefined,{$expand:{_NavigationParam:{$select:["SituationNotifParamName","SituationNotifParameterVal"]}},$select:["SitnInstanceID","SitnSemanticObject","SitnSemanticObjectAction"]});return e.requestObject()}else{return Promise.resolve({SitnInstanceID:t,SitnSemanticObject:"SituationInstance",SitnSemanticObjectAction:"display",_NavigationParam:[{SituationNotifParamName:"ui-type",SituationNotifParameterVal:"extended"},{SituationNotifParamName:"SitnInstceKey",SituationNotifParameterVal:t}]})}}catch(t){e.error(t instanceof Error?t.message:"")}}function g(){if(!u){u=new o({serviceUrl:"/sap/opu/odata4/sap/a_sitn2mblinstce_v4/srvd/sap/a_sitn2mblinstce_srv/0002/"})}return u}var d={__esModule:true};d.getSituationMessage=l;d.executeNavigation=f;d.fetchNavigationTargetData=b;return d});
|
|
397
442
|
/*!
|
|
398
443
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
399
444
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
@@ -407,9 +452,6 @@ sap.ui.predefine("sap/cux/home/utils/UshellPersonalizer", ["sap/ui/base/Object",
|
|
|
407
452
|
sap.ui.require.preload({
|
|
408
453
|
"sap/cux/home/interface/AppsInterface.js":function(){
|
|
409
454
|
|
|
410
|
-
},
|
|
411
|
-
"sap/cux/home/interface/CardsInterface.js":function(){
|
|
412
|
-
|
|
413
455
|
},
|
|
414
456
|
"sap/cux/home/interface/KeyUserInterface.js":function(){
|
|
415
457
|
|
|
@@ -420,7 +462,8 @@ sap.ui.require.preload({
|
|
|
420
462
|
"sap/cux/home/interface/PageSpaceInterface.js":function(){
|
|
421
463
|
|
|
422
464
|
},
|
|
423
|
-
"sap/cux/home/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"sap.cux.home","type":"library","embeds":[],"applicationVersion":{"version":"0.0.1"},"title":"UI5 library: sap.cux.home","description":"UI5 library: sap.cux.home","ach":"CA-UI5-CUX","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":["base","sap_fiori_3","sap_fiori_3_dark","sap_fiori_3_hcb","sap_fiori_3_hcw","sap_horizon","sap_horizon_dark","sap_horizon_hcb","sap_horizon_hcw"]},"sap.ui5":{"dependencies":{"minUI5Version":"1.
|
|
465
|
+
"sap/cux/home/manifest.json":'{"_version":"1.21.0","sap.app":{"id":"sap.cux.home","type":"library","embeds":[],"applicationVersion":{"version":"0.0.1"},"title":"UI5 library: sap.cux.home","description":"UI5 library: sap.cux.home","ach":"CA-UI5-CUX","resources":"resources.json","offline":true},"sap.ui":{"technology":"UI5","supportedThemes":["base","sap_fiori_3","sap_fiori_3_dark","sap_fiori_3_hcb","sap_fiori_3_hcw","sap_horizon","sap_horizon_dark","sap_horizon_hcb","sap_horizon_hcw"]},"sap.ui5":{"dependencies":{"minUI5Version":"1.135","libs":{"sap.ui.core":{"minVersion":"1.135.0"},"sap.m":{"minVersion":"1.135.0"},"sap.ui.integration":{"minVersion":"1.135.0"}}},"library":{"i18n":false,"content":{"controls":["sap.cux.home.Layout","sap.cux.home.ToDosContainer","sap.cux.home.NewsAndPagesContainer","sap.cux.home.AppsContainer","sap.cux.home.InsightsContainer"],"elements":["sap.cux.home.MenuItem","sap.cux.home.TaskPanel","sap.cux.home.SituationPanel","sap.cux.home.PagePanel","sap.cux.home.NewsPanel","sap.cux.home.FavAppPanel","sap.cux.home.FrequentAppPanel","sap.cux.home.RecentAppPanel","sap.cux.home.RecommendedAppPanel","sap.cux.home.TilesPanel","sap.cux.home.CardsPanel"],"types":["sap.cux.home.OrientationType","sap.cux.home.NewsType"],"interfaces":[]}}}}',
|
|
466
|
+
"sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml":'\n<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"><VBox id="container" height="100%" renderType="Bare"><VBox id="headerContent" class="headerContent" backgroundDesign="Solid"><Text id="appsAdditionDescription" text="{i18n>addAppsDescription}" /><HBox id="searchContainer" class="sapUiTinyMarginTop" renderType="Bare" justifyContent="SpaceBetween" gap="0.5rem"><SearchField\n\t\t\t\t\tid="searchField"\n\t\t\t\t\twidth="100%"\n\t\t\t\t\tmaxLength="130"\n\t\t\t\t\tshowSearchButton="false"\n\t\t\t\t\tsearch=".onPressGo"\n\t\t\t\t\tplaceholder="{i18n>searchPlaceholder}"\n\t\t\t\t\tenabled="{= ${/searchStatus} !== \'searching\' }"\n\t\t\t\t\tvalue="{ path: \'/query\', mode: \'TwoWay\' }"\n\t\t\t\t/><Button id="goBtn" text="{i18n>goButton}" enabled="{= ${/searchStatus} !== \'searching\' }" press=".onPressGo" /></HBox></VBox><VBox id="resultContent" renderType="Bare" height="81%"><ScrollContainer id="resultsContainer" vertical="true"><VBox id="resultHeader" renderType="Bare" class="sapUiSmallMargin"><Title id="resultTitle" text="{i18n>resultTitle} ({/suggestedAppsCount})" titleStyle="H5" /><Text\n\t\t\t\t\t\tid="resultDescription"\n\t\t\t\t\t\ttext="{i18n>resultDescription}"\n\t\t\t\t\t\tclass="sapUiTinyMarginTop"\n\t\t\t\t\t\tvisible="{= !${/hasError} && ${/searchStatus} === \'complete\' }"\n\t\t\t\t\t/><MessageStrip\n\t\t\t\t\t\tid="searchingMessage"\n\t\t\t\t\t\ttype="Information"\n\t\t\t\t\t\tshowIcon="true"\n\t\t\t\t\t\tclass="sapUiTinyMarginTop"\n\t\t\t\t\t\ttext="{i18n>searchingMessage}"\n\t\t\t\t\t\tvisible="{= ${/searchStatus} === \'searching\' }"\n\t\t\t\t\t/></VBox><VBox\n\t\t\t\t\tid="lodingAnimationContainer"\n\t\t\t\t\trenderType="Bare"\n\t\t\t\t\tbackgroundDesign="Solid"\n\t\t\t\t\tclass="sapUiSmallMarginBeginEnd loadingAnimation"\n\t\t\t\t><core:HTML id="searchingAnimation" visible="{= ${/searchStatus} === \'searching\' }" content="{/loadingAnimation}" /></VBox><List\n\t\t\t\t\tid="appsList"\n\t\t\t\t\tmode="MultiSelect"\n\t\t\t\t\tvisible="{= !${/hasError} && ${/searchStatus} === \'complete\' }"\n\t\t\t\t\tselectionChange=".onListSelectionChange"\n\t\t\t\t\tclass="appSuggestionList"\n\t\t\t\t/></ScrollContainer><VBox\n\t\t\t\tid="beforeSearchContainer"\n\t\t\t\trenderType="Bare"\n\t\t\t\theight="100%"\n\t\t\t\tclass="illustratedMessageContainer"\n\t\t\t\tvisible="{= ${/searchStatus} === \'idle\' }"\n\t\t\t><IllustratedMessage\n\t\t\t\t\tid="beforeSearch"\n\t\t\t\t\tillustrationSize="Large"\n\t\t\t\t\tsrc="sap-illustration://SearchEarth"\n\t\t\t\t\tdescription="{i18n>beforeSearchDescription}"\n\t\t\t\t\tvisible="{= ${/searchStatus} === \'idle\' }"\n\t\t\t\t/></VBox><VBox id="errorContainer" renderType="Bare" height="100%" class="illustratedMessageContainer" visible="{/hasError}"><IllustratedMessage\n\t\t\t\t\tid="noResultsFound"\n\t\t\t\t\tillustrationSize="Large"\n\t\t\t\t\ttitle="{i18n>validationErrorTitle}"\n\t\t\t\t\tdescription="{/errorDescription}"\n\t\t\t\t\tsrc="sap-illustration://SimpleNotFoundMagnifier"\n\t\t\t\t\tvisible="{= ${/errorType} === \'noResultsFound\' }"\n\t\t\t\t/><IllustratedMessage\n\t\t\t\t\tid="serviceError"\n\t\t\t\t\tillustrationSize="Large"\n\t\t\t\t\ttitle="{i18n>serviceErrorTitle}"\n\t\t\t\t\tdescription="{/errorDescription}"\n\t\t\t\t\tillustrationType="sapIllus-SimpleConnection"\n\t\t\t\t\tvisible="{= ${/errorType} === \'serviceError\' }"\n\t\t\t\t/><IllustratedMessage\n\t\t\t\t\tid="validationError"\n\t\t\t\t\tillustrationSize="Large"\n\t\t\t\t\tillustrationType="sapIllus-SimpleEmptyDoc"\n\t\t\t\t\ttitle="{i18n>validationErrorTitle}"\n\t\t\t\t\tdescription="{/errorDescription}"\n\t\t\t\t\tvisible="{= ${/errorType} === \'validationError\' }"\n\t\t\t\t/><IllustratedMessage\n\t\t\t\t\tid="defaultError"\n\t\t\t\t\tillustrationSize="Large"\n\t\t\t\t\tsrc="sap-illustration://SimpleError"\n\t\t\t\t\ttitle="{i18n>defaultErrorTitle}"\n\t\t\t\t\tdescription="{/errorDescription}"\n\t\t\t\t\tvisible="{= ${/errorType} === \'defaultError\' }"\n\t\t\t\t/></VBox></VBox></VBox></core:FragmentDefinition>\n',
|
|
424
467
|
"sap/cux/home/utils/fragment/showDecisionDialog.fragment.xml":'\n<Dialog\n\tid="decisionDialog"\n\txmlns="sap.m"\n\txmlns:core="sap.ui.core"\n\txmlns:fesr="http://schemas.sap.com/sapui5/extension/sap.ui.core.FESR/1"\n\ttitle="{/dialogSettings/title}"\n\ttype="Message"\n\tariaDescribedBy="confirmDialogText"\n\tafterClose=".handleAfterClose"\n\tcontentWidth="22.375rem"\n\tcontentHeight="17.8125rem"\n\tclass="sapUiDecisionDialog"\n><customHeader><Bar id="decisionDialogHeader" class="sapUiDecisionDialogHeader"><contentLeft><VBox id="icon-container" renderType="Bare" justifyContent="Center" width="100%"><Avatar\n\t\t\t\t\t\tid="icon"\n\t\t\t\t\t\tbackgroundColor="Placeholder"\n\t\t\t\t\t\tsrc="sap-icon://workflow-tasks"\n\t\t\t\t\t\tdisplaySize="S"\n\t\t\t\t\t\tdisplayShape="Square"\n\t\t\t\t\t\tbadgeIcon="{/dialogSettings/badgeIcon}"\n\t\t\t\t\t\tbadgeValueState="{/dialogSettings/badgeValueState}"\n\t\t\t\t\t/></VBox></contentLeft><contentMiddle><VBox id="title-container" renderType="Bare" justifyContent="Start" class="sapUiDecisionDialogTitleContainer"><Text id="task-title" textAlign="Begin" text="{/dialogSettings/title}" /><Text id="task-priority-text" text="{/dialogSettings/priorityText}" class="sapUiTaskPriority" /></VBox></contentMiddle></Bar></customHeader><content><VBox id="decision-approval-container" renderType="Bare" visible="{= !${/dialogSettings/showFeedbackMessage} }"><Label id="confirmDialogText" text="{/dialogSettings/question}" /><FlexBox id="reasonOptionFlex" direction="Column" renderType="Bare"><items><Label\n\t\t\t\t\t\tid="label_reasonOptionsSelect"\n\t\t\t\t\t\ttext="{i18n>XFLD_ComboBox_Decision_Reason}"\n\t\t\t\t\t\trequired="{/dialogSettings/reasonOptionsSettings/required}"\n\t\t\t\t\t\tclass="sapUiSmallMarginTop"\n\t\t\t\t\t\tvisible="{/dialogSettings/reasonOptionsSettings/show}"\n\t\t\t\t\t\tlabelFor="reasonOptionsSelect"\n\t\t\t\t\t/><ComboBox\n\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\tselectedKey="defaultSelectedKey"\n\t\t\t\t\t\tid="reasonOptionsSelect"\n\t\t\t\t\t\tvisible="{/dialogSettings/reasonOptionsSettings/show}"\n\t\t\t\t\t\tvalueStateText="{i18n>XMSG_DECISION_REASON_ERR}"\n\t\t\t\t\t\tchange=".handleReasonOptionChange"\n\t\t\t\t\t\titems="{/dialogSettings/reasonOptionsSettings/reasonOptions}"\n\t\t\t\t\t><core:Item id="reasonItem" key="{Code}" text="{Name}" /></ComboBox><Label\n\t\t\t\t\t\tid="label_confirmDialogTextarea"\n\t\t\t\t\t\ttext="{/dialogSettings/textAreaLabel}"\n\t\t\t\t\t\trequired="{/dialogSettings/noteMandatory}"\n\t\t\t\t\t\tvisible="{/dialogSettings/showNote}"\n\t\t\t\t\t\tlabelFor="confirmDialogTextarea"\n\t\t\t\t\t\tclass="sapUiSmallMarginTop"\n\t\t\t\t\t/><TextArea\n\t\t\t\t\t\twidth="100%"\n\t\t\t\t\t\theight="12.2rem"\n\t\t\t\t\t\tid="confirmDialogTextarea"\n\t\t\t\t\t\tvisible="{/dialogSettings/showNote}"\n\t\t\t\t\t\tmaxLength="10000"\n\t\t\t\t\t\tliveChange="._toggleSubmitButtonState"\n\t\t\t\t\t/></items></FlexBox></VBox><VBox\n\t\t\tid="successMessageContainer"\n\t\t\tvisible="{/dialogSettings/showFeedbackMessage}"\n\t\t\trenderType="Bare"\n\t\t\theight="16rem"\n\t\t\tjustifyContent="Center"\n\t\t><IllustratedMessage\n\t\t\t\tid="successMessage"\n\t\t\t\tillustrationSize="Spot"\n\t\t\t\tillustrationType="sapIllus-BalloonSky"\n\t\t\t\tenableDefaultTitleAndDescription="false"\n\t\t\t\ttitle="{i18n>actionSuccess}"\n\t\t\t/></VBox></content><beginButton><Button\n\t\t\tid="confirmButton"\n\t\t\ttext="{/dialogSettings/confirmButtonLabel}"\n\t\t\tvisible="{= !${/dialogSettings/showFeedbackMessage} }"\n\t\t\ttype="Emphasized"\n\t\t\tenabled="{/submitButtonEnabled}"\n\t\t\tpress=".confirmActionHandler"\n\t\t\tfesr:press="submitDecisionDialog"\n\t\t/></beginButton><endButton><Button\n\t\t\tid="cancelButton"\n\t\t\ttext="{= ${/dialogSettings/showFeedbackMessage} ? ${i18n>XBUT_CLOSE} : ${i18n>XBUT_CANCEL} }"\n\t\t\tpress=".handleCancel"\n\t\t\tariaLabelledBy="successMessage"\n\t\t\tfesr:press="cancelDecisionDialog"\n\t\t/></endButton></Dialog>\n'
|
|
425
468
|
});
|
|
426
469
|
//# sourceMappingURL=library-preload.js.map
|