@chaoswise/ui 2.7.6 → 2.7.8
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/BasicLayout/locale/index.js +2 -0
- package/lib/BasicLayout/locale/ja_JP.js +4 -0
- package/lib/CWMessage/locale/index.js +2 -0
- package/lib/CWMessage/locale/ja_JP.js +8 -0
- package/lib/CWRangePicker/locale/index.js +2 -0
- package/lib/CWRangePicker/locale/ja_JP.js +29 -0
- package/lib/CWRangePicker/utils/index.js +108 -18
- package/lib/CWSelect/locale/index.js +2 -0
- package/lib/CWSelect/locale/ja_JP.js +4 -0
- package/lib/CWTable/locale/index.js +2 -0
- package/lib/CWTable/locale/ja_JP.js +6 -0
- package/lib/CWTree/index.js +1 -20
- package/lib/CWTree/locale/index.js +2 -0
- package/lib/CWTree/locale/ja_JP.js +3 -0
- package/lib/CWUpload/locale/index.js +2 -0
- package/lib/CWUpload/locale/ja_JP.js +6 -0
- package/lib/Card/index.less +10 -0
- package/lib/ColorPicker/locale/index.js +2 -0
- package/lib/ColorPicker/locale/ja_JP.js +4 -0
- package/lib/ConfigProvider/ConfigProvider.js +11 -3
- package/lib/DateRangePicker/locale/index.js +2 -0
- package/lib/DateRangePicker/locale/ja_JP.js +5 -0
- package/lib/DropdownDatePicker/locale/index.js +2 -0
- package/lib/DropdownDatePicker/locale/ja_JP.js +21 -0
- package/lib/DropdownDatePicker/utils/index.js +123 -39
- package/lib/Empty/locale/index.js +2 -0
- package/lib/Empty/locale/ja_JP.js +3 -0
- package/lib/ErrorBoundary/index.less +15 -0
- package/lib/ErrorBoundary/locale/index.js +2 -0
- package/lib/ErrorBoundary/locale/ja_JP.js +5 -0
- package/lib/Exception/locale/index.js +2 -0
- package/lib/Exception/locale/ja_JP.js +9 -0
- package/lib/FilterDropDown/locale/index.js +2 -0
- package/lib/FilterDropDown/locale/ja_JP.js +3 -0
- package/lib/IconSelect/locale/index.js +2 -0
- package/lib/IconSelect/locale/ja_JP.js +11 -0
- package/lib/Joyride/locale/index.js +2 -0
- package/lib/Joyride/locale/ja_JP.js +25 -0
- package/lib/Pagination/locale/index.js +2 -0
- package/lib/Pagination/locale/ja_JP.js +8 -0
- package/lib/Progress/locale/index.js +2 -0
- package/lib/Progress/locale/ja_JP.js +3 -0
- package/lib/QuickTransfer/locale/index.js +2 -0
- package/lib/QuickTransfer/locale/ja_JP.js +8 -0
- package/lib/QuickTransfer/utils.js +7 -6
- package/lib/RangePicker/locale/index.js +2 -0
- package/lib/RangePicker/locale/ja_JP.js +5 -0
- package/lib/SearchBar/locale/index.js +2 -0
- package/lib/SearchBar/locale/ja_JP.js +6 -0
- package/lib/TimeRangeSlider/locale/index.js +2 -0
- package/lib/TimeRangeSlider/locale/ja_JP.js +31 -0
- package/lib/TimeRangeSlider/utils/index.js +112 -60
- package/lib/TreeSelect111/locale/index.js +2 -0
- package/lib/TreeSelect111/locale/ja_JP.js +3 -0
- package/lib/WangEditor/index.js +2 -1
- package/lib/WangEditor/locale/index.js +31 -0
- package/lib/treeLoad/index.js +57 -24
- package/package.json +3 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
recover: "デフォルトに戻す",
|
|
3
|
+
forwardSmooth: "前方スムージング",
|
|
4
|
+
backSmooth: "後方スムージング",
|
|
5
|
+
ExpandSpan: "時間範囲を{span}倍に拡大",
|
|
6
|
+
refresh: "リフレッシュ",
|
|
7
|
+
autoRefresh: "自動リフレッシュ",
|
|
8
|
+
s: "秒",
|
|
9
|
+
m: "分",
|
|
10
|
+
h: "時間",
|
|
11
|
+
d: "日",
|
|
12
|
+
mo: "月",
|
|
13
|
+
y: "年",
|
|
14
|
+
more: "さらに表示",
|
|
15
|
+
"select-calendar": "カレンダーから選択",
|
|
16
|
+
recently: "最近",
|
|
17
|
+
relative: "相対",
|
|
18
|
+
absolute: "絶対",
|
|
19
|
+
unixTimestamp: "Unix",
|
|
20
|
+
other: "その他",
|
|
21
|
+
history: '履歴',
|
|
22
|
+
clear: 'クリア',
|
|
23
|
+
"enter manually": "以下の形式で手動入力できます",
|
|
24
|
+
"fit-the-input-format": "入力形式に適合",
|
|
25
|
+
"does-not-match-the-input-format": "入力形式に一致しません。再入力してください",
|
|
26
|
+
"the-selected-time-does-not-meet-the-rule-limit": "選択した時刻が同じか現在時刻を超えています。別の時刻を選択してください",
|
|
27
|
+
"the-maximum-time-span-is-exceeded": "最大時間範囲を超過しています。再入力してください",
|
|
28
|
+
"unconverted-title": "未変換のタイトル"
|
|
29
|
+
};
|
|
@@ -15,12 +15,60 @@ var _require = require("uuid"),
|
|
|
15
15
|
uuidv4 = _require.v4;
|
|
16
16
|
// 枚举时间单位
|
|
17
17
|
var ENUM_TimeUnit = {
|
|
18
|
-
s:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
s: {
|
|
19
|
+
zh_CN: "秒",
|
|
20
|
+
en_US: {
|
|
21
|
+
singular: "Second",
|
|
22
|
+
plural: "Seconds"
|
|
23
|
+
},
|
|
24
|
+
zh_TW: "秒",
|
|
25
|
+
unit: "seconds"
|
|
26
|
+
},
|
|
27
|
+
m: {
|
|
28
|
+
zh_CN: "分钟",
|
|
29
|
+
en_US: {
|
|
30
|
+
singular: "Minute",
|
|
31
|
+
plural: "Minutes"
|
|
32
|
+
},
|
|
33
|
+
zh_TW: "分鐘",
|
|
34
|
+
unit: "minutes"
|
|
35
|
+
},
|
|
36
|
+
h: {
|
|
37
|
+
zh_CN: "小时",
|
|
38
|
+
en_US: {
|
|
39
|
+
singular: "Hour",
|
|
40
|
+
plural: "Hours"
|
|
41
|
+
},
|
|
42
|
+
zh_TW: "小時",
|
|
43
|
+
unit: "hours"
|
|
44
|
+
},
|
|
45
|
+
d: {
|
|
46
|
+
zh_CN: "天",
|
|
47
|
+
en_US: {
|
|
48
|
+
singular: "Day",
|
|
49
|
+
plural: "Days"
|
|
50
|
+
},
|
|
51
|
+
zh_TW: "天",
|
|
52
|
+
unit: "days"
|
|
53
|
+
},
|
|
54
|
+
mo: {
|
|
55
|
+
zh_CN: "月",
|
|
56
|
+
en_US: {
|
|
57
|
+
singular: "Month",
|
|
58
|
+
plural: "Months"
|
|
59
|
+
},
|
|
60
|
+
zh_TW: "月",
|
|
61
|
+
unit: "mo"
|
|
62
|
+
},
|
|
63
|
+
y: {
|
|
64
|
+
zh_CN: "年",
|
|
65
|
+
en_US: {
|
|
66
|
+
singular: "Year",
|
|
67
|
+
plural: "Years"
|
|
68
|
+
},
|
|
69
|
+
zh_TW: "年",
|
|
70
|
+
unit: "years"
|
|
71
|
+
}
|
|
24
72
|
};
|
|
25
73
|
|
|
26
74
|
/**
|
|
@@ -106,18 +154,60 @@ export var judgeType = function judgeType(recordDateValue) {
|
|
|
106
154
|
return [isRule, captureUnit, recordUnit];
|
|
107
155
|
};
|
|
108
156
|
export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captureUnit) {
|
|
109
|
-
//
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
return "\u6700\u8FD1".concat(captureUnit[0], "\u4E2A").concat(ENUM_TimeUnit.mo[2]);
|
|
113
|
-
}
|
|
114
|
-
return "\u6700\u8FD1".concat(captureUnit[0]).concat(ENUM_TimeUnit[captureUnit[1]][2]);
|
|
115
|
-
} else {
|
|
116
|
-
if (captureUnit[0] == 1) {
|
|
117
|
-
return "Past ".concat(captureUnit[0], " ").concat(ENUM_TimeUnit[captureUnit[1]][0]);
|
|
118
|
-
}
|
|
119
|
-
return "Past ".concat(captureUnit[0], " ").concat(ENUM_TimeUnit[captureUnit[1]][1]);
|
|
157
|
+
// 参数验证
|
|
158
|
+
if (!captureUnit || !Array.isArray(captureUnit) || captureUnit.length < 2) {
|
|
159
|
+
return '';
|
|
120
160
|
}
|
|
161
|
+
var _captureUnit3 = _slicedToArray(captureUnit, 2),
|
|
162
|
+
count = _captureUnit3[0],
|
|
163
|
+
unit = _captureUnit3[1];
|
|
164
|
+
var timeUnit = ENUM_TimeUnit[unit];
|
|
165
|
+
if (!timeUnit) {
|
|
166
|
+
return '';
|
|
167
|
+
}
|
|
168
|
+
var countNum = parseInt(count, 10);
|
|
169
|
+
|
|
170
|
+
// 语言配置映射
|
|
171
|
+
var localeConfig = {
|
|
172
|
+
zh_CN: {
|
|
173
|
+
template: function template(count, unitText) {
|
|
174
|
+
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
|
|
175
|
+
},
|
|
176
|
+
getUnitText: function getUnitText() {
|
|
177
|
+
return timeUnit.zh_CN;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
zh: {
|
|
181
|
+
template: function template(count, unitText) {
|
|
182
|
+
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
|
|
183
|
+
},
|
|
184
|
+
getUnitText: function getUnitText() {
|
|
185
|
+
return timeUnit.zh_CN;
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
zh_TW: {
|
|
189
|
+
template: function template(count, unitText) {
|
|
190
|
+
return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '個' : '').concat(unitText);
|
|
191
|
+
},
|
|
192
|
+
getUnitText: function getUnitText() {
|
|
193
|
+
return timeUnit.zh_TW;
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"default": {
|
|
197
|
+
template: function template(count, unitText) {
|
|
198
|
+
return "Past ".concat(count, " ").concat(unitText);
|
|
199
|
+
},
|
|
200
|
+
getUnitText: function getUnitText() {
|
|
201
|
+
var isPlural = countNum !== 1;
|
|
202
|
+
return isPlural ? timeUnit.en_US.plural : timeUnit.en_US.singular;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// 获取当前语言配置,如果不存在则使用默认配置
|
|
208
|
+
var config = localeConfig[locale] || localeConfig["default"];
|
|
209
|
+
var unitText = config.getUnitText();
|
|
210
|
+
return config.template(count, unitText);
|
|
121
211
|
};
|
|
122
212
|
export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format) {
|
|
123
213
|
var hasTimeSpan = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -349,7 +439,7 @@ export var getChangeDate = function getChangeDate(recordDateValue, direction) {
|
|
|
349
439
|
value = funcValueChangeArrayValue(values);
|
|
350
440
|
}
|
|
351
441
|
if (isRule && !values) {
|
|
352
|
-
value = getChangeUnitDate(captureUnit[0], ENUM_TimeUnit[captureUnit[1]]
|
|
442
|
+
value = getChangeUnitDate(captureUnit[0], ENUM_TimeUnit[captureUnit[1]].unit);
|
|
353
443
|
}
|
|
354
444
|
var timeDiff = value[1].diff(value[0]);
|
|
355
445
|
var duration = moment.duration(timeDiff);
|
package/lib/CWTree/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
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); }
|
|
2
1
|
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
3
2
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
4
3
|
import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
@@ -12,11 +11,6 @@ import _Tree from "antd/es/tree";
|
|
|
12
11
|
var _excluded = ["children", "treeData", "menuData", "extendType", "onClickMenu", "menuStyle", "menuRender", "extraFooter", "tooltipPlacement", "searchValue", "multiple", "selectedKeys", "defaultSelectedKeys", "onSelect", "searchHighlight", "draggable", "isDrawer", "searchHighlightStyle", "className", "caseSensitive", "onExpand", "renderItem", "useTooltipText"],
|
|
13
12
|
_excluded2 = ["icon", "title", "key", "children"];
|
|
14
13
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
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; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
-
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); }
|
|
20
14
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
21
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -26,13 +20,11 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
26
20
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
21
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
28
22
|
import React, { Fragment, useState, useEffect, useMemo, useCallback } from "react";
|
|
29
|
-
import isNull from "lodash-es/isNull";
|
|
30
|
-
import isUndefined from "lodash-es/isUndefined";
|
|
31
23
|
import PropTypes from "prop-types";
|
|
32
24
|
import classnames from "classnames";
|
|
33
25
|
import DragSvg from "./assets/Drag";
|
|
34
26
|
import "./index.less";
|
|
35
|
-
import { createTitle
|
|
27
|
+
import { createTitle } from "../QuickTransfer/utils";
|
|
36
28
|
import { createTree } from "./utils";
|
|
37
29
|
import langConfig from './locale';
|
|
38
30
|
import { formatMessage } from "../utils";
|
|
@@ -107,17 +99,6 @@ function CWTree(_ref) {
|
|
|
107
99
|
setSelfSelectedKeys(Keys);
|
|
108
100
|
}
|
|
109
101
|
}
|
|
110
|
-
function addRoot(treeData, root) {
|
|
111
|
-
if (isNull(treeData) || isUndefined(treeData)) return [];
|
|
112
|
-
return treeData.map(function (item) {
|
|
113
|
-
if (item.children) {
|
|
114
|
-
item.children = addRoot(item.children, (root === "/" ? "" : root) + "/" + item.title);
|
|
115
|
-
}
|
|
116
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
117
|
-
root: root
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
102
|
var _treeData = useMemo(function () {
|
|
122
103
|
if (!treeData) {
|
|
123
104
|
return [];
|
|
@@ -24,23 +24,28 @@ import 'moment/locale/zh-cn';
|
|
|
24
24
|
import zh_CN_antd4 from '../Antd4/locale/zh_CN';
|
|
25
25
|
import en_US_antd4 from '../Antd4/locale/en_US';
|
|
26
26
|
import zh_TW_antd4 from '../Antd4/locale/zh_TW';
|
|
27
|
+
import ja_JP_antd4 from '../Antd4/locale/ja_JP';
|
|
27
28
|
import zh_CN_antd from 'antd/es/locale/zh_CN';
|
|
28
29
|
import zh_TW_antd from 'antd/es/locale/zh_TW';
|
|
29
30
|
import en_US_antd from 'antd/es/locale/en_US';
|
|
31
|
+
import ja_JP_antd from 'antd/es/locale/ja_JP';
|
|
30
32
|
var ANTD4_LOCALE_MAP = {
|
|
31
33
|
zh_CN: zh_CN_antd4,
|
|
32
34
|
en_US: en_US_antd4,
|
|
33
|
-
zh_TW: zh_TW_antd4
|
|
35
|
+
zh_TW: zh_TW_antd4,
|
|
36
|
+
ja_JP: ja_JP_antd4
|
|
34
37
|
};
|
|
35
38
|
var ANTD3_LOCALE_MAP = {
|
|
36
39
|
zh_CN: zh_CN_antd,
|
|
37
40
|
en_US: en_US_antd,
|
|
38
|
-
zh_TW: zh_TW_antd
|
|
41
|
+
zh_TW: zh_TW_antd,
|
|
42
|
+
ja_JP: ja_JP_antd
|
|
39
43
|
};
|
|
40
44
|
var I18N_MAP = {
|
|
41
45
|
zh_CN: 'zh',
|
|
42
46
|
en_US: 'en',
|
|
43
|
-
zh_TW: 'zh'
|
|
47
|
+
zh_TW: 'zh',
|
|
48
|
+
ja_JP: 'ja'
|
|
44
49
|
};
|
|
45
50
|
export var intlContext = /*#__PURE__*/React.createContext({
|
|
46
51
|
localeContext: {
|
|
@@ -73,6 +78,9 @@ var AllProvider = function AllProvider(_ref) {
|
|
|
73
78
|
if (['zh_CN', 'zh_TW'].includes(currentLocale)) {
|
|
74
79
|
return 'zh-cn';
|
|
75
80
|
}
|
|
81
|
+
if (currentLocale === 'ja_JP') {
|
|
82
|
+
return 'ja';
|
|
83
|
+
}
|
|
76
84
|
return 'en';
|
|
77
85
|
};
|
|
78
86
|
useEffect(function () {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
recover: "デフォルトに戻す",
|
|
3
|
+
s: "秒",
|
|
4
|
+
m: "分",
|
|
5
|
+
h: "時間",
|
|
6
|
+
d: "日",
|
|
7
|
+
mo: "月",
|
|
8
|
+
y: "年",
|
|
9
|
+
more: "さらに表示",
|
|
10
|
+
"select-calendar": "カレンダーから選択",
|
|
11
|
+
recently: "最近",
|
|
12
|
+
relative: "相対",
|
|
13
|
+
absolute: "絶対",
|
|
14
|
+
unixTimestamp: "Unix",
|
|
15
|
+
other: "その他",
|
|
16
|
+
history: '履歴',
|
|
17
|
+
clear: 'クリア',
|
|
18
|
+
"enter manually": "以下の形式で手動入力できます",
|
|
19
|
+
"fit-the-input-format": "入力形式に適合",
|
|
20
|
+
"does-not-match-the-input-format": "入力形式に一致しません。再入力してください"
|
|
21
|
+
};
|