@ui5/webcomponents-localization 1.23.0-rc.4 → 1.23.0-rc.5
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,17 @@
|
|
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.23.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.23.0-rc.4...v1.23.0-rc.5) (2024-02-29)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* remove sap.ui.require call from unused openui5 module ([#8359](https://github.com/SAP/ui5-webcomponents/issues/8359)) ([50219ac](https://github.com/SAP/ui5-webcomponents/commit/50219ac23add7b86fe26d8ca51e2181f01404992))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
# [1.23.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.23.0-rc.3...v1.23.0-rc.4) (2024-02-26)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @ui5/webcomponents-localization
|
@@ -10,7 +10,7 @@ var rCamelCase = /-(.)/ig;
|
|
10
10
|
* Transforms a hyphen separated string to a camel case string.
|
11
11
|
*
|
12
12
|
* @example
|
13
|
-
* require(["sap/base/strings/camelize"], function(camelize){
|
13
|
+
* sap.ui.require(["sap/base/strings/camelize"], function(camelize){
|
14
14
|
* camelize("foo-bar"); // "fooBar"
|
15
15
|
* });
|
16
16
|
*
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* The behavior for non-object values is undefined and might change in future.
|
6
6
|
*
|
7
7
|
* @example
|
8
|
-
* require(["sap/base/util/isEmptyObject"], function(isEmptyObject){
|
8
|
+
* sap.ui.require(["sap/base/util/isEmptyObject"], function(isEmptyObject){
|
9
9
|
* isEmptyObject({}); // true
|
10
10
|
* isEmptyObject({test: '123'}); // false
|
11
11
|
* isEmptyObject(null); // true
|
@@ -1,157 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
5
|
-
*/
|
6
|
-
import ObjectPath from "./ObjectPath.js";
|
7
|
-
// indicator if the reference can't be resolved
|
8
|
-
var oNotFound = Object.create(null);
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Resolve the path segments under the given root context
|
12
|
-
*
|
13
|
-
* @param {array} aParts The path segments
|
14
|
-
* @param {object} oRoot The root context
|
15
|
-
* @param {object} [mOptions] Options
|
16
|
-
* @param {boolean} [mOptions.bindContext] When the resolved value is a
|
17
|
-
* function, whether the resolved function is bound to a context
|
18
|
-
* @param {boolean} [mOptions.rootContext] When the resolved value is a
|
19
|
-
* function and a rootContext is given, the resolved function is bound
|
20
|
-
* to this context instead of the object to which it belongs. If
|
21
|
-
* <code>mOptions.bindContext=false</code>, this option has no effect
|
22
|
-
* @return {any} The resolved value. If the value can't be resolved under the
|
23
|
-
* given root context, it returns <code>oNotFound</code>.
|
24
|
-
*/
|
25
|
-
function _resolve(aParts, oRoot, mOptions) {
|
26
|
-
var vRef, oContext;
|
27
|
-
if (oRoot && aParts[0] in oRoot) {
|
28
|
-
// the path consists of at least two segments
|
29
|
-
// e.g. key "Module.namespace.function" -> function() {...}
|
30
|
-
oContext = aParts.length > 1 ? ObjectPath.get(aParts.slice(0, -1), oRoot) : oRoot;
|
31
|
-
vRef = oContext && oContext[aParts[aParts.length - 1]];
|
32
|
-
if (typeof vRef === "function" && mOptions.bindContext) {
|
33
|
-
vRef = vRef.bind(mOptions.rootContext || oContext);
|
34
|
-
}
|
35
|
-
return vRef;
|
36
|
-
}
|
37
|
-
return oNotFound;
|
38
|
-
}
|
39
|
-
|
40
|
-
/**
|
41
|
-
* Returns a value located in the provided path using the given
|
42
|
-
* <code>mVariables</code> object.
|
43
|
-
*
|
44
|
-
* If the provided path cannot be resolved completely, <code>undefined</code> is returned.
|
45
|
-
*
|
46
|
-
* How <code>mVariables</code> are checked for resolving the path depends on
|
47
|
-
* the syntax of the path:
|
48
|
-
* <ul>
|
49
|
-
* <li><i>absolute</i>: paths not starting with a dot ('.') are first checked through
|
50
|
-
* <code>mVariables</code>.</li>
|
51
|
-
* <li><i>relative</i>: paths starting with a dot ('.') are only checked through the dot variable
|
52
|
-
* <code>mVariables["."]</code> and not the other variables in <code>mVariables</code>.</li>
|
53
|
-
* <li><i>legacy</i>: when <code>mOptions.preferDotContext=true</code>, paths not starting
|
54
|
-
* with a dot ('.') are first checked through the dot Variable
|
55
|
-
* <code>mVariables["."]</code> and then - if nothing is found - through the other
|
56
|
-
* Variables in <code>mVariables</code>.</li>
|
57
|
-
* </ul>
|
58
|
-
*
|
59
|
-
* For an absolute path, when nothing is found after resolving the value within <code>mVariables</code>,
|
60
|
-
* <code>require</code> is called when <code>mOptions.useProbingRequire=true</code> to retrieve the
|
61
|
-
* module export of the loaded module with the given <code>sPath</code> after replacing '.' with '/' in
|
62
|
-
* the path. If the path can still not be resolved, the last fallback is taken to resolve
|
63
|
-
* <code>sPath</code> within the global scope <code>window</code>.
|
64
|
-
*
|
65
|
-
* When the resolved value is a function, a context may be bound to it with the following
|
66
|
-
* conditions:
|
67
|
-
* <ul>
|
68
|
-
* <li><i>No bound</i>: if the function is resolved from the global scope (not from any
|
69
|
-
* given variables in <code>mVariables</code>, it's not bound to any context. If the
|
70
|
-
* function exists directly under <code>mVariables</code>, nothing is bound.</li>
|
71
|
-
* <li><i>Bound</i>: otherwise, the resolved function is bound to the object to which it
|
72
|
-
* belongs</li>
|
73
|
-
* <li><i>mOptions.bindContext</i>: when this option is set to <code>false</code>, no
|
74
|
-
* context is bound to the resolved function regardless where the function is resolved
|
75
|
-
* </li>
|
76
|
-
* <li><i>mOptions.bindDotContext</i>: for paths starting with a dot ('.'),
|
77
|
-
* <code>mOptions.bindDotContext=false</code> turns off the automatic binding to the
|
78
|
-
* dot variable <code>mVariables["."]</code>. <code>mOptions.bindDotContext</code> has
|
79
|
-
* no effect when <code>mOptions.bindContext=false</code>.</li>
|
80
|
-
* </ul>
|
81
|
-
*
|
82
|
-
* @function
|
83
|
-
* @private
|
84
|
-
* @ui5-restricted sap.ui.core
|
85
|
-
* @since 1.69
|
86
|
-
*
|
87
|
-
* @param {string} sPath Path
|
88
|
-
* @param {object} [mVariables] An object containing the mapping of variable name to object or function
|
89
|
-
* @param {object} [mOptions] Options
|
90
|
-
* @param {boolean} [mOptions.preferDotContext=false] Whether the path not starting with a dot ('.') is
|
91
|
-
* resolved under the dot variable when it can not be resolved through the given variables object.
|
92
|
-
* @param {boolean} [mOptions.bindContext=true] When the resolved value is a function, whether the
|
93
|
-
* resolved function is bound to a context. When this property is set to false, the
|
94
|
-
* mOptions.bindDotContext has no effect anymore.
|
95
|
-
* @param {boolean} [mOptions.bindDotContext=true] When the resolved value is a function, whether the
|
96
|
-
* resolved function from a path which starts with a dot ('.') should be bound to the dot context
|
97
|
-
* @param {boolean} [mOptions.useProbingRequire=false] When the value cannot be resolved by using the
|
98
|
-
* given <code>mVariables</code>, <code>mOptions.useProbingRequire=true</code> leads to a call of
|
99
|
-
* <code>require</code> to get the module export of the loaded module under the given
|
100
|
-
* <code>sPath</code> after replacing the '.' with '/'.
|
101
|
-
* @returns {any} Returns the value located in the provided path, or <code>undefined</code> if the path
|
102
|
-
* does not exist completely.
|
103
|
-
* @alias module:sap/base/util/resolveReference
|
104
|
-
*/
|
105
|
-
var resolveReference = function (sPath, mVariables, mOptions) {
|
106
|
-
// fill the default values
|
107
|
-
mVariables = mVariables || {};
|
108
|
-
mOptions = mOptions || {};
|
109
|
-
mOptions.bindContext = mOptions.bindContext !== false;
|
110
|
-
mOptions.bindDotContext = mOptions.bindDotContext !== false;
|
111
|
-
var aParts = sPath.split("."),
|
112
|
-
// if sPath starts with ".", split returns an empty string
|
113
|
-
// at the first position and the dot is used as variable
|
114
|
-
sVariable = aParts.shift() || ".",
|
115
|
-
bDotCase = sVariable === ".",
|
116
|
-
vRef = oNotFound;
|
117
|
-
|
118
|
-
// push the first part back to the array
|
119
|
-
aParts.unshift(sVariable);
|
120
|
-
|
121
|
-
// if preferDotContext, resolve the sPath under the dot context first for sPath which doesn't begin with "."
|
122
|
-
if (mOptions.preferDotContext && !bDotCase) {
|
123
|
-
vRef = _resolve(aParts, mVariables["."], {
|
124
|
-
bindContext: mOptions.bindContext && mOptions.bindDotContext,
|
125
|
-
// resolve function in dot variable should always bind the dot variable
|
126
|
-
rootContext: mVariables["."]
|
127
|
-
});
|
128
|
-
}
|
129
|
-
|
130
|
-
// If sPath isn't resolved yet, resolve the path under mVariables
|
131
|
-
if (vRef === oNotFound) {
|
132
|
-
vRef = _resolve(aParts, mVariables, {
|
133
|
-
bindContext: mOptions.bindContext
|
134
|
-
// dot case: mOptions.bindDotContext determines whether context should be bound
|
135
|
-
// non dot case: bind context if sPath contains more than one segment
|
136
|
-
&& (bDotCase ? mOptions.bindDotContext : aParts.length > 1),
|
137
|
-
rootContext: bDotCase ? mVariables["."] : undefined
|
138
|
-
});
|
139
|
-
}
|
140
|
-
if (!bDotCase) {
|
141
|
-
if (vRef === oNotFound && mOptions.useProbingRequire) {
|
142
|
-
vRef = require(sPath.replace(/\./g, "/"));
|
143
|
-
if (vRef === undefined) {
|
144
|
-
vRef = oNotFound;
|
145
|
-
}
|
146
|
-
}
|
147
|
-
|
148
|
-
// resolve the path under global scope, only when it can't be resolved under mVariables
|
149
|
-
if (vRef === oNotFound) {
|
150
|
-
// fallback if no value could be found under the given sPath's first segment
|
151
|
-
// otherwise resolve under global namespace
|
152
|
-
vRef = ObjectPath.get(sPath);
|
153
|
-
}
|
154
|
-
}
|
155
|
-
return vRef === oNotFound ? undefined : vRef;
|
156
|
-
};
|
157
|
-
export default resolveReference;
|
1
|
+
export default (function () {
|
2
|
+
throw new Error("not implemented");
|
3
|
+
});
|
package/package-scripts.cjs
CHANGED
@@ -2,14 +2,16 @@ const resolve = require("resolve");
|
|
2
2
|
|
3
3
|
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
4
4
|
const amdToES6 = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/index.js");
|
5
|
+
const noRequire = resolve.sync("@ui5/webcomponents-tools/lib/amd-to-es6/no-remaining-require.js");
|
5
6
|
|
6
7
|
const scripts = {
|
7
8
|
clean: "rimraf dist",
|
8
9
|
lint: "eslint .",
|
9
10
|
generate: "nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports",
|
10
11
|
build: {
|
11
|
-
"default": "nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports build.typescript",
|
12
|
+
"default": "nps clean copy.used-modules copy.cldr copy.overlay build.amd-to-es6 build.jsonImports build.typescript build.no-remaining-require",
|
12
13
|
"amd-to-es6": `node "${amdToES6}" dist/`,
|
14
|
+
"no-remaining-require": `node "${noRequire}" dist/`,
|
13
15
|
typescript: "tsc --build",
|
14
16
|
jsonImports: "node ./lib/generate-json-imports/cldr.js",
|
15
17
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-localization",
|
3
|
-
"version": "1.23.0-rc.
|
3
|
+
"version": "1.23.0-rc.5",
|
4
4
|
"description": "Localization for UI5 Web Components",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -33,15 +33,16 @@
|
|
33
33
|
"@babel/generator": "^7.23.6",
|
34
34
|
"@babel/parser": "^7.23.6",
|
35
35
|
"@openui5/sap.ui.core": "1.120.3",
|
36
|
-
"@ui5/webcomponents-tools": "1.23.0-rc.
|
36
|
+
"@ui5/webcomponents-tools": "1.23.0-rc.5",
|
37
37
|
"babel-plugin-amd-to-esm": "^2.0.3",
|
38
38
|
"chromedriver": "^121.0.2",
|
39
|
+
"estree-walk": "^2.2.0",
|
39
40
|
"mkdirp": "^1.0.4",
|
40
41
|
"resolve": "^1.20.0"
|
41
42
|
},
|
42
43
|
"dependencies": {
|
43
44
|
"@types/openui5": "^1.113.0",
|
44
|
-
"@ui5/webcomponents-base": "1.23.0-rc.
|
45
|
+
"@ui5/webcomponents-base": "1.23.0-rc.5"
|
45
46
|
},
|
46
|
-
"gitHead": "
|
47
|
+
"gitHead": "0d1e9a0c37abaeabaed26e1be9e543f991a6ed94"
|
47
48
|
}
|