All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.config.Theme.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/config/Theme.ts"],
  "sourcesContent": ["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n};\n"],
  "mappings": "aAAA,OAAS,YAAYA,MAA0B,6BAC/C,OAAS,0BAAAC,MAA8B,eACvC,OAAOC,MAAgB,2BACvB,OAAOC,MAA2B,sCAClC,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,kCAChD,OAAS,QAAAC,EAAM,YAAAC,MAAgB,aAE/B,IAAIC,EAOJ,MAAMC,EAAW,KACZD,IAAa,SAChBA,EAAWR,EAAmB,GAGxBQ,GASFE,EAAW,MAAOC,GAAiC,CACpDH,IAAaG,IAIjBH,EAAWG,EAEPJ,EAAS,IAEZ,MAAML,EAAWM,CAAQ,EACzB,MAAMP,EAAuB,CAAE,WAAY,EAAK,CAAC,GAEnD,EAUMW,EAAkB,IAChBR,EASFS,EAAWF,GAAkB,CAClC,MAAMG,EAAeL,EAAS,EAC9B,OAAOK,IAAiBH,GAASG,IAAiB,GAAGH,CAAK,MAC3D,EASMI,EAAsB,IAAM,CACjC,MAAMD,EAAeL,EAAS,EAE9B,OAAKO,EAAaF,CAAY,EAIvB,CAACA,EAAa,WAAW,aAAa,EAHrC,CAACX,EAAsB,GAAG,eAAe,WAAW,aAAa,CAI1E,EAEMc,EAA2B,UAChC,MAAMX,EAAK,EACJS,EAAoB,GAGtBC,EAAgBL,GAAkBN,EAAiB,SAASM,CAAK,EAEvE,OACCF,KAAA,SACAC,KAAA,SACAG,KAAA,QACAE,KAAA,oBACAE,KAAA,yBACAL,KAAA",
  "names": ["getConfiguredTheme", "reRenderAllUI5Elements", "applyTheme", "getThemeDesignerTheme", "DEFAULT_THEME", "SUPPORTED_THEMES", "boot", "isBooted", "curTheme", "getTheme", "setTheme", "theme", "getDefaultTheme", "isTheme", "currentTheme", "isLegacyThemeFamily", "isKnownTheme", "isLegacyThemeFamilyAsync"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy