@nocobase/plugin-client 0.9.1-alpha.2 → 0.9.2-alpha.2
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/antd.js
CHANGED
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getAntdLocale = void 0;
|
|
7
|
-
|
|
8
7
|
const getAntdLocale = lang => {
|
|
9
8
|
const lng = lang.replace('-', '_');
|
|
10
|
-
|
|
11
9
|
try {
|
|
12
10
|
require.resolve(`antd/lib/locale/${lng}`);
|
|
13
|
-
|
|
14
11
|
return require(`antd/lib/locale/${lng}`).default;
|
|
15
12
|
} catch (error) {
|
|
16
13
|
return require(`antd/lib/locale/en_US`).default;
|
|
17
14
|
}
|
|
18
15
|
};
|
|
19
|
-
|
|
20
16
|
exports.getAntdLocale = getAntdLocale;
|
package/lib/cron.js
CHANGED
|
@@ -4,32 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getCronLocale = void 0;
|
|
7
|
-
|
|
8
7
|
const getCronLocale = lang => {
|
|
9
8
|
let packageName = '@nocobase/client';
|
|
10
9
|
let locale = null;
|
|
11
|
-
|
|
12
10
|
try {
|
|
13
11
|
var _require$cron;
|
|
14
|
-
|
|
15
12
|
const file = `${packageName}/src/locale`;
|
|
16
|
-
|
|
17
13
|
require.resolve(file);
|
|
18
|
-
|
|
19
14
|
locale = (_require$cron = require(file).cron) === null || _require$cron === void 0 ? void 0 : _require$cron[lang];
|
|
20
15
|
} catch (error) {
|
|
21
16
|
try {
|
|
22
17
|
var _require$cron2;
|
|
23
|
-
|
|
24
18
|
const file = `${packageName}/lib/locale`;
|
|
25
|
-
|
|
26
19
|
require.resolve(file);
|
|
27
|
-
|
|
28
20
|
locale = (_require$cron2 = require(file).cron) === null || _require$cron2 === void 0 ? void 0 : _require$cron2[lang];
|
|
29
21
|
} catch (error) {}
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
return locale || require('react-js-cron/dist/cjs/locale').DEFAULT_LOCALE_EN;
|
|
23
|
+
return locale;
|
|
33
24
|
};
|
|
34
|
-
|
|
35
25
|
exports.getCronLocale = getCronLocale;
|
package/lib/cronstrue.js
CHANGED
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getCronstrueLocale = void 0;
|
|
7
|
-
|
|
8
|
-
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; } } }; }
|
|
9
|
-
|
|
10
|
-
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); }
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
7
|
const methods = ['atX0SecondsPastTheMinuteGt20', 'atX0MinutesPastTheHourGt20', 'commaMonthX0ThroughMonthX1', 'commaYearX0ThroughYearX1', 'use24HourTimeFormatByDefault', 'anErrorOccuredWhenGeneratingTheExpressionD', 'everyMinute', 'everyHour', 'atSpace', 'everyMinuteBetweenX0AndX1', 'at', 'spaceAnd', 'everySecond', 'everyX0Seconds', 'secondsX0ThroughX1PastTheMinute', 'atX0SecondsPastTheMinute', 'everyX0Minutes', 'minutesX0ThroughX1PastTheHour', 'atX0MinutesPastTheHour', 'everyX0Hours', 'betweenX0AndX1', 'atX0', 'commaEveryDay', 'commaEveryX0DaysOfTheWeek', 'commaX0ThroughX1', 'commaAndX0ThroughX1', 'first', 'second', 'third', 'fourth', 'fifth', 'commaOnThe', 'spaceX0OfTheMonth', 'lastDay', 'commaOnTheLastX0OfTheMonth', 'commaOnlyOnX0', 'commaAndOnX0', 'commaEveryX0Months', 'commaOnlyInX0', 'commaOnTheLastDayOfTheMonth', 'commaOnTheLastWeekdayOfTheMonth', 'commaDaysBeforeTheLastDayOfTheMonth', 'firstWeekday', 'weekdayNearestDayX0', 'commaOnTheX0OfTheMonth', 'commaEveryX0Days', 'commaBetweenDayX0AndX1OfTheMonth', 'commaOnDayX0OfTheMonth', 'commaEveryHour', 'commaEveryX0Years', 'commaStartingX0', 'daysOfTheWeek', 'monthsOfTheYear'];
|
|
15
8
|
const langs = {
|
|
16
9
|
af: 'af',
|
|
@@ -48,41 +41,23 @@ const langs = {
|
|
|
48
41
|
'zh-CN': 'zh_CN',
|
|
49
42
|
'zh-TW': 'zh_TW'
|
|
50
43
|
};
|
|
51
|
-
|
|
52
44
|
const getCronstrueLocale = lang => {
|
|
53
45
|
const lng = langs[lang] || 'en';
|
|
54
|
-
|
|
55
46
|
const Locale = require(`cronstrue/locales/${lng}`);
|
|
56
|
-
|
|
57
47
|
let locale;
|
|
58
|
-
|
|
59
48
|
if (Locale === null || Locale === void 0 ? void 0 : Locale.default) {
|
|
60
49
|
locale = Locale.default.locales[lng];
|
|
61
50
|
} else {
|
|
62
51
|
const L = Locale[lng];
|
|
63
52
|
locale = new L();
|
|
64
53
|
}
|
|
65
|
-
|
|
66
54
|
const items = {};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
73
|
-
const method = _step.value;
|
|
74
|
-
|
|
75
|
-
try {
|
|
76
|
-
items[method] = locale[method]();
|
|
77
|
-
} catch (error) {}
|
|
78
|
-
}
|
|
79
|
-
} catch (err) {
|
|
80
|
-
_iterator.e(err);
|
|
81
|
-
} finally {
|
|
82
|
-
_iterator.f();
|
|
55
|
+
for (var _i = 0, _methods = methods; _i < _methods.length; _i++) {
|
|
56
|
+
const method = _methods[_i];
|
|
57
|
+
try {
|
|
58
|
+
items[method] = locale[method]();
|
|
59
|
+
} catch (error) {}
|
|
83
60
|
}
|
|
84
|
-
|
|
85
61
|
return items;
|
|
86
62
|
};
|
|
87
|
-
|
|
88
63
|
exports.getCronstrueLocale = getCronstrueLocale;
|
package/lib/index.js
CHANGED
package/lib/locale/en-US.json
CHANGED
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
"Today": "Today",
|
|
13
13
|
"Month": "Month",
|
|
14
14
|
"Week": "Week",
|
|
15
|
+
"This week": "This week",
|
|
16
|
+
"Next week": "Next week",
|
|
17
|
+
"This month": "This month",
|
|
18
|
+
"Next month": "Next month",
|
|
19
|
+
"This year": "This year",
|
|
20
|
+
"Next year": "Next year",
|
|
21
|
+
"Last week": "Last week",
|
|
22
|
+
"Last month": "Last month",
|
|
23
|
+
"Last year": "Last year",
|
|
24
|
+
"Last 7 days": "last 7 days",
|
|
25
|
+
"Last 30 days": "last 30 days",
|
|
26
|
+
"Last 90 days": "last 90 days",
|
|
27
|
+
"Next 7 days": "next 7 days",
|
|
28
|
+
"Next 30 days": "next 30 days",
|
|
29
|
+
"Next 90 days": "next 90 days",
|
|
15
30
|
"Work week": "Work week",
|
|
16
31
|
"Day": "Day",
|
|
17
32
|
"Agenda": "Agenda",
|
|
@@ -19,6 +34,7 @@
|
|
|
19
34
|
"Time": "Time",
|
|
20
35
|
"Event": "Event",
|
|
21
36
|
"None": "None",
|
|
37
|
+
"Unconnected": "Unconnected",
|
|
22
38
|
"System settings": "System settings",
|
|
23
39
|
"System title": "System title",
|
|
24
40
|
"Logo": "Logo",
|
|
@@ -54,8 +70,10 @@
|
|
|
54
70
|
"Close": "Close",
|
|
55
71
|
"Set the data scope": "Set the data scope",
|
|
56
72
|
"Data blocks": "Data blocks",
|
|
73
|
+
"Filter blocks": "Filter blocks",
|
|
57
74
|
"Table": "Table",
|
|
58
75
|
"Form": "Form",
|
|
76
|
+
"Collapse": "Collapse",
|
|
59
77
|
"Select data source": "Select data source",
|
|
60
78
|
"Calendar": "Calendar",
|
|
61
79
|
"Delete events": "Delete events",
|
|
@@ -103,6 +121,7 @@
|
|
|
103
121
|
"Are you sure you want to delete it?": "Are you sure you want to delete it?",
|
|
104
122
|
"This is a demo text, **supports Markdown syntax**.": "This is a demo text, **supports Markdown syntax**.",
|
|
105
123
|
"Filter": "Filter",
|
|
124
|
+
"Connect data blocks": "Connect data blocks",
|
|
106
125
|
"Action type": "Action type",
|
|
107
126
|
"Actions": "Actions",
|
|
108
127
|
"Insert": "Insert",
|
|
@@ -142,6 +161,7 @@
|
|
|
142
161
|
"Association fields filter": "Association fields filter",
|
|
143
162
|
"PK & FK fields": "PK & FK fields",
|
|
144
163
|
"Association fields": "Association fields",
|
|
164
|
+
"Optional fields": "Optional fields",
|
|
145
165
|
"System fields": "System fields",
|
|
146
166
|
"General fields": "General fields",
|
|
147
167
|
"Parent collection fields": "Parent collection fields",
|
|
@@ -219,6 +239,7 @@
|
|
|
219
239
|
"Edit block title": "Edit block title",
|
|
220
240
|
"Block title": "Block title",
|
|
221
241
|
"Pattern": "Pattern",
|
|
242
|
+
"operater": "operater",
|
|
222
243
|
"Editable": "Editable",
|
|
223
244
|
"Readonly": "Readonly",
|
|
224
245
|
"Easy-reading": "Easy-reading",
|
|
@@ -227,7 +248,6 @@
|
|
|
227
248
|
"Comparision": "Comparision",
|
|
228
249
|
"is": "is",
|
|
229
250
|
"is not": "is not",
|
|
230
|
-
"is variable": "is variable",
|
|
231
251
|
"contains": "contains",
|
|
232
252
|
"does not contain": "does not contain",
|
|
233
253
|
"starts with": "starts with",
|
|
@@ -291,6 +311,7 @@
|
|
|
291
311
|
"is after": "is after",
|
|
292
312
|
"is on or after": "is on or after",
|
|
293
313
|
"is on or before": "is on or before",
|
|
314
|
+
"is between": "is between",
|
|
294
315
|
"Upload": "Upload",
|
|
295
316
|
"Select level": "Select level",
|
|
296
317
|
"Province": "Province",
|
|
@@ -379,10 +400,12 @@
|
|
|
379
400
|
"Turn pages": "Turn pages",
|
|
380
401
|
"Others": "Others",
|
|
381
402
|
"Save as template": "Save as template",
|
|
403
|
+
"Save as block template": "Save as block template",
|
|
382
404
|
"Block templates": "Block templates",
|
|
383
405
|
"Convert reference to duplicate": "Convert reference to duplicate",
|
|
384
406
|
"Template name": "Template name",
|
|
385
407
|
"Block type": "Block type",
|
|
408
|
+
"No blocks to connect": "No blocks to connect",
|
|
386
409
|
"Action column": "Action column",
|
|
387
410
|
"Records per page": "Records per page",
|
|
388
411
|
"(Fields only)": "(Fields only)",
|
|
@@ -429,8 +452,6 @@
|
|
|
429
452
|
"Add condition group": "Add condition group",
|
|
430
453
|
"exists": "exists",
|
|
431
454
|
"not exists": "not exists",
|
|
432
|
-
"is current logged-in user": "is current logged-in user",
|
|
433
|
-
"is not current logged-in user": "is not current logged-in user",
|
|
434
455
|
"=": "=",
|
|
435
456
|
"≠": "≠",
|
|
436
457
|
">": ">",
|
|
@@ -524,6 +545,8 @@
|
|
|
524
545
|
"Current user": "Current user",
|
|
525
546
|
"Current record": "Current record",
|
|
526
547
|
"Current time": "Current time",
|
|
548
|
+
"System variables": "System variables",
|
|
549
|
+
"Date variables": "Date variables",
|
|
527
550
|
"Popup close method": "Popup close method",
|
|
528
551
|
"Automatic close": "Automatic close",
|
|
529
552
|
"Manually close": "Manually close",
|
|
@@ -924,6 +947,7 @@
|
|
|
924
947
|
"Delete field": "Delete field",
|
|
925
948
|
"Required": "Required",
|
|
926
949
|
"Pattern": "Pattern",
|
|
950
|
+
"operater": "operater",
|
|
927
951
|
"Editable": "Editable",
|
|
928
952
|
"Readonly": "Readonly",
|
|
929
953
|
"Easy-reading": "Easy-reading",
|
package/lib/locale/index.js
CHANGED
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
7
|
+
var _default = {
|
|
8
|
+
// 'en-US': require('./en-US.json'),
|
|
8
9
|
// 'zh-CN': require('./zh-CN.json'),
|
|
9
10
|
};
|
|
10
11
|
exports.default = _default;
|