New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ui5/webcomponents-utils

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ui5/webcomponents-utils - npm Package Compare versions

Comparing version 0.0.0-04e3a6f74 to 0.0.0-07460127d

dist/Assets.js

82

dist/sap/base/Log.js

@@ -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);

@@ -1,5 +0,7 @@

export default {
loadResource: function (name) {
return sap.ui.loader._.getModuleContent(name);
}
import { getModuleContent } from "@ui5/webcomponents-base/dist/asset-registries/LocaleData.js";
const LoaderExtensions = {
loadResource: getModuleContent,
};
export default LoaderExtensions;
import ObjectPath from '../../base/util/ObjectPath.js';
import Device from '../Device.js';
import assert from '../../base/assert.js';

@@ -114,3 +115,3 @@ import Log from '../../base/Log.js';

};
var WRITABLE_IFF_PHANTOM = false;
var WRITABLE_IFF_PHANTOM = !!Device.browser.phantomJS;
Object.defineProperty(Metadata.prototype, '_mImplementedTypes', {

@@ -117,0 +118,0 @@ get: function () {

@@ -1,5 +0,38 @@

let Core = {};
export { Core as default };
export const inject = (CoreNew) => {
Core = CoreNew;
}
import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
import getDesigntimePropertyAsArray from "@ui5/webcomponents-base/dist/util/getDesigntimePropertyAsArray.js";
import getLocale from "@ui5/webcomponents-base/dist/locale/getLocale.js";
const emptyFn = () => {};
/**
* OpenUI5 FormatSettings shim
*/
const FormatSettings = {
getFormatLocale: getLocale,
getLegacyDateFormat: emptyFn,
getLegacyDateCalendarCustomizing: emptyFn,
getCustomLocaleData: emptyFn,
};
/**
* OpenUI5 Configuration Shim
*/
const Configuration = {
getLanguage,
getCalendarType,
getSupportedLanguages: () => 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$"),
getOriginInfo: emptyFn,
getFormatSettings: () => FormatSettings,
};
/**
* OpenUI5 Core shim
*/
const Core = {
getConfiguration: () => Configuration,
getLibraryResourceBundle: emptyFn(),
getFormatSettings: () => FormatSettings,
};
export default Core;
import UniversalDate from './UniversalDate.js';
import CalendarType from '../CalendarType.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import _Calendars from './_Calendars.js';
var Buddhist = UniversalDate.extend('sap.ui.core.date.Buddhist', {

@@ -126,3 +126,3 @@ constructor: function () {

};
CalendarClassRegistry.setCalendarClass(CalendarType.Buddhist, Buddhist);
_Calendars.set(CalendarType.Buddhist, Buddhist);
export default Buddhist;
import UniversalDate from './UniversalDate.js';
import CalendarType from '../CalendarType.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import _Calendars from './_Calendars.js';
var Gregorian = UniversalDate.extend('sap.ui.core.date.Gregorian', {

@@ -16,3 +16,3 @@ constructor: function () {

};
CalendarClassRegistry.setCalendarClass(CalendarType.Gregorian, Gregorian);
_Calendars.set(CalendarType.Gregorian, Gregorian);
export default Gregorian;

@@ -0,5 +1,6 @@

import Core from '../Core.js';
import UniversalDate from './UniversalDate.js';
import CalendarType from '../CalendarType.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import Log from '../../../base/Log.js';
import _Calendars from './_Calendars.js';
var Islamic = UniversalDate.extend('sap.ui.core.date.Islamic', {

@@ -24,2 +25,6 @@ constructor: function () {

var oCustomizationMap = null;
var aSupportedIslamicCalendarTypes = [
'A',
'B'
];
function toIslamic(oGregorian) {

@@ -101,13 +106,10 @@ var iGregorianYear = oGregorian.year, iGregorianMonth = oGregorian.month, iGregorianDay = oGregorian.day, iIslamicYear, iIslamicMonth, iIslamicDay, iMonths, iDays, iLeapAdj, iJulianDay;

oCustomizationMap = {};
sDateFormat = sap.ui.getWCCore().getFormatSettings().getLegacyDateFormat();
oCustomizationJSON = sap.ui.getWCCore().getFormatSettings().getLegacyDateCalendarCustomizing();
sDateFormat = Core.getConfiguration().getFormatSettings().getLegacyDateFormat();
sDateFormat = _isSupportedIslamicCalendarType(sDateFormat) ? sDateFormat : 'A';
oCustomizationJSON = Core.getConfiguration().getFormatSettings().getLegacyDateCalendarCustomizing();
oCustomizationJSON = oCustomizationJSON || [];
if (!sDateFormat && !oCustomizationJSON.length) {
Log.info('No calendar customizations.');
if (!oCustomizationJSON.length) {
Log.warning('No calendar customizations.');
return;
}
if (sDateFormat && !oCustomizationJSON.length || !sDateFormat && oCustomizationJSON.length) {
Log.warning('There is an inconsistency between customization data [' + JSON.stringify(oCustomizationJSON) + '] and the date format [' + sDateFormat + ']. Calendar customization won\'t be used.');
return;
}
oCustomizationJSON.forEach(function (oEntry) {

@@ -154,2 +156,5 @@ if (oEntry.dateFormat === sDateFormat) {

}
function _isSupportedIslamicCalendarType(sCalendarType) {
return aSupportedIslamicCalendarTypes.indexOf(sCalendarType) !== -1;
}
Islamic.prototype._getIslamic = function () {

@@ -251,3 +256,3 @@ return toIslamic({

};
CalendarClassRegistry.setCalendarClass(CalendarType.Islamic, Islamic);
_Calendars.set(CalendarType.Islamic, Islamic);
export default Islamic;
import UniversalDate from './UniversalDate.js';
import CalendarType from '../CalendarType.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import _Calendars from './_Calendars.js';
var Japanese = UniversalDate.extend('sap.ui.core.date.Japanese', {

@@ -161,3 +161,3 @@ constructor: function () {

};
CalendarClassRegistry.setCalendarClass(CalendarType.Japanese, Japanese);
_Calendars.set(CalendarType.Japanese, Japanese);
export default Japanese;
import UniversalDate from './UniversalDate.js';
import CalendarType from '../CalendarType.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import _Calendars from './_Calendars.js';
var Persian = UniversalDate.extend('sap.ui.core.date.Persian', {

@@ -264,3 +264,3 @@ constructor: function () {

};
CalendarClassRegistry.setCalendarClass(CalendarType.Persian, Persian);
_Calendars.set(CalendarType.Persian, Persian);
export default Persian;

@@ -0,4 +1,5 @@

import Core from '../Core.js';
import BaseObject from '../../base/Object.js';
import LocaleData from '../LocaleData.js';
import CalendarClassRegistry from './CalendarClassRegistry.js';
import _Calendars from './_Calendars.js';
var UniversalDate = BaseObject.extend('sap.ui.core.date.UniversalDate', {

@@ -43,3 +44,3 @@ constructor: function () {

if (!sCalendarType) {
sCalendarType = sap.ui.getWCCore().getConfiguration().getCalendarType();
sCalendarType = Core.getConfiguration().getCalendarType();
}

@@ -54,12 +55,5 @@ clDate = UniversalDate.getClass(sCalendarType);

if (!sCalendarType) {
sCalendarType = sap.ui.getWCCore().getConfiguration().getCalendarType();
sCalendarType = Core.getConfiguration().getCalendarType();
}
var Klass = CalendarClassRegistry.getCalendarClass(sCalendarType);
if (!Klass) {
if (!sap || !sap.ui || !sap.ui.requireSync) {
throw new Error('Calendar type [' + sCalendarType + '] is not imported');
}
Klass = sap.ui.requireSync('sap/ui/core/date/' + sCalendarType);
}
return Klass;
return _Calendars.get(sCalendarType);
};

@@ -171,3 +165,3 @@ [

UniversalDate.getWeekByDate = function (sCalendarType, iYear, iMonth, iDay) {
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;
var oLocale = Core.getConfiguration().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') {

@@ -196,3 +190,3 @@ iWeek = calculateWeeks(oFirstDay, oDate);

UniversalDate.getFirstDateOfWeek = function (sCalendarType, iYear, iWeek) {
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), clDate = this.getClass(sCalendarType), oFirstDay = getFirstDayOfFirstWeek(clDate, iYear), oDate = new clDate(oFirstDay.valueOf() + iWeek * iMillisecondsInWeek);
var oLocale = Core.getConfiguration().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) {

@@ -212,3 +206,3 @@ return {

function getFirstDayOfFirstWeek(clDate, iYear) {
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), iMinDays = oLocaleData.getMinimalDaysInFirstWeek(), iFirstDayOfWeek = sap.ui.getConfiguration().getFirstDateOfWeek() || oLocaleData.getFirstDayOfWeek(), oFirstDay = new clDate(clDate.UTC(iYear, 0, 1)), iDayCount = 7;
var oLocale = Core.getConfiguration().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) {

@@ -253,3 +247,3 @@ oFirstDay.setUTCDate(oFirstDay.getUTCDate() - 1);

function getEras(sCalendarType) {
var oLocale = sap.ui.getWCCore().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), aEras = mEras[sCalendarType];
var oLocale = Core.getConfiguration().getFormatSettings().getFormatLocale(), oLocaleData = LocaleData.getInstance(oLocale), aEras = mEras[sCalendarType];
if (!aEras) {

@@ -256,0 +250,0 @@ var aEras = oLocaleData.getEraDates(sCalendarType);

@@ -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-utils",
"version": "0.0.0-04e3a6f74",
"version": "0.0.0-07460127d",
"description": "Utilities for UI5 Web Components",

@@ -18,5 +18,6 @@ "author": "SAP SE (https://www.sap.com)",

"scripts": {
"build": "path-exists dist/ || yarn build:all",
"copy:node-modules": "node ./lib/copy-list/index.js ./used-modules.txt dist/",
"copy:resources": "copy-and-watch \"../../node_modules/@openui5/sap.ui.core/src/**/*.json\" dist/",
"build": "npm-run-all --sequential clean copy:used-modules copy:cldr copy:overlay build:replace-amd build:replace-export-true build:replace-export-false build:amd-to-es6 build:replace-global-core-usage build:esm-abs-to-rel copy:src copy:belize-fonts",
"clean": "rimraf dist",
"copy:used-modules": "node ./lib/copy-list/index.js ./used-modules.txt dist/",
"copy:cldr": "copy-and-watch \"../../node_modules/@openui5/sap.ui.core/src/sap/ui/core/cldr/*.json\" dist/generated/assets/cldr/",
"copy:overlay": "copy-and-watch \"overlay/**/*.js\" dist/",

@@ -26,9 +27,7 @@ "build:replace-amd": "replace-in-file sap.ui.define define dist/**/*.js",

"build:replace-export-false": "replace-in-file \", /* bExport= */ false\" \"\" dist/**/*.js",
"build:replace-global-core-usage": "replace-in-file /sap\\.ui\\.getCore/g sap.ui.getWCCore dist/**/*.js --isRegex",
"build:amd-to-es6": "amdtoes6 --src=dist --replace --glob=**/*.js",
"build:replace-global-core-usage": "node ./lib/replace-global-core/index.js dist/",
"build:esm-abs-to-rel": "node ./lib/esm-abs-to-rel/index.js dist/",
"copy:esm-stubs": "copy-and-watch esm/Core.js dist/sap/ui/core && copy-and-watch esm/jquery.js dist/sap/ui/thirdparty",
"copy:src": "copy-and-watch \"src/**/*.js\" dist/",
"copy:belize-fonts": "copy-and-watch \"../../node_modules/@openui5/themelib_sap_belize/src/sap/ui/core/themes/sap_belize/fonts/*.{ttf,woff,woff2}\" dist/sap/ui/core/themes/sap_belize/fonts",
"build:all": "npm-run-all --sequential clean copy:node-modules copy:resources copy:overlay build:replace-amd build:replace-export-true build:replace-export-false build:replace-global-core-usage build:amd-to-es6 build:esm-abs-to-rel copy:esm-stubs copy:belize-fonts",
"clean": "rimraf temp && rimraf dist",
"prepublishOnly": "npm run clean && npm run build"

@@ -38,3 +37,3 @@ },

"@buxlabs/amd-to-es6": "^0.15.0",
"@openui5/sap.ui.core": "1.60.2",
"@openui5/sap.ui.core": "1.75.0",
"copy-and-watch": "^0.1.4",

@@ -49,3 +48,6 @@ "escodegen": "^1.11.0",

"rimraf": "^2.6.2"
},
"dependencies": {
"@ui5/webcomponents-base": "0.0.0-07460127d"
}
}
sap/base/Log.js
sap/base/assert.js
sap/base/strings/formatMessage.js
sap/base/util/LoaderExtensions.js
sap/base/util/ObjectPath.js
sap/base/util/array/uniqueSort.js
sap/base/util/deepEqual.js
sap/base/util/merge.js
sap/base/util/isPlainObject.js
sap/base/util/now.js
sap/base/util/_merge.js
sap/base/util/extend.js
sap/ui/base/Interface.js

@@ -18,3 +18,2 @@ sap/ui/base/Metadata.js

sap/ui/core/date/Buddhist.js
sap/ui/core/date/CalendarClassRegistry.js
sap/ui/core/date/Gregorian.js

@@ -26,4 +25,1 @@ sap/ui/core/date/Islamic.js

sap/ui/core/format/DateFormat.js
sap/ui/events/KeyCodes.js
sap/ui/thirdparty/jquery.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc