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

package.dist.InitialConfiguration.js.map Maven / Gradle / Ivy

{"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,CAAC;AAGrD,IAAI,WAAW,GAAG,KAAK,CAAC;AAiBxB,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;IACjB,cAAc,EAAE,EAAE;IAClB,oBAAoB,EAAE,KAAK;IAC3B,kBAAkB,EAAE,IAAI;CACxB,CAAC;AAEF,sBAAsB;AACtB,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,iBAAiB,EAAE,CAAC;IACpB,OAAO,aAAa,CAAC,aAAa,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;IACrB,iBAAiB,EAAE,CAAC;IACpB,OAAO,aAAa,CAAC,KAAK,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,GAAG,EAAE;IACzB,iBAAiB,EAAE,CAAC;IACpB,OAAO,aAAa,CAAC,SAAS,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,iBAAiB,EAAE,CAAC;IACpB,OAAO,aAAa,CAAC,QAAQ,CAAC;AAC/B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Ac,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;QACnD,OAAO;KACP;IAED,4CAA4C;IAC5C,wBAAwB,EAAE,CAAC;IAE3B,8DAA8D;IAC9D,kBAAkB,EAAE,CAAC;IAErB,yDAAyD;IACzD,yBAAyB,EAAE,CAAC;IAE5B,WAAW,GAAG,IAAI,CAAC;AACpB,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,GACrB,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\";\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};\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};\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\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(window.location.search);\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 @ 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(\"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\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\tinitialized = true;\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};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy