@urso/core 0.4.38 → 0.4.41
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/package.json
CHANGED
package/src/js/lib/loader.js
CHANGED
|
@@ -6,6 +6,8 @@ class ModulesI18nController {
|
|
|
6
6
|
* get text by localeId
|
|
7
7
|
* @param {String} localeId
|
|
8
8
|
* @param {Object} [localeVariables] - variables for locale string
|
|
9
|
+
*
|
|
10
|
+
* @example get('Some333 ${bet} " `test ${multi} text localized', {bet:12,multi:13})
|
|
9
11
|
*/
|
|
10
12
|
get(localeId, localeVariables = {}) {
|
|
11
13
|
if (this.#vocabulary && this.#vocabulary[localeId]) {
|
|
@@ -66,12 +68,11 @@ class ModulesI18nController {
|
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
_interpolate(string, params) {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const resultEncodedString = new Function(...names, `return \`${encodedString}\`;`)(...vals);
|
|
71
|
+
for (const [key, value] of Object.entries(params)) {
|
|
72
|
+
string = Urso.helper.stringReplace('${' + key + '}', value, string);
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
return
|
|
75
|
+
return string
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -36,14 +36,24 @@ class ModulesInstancesController {
|
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* remove mode from system
|
|
41
|
+
* @param {String} mode
|
|
42
|
+
* @param {Boolean} passiveMode - do not refresh styles
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
removeMode(mode, passiveMode) {
|
|
40
46
|
let index = this._modes.indexOf(mode);
|
|
41
47
|
|
|
42
48
|
if (index === -1)
|
|
43
49
|
return false;
|
|
44
50
|
|
|
45
51
|
this._modes.splice(index, 1);
|
|
46
|
-
|
|
52
|
+
|
|
53
|
+
if (!passiveMode) {
|
|
54
|
+
Urso.observer.emit(Urso.events.MODULES_INSTANCES_MODES_CHANGED);
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
return true;
|
|
48
58
|
}
|
|
49
59
|
|
|
@@ -55,7 +55,7 @@ class ModulesScenesResolutions {
|
|
|
55
55
|
this._currentOrientation = this._templateSize.orientation;
|
|
56
56
|
|
|
57
57
|
//update InstancesModes
|
|
58
|
-
Object.values(Urso.device.ScreenOrientation).forEach((orientationValue) => Urso.removeInstancesMode(orientationValue + 'Orientation'));
|
|
58
|
+
Object.values(Urso.device.ScreenOrientation).forEach((orientationValue) => Urso.removeInstancesMode(orientationValue + 'Orientation', true));
|
|
59
59
|
Urso.addInstancesMode(this._templateSize.orientation + 'Orientation');
|
|
60
60
|
|
|
61
61
|
this.emit(Urso.events.MODULES_SCENES_ORIENTATION_CHANGE, this._templateSize.orientation);
|