@ray-js/api 1.3.22 → 1.3.23

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.
Files changed (74) hide show
  1. package/LICENSE.md +9 -0
  2. package/lib/BaseKit-3.3.10.js +85 -83
  3. package/lib/BizKit-3.2.7.js +48 -47
  4. package/lib/DeviceKit-3.3.1.js +194 -193
  5. package/lib/HomeKit-3.1.4.js +2 -1
  6. package/lib/MapKit-3.0.7.js +4 -2
  7. package/lib/MiniKit-3.1.0.js +65 -64
  8. package/lib/P2PKit-2.0.3.js +4 -2
  9. package/lib/PlayNetKit-1.1.3.js +2 -1
  10. package/lib/cloud/alarm.js +6 -9
  11. package/lib/cloud/core.js +3 -4
  12. package/lib/cloud/device.js +25 -36
  13. package/lib/cloud/interface.d.ts +7 -7
  14. package/lib/cloud/linkage.js +51 -49
  15. package/lib/cloud/statistic.js +30 -42
  16. package/lib/cloud/timer.js +45 -62
  17. package/lib/constants.js +1 -1
  18. package/lib/core/promisify/index.js +5 -9
  19. package/lib/getBoundingClientRect/index.js +16 -17
  20. package/lib/getBoundingClientRect/index.thing.js +16 -17
  21. package/lib/getBoundingClientRect/index.wechat.js +16 -17
  22. package/lib/getCdnUrl/index.js +0 -2
  23. package/lib/getCdnUrl/index.thing.js +30 -85
  24. package/lib/getCdnUrl/index.wechat.js +0 -2
  25. package/lib/getElementById/index.js +1 -3
  26. package/lib/getElementById/index.thing.js +2 -4
  27. package/lib/getElementById/index.wechat.js +2 -4
  28. package/lib/hideTabBar/index.d.ts +7 -1
  29. package/lib/index.js +3 -2
  30. package/lib/lifecycles/offAppEvent/index.js +2 -2
  31. package/lib/lifecycles/offAppHide/index.js +2 -2
  32. package/lib/lifecycles/offAppShow/index.js +2 -2
  33. package/lib/lifecycles/offError/index.js +2 -2
  34. package/lib/lifecycles/offThemeChange/index.js +2 -2
  35. package/lib/lifecycles/offWindowResize/index.js +2 -2
  36. package/lib/lifecycles/onAppEvent/index.js +2 -2
  37. package/lib/lifecycles/onAppHide/index.js +2 -2
  38. package/lib/lifecycles/onAppShow/index.js +2 -2
  39. package/lib/lifecycles/onError/index.js +2 -2
  40. package/lib/lifecycles/onPageNotFound/index.js +2 -2
  41. package/lib/lifecycles/onThemeChange/index.js +2 -2
  42. package/lib/lifecycles/onWindowResize/index.js +2 -2
  43. package/lib/navigateBack/index.js +3 -6
  44. package/lib/navigateTo/index.js +2 -5
  45. package/lib/onNavigationBarBack/index.js +1 -2
  46. package/lib/onNavigationBarBack/index.wechat.js +1 -2
  47. package/lib/panel/devInfo/index.js +84 -121
  48. package/lib/panel/i18n/index.d.ts +1 -1
  49. package/lib/panel/i18n/index.js +180 -263
  50. package/lib/panel/i18n/index.wechat.d.ts +1 -1
  51. package/lib/panel/i18n/index.wechat.js +184 -268
  52. package/lib/panel/normalizeNetwork.d.ts +2 -2
  53. package/lib/panel/normalizeNetwork.js +2 -7
  54. package/lib/panel/publishDps.d.ts +1 -1
  55. package/lib/panel/publishDps.js +14 -19
  56. package/lib/panel/types/devInfo.d.ts +3 -3
  57. package/lib/panel/types/utilities.d.ts +8 -8
  58. package/lib/panel/utils.js +1 -3
  59. package/lib/reLaunch/index.js +2 -5
  60. package/lib/redirectTo/index.js +2 -7
  61. package/lib/requestCloud/index.js +2 -2
  62. package/lib/requestCloud/index.wechat.js +0 -1
  63. package/lib/setNavigationBarBack/index.js +1 -2
  64. package/lib/setNavigationBarBack/index.wechat.js +1 -2
  65. package/lib/setNavigationBarColor/index.js +3 -6
  66. package/lib/setNavigationBarTitle/index.js +5 -6
  67. package/lib/showTabBar/index.d.ts +7 -1
  68. package/lib/switchTab/index.js +2 -5
  69. package/lib/utils.d.ts +1 -1
  70. package/lib/utils.js +9 -18
  71. package/lib/utils.wechat.d.ts +1 -1
  72. package/lib/utils.wechat.js +14 -26
  73. package/lib/viewAPI.js +14 -13
  74. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- declare type LanguageMap = {
1
+ type LanguageMap = {
2
2
  [key: string]: Record<string, string>;
3
3
  };
4
4
  export default class I18N {
@@ -1,289 +1,206 @@
1
- import _typeof from "@babel/runtime/helpers/esm/typeof";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import "core-js/modules/es.object.keys.js";
5
- import "core-js/modules/es.object.assign.js";
6
- import "core-js/modules/es.array.map.js";
7
- import "core-js/modules/es.regexp.exec.js";
8
- import "core-js/modules/es.regexp.test.js";
9
- import "core-js/modules/es.array.last-index-of.js";
10
- import "core-js/modules/es.string.replace.js";
11
- import "core-js/modules/es.regexp.constructor.js";
12
- import "core-js/modules/es.regexp.dot-all.js";
13
- import "core-js/modules/es.regexp.sticky.js";
14
- import "core-js/modules/es.regexp.to-string.js";
15
- import "core-js/modules/es.array.concat.js";
16
- import "core-js/modules/es.parse-float.js";
17
1
  import { requestCloud, getSystemInfoSync, THING } from '../..';
18
2
  import { getBitValue } from '../utils';
19
-
20
- var I18N = /*#__PURE__*/function () {
21
- function I18N(props) {
22
- _classCallCheck(this, I18N);
23
-
3
+ export default class I18N {
4
+ constructor(props) {
24
5
  this.strings = this.mergeLanguage(props, {});
25
6
  this.defaultLang = this.strings.en ? 'en' : Object.keys(this.strings)[0];
26
7
  this.setLanguage(this.defaultLang);
27
- var langKey = getSystemInfoSync().language;
8
+ const langKey = getSystemInfoSync().language;
28
9
  this.setLanguage(langKey);
29
10
  }
30
-
31
- _createClass(I18N, [{
32
- key: "forceUpdateNetworkLang",
33
- value: function forceUpdateNetworkLang(productId) {
34
- var _this = this;
35
-
36
- requestCloud({
37
- api: "".concat(THING, ".m.i18n.get"),
38
- version: '1.0',
39
- data: {
40
- productId: productId,
41
- moduleName: 'h5',
42
- endId: 2,
43
- osId: 0
44
- },
45
- // @ts-ignore
46
- success: function success(data) {
47
- if (data) {
48
- _this.strings = _this.mergeLanguage(_this.strings, data);
49
-
50
- _this.buildLanguage(_this.__language);
51
- }
11
+ forceUpdateNetworkLang(productId) {
12
+ requestCloud({
13
+ api: `${THING}.m.i18n.get`,
14
+ version: '1.0',
15
+ data: {
16
+ productId,
17
+ moduleName: 'h5',
18
+ endId: 2,
19
+ osId: 0
20
+ },
21
+ // @ts-ignore
22
+ success: data => {
23
+ if (data) {
24
+ this.strings = this.mergeLanguage(this.strings, data);
25
+ this.buildLanguage(this.__language);
52
26
  }
53
- });
54
- }
55
- }, {
56
- key: "mergeLanguage",
57
- value: function mergeLanguage(L1, L2) {
58
- if (typeof L1 === 'undefined' && typeof L2 === 'undefined') return {};
59
- if (typeof L1 === 'undefined') return L2;
60
- if (typeof L2 === 'undefined') return L1;
61
- var L0 = Object.assign({}, L1);
62
- Object.keys(L2).map(function (k) {
63
- if (typeof L0[k] !== 'undefined') {
64
- Object.assign(L0[k], L2[k]);
65
- } else {
66
- L0[k] = Object.assign({}, L2[k]);
67
- }
68
-
69
- return null;
70
- });
71
- return L0;
72
- }
73
- }, {
74
- key: "isZh",
75
- value: function isZh(language) {
76
- /**
77
- * ios 的中文简体固定为 zh-Hans,
78
- * 但安卓的中文简体可能有一大堆排列组件 = =,如 zh_CN、zh_cn、zh_Hans_CH、zh_hans_cn 等等;
79
- */
80
-
81
- /**
82
- * 如果匹配到位中文简体地区,
83
- * 则将中文 zh 相关的 values 都写入到 this.strings 下,保证兜底本地 zh 相关的能取到,
84
- * 再将当前地区 key 相关的 values 都写入到 this.strings 下,优先级最高;
85
- */
86
- if (typeof language === 'string' && /^zh-hans$|^zh_hans$|^zh_cn$|^zh-cn$|^zh_hans_\w+|^zh-hans-\w+/.test(language.toLowerCase())) {
87
- return true;
88
27
  }
89
-
90
- return false;
91
- }
92
- }, {
93
- key: "setLanguage",
94
- value: function setLanguage(language) {
95
- this.__language = language;
96
-
97
- if (this.isZh(language)) {
98
- this.buildLanguage('zh');
99
- this.buildLanguage(language);
28
+ });
29
+ }
30
+ mergeLanguage(L1, L2) {
31
+ if (typeof L1 === 'undefined' && typeof L2 === 'undefined') return {};
32
+ if (typeof L1 === 'undefined') return L2;
33
+ if (typeof L2 === 'undefined') return L1;
34
+ const L0 = Object.assign({}, L1);
35
+ Object.keys(L2).map(k => {
36
+ if (typeof L0[k] !== 'undefined') {
37
+ Object.assign(L0[k], L2[k]);
100
38
  } else {
101
- this.buildLanguage(this.__language);
102
- }
103
- }
104
- }, {
105
- key: "buildLanguage",
106
- value: function buildLanguage(language) {
107
- var _this2 = this;
108
-
109
- if (this.strings[language]) {
110
- var localizedStrings = this.strings[language];
111
- Object.keys(localizedStrings).map(function (key) {
112
- // eslint-disable-next-line no-prototype-builtins
113
- if (localizedStrings.hasOwnProperty(key)) {
114
- _this2[key] = localizedStrings[key];
115
- }
116
-
117
- return null;
118
- });
119
- }
120
- }
121
- }, {
122
- key: "_getBestMatchingLanguage",
123
- value: function _getBestMatchingLanguage(language, props) {
124
- if (props[language]) return language;
125
- var idx = language.lastIndexOf('-');
126
-
127
- if (idx >= 0) {
128
- var lang = language.substring(0, idx);
129
- return this._getBestMatchingLanguage(lang, props);
130
- }
131
-
132
- var underlineIdx = language.lastIndexOf('_');
133
-
134
- if (underlineIdx >= 0) {
135
- var _lang = language.substring(0, underlineIdx);
136
-
137
- return this._getBestMatchingLanguage(_lang, props);
138
- }
139
-
140
- return this.defaultLang;
141
- } // Format the passed string replacing the numbered placeholders
142
- // i.e. I'd like some {0} and {1}, or just {0}
143
- // Use example:
144
- // strings.formatString(strings.question, strings.bread, strings.butter)
145
-
146
- }, {
147
- key: "formatString",
148
- value: function formatString(str) {
149
- var res = str;
150
-
151
- for (var i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
152
- res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
39
+ L0[k] = Object.assign({}, L2[k]);
153
40
  }
41
+ return null;
42
+ });
43
+ return L0;
44
+ }
45
+ isZh(language) {
46
+ /**
47
+ * ios 的中文简体固定为 zh-Hans,
48
+ * 但安卓的中文简体可能有一大堆排列组件 = =,如 zh_CN、zh_cn、zh_Hans_CH、zh_hans_cn 等等;
49
+ */
154
50
 
155
- return res;
51
+ /**
52
+ * 如果匹配到位中文简体地区,
53
+ * 则将中文 zh 相关的 values 都写入到 this.strings 下,保证兜底本地 zh 相关的能取到,
54
+ * 再将当前地区 key 相关的 values 都写入到 this.strings 下,优先级最高;
55
+ */
56
+ if (typeof language === 'string' && /^zh-hans$|^zh_hans$|^zh_cn$|^zh-cn$|^zh_hans_\w+|^zh-hans-\w+/.test(language.toLowerCase())) {
57
+ return true;
156
58
  }
157
- }, {
158
- key: "formatValue",
159
- value: function formatValue(key) {
160
- var res = typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
161
-
162
- for (var i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
163
- res = this._replaceAll("{".concat(i, "}"), i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
164
- }
165
-
166
- return res;
59
+ return false;
60
+ }
61
+ setLanguage(language) {
62
+ this.__language = language;
63
+ if (this.isZh(language)) {
64
+ this.buildLanguage('zh');
65
+ this.buildLanguage(language);
66
+ } else {
67
+ this.buildLanguage(this.__language);
167
68
  }
168
- }, {
169
- key: "_replaceAll",
170
- value: function _replaceAll(find, replace, str) {
171
- // eslint-disable-next-line no-useless-escape, no-param-reassign
172
- find = find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
173
- if (!str) return '';
174
- return str.replace(new RegExp(find, 'g'), replace);
69
+ }
70
+ buildLanguage(language) {
71
+ if (this.strings[language]) {
72
+ const localizedStrings = this.strings[language];
73
+ Object.keys(localizedStrings).map(key => {
74
+ // eslint-disable-next-line no-prototype-builtins
75
+ if (localizedStrings.hasOwnProperty(key)) {
76
+ this[key] = localizedStrings[key];
77
+ }
78
+ return null;
79
+ });
175
80
  }
176
- }, {
177
- key: "getDpLang",
178
- value: function getDpLang(code, value) {
179
- var key;
180
-
181
- if (typeof value === 'undefined') {
182
- key = "dp_".concat(code).toLowerCase();
183
- } else if (typeof value === 'boolean') {
184
- var valStr = value ? 'on' : 'off';
185
- key = "dp_".concat(code, "_").concat(valStr).toLowerCase();
186
- } else {
187
- key = "dp_".concat(code, "_").concat(value).toLowerCase();
188
- }
189
-
190
- return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
81
+ }
82
+ _getBestMatchingLanguage(language, props) {
83
+ if (props[language]) return language;
84
+ const idx = language.lastIndexOf('-');
85
+ if (idx >= 0) {
86
+ const lang = language.substring(0, idx);
87
+ return this._getBestMatchingLanguage(lang, props);
191
88
  }
192
- }, {
193
- key: "getDpName",
194
- value: function getDpName(code, defaultName) {
195
- var key = "dp_".concat(code).toLowerCase();
196
- return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
89
+ const underlineIdx = language.lastIndexOf('_');
90
+ if (underlineIdx >= 0) {
91
+ const lang = language.substring(0, underlineIdx);
92
+ return this._getBestMatchingLanguage(lang, props);
197
93
  }
198
- }, {
199
- key: "getDpsLang",
200
- value: function getDpsLang(key) {
201
- var _this3 = this;
202
-
203
- var strs = {};
204
-
205
- if (_typeof(key) === 'object') {
206
- if (typeof key.strKey === 'string') {
207
- strs = I18n.t(key.strKey) !== key.strKey ? I18n.t(key.strKey) : typeof this[key.strKey] !== 'undefined' ? this[key.strKey] : I18n.t(key.strKey);
208
- } else {
209
- Object.keys(key).map(function (i) {
210
- strs[key[i]] = I18n.t(key[i]) !== key[i] ? I18n.t(key[i]) : typeof _this3[key[i]] !== 'undefined' ? _this3[key[i]] : I18n.t(key[i]);
211
- return null;
212
- });
213
- }
214
- } else {
215
- strs = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
216
- }
94
+ return this.defaultLang;
95
+ }
217
96
 
218
- return strs;
97
+ // Format the passed string replacing the numbered placeholders
98
+ // i.e. I'd like some {0} and {1}, or just {0}
99
+ // Use example:
100
+ // strings.formatString(strings.question, strings.bread, strings.butter)
101
+ formatString(str) {
102
+ let res = str;
103
+ for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
104
+ res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
219
105
  }
220
- }, {
221
- key: "getLang",
222
- value: function getLang(key, defaultString) {
223
- return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : typeof defaultString !== 'undefined' ? defaultString : I18n.t(key);
106
+ return res;
107
+ }
108
+ formatValue(key) {
109
+ let res = typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
110
+ for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
111
+ res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
224
112
  }
225
- /**
226
- * 获取picker标题
227
- * @param {*} dpCode
228
- */
229
-
230
- }, {
231
- key: "getRangeStrings",
232
- value: function getRangeStrings(dpCode, schema) {
233
- var _this4 = this;
234
-
235
- var result = {};
236
- if (typeof schema === 'undefined') return result;
237
- var lists = schema.range;
238
- lists.map(function (v) {
239
- var key = "dp_".concat(dpCode, "_").concat(v).toLowerCase();
240
- result[v] = I18n.t(key) !== key ? I18n.t(key) : typeof _this4[key] !== 'undefined' ? _this4[key] : I18n.t(key);
241
- return null;
242
- });
243
- return result;
113
+ return res;
114
+ }
115
+ _replaceAll(find, replace, str) {
116
+ // eslint-disable-next-line no-useless-escape, no-param-reassign
117
+ find = find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
118
+ if (!str) return '';
119
+ return str.replace(new RegExp(find, 'g'), replace);
120
+ }
121
+ getDpLang(code, value) {
122
+ let key;
123
+ if (typeof value === 'undefined') {
124
+ key = `dp_${code}`.toLowerCase();
125
+ } else if (typeof value === 'boolean') {
126
+ const valStr = value ? 'on' : 'off';
127
+ key = `dp_${code}_${valStr}`.toLowerCase();
128
+ } else {
129
+ key = `dp_${code}_${value}`.toLowerCase();
244
130
  }
245
- /**
246
- * 开关倒计时转换为文案 time => 设备将在xxx后 关闭/开启
247
- * 精确到分钟
248
- * @param {*} t 倒计时剩余()
249
- * @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
250
- */
251
-
252
- }, {
253
- key: "parseCountdown",
254
- value: function parseCountdown(t, power) {
255
- var h = parseFloat("".concat(t / 3600));
256
- var m = parseFloat("".concat(t / 60 - h * 60));
257
- var tHour = I18n.t('t_hour') !== 't_hour' ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
258
- var tMinute = I18n.t('t_minute') !== 't_minute' ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
259
- var time = h >= 1.0 ? "".concat(Math.round(h)).concat(tHour) : "".concat(Math.round(m)).concat(tMinute);
260
- var key = "countdown_".concat(power ? 'on' : 'off');
261
- var str = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
262
- return this.formatString(str, time);
131
+ return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
132
+ }
133
+ getDpName(code, defaultName) {
134
+ const key = `dp_${code}`.toLowerCase();
135
+ return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
136
+ }
137
+ getDpsLang(key) {
138
+ let strs = {};
139
+ if (typeof key === 'object') {
140
+ if (typeof key.strKey === 'string') {
141
+ strs = I18n.t(key.strKey) !== key.strKey ? I18n.t(key.strKey) : typeof this[key.strKey] !== 'undefined' ? this[key.strKey] : I18n.t(key.strKey);
142
+ } else {
143
+ Object.keys(key).map(i => {
144
+ strs[key[i]] = I18n.t(key[i]) !== key[i] ? I18n.t(key[i]) : typeof this[key[i]] !== 'undefined' ? this[key[i]] : I18n.t(key[i]);
145
+ return null;
146
+ });
147
+ }
148
+ } else {
149
+ strs = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
263
150
  }
264
- }, {
265
- key: "getFaultStrings",
266
- value: function getFaultStrings(schema, faultCode, faultValue) {
267
- var onlyPrior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
268
- if (!faultValue) return '';
269
- var label = schema.label;
270
- var labels = [];
151
+ return strs;
152
+ }
153
+ getLang(key, defaultString) {
154
+ return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : typeof defaultString !== 'undefined' ? defaultString : I18n.t(key);
155
+ }
271
156
 
272
- for (var i = 0; i < label.length; i++) {
273
- var value = label[i];
274
- var isExist = getBitValue(faultValue, i);
157
+ /**
158
+ * 获取picker标题
159
+ * @param {*} dpCode
160
+ */
161
+ getRangeStrings(dpCode, schema) {
162
+ const result = {};
163
+ if (typeof schema === 'undefined') return result;
164
+ const lists = schema.range;
165
+ lists.map(v => {
166
+ const key = `dp_${dpCode}_${v}`.toLowerCase();
167
+ result[v] = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
168
+ return null;
169
+ });
170
+ return result;
171
+ }
275
172
 
276
- if (isExist) {
277
- labels.push(this.getDpLang(faultCode, value));
278
- if (onlyPrior) break;
279
- }
173
+ /**
174
+ * 开关倒计时转换为文案 time => 设备将在xxx后 关闭/开启
175
+ * 精确到分钟
176
+ * @param {*} t 倒计时剩余(秒)
177
+ * @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
178
+ */
179
+ parseCountdown(t, power) {
180
+ const h = parseFloat(`${t / 3600}`);
181
+ const m = parseFloat(`${t / 60 - h * 60}`);
182
+ const tHour = I18n.t('t_hour') !== 't_hour' ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
183
+ const tMinute = I18n.t('t_minute') !== 't_minute' ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
184
+ const time = h >= 1.0 ? `${Math.round(h)}${tHour}` : `${Math.round(m)}${tMinute}`;
185
+ const key = `countdown_${power ? 'on' : 'off'}`;
186
+ const str = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
187
+ return this.formatString(str, time);
188
+ }
189
+ getFaultStrings(schema, faultCode, faultValue) {
190
+ let onlyPrior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
191
+ if (!faultValue) return '';
192
+ const {
193
+ label
194
+ } = schema;
195
+ const labels = [];
196
+ for (let i = 0; i < label.length; i++) {
197
+ const value = label[i];
198
+ const isExist = getBitValue(faultValue, i);
199
+ if (isExist) {
200
+ labels.push(this.getDpLang(faultCode, value));
201
+ if (onlyPrior) break;
280
202
  }
281
-
282
- return onlyPrior ? labels[0] : labels.join(', ');
283
203
  }
284
- }]);
285
-
286
- return I18N;
287
- }();
288
-
289
- export { I18N as default };
204
+ return onlyPrior ? labels[0] : labels.join(', ');
205
+ }
206
+ }
@@ -1,4 +1,4 @@
1
- declare type LanguageMap = {
1
+ type LanguageMap = {
2
2
  [key: string]: Record<string, string>;
3
3
  };
4
4
  export default class I18N {