@ui5/webcomponents-core
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [0.9.0](https://github.com/SAP/ui5-webcomponents/compare/v0.8.0...v0.9.0) (2019-03-18) | ||
### Bug Fixes | ||
* correct calling unexisting method ([#157](https://github.com/SAP/ui5-webcomponents/issues/157)) ([0a8c8cd](https://github.com/SAP/ui5-webcomponents/commit/0a8c8cd)) | ||
* correct device detection error on mobile ([#143](https://github.com/SAP/ui5-webcomponents/issues/143)) ([857754e](https://github.com/SAP/ui5-webcomponents/commit/857754e)) | ||
# [0.8.0](https://github.com/SAP/ui5-webcomponents/compare/v0.7.0...v0.8.0) (2019-03-01) | ||
@@ -12,3 +24,2 @@ | ||
* **eventing:** implement standard gestures ([#22](https://github.com/SAP/ui5-webcomponents/issues/22)) ([393fdd5](https://github.com/SAP/ui5-webcomponents/commit/393fdd5)) | ||
* load Web Components polyfill on demand ([#96](https://github.com/SAP/ui5-webcomponents/issues/96)) ([98b5174](https://github.com/SAP/ui5-webcomponents/commit/98b5174)) | ||
@@ -19,2 +30,3 @@ | ||
* any applications that want to support Edge and/or IE11 should now import the respective browser support module. For details, see the README.md | ||
* any applications that wants to support Edge and/or IE11 should now import the respective browser support module. For details, see the [README.md](/README.md#browser-support) | ||
* addCustomCSS is no longer on the Core object. Use Theming instead. [#58](https://github.com/SAP/ui5-webcomponents/pull/58) |
@@ -138,3 +138,3 @@ import now from './sap/base/util/now'; | ||
aScripts = document.querySelectorAll('SCRIPT[src]'); | ||
rBootScripts = /^(.*\/)?(?:sap-ui-(core|custom|boot|merged)(?:-.*)?)\.js(?:[?#]|$)/; | ||
rBootScripts = /^([^?#]*\/)?(?:sap-ui-(?:core|custom|boot|merged)(?:-[^?#/]*)?|jquery.sap.global|ui5loader(?:-autoconfig)?)\.js(?:[?#]|$)/; | ||
for (i = 0; i < aScripts.length; i++) { | ||
@@ -153,9 +153,2 @@ oResult = check(aScripts[i], rBootScripts); | ||
} | ||
if (oCfg instanceof window.HTMLElement) { | ||
oCfg = undefined; | ||
} | ||
var jsonConfig = document.getElementById('sap-ui-config'); | ||
if (jsonConfig && jsonConfig.type === 'application/json') { | ||
oCfg = Object.assign(oCfg || {}, JSON.parse(jsonConfig.innerHTML)); | ||
} | ||
oCfg = normalize(oCfg || {}); | ||
@@ -162,0 +155,0 @@ oCfg.resourceroots = oCfg.resourceroots || {}; |
import ObjectPath from '../../base/util/ObjectPath'; | ||
import Device from '../Device'; | ||
import assert from '../../base/assert'; | ||
@@ -115,3 +114,3 @@ import Log from '../../base/Log'; | ||
}; | ||
var WRITABLE_IFF_PHANTOM = !!Device.browser.phantomJS; | ||
var WRITABLE_IFF_PHANTOM = false; | ||
Object.defineProperty(Metadata.prototype, '_mImplementedTypes', { | ||
@@ -118,0 +117,0 @@ get: function () { |
@@ -100,4 +100,4 @@ import UniversalDate from './UniversalDate'; | ||
oCustomizationMap = {}; | ||
sDateFormat = sap.ui.getWCCore().getConfiguration().getFormatSettings().getLegacyDateFormat(); | ||
oCustomizationJSON = sap.ui.getWCCore().getConfiguration().getFormatSettings().getLegacyDateCalendarCustomizing(); | ||
sDateFormat = sap.ui.getWCCore().getFormatSettings().getLegacyDateFormat(); | ||
oCustomizationJSON = sap.ui.getWCCore().getFormatSettings().getLegacyDateCalendarCustomizing(); | ||
oCustomizationJSON = oCustomizationJSON || []; | ||
@@ -104,0 +104,0 @@ if (!sDateFormat && !oCustomizationJSON.length) { |
@@ -169,3 +169,3 @@ import BaseObject from '../../base/Object'; | ||
UniversalDate.getWeekByDate = function (sCalendarType, iYear, iMonth, iDay) { | ||
var oLocale = sap.ui.getWCCore().getConfiguration().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(clDate.UTC(iYear, iMonth, iDay)), iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay; | ||
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(clDate.UTC(iYear, iMonth, iDay)), iWeek, iLastYear, iNextYear, oLastFirstDay, oNextFirstDay; | ||
if (oLocale.getRegion() === 'US') { | ||
@@ -194,3 +194,3 @@ iWeek = calculateWeeks(oFirstDay, oDate); | ||
UniversalDate.getFirstDateOfWeek = function (sCalendarType, iYear, iWeek) { | ||
var oLocale = sap.ui.getWCCore().getConfiguration().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek); | ||
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek); | ||
if (oLocale.getRegion() === 'US' && iWeek === 0 && oFirstDay.getUTCFullYear() < iYear) { | ||
@@ -210,3 +210,3 @@ return { | ||
function getFirstDayOfFirstWeek(clDate, iYear) { | ||
var oLocale = sap.ui.getWCCore().getConfiguration().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), iMinDays = oLocaleData.getMinimalDaysInFirstWeek(), iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek(), oFirstDay = new clDate(clDate.UTC(iYear, 0, 1)), iDayCount = 7; | ||
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), iMinDays = oLocaleData.getMinimalDaysInFirstWeek(), iFirstDayOfWeek = oLocaleData.getFirstDayOfWeek(), oFirstDay = new clDate(clDate.UTC(iYear, 0, 1)), iDayCount = 7; | ||
while (oFirstDay.getUTCDay() !== iFirstDayOfWeek) { | ||
@@ -251,3 +251,3 @@ oFirstDay.setUTCDate(oFirstDay.getUTCDate() - 1); | ||
function getEras(sCalendarType) { | ||
var oLocale = sap.ui.getWCCore().getConfiguration().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), aEras = mEras[sCalendarType]; | ||
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), aEras = mEras[sCalendarType]; | ||
if (!aEras) { | ||
@@ -254,0 +254,0 @@ var aEras = oLocaleData.getEraDates(sCalendarType); |
@@ -1163,3 +1163,3 @@ import jQuery from '../thirdparty/jquery'; | ||
LocaleData.apply(this, arguments); | ||
this.mCustomData = sap.ui.getWCCore().getConfiguration().getFormatSettings().getCustomLocaleData(); | ||
this.mCustomData = sap.ui.getWCCore().getFormatSettings().getCustomLocaleData(); | ||
}, | ||
@@ -1166,0 +1166,0 @@ _get: function () { |
@@ -1,70 +0,11 @@ | ||
var Device = {}; | ||
var OS = { | ||
const Device = {}; | ||
const OS = { | ||
"WINDOWS": "win", | ||
"MACINTOSH": "mac", | ||
"LINUX": "linux", | ||
"IOS": "iOS", | ||
"ANDROID": "Android", | ||
"BLACKBERRY": "bb", | ||
"WINDOWS_PHONE": "winphone" | ||
"ANDROID": "Android" | ||
}; | ||
function getOS(userAgent) { | ||
userAgent = userAgent || navigator.userAgent; | ||
var rPlatform, aMatches; | ||
function getDesktopOS() { | ||
var sPlatform = navigator.platform; | ||
if (sPlatform.indexOf("Win") != -1) { | ||
var rVersion = /Windows NT (\d+).(\d)/i; | ||
var uaResult = userAgent.match(rVersion); | ||
var sVersionStr = ""; | ||
if (uaResult[1] == "6") { | ||
if (uaResult[2] == 1) { | ||
sVersionStr = "7"; | ||
} else if (uaResult[2] > 1) { | ||
sVersionStr = "8"; | ||
} | ||
} else { | ||
sVersionStr = uaResult[1]; | ||
} | ||
return { | ||
"name": OS.WINDOWS, | ||
"versionStr": sVersionStr | ||
}; | ||
} else if (sPlatform.indexOf("Mac") != -1) { | ||
return { | ||
"name": OS.MACINTOSH, | ||
"versionStr": "" | ||
}; | ||
} else if (sPlatform.indexOf("Linux") != -1) { | ||
return { | ||
"name": OS.LINUX, | ||
"versionStr": "" | ||
}; | ||
} | ||
oLogger.log(INFO, "OS detection returned no result"); | ||
return null; | ||
} | ||
rPlatform = /Windows Phone (?:OS )?([\d.]*)/; | ||
aMatches = userAgent.match(rPlatform); | ||
if (aMatches) { | ||
return { | ||
"name": OS.WINDOWS_PHONE, | ||
"versionStr": aMatches[1] | ||
}; | ||
} | ||
if (userAgent.indexOf("(BB10;") > 0) { | ||
rPlatform = /\sVersion\/([\d.]+)\s/; | ||
aMatches = userAgent.match(rPlatform); | ||
if (aMatches) { | ||
return { | ||
"name": OS.BLACKBERRY, | ||
"versionStr": aMatches[1] | ||
}; | ||
} else { | ||
return { | ||
"name": OS.BLACKBERRY, | ||
"versionStr": "10" | ||
}; | ||
} | ||
} | ||
const _getMobileOS = () => { | ||
const userAgent = navigator.userAgent; | ||
let rPlatform, aMatches; | ||
rPlatform = /\(([a-zA-Z ]+);\s(?:[U]?[;]?)([\D]+)((?:[\d._]*))(?:.*[\)][^\d]*)([\d.]*)\s/; | ||
@@ -74,3 +15,2 @@ aMatches = userAgent.match(rPlatform); | ||
var rAppleDevices = /iPhone|iPad|iPod/; | ||
var rBbDevices = /PlayBook|BlackBerry/; | ||
if (aMatches[0].match(rAppleDevices)) { | ||
@@ -82,3 +22,4 @@ aMatches[3] = aMatches[3].replace(/_/g, "."); | ||
}; | ||
} else if (aMatches[2].match(/Android/)) { | ||
} | ||
if (aMatches[2].match(/Android/)) { | ||
aMatches[2] = aMatches[2].replace(/\s/g, ""); | ||
@@ -89,7 +30,2 @@ return { | ||
}; | ||
} else if (aMatches[0].match(rBbDevices)) { | ||
return { | ||
"name": OS.BLACKBERRY, | ||
"versionStr": aMatches[4] | ||
}; | ||
} | ||
@@ -102,13 +38,36 @@ } | ||
"name": OS.ANDROID, | ||
"versionStr": aMatches.length == 3 ? aMatches[2] : "" | ||
"versionStr": aMatches.length === 3 ? aMatches[2] : "" | ||
}; | ||
} | ||
return getDesktopOS(); | ||
} | ||
function setOS(customUA) { | ||
Device.os = getOS(customUA) || ({}); | ||
}; | ||
const _getDesktopOS = () => { | ||
const sPlatform = navigator.platform; | ||
if (sPlatform.indexOf("Win") !== -1) { | ||
const rVersion = /Windows NT (\d+).(\d)/i; | ||
const uaResult = navigator.userAgent.match(rVersion); | ||
return { | ||
"name": OS.WINDOWS, | ||
"versionStr": uaResult[1] | ||
}; | ||
} | ||
if (sPlatform.indexOf("Mac") !== -1) { | ||
return { | ||
"name": OS.MACINTOSH, | ||
"versionStr": "" | ||
}; | ||
} | ||
return null; | ||
}; | ||
const _getOS = () => { | ||
return _getMobileOS() || _getDesktopOS(); | ||
}; | ||
const _setOS = () => { | ||
if (Device.os) { | ||
return; | ||
} | ||
Device.os = _getOS() || ({}); | ||
Device.os.OS = OS; | ||
Device.os.version = Device.os.versionStr ? parseFloat(Device.os.versionStr) : -1; | ||
if (Device.os.name) { | ||
for (var name in OS) { | ||
for (let name in OS) { | ||
if (OS[name] === Device.os.name) { | ||
@@ -119,6 +78,16 @@ Device.os[name.toLowerCase()] = true; | ||
} | ||
} | ||
setOS(); | ||
Device._setOS = setOS; | ||
var BROWSER = { | ||
}; | ||
const getOS = () => { | ||
if (!Device.os) { | ||
_setOS(); | ||
} | ||
return Device.os; | ||
}; | ||
const isAndroid = () => { | ||
if (!Device.os) { | ||
_setOS(); | ||
} | ||
return !!Device.os.android; | ||
}; | ||
const BROWSER = { | ||
"INTERNET_EXPLORER": "ie", | ||
@@ -131,25 +100,23 @@ "EDGE": "ed", | ||
}; | ||
var ua = navigator.userAgent; | ||
function getBrowser(customUa, customNav) { | ||
function calcBrowser(customUa) { | ||
var sUserAgent = (customUa || ua).toLowerCase(); | ||
var rwebkit = /(webkit)[ \/]([\w.]+)/; | ||
var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/; | ||
var rmsie = /(msie) ([\w.]+)/; | ||
var rmsie11 = /(trident)\/[\w.]+;.*rv:([\w.]+)/; | ||
var redge = /(edge)[ \/]([\w.]+)/; | ||
var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/; | ||
var browserMatch = redge.exec(sUserAgent) || rmsie11.exec(sUserAgent) || rwebkit.exec(sUserAgent) || ropera.exec(sUserAgent) || rmsie.exec(sUserAgent) || sUserAgent.indexOf("compatible") < 0 && rmozilla.exec(sUserAgent) || []; | ||
var oRes = { | ||
browser: browserMatch[1] || "", | ||
version: browserMatch[2] || "0" | ||
}; | ||
oRes[oRes.browser] = true; | ||
return oRes; | ||
} | ||
var oBrowser = calcBrowser(customUa); | ||
var sUserAgent = customUa || ua; | ||
var oNavigator = customNav || window.navigator; | ||
var oExpMobile; | ||
var oResult; | ||
const _calcBrowser = () => { | ||
const sUserAgent = navigator.userAgent.toLowerCase(); | ||
const rwebkit = /(webkit)[ \/]([\w.]+)/; | ||
const rmsie = /(msie) ([\w.]+)/; | ||
const rmsie11 = /(trident)\/[\w.]+;.*rv:([\w.]+)/; | ||
const redge = /(edge)[ \/]([\w.]+)/; | ||
const rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/; | ||
const browserMatch = redge.exec(sUserAgent) || rmsie11.exec(sUserAgent) || rwebkit.exec(sUserAgent) || rmsie.exec(sUserAgent) || sUserAgent.indexOf("compatible") < 0 && rmozilla.exec(sUserAgent) || []; | ||
const oRes = { | ||
browser: browserMatch[1] || "", | ||
version: browserMatch[2] || "0" | ||
}; | ||
oRes[oRes.browser] = true; | ||
return oRes; | ||
}; | ||
const _getBrowser = () => { | ||
const oBrowser = _calcBrowser(); | ||
const sUserAgent = navigator.userAgent; | ||
const oNavigator = window.navigator; | ||
let oExpMobile; | ||
let oResult; | ||
if (oBrowser.mozilla) { | ||
@@ -243,12 +210,3 @@ oExpMobile = /Mobile/; | ||
} else if (oBrowser.msie || oBrowser.trident) { | ||
var fVersion; | ||
if (document.documentMode && !customUa) { | ||
if (document.documentMode === 7) { | ||
fVersion = 8; | ||
} else { | ||
fVersion = parseFloat(document.documentMode); | ||
} | ||
} else { | ||
fVersion = parseFloat(oBrowser.version); | ||
} | ||
var fVersion = parseFloat(oBrowser.version); | ||
oResult = { | ||
@@ -277,10 +235,6 @@ name: BROWSER.INTERNET_EXPLORER, | ||
} | ||
if ((((oBrowser.chrome || window.Intl && window.Intl.v8BreakIterator) && "CSS") in window)) { | ||
oResult.blink = true; | ||
} | ||
return oResult; | ||
} | ||
Device._testUserAgent = getBrowser; | ||
function setBrowser() { | ||
Device.browser = getBrowser(); | ||
}; | ||
const _setBrowser = () => { | ||
Device.browser = _getBrowser(); | ||
Device.browser.BROWSER = BROWSER; | ||
@@ -294,20 +248,56 @@ if (Device.browser.name) { | ||
} | ||
} | ||
setBrowser(); | ||
Device.support = {}; | ||
Device.support.touch = !!(("ontouchstart" in window) || window.DocumentTouch && document instanceof window.DocumentTouch); | ||
if (Device.browser.phantomJS) { | ||
oLogger.log(ERROR, "PhantomJS is not supported! UI5 might break on PhantomJS in future releases. Please use Chrome Headless instead."); | ||
Device.support.touch = false; | ||
} | ||
Device.support.pointer = !!window.PointerEvent; | ||
Device.support.matchmedia = !!window.matchMedia; | ||
var m = Device.support.matchmedia ? window.matchMedia("all and (max-width:0px)") : null; | ||
Device.support.matchmedialistener = !!(m && m.addListener); | ||
Device.support.orientation = !!(((("orientation" in window) && "onorientationchange") in window)); | ||
Device.support.retina = window.retina || window.devicePixelRatio >= 2; | ||
Device.support.websocket = ("WebSocket" in window); | ||
Device.support.input = {}; | ||
Device.support.input.placeholder = ("placeholder" in document.createElement("input")); | ||
var SYSTEMTYPE = { | ||
}; | ||
const getBrowser = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return Device.browser; | ||
}; | ||
const isIE = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return !!Device.browser.msie; | ||
}; | ||
const isEdge = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return !!Device.browser.edge; | ||
}; | ||
const isChrome = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return !!Device.browser.chrome; | ||
}; | ||
const isFF = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return !!Device.browser.firefox; | ||
}; | ||
const isSafari = () => { | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
return !!Device.browser.safari; | ||
}; | ||
const _setSupport = () => { | ||
if (Device.support) { | ||
return; | ||
} | ||
if (!Device.browser) { | ||
_setBrowser(); | ||
} | ||
Device.support = {}; | ||
Device.support.touch = !!(("ontouchstart" in window) || navigator.maxTouchPoints > 0 || window.DocumentTouch && document instanceof window.DocumentTouch); | ||
}; | ||
const supportTouch = () => { | ||
if (!Device.support) { | ||
_setSupport(); | ||
} | ||
return !!Device.support.touch; | ||
}; | ||
const SYSTEMTYPE = { | ||
"TABLET": "tablet", | ||
@@ -318,22 +308,8 @@ "PHONE": "phone", | ||
}; | ||
Device.system = {}; | ||
function getSystem(simMobileOnDesktop, customUA) { | ||
var bTabletDetected = isTablet(customUA); | ||
var isWin8Upwards = Device.os.windows && Device.os.version >= 8; | ||
var isWin7 = Device.os.windows && Device.os.version === 7; | ||
var oSystem = {}; | ||
oSystem.tablet = !!((Device.support.touch && !isWin7 || isWin8Upwards || !!simMobileOnDesktop) && bTabletDetected); | ||
oSystem.phone = !!(Device.os.windows_phone || (Device.support.touch && !isWin7 || !!simMobileOnDesktop) && !bTabletDetected); | ||
oSystem.desktop = !!(!oSystem.tablet && !oSystem.phone || isWin8Upwards || isWin7 || Device.os.linux); | ||
oSystem.combi = oSystem.desktop && oSystem.tablet; | ||
oSystem.SYSTEMTYPE = SYSTEMTYPE; | ||
for (var type in SYSTEMTYPE) {} | ||
return oSystem; | ||
} | ||
function isTablet(customUA) { | ||
var sUserAgent = customUA || navigator.userAgent; | ||
const _isTablet = () => { | ||
const sUserAgent = navigator.userAgent; | ||
if (Device.os.name === Device.os.OS.IOS) { | ||
return (/ipad/i).test(sUserAgent); | ||
} else { | ||
if (Device.support.touch) { | ||
if (supportTouch()) { | ||
if (Device.os.windows && Device.os.version >= 8) { | ||
@@ -345,23 +321,65 @@ return true; | ||
} else { | ||
var densityFactor = window.devicePixelRatio ? window.devicePixelRatio : 1; | ||
let densityFactor = window.devicePixelRatio ? window.devicePixelRatio : 1; | ||
if (Device.os.android && Device.browser.webkit && parseFloat(Device.browser.webkitVersion) > 537.1) { | ||
densityFactor = 1; | ||
} | ||
var bTablet = Math.min(window.screen.width / densityFactor, window.screen.height / densityFactor) >= 600; | ||
const bTablet = Math.min(window.screen.width / densityFactor, window.screen.height / densityFactor) >= 600; | ||
return bTablet; | ||
} | ||
} else { | ||
var bAndroidPhone = (/(?=android)(?=.*mobile)/i).test(sUserAgent); | ||
const bAndroidPhone = (/(?=android)(?=.*mobile)/i).test(sUserAgent); | ||
return Device.browser.msie && sUserAgent.indexOf("Touch") !== -1 || Device.os.android && !bAndroidPhone; | ||
} | ||
} | ||
} | ||
function setSystem(simMobileOnDesktop, customUA) { | ||
Device.system = getSystem(simMobileOnDesktop, customUA); | ||
}; | ||
const _getSystem = () => { | ||
const bTabletDetected = _isTablet(); | ||
const isWin8Upwards = Device.os.windows && Device.os.version >= 8; | ||
const oSystem = {}; | ||
oSystem.tablet = !!((Device.support.touch || isWin8Upwards) && bTabletDetected); | ||
oSystem.phone = !!(Device.os.windows_phone || Device.support.touch && !bTabletDetected); | ||
oSystem.desktop = !!(!oSystem.tablet && !oSystem.phone || isWin8Upwards); | ||
oSystem.combi = oSystem.desktop && oSystem.tablet; | ||
oSystem.SYSTEMTYPE = SYSTEMTYPE; | ||
return oSystem; | ||
}; | ||
const _setSystem = () => { | ||
_setSupport(); | ||
_setOS(); | ||
Device.system = {}; | ||
Device.system = _getSystem(); | ||
if (Device.system.tablet || Device.system.phone) { | ||
Device.browser.mobile = true; | ||
} | ||
} | ||
setSystem(); | ||
Device._getSystem = getSystem; | ||
export default Device; | ||
}; | ||
const getSystem = () => { | ||
if (!Device.system) { | ||
_setSystem(); | ||
} | ||
return Device.system; | ||
}; | ||
const isDesktop = () => { | ||
if (!Device.system) { | ||
_setSystem(); | ||
} | ||
return Device.system.desktop; | ||
}; | ||
const isTablet = () => { | ||
if (!Device.system) { | ||
_setSystem(); | ||
} | ||
return Device.system.tablet; | ||
}; | ||
const isPhone = () => { | ||
if (!Device.system) { | ||
_setSystem(); | ||
} | ||
return Device.system.phone; | ||
}; | ||
const isMobile = () => { | ||
if (!Device.system) { | ||
_setSystem(); | ||
} | ||
return Device.browser.mobile; | ||
}; | ||
export {isIE, isEdge, isChrome, isFF, isSafari, isMobile, isDesktop, isTablet, isPhone, isAndroid, getOS, getSystem, getBrowser, supportTouch}; |
{ | ||
"name": "@ui5/webcomponents-core", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "UI5 Web Components: webcomponents.core", | ||
@@ -5,0 +5,0 @@ "author": "SAP SE (https://www.sap.com)", |
@@ -12,3 +12,3 @@ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/master/docs/images/UI5_logo_wide.png) | ||
- [UI5 Web Components](https://sap.github.io/ui5-webcomponents) | ||
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground.html) | ||
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/) | ||
@@ -15,0 +15,0 @@ ## Support |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
399890
10649438