@das-fed/upf-web 6.4.0-dev.200 → 6.4.0-dev.202
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/es5.js +49 -49
- package/esm-map.json +10 -8
- package/front-end/i18n/front-end-page/dasweb_en-US.js +2 -2
- package/front-end/i18n/front-end-page/dasweb_zh-CN.js +2 -2
- package/front-end/i18n/front-end-page/dasweb_zh-MO.js +2 -2
- package/{index-DN3L_UYL.js → index-B3QSTHl8.js} +1 -1
- package/{index-D7Yosv5R.js → index-DvcXHpcr.js} +1 -1
- package/index-DvcXHpcr.js.gz +0 -0
- package/{index-Cwnxjz4B.js → index-L0ZWbpXA.js} +1247 -1217
- package/index-L0ZWbpXA.js.gz +0 -0
- package/index.js +19 -17
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +33 -33
- package/packages/create-das-web-app/index.js +29 -29
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +188 -111
- package/packages/i18n/index.js +87 -56
- package/packages/i18n/index.js.gz +0 -0
- package/types/i18n/index.d.ts +5 -2
- package/types/i18n/register.d.ts +3 -0
- package/index-Cwnxjz4B.js.gz +0 -0
- package/index-D7Yosv5R.js.gz +0 -0
package/packages/i18n/es5.js
CHANGED
|
@@ -1,104 +1,150 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
6
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
7
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
|
|
5
8
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
6
9
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
7
10
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
8
11
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
9
12
|
var vue = require('vue');
|
|
10
13
|
var commonTools = require('@das-fed/upf-utils/common-tools');
|
|
11
|
-
var
|
|
14
|
+
var config = require('@das-fed/upf-utils/config');
|
|
15
|
+
var k = /*#__PURE__*/function () {
|
|
16
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t, n) {
|
|
17
|
+
var _ref2, _ref3, _ref4;
|
|
18
|
+
var m, u, b, a, o, s, e, r, l, _t;
|
|
19
|
+
return _regenerator().w(function (_context) {
|
|
20
|
+
while (1) switch (_context.p = _context.n) {
|
|
21
|
+
case 0:
|
|
22
|
+
a = config.getConfig() || {}, o = (_ref2 = (m = a.i18n) == null ? undefined : m.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, s = (_ref3 = (u = a.i18n) == null ? undefined : u.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : true, e = (_ref4 = (b = a.i18n) == null ? undefined : b.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
|
|
23
|
+
r = "/oss/resource/";
|
|
24
|
+
_context.p = 1;
|
|
25
|
+
_context.n = 2;
|
|
26
|
+
return commonTools.handleI18nData({
|
|
27
|
+
baseUrl: o ? r : "/",
|
|
28
|
+
currentLang: n,
|
|
29
|
+
appName: t,
|
|
30
|
+
isPullBack: s,
|
|
31
|
+
fallbackBaseUrl: "/",
|
|
32
|
+
isDasUI: e
|
|
33
|
+
});
|
|
34
|
+
case 2:
|
|
35
|
+
l = _context.v;
|
|
36
|
+
if (!(!l || !(l != null && l.frontEnd))) {
|
|
37
|
+
_context.n = 3;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
throw new Error("Failed to fetch i18n data");
|
|
41
|
+
case 3:
|
|
42
|
+
return _context.a(2, l);
|
|
43
|
+
case 4:
|
|
44
|
+
_context.p = 4;
|
|
45
|
+
_t = _context.v;
|
|
46
|
+
throw new Error("registerResources error: ".concat(_t));
|
|
47
|
+
case 5:
|
|
48
|
+
return _context.a(2);
|
|
49
|
+
}
|
|
50
|
+
}, _callee, null, [[1, 4]]);
|
|
51
|
+
}));
|
|
52
|
+
return function k(_x, _x2) {
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}(),
|
|
56
|
+
j = "language",
|
|
12
57
|
c = vue.reactive({}),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
58
|
+
i = vue.reactive({}),
|
|
59
|
+
f = vue.reactive({}),
|
|
60
|
+
U = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
61
|
+
D = U || window.localStorage.getItem(j) || window.navigator.language || "zh-CN",
|
|
62
|
+
g = vue.ref(D),
|
|
63
|
+
O = "dasI18n",
|
|
64
|
+
E = function E() {
|
|
19
65
|
var t = document.documentElement;
|
|
20
|
-
t && t.setAttribute("lang",
|
|
66
|
+
t && t.setAttribute("lang", g.value);
|
|
21
67
|
},
|
|
22
|
-
|
|
68
|
+
d = function d() {
|
|
23
69
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
for (var
|
|
29
|
-
var _t$
|
|
30
|
-
|
|
70
|
+
var n = arguments.length > 1 ? arguments[1] : undefined;
|
|
71
|
+
var a = n === "global",
|
|
72
|
+
o = !a,
|
|
73
|
+
s = {};
|
|
74
|
+
for (var e in t) for (var r in t[e]) {
|
|
75
|
+
var _t$e$r;
|
|
76
|
+
s[r] || (s[r] = {}), s[r][e] = (_t$e$r = t[e][r]) !== null && _t$e$r !== void 0 ? _t$e$r : "", a && (i[r] || (i[r] = {}), i[r][e] = s[r][e]), o && (c[r] || (c[r] = {}), c[r][e] = s[r][e]);
|
|
31
77
|
}
|
|
32
78
|
},
|
|
33
|
-
|
|
79
|
+
z = function z() {
|
|
34
80
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
for (var
|
|
40
|
-
var
|
|
41
|
-
|
|
81
|
+
var n = arguments.length > 1 ? arguments[1] : undefined;
|
|
82
|
+
var s;
|
|
83
|
+
var a = n === "global",
|
|
84
|
+
o = !a;
|
|
85
|
+
for (var e in t) if (a && !i[e] && (i[e] = t[e]), o) {
|
|
86
|
+
var r = (s = t[e]) != null && s._appCode ? t[e]._appCode.toLowerCase() : "";
|
|
87
|
+
r && (f[r] || (f[r] = {}), f[r][e] = t[e]), c[e] || (c[e] = t[e]);
|
|
42
88
|
}
|
|
43
89
|
},
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
return _regenerator().w(function (
|
|
48
|
-
while (1) switch (
|
|
90
|
+
x = /*#__PURE__*/function () {
|
|
91
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
|
|
92
|
+
var n;
|
|
93
|
+
return _regenerator().w(function (_context2) {
|
|
94
|
+
while (1) switch (_context2.n) {
|
|
49
95
|
case 0:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
96
|
+
E();
|
|
97
|
+
n = window[O];
|
|
98
|
+
n && z(n, "global");
|
|
53
99
|
case 1:
|
|
54
|
-
return
|
|
100
|
+
return _context2.a(2);
|
|
55
101
|
}
|
|
56
|
-
},
|
|
102
|
+
}, _callee2);
|
|
57
103
|
}));
|
|
58
|
-
return function
|
|
59
|
-
return
|
|
104
|
+
return function x(_x3) {
|
|
105
|
+
return _ref5.apply(this, arguments);
|
|
60
106
|
};
|
|
61
107
|
}(),
|
|
62
|
-
b = function b(t) {
|
|
63
|
-
var a = "";
|
|
64
|
-
var r = /\/([^\/]+)\/([^\/]+)\//,
|
|
65
|
-
e = t.match(r);
|
|
66
|
-
return e && e.length >= 3 && (a = e[1] + "/" + e[2]), a ? a.toLowerCase() : "";
|
|
67
|
-
},
|
|
68
108
|
A = function A(t) {
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
var n = "";
|
|
110
|
+
var a = /\/([^\/]+)\/([^\/]+)\//,
|
|
111
|
+
o = t.match(a);
|
|
112
|
+
return o && o.length >= 3 && (n = o[1] + "/" + o[2]), n ? n.toLowerCase() : "";
|
|
113
|
+
},
|
|
114
|
+
v = function v(t) {
|
|
115
|
+
for (var _len = arguments.length, n = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
116
|
+
n[_key - 1] = arguments[_key];
|
|
71
117
|
}
|
|
72
118
|
return vue.computed(function () {
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
typeof
|
|
80
|
-
"zh-CN":
|
|
119
|
+
var _f$framework, _f$a;
|
|
120
|
+
var a = A(location.pathname);
|
|
121
|
+
var o = (_f$framework = f.framework) !== null && _f$framework !== void 0 ? _f$framework : {},
|
|
122
|
+
s = (_f$a = f[a]) !== null && _f$a !== void 0 ? _f$a : {},
|
|
123
|
+
e = c[t] || i[t] || o[t] || s[t] || t;
|
|
124
|
+
if (e === t) return t;
|
|
125
|
+
typeof e == "string" && (e = {
|
|
126
|
+
"zh-CN": e
|
|
81
127
|
});
|
|
82
|
-
var
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
}),
|
|
128
|
+
var r = e[g.value];
|
|
129
|
+
return g.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (r = e["zh-cn"]), n.map(function (m, u) {
|
|
130
|
+
r && (r = r.replace("$".concat(u), m));
|
|
131
|
+
}), r;
|
|
86
132
|
});
|
|
87
133
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
for (var _len2 = arguments.length,
|
|
91
|
-
|
|
134
|
+
N = v,
|
|
135
|
+
B = function B(t) {
|
|
136
|
+
for (var _len2 = arguments.length, n = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
137
|
+
n[_key2 - 1] = arguments[_key2];
|
|
92
138
|
}
|
|
93
|
-
return
|
|
139
|
+
return N.apply(void 0, [t].concat(n)).value;
|
|
94
140
|
},
|
|
95
|
-
|
|
96
|
-
|
|
141
|
+
R = function R(t) {
|
|
142
|
+
g.value = t, E();
|
|
97
143
|
},
|
|
98
|
-
|
|
99
|
-
return
|
|
144
|
+
F = function F() {
|
|
145
|
+
return g;
|
|
100
146
|
},
|
|
101
|
-
|
|
147
|
+
y = {
|
|
102
148
|
"en-US": {
|
|
103
149
|
ant: function ant() {
|
|
104
150
|
return Promise.resolve().then(function () {
|
|
@@ -256,48 +302,79 @@ var s = vue.reactive({}),
|
|
|
256
302
|
}
|
|
257
303
|
}
|
|
258
304
|
};
|
|
259
|
-
function
|
|
260
|
-
var
|
|
261
|
-
var
|
|
262
|
-
return
|
|
305
|
+
function G(t, n) {
|
|
306
|
+
var o;
|
|
307
|
+
var a = window.DATE_FORMAT_MAP;
|
|
308
|
+
return a && a[t] && a[t][n] ? a[t][n] : ((o = window.DATE_FORMAT_MAP[t]) == null ? undefined : o[n]) || "YYYY-MM-DD";
|
|
263
309
|
}
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}()
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
310
|
+
var Y = /*#__PURE__*/function () {
|
|
311
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(t) {
|
|
312
|
+
var n, a, _t2;
|
|
313
|
+
return _regenerator().w(function (_context3) {
|
|
314
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
315
|
+
case 0:
|
|
316
|
+
n = y[t] || y["zh-CN"];
|
|
317
|
+
_context3.p = 1;
|
|
318
|
+
_context3.n = 2;
|
|
319
|
+
return n.ant();
|
|
320
|
+
case 2:
|
|
321
|
+
a = _context3.v;
|
|
322
|
+
_context3.n = 3;
|
|
323
|
+
return n.dayjs();
|
|
324
|
+
case 3:
|
|
325
|
+
return _context3.a(2, a["default"]);
|
|
326
|
+
case 4:
|
|
327
|
+
_context3.p = 4;
|
|
328
|
+
_t2 = _context3.v;
|
|
329
|
+
case 5:
|
|
330
|
+
return _context3.a(2);
|
|
331
|
+
}
|
|
332
|
+
}, _callee3, null, [[1, 4]]);
|
|
333
|
+
}));
|
|
334
|
+
return function Y(_x4) {
|
|
335
|
+
return _ref6.apply(this, arguments);
|
|
336
|
+
};
|
|
337
|
+
}(),
|
|
338
|
+
K = /*#__PURE__*/function () {
|
|
339
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(t) {
|
|
340
|
+
var n, a, o, _t3;
|
|
341
|
+
return _regenerator().w(function (_context4) {
|
|
342
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
343
|
+
case 0:
|
|
344
|
+
n = commonTools.getUrlParams(location.href, "uiCulture") || window.localStorage.getItem(j) || window.navigator.language || "zh-CN", a = (t == null ? undefined : t.i18n) || [];
|
|
345
|
+
_context4.p = 1;
|
|
346
|
+
_context4.n = 2;
|
|
347
|
+
return k(a, n);
|
|
348
|
+
case 2:
|
|
349
|
+
o = _context4.v;
|
|
350
|
+
o != null && o.frontEnd && _typeof(o.frontEnd) == "object" && Object.keys(o.frontEnd).length && a.forEach(function (s) {
|
|
351
|
+
o.frontEnd[s] && _typeof(o.frontEnd[s]) == "object" && Object.keys(o.frontEnd[s]).length && d(_defineProperty({}, n, o.frontEnd[s]));
|
|
352
|
+
}), o != null && o.backMsg && _typeof(o.backMsg) == "object" && Object.keys(o.backMsg).length && o.backMsg.aiot && _typeof(o.backMsg.aiot) == "object" && Object.keys(o.backMsg.aiot).length && d(_defineProperty({}, n, o.backMsg.aiot)), o != null && o.dasUiEnd && _typeof(o.dasUiEnd) == "object" && Object.keys(o.dasUiEnd).length && d(_defineProperty({}, n, o.dasUiEnd)), R(n);
|
|
353
|
+
_context4.n = 4;
|
|
354
|
+
break;
|
|
355
|
+
case 3:
|
|
356
|
+
_context4.p = 3;
|
|
357
|
+
_t3 = _context4.v;
|
|
358
|
+
case 4:
|
|
359
|
+
return _context4.a(2);
|
|
360
|
+
}
|
|
361
|
+
}, _callee4, null, [[1, 3]]);
|
|
362
|
+
}));
|
|
363
|
+
return function K(_x5) {
|
|
364
|
+
return _ref7.apply(this, arguments);
|
|
365
|
+
};
|
|
366
|
+
}();
|
|
367
|
+
exports.currentLang = g;
|
|
368
|
+
exports.customLangeData = c;
|
|
369
|
+
exports.getDateFormat = G;
|
|
370
|
+
exports.getI18nRule = v;
|
|
371
|
+
exports.getLang = F;
|
|
372
|
+
exports.i18n = N;
|
|
373
|
+
exports.initI18n = x;
|
|
374
|
+
exports.languageKey = j;
|
|
375
|
+
exports.loadLocale = Y;
|
|
376
|
+
exports.registerMicroI18nData = K;
|
|
377
|
+
exports.setI18nRule = z;
|
|
378
|
+
exports.setLang = R;
|
|
379
|
+
exports.setLangRule = d;
|
|
380
|
+
exports.t = B;
|
package/packages/i18n/index.js
CHANGED
|
@@ -1,41 +1,61 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getUrlParams as
|
|
3
|
-
|
|
1
|
+
import { reactive as p, ref as L, computed as C } from "vue";
|
|
2
|
+
import { handleI18nData as M, getUrlParams as w } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
import { getConfig as I } from "@das-fed/upf-utils/config";
|
|
4
|
+
const k = async (t, n) => {
|
|
5
|
+
var m, u, b;
|
|
6
|
+
const a = I() || {}, o = ((m = a.i18n) == null ? void 0 : m.fromOss) ?? !0, s = ((u = a.i18n) == null ? void 0 : u.isPullBack) ?? !0, e = ((b = a.i18n) == null ? void 0 : b.isDasUI) ?? !0;
|
|
7
|
+
let r = "/oss/resource/";
|
|
8
|
+
try {
|
|
9
|
+
const l = await M({
|
|
10
|
+
baseUrl: o ? r : "/",
|
|
11
|
+
currentLang: n,
|
|
12
|
+
appName: t,
|
|
13
|
+
isPullBack: s,
|
|
14
|
+
fallbackBaseUrl: "/",
|
|
15
|
+
isDasUI: e
|
|
16
|
+
});
|
|
17
|
+
if (!l || !(l != null && l.frontEnd))
|
|
18
|
+
throw new Error("Failed to fetch i18n data");
|
|
19
|
+
return l;
|
|
20
|
+
} catch (h) {
|
|
21
|
+
throw new Error(`registerResources error: ${h}`);
|
|
22
|
+
}
|
|
23
|
+
}, j = "language", c = p({}), i = p({}), f = p({}), U = w(location.href, "uiCulture") || "", D = U || window.localStorage.getItem(j) || window.navigator.language || "zh-CN", g = L(D), O = "dasI18n", E = () => {
|
|
4
24
|
const t = document.documentElement;
|
|
5
|
-
t && t.setAttribute("lang",
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
for (const
|
|
9
|
-
for (const
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
|
|
25
|
+
t && t.setAttribute("lang", g.value);
|
|
26
|
+
}, d = (t = {}, n) => {
|
|
27
|
+
const a = n === "global", o = !a, s = {};
|
|
28
|
+
for (const e in t)
|
|
29
|
+
for (const r in t[e])
|
|
30
|
+
s[r] || (s[r] = {}), s[r][e] = t[e][r] ?? "", a && (i[r] || (i[r] = {}), i[r][e] = s[r][e]), o && (c[r] || (c[r] = {}), c[r][e] = s[r][e]);
|
|
31
|
+
}, z = (t = {}, n) => {
|
|
32
|
+
var s;
|
|
33
|
+
const a = n === "global", o = !a;
|
|
34
|
+
for (const e in t)
|
|
35
|
+
if (a && !i[e] && (i[e] = t[e]), o) {
|
|
36
|
+
const r = (s = t[e]) != null && s._appCode ? t[e]._appCode.toLowerCase() : "";
|
|
37
|
+
r && (f[r] || (f[r] = {}), f[r][e] = t[e]), c[e] || (c[e] = t[e]);
|
|
18
38
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
typeof
|
|
32
|
-
let
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
+
}, x = async (t) => {
|
|
40
|
+
E();
|
|
41
|
+
const n = window[O];
|
|
42
|
+
n && z(n, "global");
|
|
43
|
+
}, A = (t) => {
|
|
44
|
+
let n = "";
|
|
45
|
+
const a = /\/([^\/]+)\/([^\/]+)\//, o = t.match(a);
|
|
46
|
+
return o && o.length >= 3 && (n = o[1] + "/" + o[2]), n ? n.toLowerCase() : "";
|
|
47
|
+
}, v = (t, ...n) => C(() => {
|
|
48
|
+
const a = A(location.pathname);
|
|
49
|
+
let o = f.framework ?? {}, s = f[a] ?? {}, e = c[t] || i[t] || o[t] || s[t] || t;
|
|
50
|
+
if (e === t) return t;
|
|
51
|
+
typeof e == "string" && (e = { "zh-CN": e });
|
|
52
|
+
let r = e[g.value];
|
|
53
|
+
return g.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (r = e["zh-cn"]), n.map((m, u) => {
|
|
54
|
+
r && (r = r.replace(`$${u}`, m));
|
|
55
|
+
}), r;
|
|
56
|
+
}), N = v, B = (t, ...n) => N(t, ...n).value, R = (t) => {
|
|
57
|
+
g.value = t, E();
|
|
58
|
+
}, F = () => g, y = {
|
|
39
59
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
40
60
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
41
61
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -50,30 +70,41 @@ const s = u({}), c = u({}), l = u({}), p = h(location.href, "uiCulture") || {},
|
|
|
50
70
|
"nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
|
|
51
71
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
52
72
|
};
|
|
53
|
-
function
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
return
|
|
73
|
+
function G(t, n) {
|
|
74
|
+
var o;
|
|
75
|
+
const a = window.DATE_FORMAT_MAP;
|
|
76
|
+
return a && a[t] && a[t][n] ? a[t][n] : ((o = window.DATE_FORMAT_MAP[t]) == null ? void 0 : o[n]) || "YYYY-MM-DD";
|
|
57
77
|
}
|
|
58
|
-
const
|
|
59
|
-
const
|
|
78
|
+
const Y = async (t) => {
|
|
79
|
+
const n = y[t] || y["zh-CN"];
|
|
80
|
+
try {
|
|
81
|
+
const a = await n.ant();
|
|
82
|
+
return await n.dayjs(), a.default;
|
|
83
|
+
} catch {
|
|
84
|
+
}
|
|
85
|
+
}, K = async (t) => {
|
|
86
|
+
const n = w(location.href, "uiCulture") || window.localStorage.getItem(j) || window.navigator.language || "zh-CN", a = (t == null ? void 0 : t.i18n) || [];
|
|
60
87
|
try {
|
|
61
|
-
const
|
|
62
|
-
|
|
88
|
+
const o = await k(a, n);
|
|
89
|
+
o != null && o.frontEnd && typeof o.frontEnd == "object" && Object.keys(o.frontEnd).length && a.forEach((s) => {
|
|
90
|
+
o.frontEnd[s] && typeof o.frontEnd[s] == "object" && Object.keys(o.frontEnd[s]).length && d({ [n]: o.frontEnd[s] });
|
|
91
|
+
}), o != null && o.backMsg && typeof o.backMsg == "object" && Object.keys(o.backMsg).length && o.backMsg.aiot && typeof o.backMsg.aiot == "object" && Object.keys(o.backMsg.aiot).length && d({ [n]: o.backMsg.aiot }), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length && d({ [n]: o.dasUiEnd }), R(n);
|
|
63
92
|
} catch {
|
|
64
93
|
}
|
|
65
94
|
};
|
|
66
95
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
R as
|
|
96
|
+
g as currentLang,
|
|
97
|
+
c as customLangeData,
|
|
98
|
+
G as getDateFormat,
|
|
99
|
+
v as getI18nRule,
|
|
100
|
+
F as getLang,
|
|
101
|
+
N as i18n,
|
|
102
|
+
x as initI18n,
|
|
103
|
+
j as languageKey,
|
|
104
|
+
Y as loadLocale,
|
|
105
|
+
K as registerMicroI18nData,
|
|
106
|
+
z as setI18nRule,
|
|
107
|
+
R as setLang,
|
|
108
|
+
d as setLangRule,
|
|
109
|
+
B as t
|
|
79
110
|
};
|
|
Binary file
|
package/types/i18n/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { langType } from './type';
|
|
2
|
+
|
|
3
|
+
declare const languageKey = "language";
|
|
2
4
|
declare const customLangeData: any;
|
|
3
5
|
declare const currentLang: import('vue').Ref<any, any>;
|
|
4
6
|
declare const setLangRule: (data?: any, type?: "global" | "custom") => void;
|
|
@@ -23,4 +25,5 @@ declare const setLang: (lang: langType) => void;
|
|
|
23
25
|
declare const getLang: () => import('vue').Ref<any, any>;
|
|
24
26
|
export declare function getDateFormat(type: 'month' | 'date' | 'datetime' | 'time', lang: string): string;
|
|
25
27
|
declare const loadLocale: (lang: string) => unknown;
|
|
26
|
-
|
|
28
|
+
declare const registerMicroI18nData: (opt?: any) => any;
|
|
29
|
+
export { languageKey, initI18n, setI18nRule, getI18nRule, i18n, t, setLang, getLang, currentLang, setLangRule, customLangeData, loadLocale, registerMicroI18nData, };
|
package/index-Cwnxjz4B.js.gz
DELETED
|
Binary file
|
package/index-D7Yosv5R.js.gz
DELETED
|
Binary file
|