@nocobase/plugin-client 0.9.1-alpha.1 → 0.9.2-alpha.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/lib/antd.js +0 -4
- package/lib/cron.js +1 -11
- package/lib/cronstrue.js +5 -30
- package/lib/index.js +0 -2
- package/lib/locale/en-US.json +27 -3
- package/lib/locale/index.js +2 -1
- package/lib/locale/pt-BR.json +1381 -0
- package/lib/locale/zh-CN.json +27 -3
- package/lib/moment-locale.js +0 -2
- package/lib/resource.js +6 -43
- package/lib/server.js +137 -91
- package/package.json +4 -4
package/lib/locale/zh-CN.json
CHANGED
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
"Today": "今天",
|
|
13
13
|
"Month": "月",
|
|
14
14
|
"Week": "周",
|
|
15
|
+
"This week": "本周",
|
|
16
|
+
"Next week": "下周",
|
|
17
|
+
"This month": "本月",
|
|
18
|
+
"Next month": "下月",
|
|
19
|
+
"This year": "今年",
|
|
20
|
+
"Next year": "明年",
|
|
21
|
+
"Last week": "上周",
|
|
22
|
+
"Last month": "上月",
|
|
23
|
+
"Last year": "去年",
|
|
24
|
+
"Last 7 days": "过去 7 天",
|
|
25
|
+
"Last 30 days": "过去 30 天",
|
|
26
|
+
"Last 90 days": "过去 90 天",
|
|
27
|
+
"Next 7 days": "未来 7 天",
|
|
28
|
+
"Next 30 days": "未来 30 天",
|
|
29
|
+
"Next 90 days": "未来 90 天",
|
|
15
30
|
"Work week": "工作日",
|
|
16
31
|
"Day": "天",
|
|
17
32
|
"Agenda": "列表",
|
|
@@ -19,6 +34,7 @@
|
|
|
19
34
|
"Time": "时间",
|
|
20
35
|
"Event": "事件",
|
|
21
36
|
"None": "无",
|
|
37
|
+
"Unconnected": "未连接",
|
|
22
38
|
"System settings": "系统设置",
|
|
23
39
|
"System title": "系统名称",
|
|
24
40
|
"Logo": "Logo",
|
|
@@ -54,8 +70,10 @@
|
|
|
54
70
|
"Close": "关闭",
|
|
55
71
|
"Set the data scope": "设置数据范围",
|
|
56
72
|
"Data blocks": "数据区块",
|
|
73
|
+
"Filter blocks": "筛选区块",
|
|
57
74
|
"Table": "表格",
|
|
58
75
|
"Form": "表单",
|
|
76
|
+
"Collapse": "折叠面板",
|
|
59
77
|
"Select data source": "选择数据源",
|
|
60
78
|
"Calendar": "日历",
|
|
61
79
|
"Delete events": "删除日程",
|
|
@@ -103,6 +121,7 @@
|
|
|
103
121
|
"Are you sure you want to delete it?": "你确定要删除吗?",
|
|
104
122
|
"This is a demo text, **supports Markdown syntax**.": "这是一段演示文本,**支持 Markdown 语法**。",
|
|
105
123
|
"Filter": "筛选",
|
|
124
|
+
"Connect data blocks": "连接数据区块",
|
|
106
125
|
"Action type": "操作类型",
|
|
107
126
|
"Actions": "操作",
|
|
108
127
|
"Insert": "新增",
|
|
@@ -142,6 +161,7 @@
|
|
|
142
161
|
"Association fields filter": "关系筛选",
|
|
143
162
|
"PK & FK fields": "主外键字段",
|
|
144
163
|
"Association fields": "关系字段",
|
|
164
|
+
"Optional fields": "可选字段",
|
|
145
165
|
"System fields": "系统字段",
|
|
146
166
|
"General fields": "普通字段",
|
|
147
167
|
"Parent collection fields": "父表字段",
|
|
@@ -219,6 +239,7 @@
|
|
|
219
239
|
"Edit block title": "编辑区块标题",
|
|
220
240
|
"Block title": "区块标题",
|
|
221
241
|
"Pattern": "模式",
|
|
242
|
+
"operater": "运算符",
|
|
222
243
|
"Editable": "可编辑",
|
|
223
244
|
"Readonly": "只读(禁止编辑)",
|
|
224
245
|
"Easy-reading": "只读(阅读模式)",
|
|
@@ -227,7 +248,6 @@
|
|
|
227
248
|
"Comparision": "值比较",
|
|
228
249
|
"is": "等于",
|
|
229
250
|
"is not": "不等于",
|
|
230
|
-
"is variable": "为动态变量",
|
|
231
251
|
"contains": "包含",
|
|
232
252
|
"does not contain": "不包含",
|
|
233
253
|
"starts with": "开头是",
|
|
@@ -291,6 +311,7 @@
|
|
|
291
311
|
"is after": "晚于",
|
|
292
312
|
"is on or after": "不早于",
|
|
293
313
|
"is on or before": "不晚于",
|
|
314
|
+
"is between": "介于",
|
|
294
315
|
"Upload": "上传",
|
|
295
316
|
"Select level": "选择层级",
|
|
296
317
|
"Province": "省",
|
|
@@ -379,10 +400,12 @@
|
|
|
379
400
|
"Turn pages": "翻页",
|
|
380
401
|
"Others": "其他",
|
|
381
402
|
"Save as template": "保存为模板",
|
|
403
|
+
"Save as block template": "保存为区块模板",
|
|
382
404
|
"Block templates": "区块模板",
|
|
383
405
|
"Convert reference to duplicate": "模板引用转为复制",
|
|
384
406
|
"Template name": "模板名称",
|
|
385
407
|
"Block type": "区块类型",
|
|
408
|
+
"No blocks to connect": "没有可连接的区块",
|
|
386
409
|
"Action column": "操作列",
|
|
387
410
|
"Records per page": "每页显示数量",
|
|
388
411
|
"(Fields only)": "(仅字段)",
|
|
@@ -429,8 +452,6 @@
|
|
|
429
452
|
"Add condition group": "添加条件分组",
|
|
430
453
|
"exists": "存在",
|
|
431
454
|
"not exists": "不存在",
|
|
432
|
-
"is current logged-in user": "为当前登录用户",
|
|
433
|
-
"is not current logged-in user": "不为当前登录用户",
|
|
434
455
|
"=": "=",
|
|
435
456
|
"≠": "≠",
|
|
436
457
|
">": ">",
|
|
@@ -524,6 +545,8 @@
|
|
|
524
545
|
"Current user": "当前用户",
|
|
525
546
|
"Current record": "当前记录",
|
|
526
547
|
"Current time": "当前时间",
|
|
548
|
+
"System variables": "系统变量",
|
|
549
|
+
"Date Variables": "日期变量",
|
|
527
550
|
"Popup close method": "弹窗关闭方式",
|
|
528
551
|
"Automatic close": "自动关闭",
|
|
529
552
|
"Manually close": "手动关闭",
|
|
@@ -918,6 +941,7 @@
|
|
|
918
941
|
"Delete field": "删除字段",
|
|
919
942
|
"Required": "必填",
|
|
920
943
|
"Pattern": "模式",
|
|
944
|
+
"operater": "运算符",
|
|
921
945
|
"Editable": "可编辑",
|
|
922
946
|
"Readonly": "只读(禁止编辑)",
|
|
923
947
|
"Easy-reading": "只读(阅读模式)",
|
package/lib/moment-locale.js
CHANGED
package/lib/resource.js
CHANGED
|
@@ -4,39 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getResourceLocale = void 0;
|
|
7
|
-
|
|
8
7
|
function _server() {
|
|
9
8
|
const data = require("@nocobase/server");
|
|
10
|
-
|
|
11
9
|
_server = function _server() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
16
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
19
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
25
|
-
|
|
26
20
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
27
|
-
|
|
28
21
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
29
|
-
|
|
30
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
23
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
33
|
-
|
|
34
24
|
const arr2obj = items => {
|
|
35
25
|
const obj = {};
|
|
36
|
-
|
|
37
26
|
var _iterator = _createForOfIteratorHelper(items),
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
_step;
|
|
40
28
|
try {
|
|
41
29
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
42
30
|
const item = _step.value;
|
|
@@ -47,32 +35,23 @@ const arr2obj = items => {
|
|
|
47
35
|
} finally {
|
|
48
36
|
_iterator.f();
|
|
49
37
|
}
|
|
50
|
-
|
|
51
38
|
return obj;
|
|
52
39
|
};
|
|
53
|
-
|
|
54
40
|
const getResource = (packageName, lang) => {
|
|
55
41
|
let resources = [];
|
|
56
42
|
const prefixes = ['src', 'lib'];
|
|
57
43
|
const localeKeys = ['locale', 'client/locale', 'server/locale'];
|
|
58
|
-
|
|
59
44
|
for (var _i = 0, _prefixes = prefixes; _i < _prefixes.length; _i++) {
|
|
60
45
|
const prefix = _prefixes[_i];
|
|
61
|
-
|
|
62
46
|
var _iterator2 = _createForOfIteratorHelper(localeKeys),
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
_step2;
|
|
65
48
|
try {
|
|
66
49
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
67
50
|
const localeKey = _step2.value;
|
|
68
|
-
|
|
69
51
|
try {
|
|
70
52
|
const file = `${packageName}/${prefix}/${localeKey}/${lang}`;
|
|
71
|
-
|
|
72
53
|
require.resolve(file);
|
|
73
|
-
|
|
74
54
|
const resource = require(file).default;
|
|
75
|
-
|
|
76
55
|
resources.push(resource);
|
|
77
56
|
} catch (error) {}
|
|
78
57
|
}
|
|
@@ -81,61 +60,48 @@ const getResource = (packageName, lang) => {
|
|
|
81
60
|
} finally {
|
|
82
61
|
_iterator2.f();
|
|
83
62
|
}
|
|
84
|
-
|
|
85
63
|
if (resources.length) {
|
|
86
64
|
break;
|
|
87
65
|
}
|
|
88
66
|
}
|
|
89
|
-
|
|
90
67
|
if (resources.length === 0 && lang.replace('-', '_') !== lang) {
|
|
91
68
|
return getResource(packageName, lang.replace('-', '_'));
|
|
92
69
|
}
|
|
93
|
-
|
|
94
70
|
return arr2obj(resources);
|
|
95
71
|
};
|
|
96
|
-
|
|
97
72
|
const getResourceLocale = /*#__PURE__*/function () {
|
|
98
73
|
var _ref = _asyncToGenerator(function* (lang, db) {
|
|
99
74
|
const resources = {};
|
|
100
75
|
const res = getResource('@nocobase/client', lang);
|
|
101
76
|
const defaults = getResource('@nocobase/client', 'zh-CN');
|
|
102
|
-
|
|
103
77
|
for (const key in defaults) {
|
|
104
78
|
if (Object.prototype.hasOwnProperty.call(defaults, key)) {
|
|
105
79
|
defaults[key] = key;
|
|
106
80
|
}
|
|
107
81
|
}
|
|
108
|
-
|
|
109
82
|
if (res) {
|
|
110
83
|
resources['client'] = _objectSpread(_objectSpread({}, defaults), res);
|
|
111
84
|
} else {
|
|
112
85
|
resources['client'] = defaults;
|
|
113
86
|
}
|
|
114
|
-
|
|
115
87
|
const plugins = yield db.getRepository('applicationPlugins').find({
|
|
116
88
|
filter: {
|
|
117
89
|
'name.$ne': 'client'
|
|
118
90
|
}
|
|
119
91
|
});
|
|
120
|
-
|
|
121
92
|
var _iterator3 = _createForOfIteratorHelper(plugins),
|
|
122
|
-
|
|
123
|
-
|
|
93
|
+
_step3;
|
|
124
94
|
try {
|
|
125
95
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
126
96
|
const plugin = _step3.value;
|
|
127
|
-
|
|
128
97
|
const packageName = _server().PluginManager.getPackageName(plugin.get('name'));
|
|
129
|
-
|
|
130
98
|
const res = getResource(packageName, lang);
|
|
131
99
|
const defaults = getResource(packageName, 'zh-CN');
|
|
132
|
-
|
|
133
100
|
for (const key in defaults) {
|
|
134
101
|
if (Object.prototype.hasOwnProperty.call(defaults, key)) {
|
|
135
102
|
defaults[key] = key;
|
|
136
103
|
}
|
|
137
104
|
}
|
|
138
|
-
|
|
139
105
|
if (res) {
|
|
140
106
|
resources[plugin.get('name')] = _objectSpread(_objectSpread({}, defaults), res);
|
|
141
107
|
} else {
|
|
@@ -147,13 +113,10 @@ const getResourceLocale = /*#__PURE__*/function () {
|
|
|
147
113
|
} finally {
|
|
148
114
|
_iterator3.f();
|
|
149
115
|
}
|
|
150
|
-
|
|
151
116
|
return resources;
|
|
152
117
|
});
|
|
153
|
-
|
|
154
118
|
return function getResourceLocale(_x, _x2) {
|
|
155
119
|
return _ref.apply(this, arguments);
|
|
156
120
|
};
|
|
157
121
|
}();
|
|
158
|
-
|
|
159
122
|
exports.getResourceLocale = getResourceLocale;
|