@ui5/webcomponents-core
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [0.19.0](https://github.com/SAP/ui5-webcomponents/compare/v0.18.0...v0.19.0) (2020-03-27) | ||
**Note:** Version bump only for package @ui5/webcomponents-core | ||
# [0.18.0](https://github.com/SAP/ui5-webcomponents/compare/v0.17.0...v0.18.0) (2019-12-02) | ||
@@ -8,0 +16,0 @@ |
@@ -13,3 +13,3 @@ import now from './util/now.js'; | ||
}; | ||
var sDefaultComponent, aLog = [], mMaxLevel = { '': Log.Level.ERROR }, oListener = null, bLogSupportInfo = false; | ||
var sDefaultComponent, aLog = [], mMaxLevel = { '': Log.Level.ERROR }, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false; | ||
function pad0(i, w) { | ||
@@ -21,2 +21,16 @@ return ('000' + String(i)).slice(-w); | ||
} | ||
function discardLogEntries() { | ||
var iLogLength = aLog.length; | ||
if (iLogLength) { | ||
var iEntriesToKeep = Math.min(iLogLength, Math.floor(iLogEntriesLimit * 0.7)); | ||
if (oListener) { | ||
oListener.onDiscardLogEntries(aLog.slice(0, iLogLength - iEntriesToKeep)); | ||
} | ||
if (iEntriesToKeep) { | ||
aLog = aLog.slice(-iEntriesToKeep, iLogLength); | ||
} else { | ||
aLog = []; | ||
} | ||
} | ||
} | ||
function getLogEntryListenerInstance() { | ||
@@ -33,2 +47,9 @@ if (!oListener) { | ||
}, | ||
onDiscardLogEntries: function (aDiscardedLogEntries) { | ||
for (var i = 0; i < oListener.listeners.length; i++) { | ||
if (oListener.listeners[i].onDiscardLogEntries) { | ||
oListener.listeners[i].onDiscardLogEntries(aDiscardedLogEntries); | ||
} | ||
} | ||
}, | ||
attach: function (oLog, oLstnr) { | ||
@@ -98,12 +119,10 @@ if (oLstnr) { | ||
function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) { | ||
if (bLogSupportInfo) { | ||
if (!fnSupportInfo && !sComponent && typeof sDetails === 'function') { | ||
fnSupportInfo = sDetails; | ||
sDetails = ''; | ||
} | ||
if (!fnSupportInfo && typeof sComponent === 'function') { | ||
fnSupportInfo = sComponent; | ||
sComponent = ''; | ||
} | ||
if (!fnSupportInfo && !sComponent && typeof sDetails === 'function') { | ||
fnSupportInfo = sDetails; | ||
sDetails = ''; | ||
} | ||
if (!fnSupportInfo && typeof sComponent === 'function') { | ||
fnSupportInfo = sComponent; | ||
sComponent = ''; | ||
} | ||
sComponent = sComponent || sDefaultComponent; | ||
@@ -123,3 +142,8 @@ if (iLevel <= level(sComponent)) { | ||
} | ||
aLog.push(oLogEntry); | ||
if (iLogEntriesLimit) { | ||
if (aLog.length >= iLogEntriesLimit) { | ||
discardLogEntries(); | ||
} | ||
aLog.push(oLogEntry); | ||
} | ||
if (oListener) { | ||
@@ -129,19 +153,31 @@ oListener.onLogEntry(oLogEntry); | ||
if (console) { | ||
var logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component; | ||
var isDetailsError = sDetails instanceof Error, logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component; | ||
switch (iLevel) { | ||
case Log.Level.FATAL: | ||
case Log.Level.ERROR: | ||
console.error(logText); | ||
isDetailsError ? console.error(logText, '\n', sDetails) : console.error(logText); | ||
break; | ||
case Log.Level.WARNING: | ||
console.warn(logText); | ||
isDetailsError ? console.warn(logText, '\n', sDetails) : console.warn(logText); | ||
break; | ||
case Log.Level.INFO: | ||
console.info ? console.info(logText) : console.log(logText); | ||
if (console.info) { | ||
isDetailsError ? console.info(logText, '\n', sDetails) : console.info(logText); | ||
} else { | ||
isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText); | ||
} | ||
break; | ||
case Log.Level.DEBUG: | ||
console.debug ? console.debug(logText) : console.log(logText); | ||
if (console.debug) { | ||
isDetailsError ? console.debug(logText, '\n', sDetails) : console.debug(logText); | ||
} else { | ||
isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText); | ||
} | ||
break; | ||
case Log.Level.TRACE: | ||
console.trace ? console.trace(logText) : console.log(logText); | ||
if (console.trace) { | ||
isDetailsError ? console.trace(logText, '\n', sDetails) : console.trace(logText); | ||
} else { | ||
isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText); | ||
} | ||
break; | ||
@@ -159,2 +195,14 @@ } | ||
}; | ||
Log.getLogEntriesLimit = function () { | ||
return iLogEntriesLimit; | ||
}; | ||
Log.setLogEntriesLimit = function (iLimit) { | ||
if (iLimit < 0) { | ||
throw new Error('The log entries limit needs to be greater than or equal to 0!'); | ||
} | ||
iLogEntriesLimit = iLimit; | ||
if (aLog.length >= iLogEntriesLimit) { | ||
discardLogEntries(); | ||
} | ||
}; | ||
Log.addLogListener = function (oListener) { | ||
@@ -161,0 +209,0 @@ getLogEntryListenerInstance().attach(this, oListener); |
@@ -15,3 +15,3 @@ import assert from '../assert.js'; | ||
} else if ($3) { | ||
return String(aValues[parseInt($3, 10)]); | ||
return String(aValues[parseInt($3)]); | ||
} | ||
@@ -18,0 +18,0 @@ throw new Error('formatMessage: pattern syntax error at pos. ' + offset); |
var ObjectPath = {}; | ||
var defaultRootContext = window; | ||
function getObjectPathArray(vObjectPath) { | ||
return Array.isArray(vObjectPath) ? vObjectPath : vObjectPath.split("."); | ||
return Array.isArray(vObjectPath) ? vObjectPath.slice() : vObjectPath.split("."); | ||
} | ||
@@ -6,0 +6,0 @@ ObjectPath.create = function (vObjectPath, oRootContext) { |
@@ -109,3 +109,3 @@ import BaseObject from '../base/Object.js'; | ||
Locale._cldrLocales = getDesigntimePropertyAsArray('$cldr-locales:ar,ar_EG,ar_SA,bg,br,ca,cs,da,de,de_AT,de_CH,el,el_CY,en,en_AU,en_GB,en_HK,en_IE,en_IN,en_NZ,en_PG,en_SG,en_ZA,es,es_AR,es_BO,es_CL,es_CO,es_MX,es_PE,es_UY,es_VE,et,fa,fi,fr,fr_BE,fr_CA,fr_CH,fr_LU,he,hi,hr,hu,id,it,it_CH,ja,kk,ko,lt,lv,ms,nb,nl,nl_BE,nn,pl,pt,pt_PT,ro,ru,ru_UA,sk,sl,sr,sv,th,tr,uk,vi,zh_CN,zh_HK,zh_SG,zh_TW$'); | ||
Locale._coreI18nLocales = getDesigntimePropertyAsArray('$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,ko,lt,lv,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$'); | ||
Locale._coreI18nLocales = getDesigntimePropertyAsArray('$core-i18n-locales:,ar,bg,ca,cs,da,de,el,en,es,et,fi,fr,hi,hr,hu,it,iw,ja,kk,ko,lt,lv,ms,nl,no,pl,pt,ro,ru,sh,sk,sl,sv,th,tr,uk,vi,zh_CN,zh_TW$'); | ||
Locale._impliesRTL = function (vLanguage) { | ||
@@ -112,0 +112,0 @@ var oLocale = vLanguage instanceof Locale ? vLanguage : new Locale(vLanguage); |
{ | ||
"name": "@ui5/webcomponents-core", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "UI5 Web Components: webcomponents.core", | ||
@@ -35,5 +35,4 @@ "author": "SAP SE (https://www.sap.com)", | ||
"devDependencies": { | ||
"@buxlabs/amd-to-es6": "^0.13.2", | ||
"@openui5/sap.ui.core": "1.60.2", | ||
"abstract-syntax-tree": "1.0.3", | ||
"@buxlabs/amd-to-es6": "^0.15.0", | ||
"@openui5/sap.ui.core": "1.76.0", | ||
"copy-and-watch": "^0.1.4", | ||
@@ -48,7 +47,3 @@ "escodegen": "^1.11.0", | ||
"rimraf": "^2.6.2" | ||
}, | ||
"resolutions": { | ||
"abstract-syntax-tree": "1.0.3", | ||
"dir-glob": "2.0.0" | ||
} | ||
} |
@@ -5,2 +5,6 @@ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/master/docs/images/UI5_logo_wide.png) | ||
**DEPRECATED!!!** | ||
This package is now deprecated in favor of [@ui5/webcomponents-localization](https://www.npmjs.com/package/@ui5/webcomponents-localization). | ||
[![Travis CI Build Status](https://travis-ci.org/SAP/ui5-webcomponents.svg?branch=master)](https://travis-ci.org/SAP/ui5-webcomponents) | ||
@@ -7,0 +11,0 @@ [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](https://www.npmjs.com/package/@ui5/webcomponents) |
@@ -10,3 +10,2 @@ sap/base/Log.js | ||
sap/base/util/now.js | ||
sap/ui/Device.js | ||
sap/ui/base/Interface.js | ||
@@ -28,2 +27,2 @@ sap/ui/base/Metadata.js | ||
sap/ui/thirdparty/jquery.js | ||
sap/ui/thirdparty/es6-string-methods.js | ||
sap/ui/thirdparty/es6-string-methods.js |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
8511347
11
370783
28