@ui5/webcomponents-base 2.14.0 → 2.14.1

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.
@@ -1,7 +1,6 @@
1
1
  import merge from "./thirdparty/merge.js";
2
2
  import { getFeature } from "./FeaturesRegistry.js";
3
3
  import { DEFAULT_THEME } from "./generated/AssetParameters.js";
4
- import validateThemeRoot from "./validateThemeRoot.js";
5
4
  import AnimationMode from "./types/AnimationMode.js";
6
5
  import { resetConfiguration as resetConfigurationFn } from "./config/ConfigurationReset.js";
7
6
  import { getLocationSearch } from "./Location.js";
@@ -32,13 +31,6 @@ const getTheme = () => {
32
31
  };
33
32
  const getThemeRoot = () => {
34
33
  initConfiguration();
35
- if (initialConfig.themeRoot === undefined) {
36
- return;
37
- }
38
- if (!validateThemeRoot(initialConfig.themeRoot)) {
39
- console.warn(`The ${initialConfig.themeRoot} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`); // eslint-disable-line
40
- return;
41
- }
42
34
  return initialConfig.themeRoot;
43
35
  };
44
36
  const getLanguage = () => {
@@ -128,7 +120,7 @@ const parseURLParameters = () => {
128
120
  };
129
121
  const normalizeThemeRootParamValue = (value) => {
130
122
  const themeRoot = value.split("@")[1];
131
- return validateThemeRoot(themeRoot);
123
+ return themeRoot;
132
124
  };
133
125
  const normalizeThemeParamValue = (param, value) => {
134
126
  if (param === "theme" && value.includes("@")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this
@@ -1 +1 @@
1
- {"version":3,"file":"InitialConfiguration.js","sourceRoot":"","sources":["../src/InitialConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAGvD,OAAO,aAAa,MAAM,0BAA0B,CAA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AAC;QACP,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,GAAG,EAAE;IACtC,MAAM,cAAc,GAAG,UAAU,CAAwB,gBAAgB,CAAC,CAAC;IAC3E,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;QAC5D,OAAO;IACR,CAAC;IAED,MAAM,aAAa,GAAG,cAAc,CAAC,8BAA8B,EAAE,CAAC;IACtE,aAAa,GAAG,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;QACpD,OAAO;IACR,CAAC;IAED,kBAAkB,EAAE,CAAC;IAErB,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,kBAAkB,GAAG,CAAC,OAAiB,EAAE,EAAE;IAChD,IAAI,OAAO,EAAE,CAAC;QACb,oBAAoB,EAAE,CAAC;IACxB,CAAC;IACD,4CAA4C;IAC5C,wBAAwB,EAAE,CAAC;IAE3B,8DAA8D;IAC9D,kBAAkB,EAAE,CAAC;IAErB,yDAAyD;IACzD,yBAAyB,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,GACxB,CAAC","sourcesContent":["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\nimport { resetConfiguration as resetConfigurationFn } from \"./config/ConfigurationReset.js\";\nimport { getLocationSearch } from \"./Location.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n\tdefaultFontLoading: boolean,\n\tenableDefaultTooltips: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n\tdefaultFontLoading: true,\n\tenableDefaultTooltips: true,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\n\tif (initialConfig.themeRoot === undefined) {\n\t\treturn;\n\t}\n\n\tif (!validateThemeRoot(initialConfig.themeRoot)) {\n\t\tconsole.warn(`The ${initialConfig.themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\nconst getDefaultFontLoading = () => {\n\tinitConfiguration();\n\treturn initialConfig.defaultFontLoading;\n};\n\nconst getEnableDefaultTooltips = () => {\n\tinitConfiguration();\n\treturn initialConfig.enableDefaultTooltips;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(getLocationSearch());\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\tresetConfiguration();\n\n\tinitialized = true;\n};\n\n/**\n * Internaly exposed method to enable configurations in tests.\n * @private\n */\nconst resetConfiguration = (testEnv?: boolean) => {\n\tif (testEnv) {\n\t\tresetConfigurationFn();\n\t}\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n\tgetDefaultFontLoading,\n\tresetConfiguration,\n\tgetEnableDefaultTooltips,\n};\n"]}
1
+ {"version":3,"file":"InitialConfiguration.js","sourceRoot":"","sources":["../src/InitialConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,kBAAkB,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,IAAI,WAAW,GAAG,KAAK,CAAC;AAkBxB,IAAI,aAAa,GAAkB;IAClC,aAAa,EAAE,aAAa,CAAC,IAAI;IACjC,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,SAAS;IACpB,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,SAAS;IACvB,qBAAqB,EAAE,SAAS;IAChC,UAAU,EAAE,KAAK,EAAE,SAAS;IAC5B,cAAc,EAAE,EAAE;IAClB,oBAAoB,EAAE,KAAK;IAC3B,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;CAC3B,CAAC;AAEF,sBAAsB;AACtB,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,iBAAiB,EAAE,C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BAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,GACxB,CAAC","sourcesContent":["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\nimport { resetConfiguration as resetConfigurationFn } from \"./config/ConfigurationReset.js\";\nimport { getLocationSearch } from \"./Location.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n\tdefaultFontLoading: boolean,\n\tenableDefaultTooltips: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n\tdefaultFontLoading: true,\n\tenableDefaultTooltips: true,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\nconst getDefaultFontLoading = () => {\n\tinitConfiguration();\n\treturn initialConfig.defaultFontLoading;\n};\n\nconst getEnableDefaultTooltips = () => {\n\tinitConfiguration();\n\treturn initialConfig.enableDefaultTooltips;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(getLocationSearch());\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn themeRoot;\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\tresetConfiguration();\n\n\tinitialized = true;\n};\n\n/**\n * Internaly exposed method to enable configurations in tests.\n * @private\n */\nconst resetConfiguration = (testEnv?: boolean) => {\n\tif (testEnv) {\n\t\tresetConfigurationFn();\n\t}\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n\tgetDefaultFontLoading,\n\tresetConfiguration,\n\tgetEnableDefaultTooltips,\n};\n"]}
@@ -43,21 +43,26 @@ const setThemeRoot = (themeRoot) => {
43
43
  return;
44
44
  }
45
45
  currThemeRoot = themeRoot;
46
- if (!validateThemeRoot(themeRoot)) {
47
- console.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`); // eslint-disable-line
48
- return;
49
- }
50
46
  return attachCustomThemeStylesToHead(getTheme());
51
47
  };
52
- const formatThemeLink = (theme) => {
53
- return `${getThemeRoot()}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.
48
+ const formatThemeLink = (theme, validatedThemeRoot) => {
49
+ return `${validatedThemeRoot}Base/baseLib/${theme}/css_variables.css`;
54
50
  };
55
51
  const attachCustomThemeStylesToHead = async (theme) => {
56
52
  const link = document.querySelector(`[sap-ui-webcomponents-theme="${theme}"]`);
57
53
  if (link) {
58
54
  document.head.removeChild(link);
59
55
  }
60
- await createLinkInHead(formatThemeLink(theme), { "sap-ui-webcomponents-theme": theme });
56
+ const themeRoot = getThemeRoot();
57
+ if (!themeRoot) {
58
+ return;
59
+ }
60
+ const validatedThemeRoot = validateThemeRoot(themeRoot);
61
+ if (!validatedThemeRoot) {
62
+ console.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`); // eslint-disable-line
63
+ return;
64
+ }
65
+ await createLinkInHead(formatThemeLink(theme, validatedThemeRoot), { "sap-ui-webcomponents-theme": theme });
61
66
  };
62
67
  export { getThemeRoot, setThemeRoot, attachCustomThemeStylesToHead, };
63
68
  //# sourceMappingURL=ThemeRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,aAAiC,CAAC;AAEtC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,aAAa,GAAG,SAAS,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QACjC,aAAa,GAAG,sBAAsB,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,YAAY,GAAG,CAAC,SAAiB,EAA6B,EAAE;IACrE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO;IACR,CAAC;IAED,aAAa,GAAG,SAAS,CAAC;IAE1B,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,OAAO,SAAS,0FAA0F,CAAC,CAAC,CAAC,sBAAsB;QAChJ,OAAO;IACR,CAAC;IAED,OAAO,6BAA6B,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,OAAO,GAAG,YAAY,EAAG,gBAAgB,KAAK,oBAAoB,CAAC,CAAC,0CAA0C;AAC/G,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IAC5E,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,KAAK,IAAI,CAAC,CAAC;IAE/E,IAAI,IAAI,EAAE,CAAC;QACV,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,6BAA6B,GAC7B,CAAC","sourcesContent":["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currThemeRoot: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrThemeRoot = undefined;\n});\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n *\n * **Important:** To use this feature you must explicitly allow specific origins by using &lt;meta name=\"sap-allowed-theme-origins\" content=\"https://my-example-host.com/\"&gt; tag inside the &lt;head&gt; of the page.\n * Failing to do so will result in a warning in the console and the theme root will not be set.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
1
+ {"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,aAAiC,CAAC;AAEtC,wBAAwB,CAAC,GAAG,EA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,CAAC,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7G,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,6BAA6B,GAC7B,CAAC","sourcesContent":["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currThemeRoot: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrThemeRoot = undefined;\n});\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n *\n * **Important:** To use this feature you must explicitly allow specific origins by using &lt;meta name=\"sap-allowed-theme-origins\" content=\"https://my-example-host.com/\"&gt; tag inside the &lt;head&gt; of the page.\n * Failing to do so will result in a warning in the console and the theme root will not be set.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string, validatedThemeRoot: string) => {\n\treturn `${validatedThemeRoot}Base/baseLib/${theme}/css_variables.css`;\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tconst themeRoot = getThemeRoot();\n\n\tif (!themeRoot) {\n\t\treturn;\n\t}\n\n\tconst validatedThemeRoot = validateThemeRoot(themeRoot);\n\n\tif (!validatedThemeRoot) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme, validatedThemeRoot), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
@@ -769,138 +769,138 @@
769
769
  },
770
770
  {
771
771
  "kind": "javascript-module",
772
- "path": "dist/theming/CustomStyle.js",
773
- "declarations": [],
774
- "exports": []
775
- },
776
- {
777
- "kind": "javascript-module",
778
- "path": "dist/theming/ThemeLoaded.js",
779
- "declarations": [],
780
- "exports": []
781
- },
782
- {
783
- "kind": "javascript-module",
784
- "path": "dist/theming/ThemeRegistered.js",
785
- "declarations": [],
786
- "exports": []
787
- },
788
- {
789
- "kind": "javascript-module",
790
- "path": "dist/theming/applyTheme.js",
772
+ "path": "dist/thirdparty/_merge.js",
791
773
  "declarations": [],
792
774
  "exports": [
793
775
  {
794
776
  "kind": "js",
795
777
  "name": "default",
796
778
  "declaration": {
797
- "name": "applyTheme",
798
- "module": "dist/theming/applyTheme.js"
779
+ "name": "fnMerge",
780
+ "module": "dist/thirdparty/_merge.js"
799
781
  }
800
782
  }
801
783
  ]
802
784
  },
803
785
  {
804
786
  "kind": "javascript-module",
805
- "path": "dist/theming/getConstructableStyle.js",
787
+ "path": "dist/thirdparty/isPlainObject.js",
806
788
  "declarations": [],
807
789
  "exports": [
808
790
  {
809
791
  "kind": "js",
810
792
  "name": "default",
811
793
  "declaration": {
812
- "name": "getConstructableStyle",
813
- "module": "dist/theming/getConstructableStyle.js"
794
+ "name": "fnIsPlainObject",
795
+ "module": "dist/thirdparty/isPlainObject.js"
814
796
  }
815
797
  }
816
798
  ]
817
799
  },
818
800
  {
819
801
  "kind": "javascript-module",
820
- "path": "dist/theming/getEffectiveStyle.js",
802
+ "path": "dist/thirdparty/merge.js",
821
803
  "declarations": [],
822
804
  "exports": [
823
805
  {
824
806
  "kind": "js",
825
807
  "name": "default",
826
808
  "declaration": {
827
- "name": "getEffectiveStyle",
828
- "module": "dist/theming/getEffectiveStyle.js"
809
+ "name": "fnMerge",
810
+ "module": "dist/thirdparty/merge.js"
829
811
  }
830
812
  }
831
813
  ]
832
814
  },
833
815
  {
834
816
  "kind": "javascript-module",
835
- "path": "dist/theming/getStylesString.js",
817
+ "path": "dist/theming/CustomStyle.js",
818
+ "declarations": [],
819
+ "exports": []
820
+ },
821
+ {
822
+ "kind": "javascript-module",
823
+ "path": "dist/theming/ThemeLoaded.js",
824
+ "declarations": [],
825
+ "exports": []
826
+ },
827
+ {
828
+ "kind": "javascript-module",
829
+ "path": "dist/theming/ThemeRegistered.js",
830
+ "declarations": [],
831
+ "exports": []
832
+ },
833
+ {
834
+ "kind": "javascript-module",
835
+ "path": "dist/theming/applyTheme.js",
836
836
  "declarations": [],
837
837
  "exports": [
838
838
  {
839
839
  "kind": "js",
840
840
  "name": "default",
841
841
  "declaration": {
842
- "name": "getStylesString",
843
- "module": "dist/theming/getStylesString.js"
842
+ "name": "applyTheme",
843
+ "module": "dist/theming/applyTheme.js"
844
844
  }
845
845
  }
846
846
  ]
847
847
  },
848
848
  {
849
849
  "kind": "javascript-module",
850
- "path": "dist/theming/getThemeDesignerTheme.js",
850
+ "path": "dist/theming/getConstructableStyle.js",
851
851
  "declarations": [],
852
852
  "exports": [
853
853
  {
854
854
  "kind": "js",
855
855
  "name": "default",
856
856
  "declaration": {
857
- "name": "getThemeDesignerTheme",
858
- "module": "dist/theming/getThemeDesignerTheme.js"
857
+ "name": "getConstructableStyle",
858
+ "module": "dist/theming/getConstructableStyle.js"
859
859
  }
860
860
  }
861
861
  ]
862
862
  },
863
863
  {
864
864
  "kind": "javascript-module",
865
- "path": "dist/thirdparty/_merge.js",
865
+ "path": "dist/theming/getEffectiveStyle.js",
866
866
  "declarations": [],
867
867
  "exports": [
868
868
  {
869
869
  "kind": "js",
870
870
  "name": "default",
871
871
  "declaration": {
872
- "name": "fnMerge",
873
- "module": "dist/thirdparty/_merge.js"
872
+ "name": "getEffectiveStyle",
873
+ "module": "dist/theming/getEffectiveStyle.js"
874
874
  }
875
875
  }
876
876
  ]
877
877
  },
878
878
  {
879
879
  "kind": "javascript-module",
880
- "path": "dist/thirdparty/isPlainObject.js",
880
+ "path": "dist/theming/getStylesString.js",
881
881
  "declarations": [],
882
882
  "exports": [
883
883
  {
884
884
  "kind": "js",
885
885
  "name": "default",
886
886
  "declaration": {
887
- "name": "fnIsPlainObject",
888
- "module": "dist/thirdparty/isPlainObject.js"
887
+ "name": "getStylesString",
888
+ "module": "dist/theming/getStylesString.js"
889
889
  }
890
890
  }
891
891
  ]
892
892
  },
893
893
  {
894
894
  "kind": "javascript-module",
895
- "path": "dist/thirdparty/merge.js",
895
+ "path": "dist/theming/getThemeDesignerTheme.js",
896
896
  "declarations": [],
897
897
  "exports": [
898
898
  {
899
899
  "kind": "js",
900
900
  "name": "default",
901
901
  "declaration": {
902
- "name": "fnMerge",
903
- "module": "dist/thirdparty/merge.js"
902
+ "name": "getThemeDesignerTheme",
903
+ "module": "dist/theming/getThemeDesignerTheme.js"
904
904
  }
905
905
  }
906
906
  ]
@@ -761,138 +761,138 @@
761
761
  },
762
762
  {
763
763
  "kind": "javascript-module",
764
- "path": "dist/theming/CustomStyle.js",
765
- "declarations": [],
766
- "exports": []
767
- },
768
- {
769
- "kind": "javascript-module",
770
- "path": "dist/theming/ThemeLoaded.js",
771
- "declarations": [],
772
- "exports": []
773
- },
774
- {
775
- "kind": "javascript-module",
776
- "path": "dist/theming/ThemeRegistered.js",
777
- "declarations": [],
778
- "exports": []
779
- },
780
- {
781
- "kind": "javascript-module",
782
- "path": "dist/theming/applyTheme.js",
764
+ "path": "dist/thirdparty/_merge.js",
783
765
  "declarations": [],
784
766
  "exports": [
785
767
  {
786
768
  "kind": "js",
787
769
  "name": "default",
788
770
  "declaration": {
789
- "name": "applyTheme",
790
- "module": "dist/theming/applyTheme.js"
771
+ "name": "fnMerge",
772
+ "module": "dist/thirdparty/_merge.js"
791
773
  }
792
774
  }
793
775
  ]
794
776
  },
795
777
  {
796
778
  "kind": "javascript-module",
797
- "path": "dist/theming/getConstructableStyle.js",
779
+ "path": "dist/thirdparty/isPlainObject.js",
798
780
  "declarations": [],
799
781
  "exports": [
800
782
  {
801
783
  "kind": "js",
802
784
  "name": "default",
803
785
  "declaration": {
804
- "name": "getConstructableStyle",
805
- "module": "dist/theming/getConstructableStyle.js"
786
+ "name": "fnIsPlainObject",
787
+ "module": "dist/thirdparty/isPlainObject.js"
806
788
  }
807
789
  }
808
790
  ]
809
791
  },
810
792
  {
811
793
  "kind": "javascript-module",
812
- "path": "dist/theming/getEffectiveStyle.js",
794
+ "path": "dist/thirdparty/merge.js",
813
795
  "declarations": [],
814
796
  "exports": [
815
797
  {
816
798
  "kind": "js",
817
799
  "name": "default",
818
800
  "declaration": {
819
- "name": "getEffectiveStyle",
820
- "module": "dist/theming/getEffectiveStyle.js"
801
+ "name": "fnMerge",
802
+ "module": "dist/thirdparty/merge.js"
821
803
  }
822
804
  }
823
805
  ]
824
806
  },
825
807
  {
826
808
  "kind": "javascript-module",
827
- "path": "dist/theming/getStylesString.js",
809
+ "path": "dist/theming/CustomStyle.js",
810
+ "declarations": [],
811
+ "exports": []
812
+ },
813
+ {
814
+ "kind": "javascript-module",
815
+ "path": "dist/theming/ThemeLoaded.js",
816
+ "declarations": [],
817
+ "exports": []
818
+ },
819
+ {
820
+ "kind": "javascript-module",
821
+ "path": "dist/theming/ThemeRegistered.js",
822
+ "declarations": [],
823
+ "exports": []
824
+ },
825
+ {
826
+ "kind": "javascript-module",
827
+ "path": "dist/theming/applyTheme.js",
828
828
  "declarations": [],
829
829
  "exports": [
830
830
  {
831
831
  "kind": "js",
832
832
  "name": "default",
833
833
  "declaration": {
834
- "name": "getStylesString",
835
- "module": "dist/theming/getStylesString.js"
834
+ "name": "applyTheme",
835
+ "module": "dist/theming/applyTheme.js"
836
836
  }
837
837
  }
838
838
  ]
839
839
  },
840
840
  {
841
841
  "kind": "javascript-module",
842
- "path": "dist/theming/getThemeDesignerTheme.js",
842
+ "path": "dist/theming/getConstructableStyle.js",
843
843
  "declarations": [],
844
844
  "exports": [
845
845
  {
846
846
  "kind": "js",
847
847
  "name": "default",
848
848
  "declaration": {
849
- "name": "getThemeDesignerTheme",
850
- "module": "dist/theming/getThemeDesignerTheme.js"
849
+ "name": "getConstructableStyle",
850
+ "module": "dist/theming/getConstructableStyle.js"
851
851
  }
852
852
  }
853
853
  ]
854
854
  },
855
855
  {
856
856
  "kind": "javascript-module",
857
- "path": "dist/thirdparty/_merge.js",
857
+ "path": "dist/theming/getEffectiveStyle.js",
858
858
  "declarations": [],
859
859
  "exports": [
860
860
  {
861
861
  "kind": "js",
862
862
  "name": "default",
863
863
  "declaration": {
864
- "name": "fnMerge",
865
- "module": "dist/thirdparty/_merge.js"
864
+ "name": "getEffectiveStyle",
865
+ "module": "dist/theming/getEffectiveStyle.js"
866
866
  }
867
867
  }
868
868
  ]
869
869
  },
870
870
  {
871
871
  "kind": "javascript-module",
872
- "path": "dist/thirdparty/isPlainObject.js",
872
+ "path": "dist/theming/getStylesString.js",
873
873
  "declarations": [],
874
874
  "exports": [
875
875
  {
876
876
  "kind": "js",
877
877
  "name": "default",
878
878
  "declaration": {
879
- "name": "fnIsPlainObject",
880
- "module": "dist/thirdparty/isPlainObject.js"
879
+ "name": "getStylesString",
880
+ "module": "dist/theming/getStylesString.js"
881
881
  }
882
882
  }
883
883
  ]
884
884
  },
885
885
  {
886
886
  "kind": "javascript-module",
887
- "path": "dist/thirdparty/merge.js",
887
+ "path": "dist/theming/getThemeDesignerTheme.js",
888
888
  "declarations": [],
889
889
  "exports": [
890
890
  {
891
891
  "kind": "js",
892
892
  "name": "default",
893
893
  "declaration": {
894
- "name": "fnMerge",
895
- "module": "dist/thirdparty/merge.js"
894
+ "name": "getThemeDesignerTheme",
895
+ "module": "dist/theming/getThemeDesignerTheme.js"
896
896
  }
897
897
  }
898
898
  ]
@@ -1,11 +1,11 @@
1
1
  const VersionInfo = {
2
- version: "2.14.0",
2
+ version: "2.14.1",
3
3
  major: 2,
4
4
  minor: 14,
5
- patch: 0,
5
+ patch: 1,
6
6
  suffix: "",
7
7
  isNext: false,
8
- buildTime: 1756977409,
8
+ buildTime: 1778504096,
9
9
  };
10
10
  export default VersionInfo;
11
11
  //# sourceMappingURL=VersionInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.0\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1756977409,\n};\nexport default VersionInfo;"]}
1
+ {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.1\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 1,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1778504096,\n};\nexport default VersionInfo;"]}
@@ -1,2 +1,2 @@
1
- "use strict";import f from"./thirdparty/merge.js";import{getFeature as c}from"./FeaturesRegistry.js";import{DEFAULT_THEME as d}from"./generated/AssetParameters.js";import u from"./validateThemeRoot.js";import m from"./types/AnimationMode.js";import{resetConfiguration as h}from"./config/ConfigurationReset.js";import{getLocationSearch as y}from"./Location.js";let p=!1,t={animationMode:m.Full,theme:d,themeRoot:void 0,rtl:void 0,language:void 0,timezone:void 0,calendarType:void 0,secondaryCalendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1,defaultFontLoading:!0,enableDefaultTooltips:!0};const C=()=>(o(),t.animationMode),T=()=>(o(),t.theme),S=()=>{if(o(),t.themeRoot!==void 0){if(!u(t.themeRoot)){console.warn(`The ${t.themeRoot} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}return t.themeRoot}},L=()=>(o(),t.language),R=()=>(o(),t.fetchDefaultLanguage),F=()=>(o(),t.noConflict),U=()=>(o(),t.defaultFontLoading),b=()=>(o(),t.enableDefaultTooltips),D=()=>(o(),t.calendarType),I=()=>(o(),t.secondaryCalendarType),O=()=>(o(),t.timezone),M=()=>(o(),t.formatSettings),i=new Map;i.set("true",!0),i.set("false",!1);const w=()=>{const n=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let e;if(n){try{e=JSON.parse(n.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}e&&(t=f(t,e))}},z=()=>{const n=new URLSearchParams(y());n.forEach((e,r)=>{const a=r.split("sap-").length;a===0||a===r.split("sap-ui-").length||g(r,e,"sap")}),n.forEach((e,r)=>{r.startsWith("sap-ui")&&g(r,e,"sap-ui")})},E=n=>{const e=n.split("@")[1];return u(e)},P=(n,e)=>n==="theme"&&e.includes("@")?e.split("@")[0]:e,g=(n,e,r)=>{const a=e.toLowerCase(),s=n.split(`${r}-`)[1];i.has(e)&&(e=i.get(a)),s==="theme"?(t.theme=P(s,e),e&&e.includes("@")&&(t.themeRoot=E(e))):t[s]=e},j=()=>{const n=c("OpenUI5Support");if(!n||!n.isOpenUI5Detected())return;const e=n.getConfigurationSettingsObject();t=f(t,e)},o=()=>{typeof document>"u"||p||(l(),p=!0)},l=n=>{n&&h(),w(),z(),j()};export{C as getAnimationMode,T as getTheme,S as getThemeRoot,L as getLanguage,R as getFetchDefaultLanguage,F as getNoConflict,D as getCalendarType,I as getSecondaryCalendarType,O as getTimezone,M as getFormatSettings,U as getDefaultFontLoading,l as resetConfiguration,b as getEnableDefaultTooltips};
1
+ "use strict";import f from"./thirdparty/merge.js";import{getFeature as l}from"./FeaturesRegistry.js";import{DEFAULT_THEME as c}from"./generated/AssetParameters.js";import m from"./types/AnimationMode.js";import{resetConfiguration as d}from"./config/ConfigurationReset.js";import{getLocationSearch as h}from"./Location.js";let u=!1,t={animationMode:m.Full,theme:c,themeRoot:void 0,rtl:void 0,language:void 0,timezone:void 0,calendarType:void 0,secondaryCalendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1,defaultFontLoading:!0,enableDefaultTooltips:!0};const y=()=>(o(),t.animationMode),C=()=>(o(),t.theme),T=()=>(o(),t.themeRoot),S=()=>(o(),t.language),L=()=>(o(),t.fetchDefaultLanguage),F=()=>(o(),t.noConflict),U=()=>(o(),t.defaultFontLoading),b=()=>(o(),t.enableDefaultTooltips),D=()=>(o(),t.calendarType),I=()=>(o(),t.secondaryCalendarType),O=()=>(o(),t.timezone),R=()=>(o(),t.formatSettings),i=new Map;i.set("true",!0),i.set("false",!1);const M=()=>{const n=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let e;if(n){try{e=JSON.parse(n.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}e&&(t=f(t,e))}},z=()=>{const n=new URLSearchParams(h());n.forEach((e,a)=>{const r=a.split("sap-").length;r===0||r===a.split("sap-ui-").length||p(a,e,"sap")}),n.forEach((e,a)=>{a.startsWith("sap-ui")&&p(a,e,"sap-ui")})},E=n=>n.split("@")[1],P=(n,e)=>n==="theme"&&e.includes("@")?e.split("@")[0]:e,p=(n,e,a)=>{const r=e.toLowerCase(),s=n.split(`${a}-`)[1];i.has(e)&&(e=i.get(r)),s==="theme"?(t.theme=P(s,e),e&&e.includes("@")&&(t.themeRoot=E(e))):t[s]=e},w=()=>{const n=l("OpenUI5Support");if(!n||!n.isOpenUI5Detected())return;const e=n.getConfigurationSettingsObject();t=f(t,e)},o=()=>{typeof document>"u"||u||(g(),u=!0)},g=n=>{n&&d(),M(),z(),w()};export{y as getAnimationMode,C as getTheme,T as getThemeRoot,S as getLanguage,L as getFetchDefaultLanguage,F as getNoConflict,D as getCalendarType,I as getSecondaryCalendarType,O as getTimezone,R as getFormatSettings,U as getDefaultFontLoading,g as resetConfiguration,b as getEnableDefaultTooltips};
2
2
  //# sourceMappingURL=InitialConfiguration.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/InitialConfiguration.ts"],
4
- "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\nimport { resetConfiguration as resetConfigurationFn } from \"./config/ConfigurationReset.js\";\nimport { getLocationSearch } from \"./Location.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n\tdefaultFontLoading: boolean,\n\tenableDefaultTooltips: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n\tdefaultFontLoading: true,\n\tenableDefaultTooltips: true,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\n\tif (initialConfig.themeRoot === undefined) {\n\t\treturn;\n\t}\n\n\tif (!validateThemeRoot(initialConfig.themeRoot)) {\n\t\tconsole.warn(`The ${initialConfig.themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\nconst getDefaultFontLoading = () => {\n\tinitConfiguration();\n\treturn initialConfig.defaultFontLoading;\n};\n\nconst getEnableDefaultTooltips = () => {\n\tinitConfiguration();\n\treturn initialConfig.enableDefaultTooltips;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(getLocationSearch());\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\tresetConfiguration();\n\n\tinitialized = true;\n};\n\n/**\n * Internaly exposed method to enable configurations in tests.\n * @private\n */\nconst resetConfiguration = (testEnv?: boolean) => {\n\tif (testEnv) {\n\t\tresetConfigurationFn();\n\t}\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n\tgetDefaultFontLoading,\n\tresetConfiguration,\n\tgetEnableDefaultTooltips,\n};\n"],
5
- "mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,iCAC9B,OAAOC,MAAuB,yBAG9B,OAAOC,MAAmB,2BAE1B,OAAS,sBAAsBC,MAA4B,iCAC3D,OAAS,qBAAAC,MAAyB,gBAElC,IAAIC,EAAc,GAkBdC,EAA+B,CAClC,cAAeJ,EAAc,KAC7B,MAAOF,EACP,UAAW,OACX,IAAK,OACL,SAAU,OACV,SAAU,OACV,aAAc,OACd,sBAAuB,OACvB,WAAY,GACZ,eAAgB,CAAC,EACjB,qBAAsB,GACtB,mBAAoB,GACpB,sBAAuB,EACxB,EAGA,MAAMO,EAAmB,KACxBC,EAAkB,EACXF,EAAc,eAGhBG,EAAW,KAChBD,EAAkB,EACXF,EAAc,OAGhBI,EAAe,IAAM,CAG1B,GAFAF,EAAkB,EAEdF,EAAc,YAAc,OAIhC,IAAI,CAACL,EAAkBK,EAAc,SAAS,EAAG,CAChD,QAAQ,KAAK,OAAOA,EAAc,SAAS,0FAA0F,EACrI,MACD,CAEA,OAAOA,EAAc,UACtB,EAEMK,EAAc,KACnBH,EAAkB,EACXF,EAAc,UAQhBM,EAA0B,KAC/BJ,EAAkB,EACXF,EAAc,sBAGhBO,EAAgB,KACrBL,EAAkB,EACXF,EAAc,YAGhBQ,EAAwB,KAC7BN,EAAkB,EACXF,EAAc,oBAGhBS,EAA2B,KAChCP,EAAkB,EACXF,EAAc,uBAOhBU,EAAkB,KACvBR,EAAkB,EACXF,EAAc,cAGhBW,EAA2B,KAChCT,EAAkB,EACXF,EAAc,uBAOhBY,EAAc,KACnBV,EAAkB,EACXF,EAAc,UAGhBa,EAAoB,KACzBX,EAAkB,E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P,CAAK,EAEvDA,GAASA,EAAM,SAAS,GAAG,IAC9BpB,EAAc,UAAYwB,EAA6BJ,CAAK,IAG7DpB,EAAc2B,CAAK,EAAIP,CAEzB,EAEMU,EAA4B,IAAM,CACvC,MAAMC,EAAiBtC,EAAkC,gBAAgB,EACzE,GAAI,CAACsC,GAAkB,CAACA,EAAe,kBAAkB,EACxD,OAGD,MAAMC,EAAgBD,EAAe,+BAA+B,EACpE/B,EAAgBR,EAAMQ,EAAegC,CAAa,CACnD,EAEM9B,EAAoB,IAAM,CAC3B,OAAO,SAAa,KAAeH,IAIvCkC,EAAmB,EAEnBlC,EAAc,GACf,EAMMkC,EAAsBC,GAAsB,CAC7CA,GACHrC,EAAqB,EAGtBkB,EAAyB,EAGzBG,EAAmB,EAGnBY,EAA0B,CAC3B,EAEA,OACC7B,KAAA,iBACAE,KAAA,SACAC,KAAA,aACAC,KAAA,YACAC,KAAA,wBACAC,KAAA,cACAG,KAAA,gBACAC,KAAA,yBACAC,KAAA,YACAC,KAAA,kBACAL,KAAA,sBACAyB,KAAA,mBACAxB,KAAA",
6
- "names": ["merge", "getFeature", "DEFAULT_THEME", "validateThemeRoot", "AnimationMode", "resetConfigurationFn", "getLocationSearch", "initialized", "initialConfig", "getAnimationMode", "initConfiguration", "getTheme", "getThemeRoot", "getLanguage", "getFetchDefaultLanguage", "getNoConflict", "getDefaultFontLoading", "getEnableDefaultTooltips", "getCalendarType", "getSecondaryCalendarType", "getTimezone", "getFormatSettings", "booleanMapping", "parseConfigurationScript", "configScript", "configJSON", "parseURLParameters", "params", "value", "key", "parts", "applyURLParam", "normalizeThemeRootParamValue", "themeRoot", "normalizeThemeParamValue", "param", "paramType", "lowerCaseValue", "applyOpenUI5Configuration", "openUI5Support", "OpenUI5Config", "resetConfiguration", "testEnv"]
4
+ "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\nimport { resetConfiguration as resetConfigurationFn } from \"./config/ConfigurationReset.js\";\nimport { getLocationSearch } from \"./Location.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n\tdefaultFontLoading: boolean,\n\tenableDefaultTooltips: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n\tdefaultFontLoading: true,\n\tenableDefaultTooltips: true,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\nconst getDefaultFontLoading = () => {\n\tinitConfiguration();\n\treturn initialConfig.defaultFontLoading;\n};\n\nconst getEnableDefaultTooltips = () => {\n\tinitConfiguration();\n\treturn initialConfig.enableDefaultTooltips;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(getLocationSearch());\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn themeRoot;\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\tresetConfiguration();\n\n\tinitialized = true;\n};\n\n/**\n * Internaly exposed method to enable configurations in tests.\n * @private\n */\nconst resetConfiguration = (testEnv?: boolean) => {\n\tif (testEnv) {\n\t\tresetConfigurationFn();\n\t}\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n\tgetDefaultFontLoading,\n\tresetConfiguration,\n\tgetEnableDefaultTooltips,\n};\n"],
5
+ "mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,iCAG9B,OAAOC,MAAmB,2BAE1B,OAAS,sBAAsBC,MAA4B,iCAC3D,OAAS,qBAAAC,MAAyB,gBAElC,IAAIC,EAAc,GAkBdC,EAA+B,CAClC,cAAeJ,EAAc,KAC7B,MAAOD,EACP,UAAW,OACX,IAAK,OACL,SAAU,OACV,SAAU,OACV,aAAc,OACd,sBAAuB,OACvB,WAAY,GACZ,eAAgB,CAAC,EACjB,qBAAsB,GACtB,mBAAoB,GACpB,sBAAuB,EACxB,EAGA,MAAMM,EAAmB,KACxBC,EAAkB,EACXF,EAAc,eAGhBG,EAAW,KAChBD,EAAkB,EACXF,EAAc,OAGhBI,EAAe,KACpBF,EAAkB,EACXF,EAAc,WAGhBK,EAAc,KACnBH,EAAkB,EACXF,EAAc,UAQhBM,EAA0B,KAC/BJ,EAAkB,EACXF,EAAc,sBAGhBO,EAAgB,KACrBL,EAAkB,EACXF,EAAc,YAGhBQ,EAAwB,KAC7BN,EAAkB,EACXF,EAAc,oBAGhBS,EAA2B,KAChCP,EAAkB,EACXF,EAAc,uBAOhBU,EAAkB,KACvBR,EAAkB,EACXF,EAAc,cAGhBW,EAA2B,KAChCT,EAAkB,EACXF,EAAc,uBAOhBY,EAAc,KACnBV,EAAkB,EACXF,EAAc,UAGhBa,EAAoB,KACzBX,EAAkB,EACXF,EAAc,gBAGhBc,EAAiB,IAAI,IAC3BA,EAAe,IAAI,OAAQ,EAAI,EAC/BA,EAAe,IAAI,QAAS,EAAK,EAEjC,MAAMC,EAA2B,IAAM,CACtC,MAAMC,EAAe,SAAS,cAAc,mBAAmB,GAAK,SAA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AAMC,EAAgBD,EAAe,+BAA+B,EACpE9B,EAAgBP,EAAMO,EAAe+B,CAAa,CACnD,EAEM7B,EAAoB,IAAM,CAC3B,OAAO,SAAa,KAAeH,IAIvCiC,EAAmB,EAEnBjC,EAAc,GACf,EAMMiC,EAAsBC,GAAsB,CAC7CA,GACHpC,EAAqB,EAGtBkB,EAAyB,EAGzBG,EAAmB,EAGnBW,EAA0B,CAC3B,EAEA,OACC5B,KAAA,iBACAE,KAAA,SACAC,KAAA,aACAC,KAAA,YACAC,KAAA,wBACAC,KAAA,cACAG,KAAA,gBACAC,KAAA,yBACAC,KAAA,YACAC,KAAA,kBACAL,KAAA,sBACAwB,KAAA,mBACAvB,KAAA",
6
+ "names": ["merge", "getFeature", "DEFAULT_THEME", "AnimationMode", "resetConfigurationFn", "getLocationSearch", "initialized", "initialConfig", "getAnimationMode", "initConfiguration", "getTheme", "getThemeRoot", "getLanguage", "getFetchDefaultLanguage", "getNoConflict", "getDefaultFontLoading", "getEnableDefaultTooltips", "getCalendarType", "getSecondaryCalendarType", "getTimezone", "getFormatSettings", "booleanMapping", "parseConfigurationScript", "configScript", "configJSON", "parseURLParameters", "params", "value", "key", "parts", "applyURLParam", "normalizeThemeRootParamValue", "normalizeThemeParamValue", "param", "paramType", "lowerCaseValue", "applyOpenUI5Configuration", "openUI5Support", "OpenUI5Config", "resetConfiguration", "testEnv"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import r from"../util/createLinkInHead.js";import s from"../validateThemeRoot.js";import{getThemeRoot as a}from"../InitialConfiguration.js";import{getTheme as m}from"./Theme.js";import{attachConfigurationReset as d}from"./ConfigurationReset.js";let t;d(()=>{t=void 0});const n=()=>(t===void 0&&(t=a()),t),c=e=>{if(t!==e){if(t=e,!s(e)){console.warn(`The ${e} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}return i(m())}},u=e=>`${n()}Base/baseLib/${e}/css_variables.css`,i=async e=>{const o=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);o&&document.head.removeChild(o),await r(u(e),{"sap-ui-webcomponents-theme":e})};export{n as getThemeRoot,c as setThemeRoot,i as attachCustomThemeStylesToHead};
1
+ "use strict";import m from"../util/createLinkInHead.js";import a from"../validateThemeRoot.js";import{getThemeRoot as d}from"../InitialConfiguration.js";import{getTheme as c}from"./Theme.js";import{attachConfigurationReset as u}from"./ConfigurationReset.js";let t;u(()=>{t=void 0});const r=()=>(t===void 0&&(t=d()),t),h=e=>{if(t!==e)return t=e,s(c())},f=(e,o)=>`${o}Base/baseLib/${e}/css_variables.css`,s=async e=>{const o=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);o&&document.head.removeChild(o);const n=r();if(!n)return;const i=a(n);if(!i){console.warn(`The ${n} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}await m(f(e,i),{"sap-ui-webcomponents-theme":e})};export{r as getThemeRoot,h as setThemeRoot,s as attachCustomThemeStylesToHead};
2
2
  //# sourceMappingURL=ThemeRoot.js.map