@ui5/webcomponents-localization 0.34.0 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,40 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-localization
9
+
10
+
11
+
12
+
13
+
14
+ # [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
15
+
16
+
17
+ **Note:** Version bump only for package @ui5/webcomponents-localization
18
+
19
+
20
+
21
+
22
+
23
+ # [1.0.0-rc.16](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.15...v1.0.0-rc.16) (2021-11-09)
24
+
25
+
26
+ **Note:** Version bump only for package @ui5/webcomponents-localization
27
+
28
+
29
+
30
+
31
+
32
+ # [1.0.0-rc.15](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.14...v1.0.0-rc.15) (2021-07-23)
33
+
34
+
35
+ **Note:** Version bump only for package @ui5/webcomponents-icons-tnt
36
+
37
+
38
+
39
+
6
40
  # [1.0.0-rc.14](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.13...v1.0.0-rc.14) (2021-04-01)
7
41
 
8
42
 
package/README.md CHANGED
@@ -7,6 +7,37 @@
7
7
 
8
8
  Provides date/time and CLDR functionality for the purposes of building UI5 Web Components.
9
9
 
10
+ ## Provided assets
11
+
12
+ The assets, provided by this package, are CLDR data:
13
+
14
+ `import "@ui5/webcomponents-localization/dist/Assets.js";`
15
+
16
+ *Note:* These assets are already imported by the UI5 Web Components packages that need them.
17
+
18
+ ## Provided features
19
+
20
+ | Feature Import | Description |
21
+ |----------------------------------------------------------------------|---------------------------|
22
+ | `@ui5/webcomponents-localization/dist/features/calendar/Buddhist.js` | Buddhist calendar support |
23
+ | `@ui5/webcomponents-localization/dist/features/calendar/Islamic.js` | Islamic calendar support |
24
+ | `@ui5/webcomponents-localization/dist/features/calendar/Japanese.js` | Japanese calendar support |
25
+ | `@ui5/webcomponents-localization/dist/features/calendar/Persian.js` | Persian calendar support |
26
+
27
+ ### Advanced Calendar Types Feature
28
+
29
+ ```js
30
+ import "@ui5/webcomponents-localization/dist/features/calendar/Buddhist.js";
31
+ import "@ui5/webcomponents-localization/dist/features/calendar/Islamic.js";
32
+ import "@ui5/webcomponents-localization/dist/features/calendar/Japanese.js";
33
+ import "@ui5/webcomponents-localization/dist/features/calendar/Persian.js";
34
+ ```
35
+
36
+ The `ui5-date-picker` and `ui5-datetime-picker` components supports Gregorian Calendar by default.
37
+
38
+ In order to be able to use Buddhist, Islamic, Japanese, or Persian calendar with these components
39
+ (by setting its `primaryCalendarType` property), you must import one or more of the modules above.
40
+
10
41
  ## Resources
11
42
  - [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/master/README.md)
12
43
  - [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
@@ -16,7 +47,7 @@ Provides date/time and CLDR functionality for the purposes of building UI5 Web C
16
47
  We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://join-ui5-slack.herokuapp.com/).
17
48
 
18
49
  ## Contribute
19
- Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/CONTRIBUTING.md).
50
+ Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/docs/6-contributing/02-conventions-and-guidelines.md).
20
51
 
21
52
  ## License
22
53
  Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
@@ -4925,6 +4925,7 @@
4925
4925
  "weekData-firstDay": 0,
4926
4926
  "weekData-weekendStart": 6,
4927
4927
  "weekData-weekendEnd": 0,
4928
+ "weekData-algorithm": "FIRSTDAY_STARTS_FIRSTWEEK",
4928
4929
  "timeData": {
4929
4930
  "_allowed": "h hb H hB",
4930
4931
  "_preferred": "h"
@@ -162,18 +162,10 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
162
162
  }
163
163
  break;
164
164
  case Log.Level.DEBUG:
165
- if (console.debug) {
166
- isDetailsError ? console.debug(logText, '\n', sDetails) : console.debug(logText);
167
- } else {
168
- isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText);
169
- }
165
+ isDetailsError ? console.debug(logText, '\n', sDetails) : console.debug(logText);
170
166
  break;
171
167
  case Log.Level.TRACE:
172
- if (console.trace) {
173
- isDetailsError ? console.trace(logText, '\n', sDetails) : console.trace(logText);
174
- } else {
175
- isDetailsError ? console.log(logText, '\n', sDetails) : console.log(logText);
176
- }
168
+ isDetailsError ? console.trace(logText, '\n', sDetails) : console.trace(logText);
177
169
  break;
178
170
  }
179
171
  if (console.info && oLogEntry.supportInfo) {
@@ -2,11 +2,7 @@ import Log from './Log.js';
2
2
  var fnAssert = function (bResult, vMessage) {
3
3
  if (!bResult) {
4
4
  var sMessage = typeof vMessage === 'function' ? vMessage() : vMessage;
5
- if (console && console.assert) {
6
- console.assert(bResult, sMessage);
7
- } else {
8
- Log.debug('[Assertions] ' + sMessage);
9
- }
5
+ console.assert(bResult, sMessage);
10
6
  }
11
7
  };
12
8
  export default fnAssert;
@@ -14,11 +14,7 @@ var fnEqual = function (a, b, maxDepth, contains, depth) {
14
14
  Log.warning('deepEqual comparison exceeded maximum recursion depth of ' + maxDepth + '. Treating values as unequal');
15
15
  return false;
16
16
  }
17
- if (a === b) {
18
- return true;
19
- }
20
- var bIsReallyNaN = typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);
21
- if (bIsReallyNaN) {
17
+ if (a === b || Number.isNaN(a) && Number.isNaN(b)) {
22
18
  return true;
23
19
  }
24
20
  if (Array.isArray(a) && Array.isArray(b)) {
@@ -1,16 +1,14 @@
1
- var BaseObject;
2
1
  var Interface = function (oObject, aMethods, _bReturnFacade) {
3
2
  if (!oObject) {
4
3
  return oObject;
5
4
  }
6
- BaseObject = BaseObject || sap.ui.requireSync("sap/ui/base/Object");
7
5
  function fCreateDelegator(oObject, sMethodName) {
8
6
  return function () {
9
7
  var tmp = oObject[sMethodName].apply(oObject, arguments);
10
8
  if (_bReturnFacade) {
11
9
  return this;
12
10
  } else {
13
- return tmp instanceof BaseObject ? tmp.getInterface() : tmp;
11
+ return typeof tmp.getInterface === "function" ? tmp.getInterface() : tmp;
14
12
  }
15
13
  };
16
14
  }
@@ -1,4 +1,3 @@
1
- import Interface from './Interface.js';
2
1
  import Metadata from './Metadata.js';
3
2
  import Log from '../../base/Log.js';
4
3
  var BaseObject = Metadata.createClass('sap.ui.base.Object', {
@@ -11,7 +10,7 @@ var BaseObject = Metadata.createClass('sap.ui.base.Object', {
11
10
  BaseObject.prototype.destroy = function () {
12
11
  };
13
12
  BaseObject.prototype.getInterface = function () {
14
- var oInterface = new Interface(this, this.getMetadata().getAllPublicMethods());
13
+ var oInterface = new BaseObject._Interface(this, this.getMetadata().getAllPublicMethods());
15
14
  this.getInterface = function () {
16
15
  return oInterface;
17
16
  };
@@ -37,4 +36,29 @@ BaseObject.prototype.isA = function (vTypeName) {
37
36
  BaseObject.isA = function (oObject, vTypeName) {
38
37
  return oObject instanceof BaseObject && oObject.isA(vTypeName);
39
38
  };
39
+ BaseObject._Interface = function (oObject, aMethods, _bReturnFacade) {
40
+ if (!oObject) {
41
+ return oObject;
42
+ }
43
+ function fCreateDelegator(oObject, sMethodName) {
44
+ return function () {
45
+ var tmp = oObject[sMethodName].apply(oObject, arguments);
46
+ if (_bReturnFacade) {
47
+ return this;
48
+ } else {
49
+ return tmp instanceof BaseObject ? tmp.getInterface() : tmp;
50
+ }
51
+ };
52
+ }
53
+ if (!aMethods) {
54
+ return {};
55
+ }
56
+ var sMethodName;
57
+ for (var i = 0, ml = aMethods.length; i < ml; i++) {
58
+ sMethodName = aMethods[i];
59
+ if (!oObject[sMethodName] || typeof oObject[sMethodName] === 'function') {
60
+ this[sMethodName] = fCreateDelegator(oObject, sMethodName);
61
+ }
62
+ }
63
+ };
40
64
  export default BaseObject;
@@ -100,7 +100,9 @@ var M_ABAP_LANGUAGE_TO_LOCALE = {
100
100
  'ZF': 'zh-Hant',
101
101
  'SH': 'sr-Latn',
102
102
  '6N': 'en-GB',
103
+ '1P': 'pt-PT',
103
104
  '1X': 'es-MX',
105
+ '3F': 'fr-CA',
104
106
  '1Q': 'en-US-x-saptrc',
105
107
  '2Q': 'en-US-x-sappsd',
106
108
  '3Q': 'en-US-x-saprigi'