@chaoswise/ui 2.7.11 → 2.8.0
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/AlgorithmChart/common/chart.option.js +14 -11
- package/lib/AlgorithmChart/index.js +29 -26
- package/lib/Antd4/comment/index.js +1 -1
- package/lib/Antd4Form/FormItem.js +1 -1
- package/lib/BasicLayout/Nav.js +3 -5
- package/lib/BasicLayout/index.js +9 -10
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
- package/lib/CWMessage/MessageContent/TabList/index.js +19 -17
- package/lib/CWMessage/MessageContent/index.js +86 -73
- package/lib/CWMessage/index.js +62 -50
- package/lib/CWMessage/service/index.js +14 -14
- package/lib/CWMessage/utils/index.js +18 -11
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +16 -10
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +4 -6
- package/lib/CWRangePicker/DropdownMenu/index.js +20 -13
- package/lib/CWRangePicker/Refresh/index.js +4 -7
- package/lib/CWRangePicker/TimeSpan/index.js +6 -9
- package/lib/CWRangePicker/index.js +39 -32
- package/lib/CWRangePicker/utils/index.js +45 -114
- package/lib/CWSelect/index.js +7 -10
- package/lib/CWTable/CWTable.js +23 -23
- package/lib/CWTable/EditLine.js +5 -8
- package/lib/CWTable/Filter.js +5 -8
- package/lib/CWTable/index.js +3 -0
- package/lib/CWTree/index.js +4 -7
- package/lib/CWUpload/upload/Dragger.js +4 -7
- package/lib/CWUpload/upload/UploadList.js +12 -15
- package/lib/CardSelect/index.js +16 -14
- package/lib/CitySelect/index.js +3 -1
- package/lib/ColorPicker/index.js +4 -7
- package/lib/ConfigProvider/ConfigProvider.js +143 -48
- package/lib/ConfigProvider/Switch.js +10 -2
- package/lib/ConfigProvider/context.js +8 -0
- package/lib/ConfigProvider/useLocale.js +1 -1
- package/lib/DatePicker/useLocale.js +17 -10
- package/lib/DateRangePicker/RangeDateTimePicker.js +3 -3
- package/lib/DateRangePicker/components/ExtraQuickFooter.js +5 -8
- package/lib/DateRangePicker/index.js +6 -5
- package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +4 -6
- package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -7
- package/lib/DropdownDatePicker/index.js +12 -13
- package/lib/DropdownDatePicker/utils/index.js +5 -93
- package/lib/EchartsBar/index.js +1 -1
- package/lib/Empty/index.js +3 -6
- package/lib/ErrorBoundary/ErrorPage.js +8 -9
- package/lib/Exception/index.js +9 -12
- package/lib/FilterDropDown/index.js +3 -6
- package/lib/Flow/tools/index.js +4 -1
- package/lib/Header/Document/index.js +3 -8
- package/lib/Header/LocaleSwitcher.js +2 -0
- package/lib/Header/UserSetting/index.js +27 -45
- package/lib/IconSelect/components/CustomImg/index.js +8 -11
- package/lib/IconSelect/components/SearchIcon/index.js +9 -9
- package/lib/IconSelect/index.js +4 -7
- package/lib/ImagePreview/index.js +3 -1
- package/lib/Joyride/List.js +9 -8
- package/lib/Joyride/index.js +22 -25
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
- package/lib/Pagination/index.js +14 -14
- package/lib/PolymerizationSearch/DropdownMenu.js +4 -2
- package/lib/PolymerizationSearch/index.js +7 -7
- package/lib/Progress/index.js +3 -6
- package/lib/QuickTransfer/DragList.js +3 -6
- package/lib/QuickTransfer/index.js +19 -22
- package/lib/RangePicker/components/ExtraTimeFooter.js +4 -7
- package/lib/SearchBar/OutSearch.js +9 -2
- package/lib/SearchBar/index.js +13 -16
- package/lib/SimpleCard/index.js +3 -1
- package/lib/SingleSpa/index.js +30 -26
- package/lib/ThemeProvider/Switcher.js +3 -1
- package/lib/TimeRangeSlider/Refresh/index.js +4 -7
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
- package/lib/TimeRangeSlider/TimeSpan/index.js +6 -9
- package/lib/TimeRangeSlider/index.js +28 -24
- package/lib/TimeRangeSlider/utils/index.js +20 -100
- package/lib/TimeZoneSelect/index.js +21 -22
- package/lib/TreeSelect111/index.js +3 -6
- package/lib/Upload-back/index.js +27 -25
- package/lib/VerticalLayout/index.js +3 -1
- package/lib/WangEditor/extraLanguage.js +19 -0
- package/lib/WangEditor/index.js +19 -13
- package/lib/WangEditor/messages.js +49 -0
- package/lib/WangEditor/wangEditor.js +47 -20
- package/lib/index.js +1 -0
- package/lib/locales/en_US.json +1 -0
- package/lib/locales/index.js +2 -0
- package/lib/locales/ja_JP.json +1 -0
- package/lib/locales/load.js +48 -0
- package/lib/locales/messages/antd.js +404 -0
- package/lib/locales/messages/editor.js +42 -0
- package/lib/locales/messages/timeRanges.js +36 -0
- package/lib/locales/messages/timeTypes.js +11 -0
- package/lib/locales/runtime.js +127 -0
- package/lib/locales/zh_CN.json +1 -0
- package/lib/locales/zh_HK.json +1 -0
- package/lib/locales/zh_TW.json +1 -0
- package/lib/useIntl/index.js +9 -0
- package/lib/useLocale/index.js +16 -13
- package/lib/utils/index.js +4 -1
- package/package.json +14 -3
- package/lib/BasicLayout/locale/en_US.js +0 -4
- package/lib/BasicLayout/locale/index.js +0 -13
- package/lib/BasicLayout/locale/ja_JP.js +0 -4
- package/lib/BasicLayout/locale/zh_CN.js +0 -4
- package/lib/BasicLayout/locale/zh_TW.js +0 -4
- package/lib/CWMessage/locale/en_US.js +0 -8
- package/lib/CWMessage/locale/index.js +0 -13
- package/lib/CWMessage/locale/ja_JP.js +0 -8
- package/lib/CWMessage/locale/zh_CN.js +0 -8
- package/lib/CWMessage/locale/zh_TW.js +0 -8
- package/lib/CWRangePicker/locale/en_US.js +0 -29
- package/lib/CWRangePicker/locale/index.js +0 -13
- package/lib/CWRangePicker/locale/ja_JP.js +0 -29
- package/lib/CWRangePicker/locale/zh_CN.js +0 -29
- package/lib/CWRangePicker/locale/zh_TW.js +0 -29
- package/lib/CWSelect/locale/en_US.js +0 -4
- package/lib/CWSelect/locale/index.js +0 -13
- package/lib/CWSelect/locale/ja_JP.js +0 -4
- package/lib/CWSelect/locale/zh_CN.js +0 -4
- package/lib/CWSelect/locale/zh_TW.js +0 -4
- package/lib/CWTable/locale/en_US.js +0 -6
- package/lib/CWTable/locale/index.js +0 -13
- package/lib/CWTable/locale/ja_JP.js +0 -6
- package/lib/CWTable/locale/zh_CN.js +0 -6
- package/lib/CWTable/locale/zh_TW.js +0 -6
- package/lib/CWTree/locale/en_US.js +0 -3
- package/lib/CWTree/locale/index.js +0 -13
- package/lib/CWTree/locale/ja_JP.js +0 -3
- package/lib/CWTree/locale/zh_CN.js +0 -3
- package/lib/CWTree/locale/zh_TW.js +0 -3
- package/lib/CWUpload/locale/en_US.js +0 -6
- package/lib/CWUpload/locale/index.js +0 -13
- package/lib/CWUpload/locale/ja_JP.js +0 -6
- package/lib/CWUpload/locale/zh_CN.js +0 -6
- package/lib/CWUpload/locale/zh_TW.js +0 -6
- package/lib/Card/index.less +0 -10
- package/lib/ColorPicker/locale/en_US.js +0 -4
- package/lib/ColorPicker/locale/index.js +0 -13
- package/lib/ColorPicker/locale/ja_JP.js +0 -4
- package/lib/ColorPicker/locale/zh_CN.js +0 -4
- package/lib/ColorPicker/locale/zh_TW.js +0 -4
- package/lib/DateRangePicker/locale/en_US.js +0 -5
- package/lib/DateRangePicker/locale/index.js +0 -13
- package/lib/DateRangePicker/locale/ja_JP.js +0 -5
- package/lib/DateRangePicker/locale/zh_CN.js +0 -5
- package/lib/DateRangePicker/locale/zh_TW.js +0 -5
- package/lib/DropdownDatePicker/locale/en_US.js +0 -21
- package/lib/DropdownDatePicker/locale/index.js +0 -13
- package/lib/DropdownDatePicker/locale/ja_JP.js +0 -21
- package/lib/DropdownDatePicker/locale/zh_CN.js +0 -21
- package/lib/DropdownDatePicker/locale/zh_TW.js +0 -21
- package/lib/Empty/locale/en_US.js +0 -3
- package/lib/Empty/locale/index.js +0 -13
- package/lib/Empty/locale/ja_JP.js +0 -3
- package/lib/Empty/locale/zh_CN.js +0 -3
- package/lib/Empty/locale/zh_TW.js +0 -3
- package/lib/ErrorBoundary/index.less +0 -15
- package/lib/ErrorBoundary/locale/en_US.js +0 -5
- package/lib/ErrorBoundary/locale/index.js +0 -13
- package/lib/ErrorBoundary/locale/ja_JP.js +0 -5
- package/lib/ErrorBoundary/locale/zh_CN.js +0 -5
- package/lib/ErrorBoundary/locale/zh_TW.js +0 -5
- package/lib/Exception/locale/en_US.js +0 -9
- package/lib/Exception/locale/index.js +0 -13
- package/lib/Exception/locale/ja_JP.js +0 -9
- package/lib/Exception/locale/zh_CN.js +0 -9
- package/lib/Exception/locale/zh_TW.js +0 -9
- package/lib/FilterDropDown/locale/en_US.js +0 -3
- package/lib/FilterDropDown/locale/index.js +0 -13
- package/lib/FilterDropDown/locale/ja_JP.js +0 -3
- package/lib/FilterDropDown/locale/zh_CN.js +0 -3
- package/lib/FilterDropDown/locale/zh_TW.js +0 -3
- package/lib/IconSelect/locale/en_US.js +0 -11
- package/lib/IconSelect/locale/index.js +0 -13
- package/lib/IconSelect/locale/ja_JP.js +0 -11
- package/lib/IconSelect/locale/zh_CN.js +0 -11
- package/lib/IconSelect/locale/zh_TW.js +0 -11
- package/lib/Joyride/locale/en_US.js +0 -25
- package/lib/Joyride/locale/index.js +0 -13
- package/lib/Joyride/locale/ja_JP.js +0 -25
- package/lib/Joyride/locale/zh_CN.js +0 -25
- package/lib/Joyride/locale/zh_TW.js +0 -25
- package/lib/Pagination/locale/en_US.js +0 -8
- package/lib/Pagination/locale/index.js +0 -13
- package/lib/Pagination/locale/ja_JP.js +0 -8
- package/lib/Pagination/locale/zh_CN.js +0 -8
- package/lib/Pagination/locale/zh_TW.js +0 -8
- package/lib/Progress/locale/en_US.js +0 -3
- package/lib/Progress/locale/index.js +0 -13
- package/lib/Progress/locale/ja_JP.js +0 -3
- package/lib/Progress/locale/zh_CN.js +0 -3
- package/lib/Progress/locale/zh_TW.js +0 -3
- package/lib/QuickTransfer/locale/en_US.js +0 -8
- package/lib/QuickTransfer/locale/index.js +0 -13
- package/lib/QuickTransfer/locale/ja_JP.js +0 -8
- package/lib/QuickTransfer/locale/zh_CN.js +0 -8
- package/lib/QuickTransfer/locale/zh_TW.js +0 -8
- package/lib/RangePicker/locale/en_US.js +0 -5
- package/lib/RangePicker/locale/index.js +0 -13
- package/lib/RangePicker/locale/ja_JP.js +0 -5
- package/lib/RangePicker/locale/zh_CN.js +0 -5
- package/lib/RangePicker/locale/zh_TW.js +0 -5
- package/lib/SearchBar/locale/en_US.js +0 -6
- package/lib/SearchBar/locale/index.js +0 -13
- package/lib/SearchBar/locale/ja_JP.js +0 -6
- package/lib/SearchBar/locale/zh_CN.js +0 -6
- package/lib/SearchBar/locale/zh_TW.js +0 -6
- package/lib/TimeRangeSlider/locale/en_US.js +0 -31
- package/lib/TimeRangeSlider/locale/index.js +0 -13
- package/lib/TimeRangeSlider/locale/ja_JP.js +0 -31
- package/lib/TimeRangeSlider/locale/zh_CN.js +0 -31
- package/lib/TimeRangeSlider/locale/zh_TW.js +0 -31
- package/lib/TreeSelect111/locale/en_US.js +0 -3
- package/lib/TreeSelect111/locale/index.js +0 -13
- package/lib/TreeSelect111/locale/ja_JP.js +0 -3
- package/lib/TreeSelect111/locale/zh_CN.js +0 -3
- package/lib/TreeSelect111/locale/zh_TW.js +0 -3
- package/lib/WangEditor/locale/index.js +0 -93
|
@@ -10,63 +10,29 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import formatRecentTime from '../../locales/messages/timeRanges';
|
|
13
14
|
import moment from "moment";
|
|
15
|
+
import { getFallbackIntl } from '../../locales/runtime';
|
|
14
16
|
var _require = require("uuid"),
|
|
15
17
|
uuidv4 = _require.v4;
|
|
16
18
|
// 枚举时间单位
|
|
17
19
|
var ENUM_TimeUnit = {
|
|
18
20
|
s: {
|
|
19
|
-
zh_CN: "秒",
|
|
20
|
-
en_US: {
|
|
21
|
-
singular: "Second",
|
|
22
|
-
plural: "Seconds"
|
|
23
|
-
},
|
|
24
|
-
zh_TW: "秒",
|
|
25
21
|
unit: "seconds"
|
|
26
22
|
},
|
|
27
23
|
m: {
|
|
28
|
-
zh_CN: "分钟",
|
|
29
|
-
en_US: {
|
|
30
|
-
singular: "Minute",
|
|
31
|
-
plural: "Minutes"
|
|
32
|
-
},
|
|
33
|
-
zh_TW: "分鐘",
|
|
34
24
|
unit: "minutes"
|
|
35
25
|
},
|
|
36
26
|
h: {
|
|
37
|
-
zh_CN: "小时",
|
|
38
|
-
en_US: {
|
|
39
|
-
singular: "Hour",
|
|
40
|
-
plural: "Hours"
|
|
41
|
-
},
|
|
42
|
-
zh_TW: "小時",
|
|
43
27
|
unit: "hours"
|
|
44
28
|
},
|
|
45
29
|
d: {
|
|
46
|
-
zh_CN: "天",
|
|
47
|
-
en_US: {
|
|
48
|
-
singular: "Day",
|
|
49
|
-
plural: "Days"
|
|
50
|
-
},
|
|
51
|
-
zh_TW: "天",
|
|
52
30
|
unit: "days"
|
|
53
31
|
},
|
|
54
32
|
mo: {
|
|
55
|
-
zh_CN: "月",
|
|
56
|
-
en_US: {
|
|
57
|
-
singular: "Month",
|
|
58
|
-
plural: "Months"
|
|
59
|
-
},
|
|
60
|
-
zh_TW: "月",
|
|
61
33
|
unit: "mo"
|
|
62
34
|
},
|
|
63
35
|
y: {
|
|
64
|
-
zh_CN: "年",
|
|
65
|
-
en_US: {
|
|
66
|
-
singular: "Year",
|
|
67
|
-
plural: "Years"
|
|
68
|
-
},
|
|
69
|
-
zh_TW: "年",
|
|
70
36
|
unit: "years"
|
|
71
37
|
}
|
|
72
38
|
};
|
|
@@ -153,62 +119,7 @@ export var judgeType = function judgeType(recordDateValue) {
|
|
|
153
119
|
}
|
|
154
120
|
return [isRule, captureUnit, recordUnit];
|
|
155
121
|
};
|
|
156
|
-
export var echoRecentlyTimeTitle =
|
|
157
|
-
// 参数验证
|
|
158
|
-
if (!captureUnit || !Array.isArray(captureUnit) || captureUnit.length < 2) {
|
|
159
|
-
return '';
|
|
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);
|
|
211
|
-
};
|
|
122
|
+
export var echoRecentlyTimeTitle = formatRecentTime;
|
|
212
123
|
export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format) {
|
|
213
124
|
var hasTimeSpan = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
214
125
|
var timeSpanBoundary = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -227,8 +138,12 @@ export var echoInputValue = function echoInputValue() {
|
|
|
227
138
|
var timeSpanBoundary = arguments.length > 5 ? arguments[5] : undefined;
|
|
228
139
|
var isSpecialRelativeTime = arguments.length > 6 ? arguments[6] : undefined;
|
|
229
140
|
var _defaultValue = arguments.length > 7 ? arguments[7] : undefined;
|
|
230
|
-
var
|
|
231
|
-
|
|
141
|
+
var intl = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : getFallbackIntl(locale);
|
|
142
|
+
var type = recordDateValue.type;
|
|
143
|
+
var title = recordDateValue.autoTitle ? getHistoryTitle(recordDateValue, {
|
|
144
|
+
locale: locale,
|
|
145
|
+
intl: intl
|
|
146
|
+
}, format, timeSpanBoundary) : recordDateValue.title;
|
|
232
147
|
var _judgeType = judgeType(recordDateValue),
|
|
233
148
|
_judgeType2 = _slicedToArray(_judgeType, 2),
|
|
234
149
|
isRule = _judgeType2[0],
|
|
@@ -241,7 +156,7 @@ export var echoInputValue = function echoInputValue() {
|
|
|
241
156
|
return title;
|
|
242
157
|
}
|
|
243
158
|
if (isRule && !isFoucs) {
|
|
244
|
-
return echoRecentlyTimeTitle(locale, captureUnit);
|
|
159
|
+
return echoRecentlyTimeTitle(locale, captureUnit, intl);
|
|
245
160
|
}
|
|
246
161
|
if (Array.isArray(_defaultValue) && _defaultValue !== null && _defaultValue !== void 0 && _defaultValue.length) {
|
|
247
162
|
return echoAbsoluteTimeTitle(_defaultValue, format, true, timeSpanBoundary);
|
|
@@ -516,17 +431,22 @@ export var getCorrectValue = function getCorrectValue(value) {
|
|
|
516
431
|
};
|
|
517
432
|
// ----------------------------------历史记录----------------------------------
|
|
518
433
|
/**
|
|
519
|
-
*
|
|
520
|
-
* @param {Object}
|
|
521
|
-
* @returns
|
|
434
|
+
* Resolve generated history labels at render time; caller titles stay untouched.
|
|
435
|
+
* @param {Object} recordValue Stored time range and title origin.
|
|
522
436
|
*/
|
|
523
|
-
export var
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
var
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
437
|
+
export var getHistoryTitle = function getHistoryTitle(recordValue) {
|
|
438
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
439
|
+
var format = arguments.length > 2 ? arguments[2] : undefined;
|
|
440
|
+
var timeSpanBoundary = arguments.length > 3 ? arguments[3] : undefined;
|
|
441
|
+
var _ref = typeof language === 'string' ? {
|
|
442
|
+
locale: language
|
|
443
|
+
} : language,
|
|
444
|
+
_ref$locale = _ref.locale,
|
|
445
|
+
locale = _ref$locale === void 0 ? 'zh_CN' : _ref$locale,
|
|
446
|
+
_ref$intl = _ref.intl,
|
|
447
|
+
intl = _ref$intl === void 0 ? getFallbackIntl(locale) : _ref$intl;
|
|
448
|
+
var value = recordValue.value;
|
|
449
|
+
var title = recordValue.autoTitle ? '' : recordValue.title || '';
|
|
530
450
|
var _judgeType3 = judgeType(recordValue),
|
|
531
451
|
_judgeType4 = _slicedToArray(_judgeType3, 2),
|
|
532
452
|
isRule = _judgeType4[0],
|
|
@@ -538,19 +458,30 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
|
|
|
538
458
|
}
|
|
539
459
|
if (isRule) {
|
|
540
460
|
if (!title) {
|
|
541
|
-
_title = echoRecentlyTimeTitle(locale, captureUnit);
|
|
461
|
+
_title = echoRecentlyTimeTitle(locale, captureUnit, intl);
|
|
542
462
|
}
|
|
543
463
|
}
|
|
544
464
|
if (!values && !isRule && !_title) {
|
|
545
|
-
_title =
|
|
465
|
+
_title = intl.get("bbf8ccde-ab7c-4040-97eb-35b56742de27").d("未转化标题");
|
|
546
466
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
467
|
+
return _title;
|
|
468
|
+
};
|
|
469
|
+
export var getHistoryInfo = function getHistoryInfo(recordValue, historyList) {
|
|
470
|
+
var language = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
471
|
+
var format = arguments.length > 3 ? arguments[3] : undefined;
|
|
472
|
+
var timeSpanBoundary = arguments.length > 4 ? arguments[4] : undefined;
|
|
473
|
+
// Preserve the old title field/signature, but mark generated labels for rendering.
|
|
474
|
+
var autoTitle = recordValue.autoTitle === true || !recordValue.title;
|
|
475
|
+
var record = _objectSpread(_objectSpread({}, recordValue), {}, {
|
|
476
|
+
autoTitle: autoTitle
|
|
477
|
+
});
|
|
478
|
+
var title = getHistoryTitle(record, language, format, timeSpanBoundary);
|
|
479
|
+
var isRepeat = historyList.some(function (item) {
|
|
480
|
+
return item.key === record.key || getHistoryTitle(item, language, format, timeSpanBoundary) === title;
|
|
481
|
+
});
|
|
482
|
+
return [isRepeat, _objectSpread(_objectSpread({}, record), {}, {
|
|
483
|
+
title: title,
|
|
484
|
+
key: record.key || uuidv4()
|
|
554
485
|
})];
|
|
555
486
|
};
|
|
556
487
|
|
package/lib/CWSelect/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
|
5
5
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
6
6
|
import "@chaoswise/ui/lib/Tag/index.less";
|
|
7
7
|
import _Tag from "@chaoswise/ui/lib/Tag";
|
|
8
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
9
8
|
var _excluded = ["onChange", "tagTooltipRender", "tagLabelRender", "maxTagCount", "maxTagTextLength", "defaultValue", "tagRender", "tagDropdownStyle", "mode", "value", "labelInValue", "allowDrag", "onDragEnd", "showTooltip", "showCheckbox", "dropdownRender", "onSelect", "onDeselect", "listHeight", "onDropdownVisibleChange", "selectLabel", "label", "multipleOptions"];
|
|
10
9
|
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); }
|
|
11
10
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -25,6 +24,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
25
24
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
26
25
|
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
26
|
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; }
|
|
27
|
+
import useIntl from '../useIntl';
|
|
28
28
|
import React, { useEffect, useState, forwardRef, useRef, useCallback, useMemo } from "react";
|
|
29
29
|
import ReactDom from "react-dom";
|
|
30
30
|
import RCSelect from "./antd-select";
|
|
@@ -36,8 +36,6 @@ import update from "immutability-helper";
|
|
|
36
36
|
import { getDefaultPaddingLeft } from "./utils";
|
|
37
37
|
import useConfigContext from "../useConfigContext";
|
|
38
38
|
import DragTag from "./DragTag";
|
|
39
|
-
import langConfig from "./locale";
|
|
40
|
-
import { formatMessage } from "../utils";
|
|
41
39
|
var Option = RCSelect.Option,
|
|
42
40
|
OptGroup = RCSelect.OptGroup;
|
|
43
41
|
/**
|
|
@@ -81,8 +79,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
81
79
|
isCheckboxMultipleHasSelectAll: true
|
|
82
80
|
} : _props$multipleOption,
|
|
83
81
|
rest = _objectWithoutProperties(props, _excluded);
|
|
84
|
-
var
|
|
85
|
-
localeObj = _useLocale.langObj;
|
|
82
|
+
var intl = useIntl();
|
|
86
83
|
var _useConfigContext = useConfigContext(),
|
|
87
84
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
88
85
|
var prefixCls = getPrefixCls();
|
|
@@ -107,9 +104,9 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
107
104
|
activeKey = _useState8[0],
|
|
108
105
|
setActiveKey = _useState8[1];
|
|
109
106
|
var _useState9 = useState(false),
|
|
110
|
-
|
|
111
|
-
resOpen =
|
|
112
|
-
setResOpen =
|
|
107
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
108
|
+
resOpen = _useState0[0],
|
|
109
|
+
setResOpen = _useState0[1];
|
|
113
110
|
var _showCheckbox = useMemo(function () {
|
|
114
111
|
return mode === "multiple" && (showCheckbox || multipleOptions.showCheckbox);
|
|
115
112
|
}, [mode, showCheckbox, multipleOptions.showCheckbox]);
|
|
@@ -372,7 +369,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
372
369
|
});
|
|
373
370
|
var notFoundContent = rest.notFoundContent ? rest.notFoundContent : /*#__PURE__*/React.createElement("div", {
|
|
374
371
|
className: "cw-select-show-checkbox-empty"
|
|
375
|
-
},
|
|
372
|
+
}, intl.get("812f44fc-ed3c-4bd3-8ad5-35cd2996c5ae").d("未查找到任何结果"));
|
|
376
373
|
return !dataSource.length ? notFoundContent : /*#__PURE__*/React.createElement(React.Fragment, null, multipleOptions.isCheckboxMultipleHasSelectAll && /*#__PURE__*/React.createElement("div", {
|
|
377
374
|
className: "cw-checkbox-all",
|
|
378
375
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -388,7 +385,7 @@ var CWSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
388
385
|
style: {
|
|
389
386
|
width: "100%"
|
|
390
387
|
}
|
|
391
|
-
},
|
|
388
|
+
}, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"), "\uFF08", filterActiveValues.length, "/", dataSource.length, "\uFF09")), originNode);
|
|
392
389
|
};
|
|
393
390
|
var onDropdownVisibleChange = function onDropdownVisibleChange(open) {
|
|
394
391
|
setResOpen(open);
|
package/lib/CWTable/CWTable.js
CHANGED
|
@@ -11,7 +11,8 @@ import "@chaoswise/ui/lib/FilterDropDown/index.less";
|
|
|
11
11
|
import _FilterDropDown from "@chaoswise/ui/lib/FilterDropDown";
|
|
12
12
|
var _excluded = ["columns", "lazyLoading", "loadData", "dataSource", "rowSelection", "pagination", "onExpand", "searchBar", "showHeader", "bordered", "scroll", "size", "className", "columnFilter", "tableWapperClassName", "onColumnsExchange", "expandIcon", "frontPagination", "tableHeader", "tableHeaderClassName", "autoHeight", "expandedRowRender", "onScrollToBottom", "getForm", "onSubmit", "onChange", "components", "onColumnsResizeEnd", "isRealTimeDrag"],
|
|
13
13
|
_excluded2 = ["onSearch"];
|
|
14
|
-
function
|
|
14
|
+
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 }; })(); }
|
|
15
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
15
16
|
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); }
|
|
16
17
|
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); }); }; }
|
|
17
18
|
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); }
|
|
@@ -115,9 +116,9 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
115
116
|
editingKey = _useState8[0],
|
|
116
117
|
setEditingKey = _useState8[1];
|
|
117
118
|
var _useState9 = useState([]),
|
|
118
|
-
|
|
119
|
-
finalDataSource =
|
|
120
|
-
setFinalDataSource =
|
|
119
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
120
|
+
finalDataSource = _useState0[0],
|
|
121
|
+
setFinalDataSource = _useState0[1];
|
|
121
122
|
|
|
122
123
|
// 重写onChange
|
|
123
124
|
var sorterInfo = useRef({}); // header中也会修改sorterInfo中的属性
|
|
@@ -180,13 +181,13 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
180
181
|
};
|
|
181
182
|
|
|
182
183
|
// 设置前端分页
|
|
183
|
-
var
|
|
184
|
+
var _useState1 = useState({
|
|
184
185
|
current: 1,
|
|
185
186
|
pageSize: 30
|
|
186
187
|
}),
|
|
187
|
-
|
|
188
|
-
pageInfo =
|
|
189
|
-
setPageInfo =
|
|
188
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
189
|
+
pageInfo = _useState10[0],
|
|
190
|
+
setPageInfo = _useState10[1];
|
|
190
191
|
// 设置搜索字段
|
|
191
192
|
var searchInfo = useRef({}); // 搜索信息
|
|
192
193
|
var watcher = useRef(null); // null
|
|
@@ -676,37 +677,36 @@ var CWTable = function CWTable(_ref, ref) {
|
|
|
676
677
|
oldValue = _ref4.oldValue,
|
|
677
678
|
cb = _ref4.cb;
|
|
678
679
|
tableForm.current.validateFields(/*#__PURE__*/function () {
|
|
679
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/
|
|
680
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(error, values) {
|
|
680
681
|
var oldValue_, isOk;
|
|
681
|
-
return
|
|
682
|
-
while (1) switch (_context.
|
|
682
|
+
return _regenerator().w(function (_context) {
|
|
683
|
+
while (1) switch (_context.n) {
|
|
683
684
|
case 0:
|
|
684
685
|
if (!error) {
|
|
685
|
-
_context.
|
|
686
|
+
_context.n = 1;
|
|
686
687
|
break;
|
|
687
688
|
}
|
|
688
|
-
return _context.
|
|
689
|
-
case
|
|
689
|
+
return _context.a(2);
|
|
690
|
+
case 1:
|
|
690
691
|
setLoading(true);
|
|
691
692
|
oldValue_ = oldValue || dataSource.find(function (record) {
|
|
692
693
|
return getKey(record, rest.rowKey) === editingKey;
|
|
693
694
|
});
|
|
694
|
-
_context.
|
|
695
|
+
_context.n = 2;
|
|
695
696
|
return onSubmit(_objectSpread(_objectSpread({}, oldValue_), values));
|
|
696
|
-
case
|
|
697
|
-
isOk = _context.
|
|
697
|
+
case 2:
|
|
698
|
+
isOk = _context.v;
|
|
698
699
|
setLoading('');
|
|
699
700
|
if (!(isOk === false)) {
|
|
700
|
-
_context.
|
|
701
|
+
_context.n = 3;
|
|
701
702
|
break;
|
|
702
703
|
}
|
|
703
|
-
return _context.
|
|
704
|
-
case
|
|
704
|
+
return _context.a(2);
|
|
705
|
+
case 3:
|
|
705
706
|
if (editMode === 'line') setEditingKey('');else if (editMode === 'cell') setEditingKey(editingKey + '1'); // 让数据重新渲染
|
|
706
707
|
typeof cb === 'function' && cb();
|
|
707
|
-
case
|
|
708
|
-
|
|
709
|
-
return _context.stop();
|
|
708
|
+
case 4:
|
|
709
|
+
return _context.a(2);
|
|
710
710
|
}
|
|
711
711
|
}, _callee);
|
|
712
712
|
}));
|
package/lib/CWTable/EditLine.js
CHANGED
|
@@ -9,7 +9,6 @@ import "@chaoswise/ui/lib/Form/index.less";
|
|
|
9
9
|
import _Form from "@chaoswise/ui/lib/Form";
|
|
10
10
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
11
11
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
12
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
13
12
|
var _excluded = ["form"],
|
|
14
13
|
_excluded2 = ["render", "helpText", "rules"];
|
|
15
14
|
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; }
|
|
@@ -30,9 +29,8 @@ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(
|
|
|
30
29
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
31
30
|
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; }
|
|
32
31
|
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; }
|
|
32
|
+
import useIntl from '../useIntl';
|
|
33
33
|
import React, { useEffect, useState } from 'react';
|
|
34
|
-
import langConfig from './locale';
|
|
35
|
-
import { formatMessage } from "../utils";
|
|
36
34
|
import useConfigContext from '../useConfigContext';
|
|
37
35
|
var EditableContext = /*#__PURE__*/React.createContext();
|
|
38
36
|
|
|
@@ -106,8 +104,7 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
106
104
|
var _useConfigContext2 = useConfigContext(),
|
|
107
105
|
getPrefixCls = _useConfigContext2.getPrefixCls;
|
|
108
106
|
var prefixCls = getPrefixCls();
|
|
109
|
-
var
|
|
110
|
-
localeObj = _useLocale.langObj;
|
|
107
|
+
var intl = useIntl();
|
|
111
108
|
var editable = ['line', 'cell'].includes(editMode);
|
|
112
109
|
var renderCell = function renderCell(_ref2) {
|
|
113
110
|
var form = _ref2.form,
|
|
@@ -156,12 +153,12 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
156
153
|
disabled: Boolean(loading),
|
|
157
154
|
type: "primary",
|
|
158
155
|
onClick: onOk
|
|
159
|
-
},
|
|
156
|
+
}, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定")), /*#__PURE__*/React.createElement(_Button, {
|
|
160
157
|
disabled: Boolean(loading),
|
|
161
158
|
onClick: function onClick() {
|
|
162
159
|
return setEditing(false);
|
|
163
160
|
}
|
|
164
|
-
},
|
|
161
|
+
}, intl.get("04a57125-d7d3-4559-9e88-cf91124095a4").d("取消"))), /*#__PURE__*/React.createElement("span", {
|
|
165
162
|
className: "".concat(prefixCls, "-cw-editcell-help")
|
|
166
163
|
}, helpText)) : '',
|
|
167
164
|
trigger: "click",
|
|
@@ -170,7 +167,7 @@ var EditableRowCell = function EditableRowCell(props) {
|
|
|
170
167
|
}, /*#__PURE__*/React.createElement("a", {
|
|
171
168
|
className: "cw-edit-text"
|
|
172
169
|
}, children, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
173
|
-
title:
|
|
170
|
+
title: intl.get("01f88687-defa-4388-8ccd-b9842fa5a6f2").d("编辑")
|
|
174
171
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
175
172
|
className: "cw-edit-icon",
|
|
176
173
|
type: "edit",
|
package/lib/CWTable/Filter.js
CHANGED
|
@@ -2,7 +2,6 @@ import "@chaoswise/ui/lib/Button/index.less";
|
|
|
2
2
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
3
3
|
import "@chaoswise/ui/lib/Checkbox/index.less";
|
|
4
4
|
import _Checkbox from "@chaoswise/ui/lib/Checkbox";
|
|
5
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
6
5
|
import _Tree from "@chaoswise/ui/lib/Tree";
|
|
7
6
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
7
|
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."); }
|
|
@@ -10,13 +9,11 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
9
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
10
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
11
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12
|
+
import useIntl from '../useIntl';
|
|
13
13
|
import React, { memo, useEffect, useState } from "react";
|
|
14
|
-
import langConfig from './locale';
|
|
15
|
-
import { formatMessage } from "../utils";
|
|
16
14
|
var TreeNode = _Tree.TreeNode;
|
|
17
15
|
function Filter(props) {
|
|
18
|
-
var
|
|
19
|
-
localeObj = _useLocale.langObj;
|
|
16
|
+
var intl = useIntl();
|
|
20
17
|
var _props$filters = props.filters,
|
|
21
18
|
filters = _props$filters === void 0 ? [] : _props$filters,
|
|
22
19
|
filterMultiple = props.filterMultiple,
|
|
@@ -104,7 +101,7 @@ function Filter(props) {
|
|
|
104
101
|
setTempSelectKey(allKeys.length === tempSelectKey.length ? [] : allKeys);
|
|
105
102
|
},
|
|
106
103
|
checked: allKeys.length === tempSelectKey.length
|
|
107
|
-
},
|
|
104
|
+
}, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"))), /*#__PURE__*/React.createElement(_Tree, {
|
|
108
105
|
checkable: true,
|
|
109
106
|
selectedKeys: [],
|
|
110
107
|
checkedKeys: tempSelectKey,
|
|
@@ -119,10 +116,10 @@ function Filter(props) {
|
|
|
119
116
|
style: {
|
|
120
117
|
marginLeft: '8px'
|
|
121
118
|
}
|
|
122
|
-
},
|
|
119
|
+
}, intl.get("04a57125-d7d3-4559-9e88-cf91124095a4").d("取消")), /*#__PURE__*/React.createElement(_Button, {
|
|
123
120
|
size: "small",
|
|
124
121
|
onClick: sure,
|
|
125
122
|
type: "primary"
|
|
126
|
-
},
|
|
123
|
+
}, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定")))) : _renderSelect(filters));
|
|
127
124
|
}
|
|
128
125
|
export default Filter;
|
package/lib/CWTable/index.js
CHANGED
|
@@ -241,7 +241,10 @@ Table.propTypes = {
|
|
|
241
241
|
* 编辑行和编辑单元格,自定义渲染
|
|
242
242
|
* example2 render: `(props) => <Input {...props} />`
|
|
243
243
|
*/
|
|
244
|
+
// PropTypes metadata is not display text; preserve the existing contract.
|
|
245
|
+
/* cw-i18n-disable */
|
|
244
246
|
'columns[0].form.render': PropTypes.oneOf(['React组件']),
|
|
247
|
+
/* cw-i18n-enable */
|
|
245
248
|
/**
|
|
246
249
|
* 编辑单元格的提示文字
|
|
247
250
|
*/
|
package/lib/CWTree/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
|
4
4
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
5
5
|
import _Dropdown from "@chaoswise/ui/lib/Dropdown";
|
|
6
6
|
import _Icon from "@chaoswise/ui/lib/Icon";
|
|
7
|
-
import _useLocale2 from "@chaoswise/ui/lib/useLocale";
|
|
8
7
|
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
9
8
|
import "antd/es/tree/style";
|
|
10
9
|
import _Tree from "antd/es/tree";
|
|
@@ -19,6 +18,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
19
18
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
19
|
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; }
|
|
21
20
|
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; }
|
|
21
|
+
import useIntl from '../useIntl';
|
|
22
22
|
import React, { Fragment, useState, useEffect, useMemo, useCallback } from "react";
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classnames from "classnames";
|
|
@@ -26,8 +26,6 @@ import DragSvg from "./assets/Drag";
|
|
|
26
26
|
import "./index.less";
|
|
27
27
|
import { createTitle } from "../QuickTransfer/utils";
|
|
28
28
|
import { createTree } from "./utils";
|
|
29
|
-
import langConfig from './locale';
|
|
30
|
-
import { formatMessage } from "../utils";
|
|
31
29
|
var TreeNode = _Tree.TreeNode,
|
|
32
30
|
DirectoryTree = _Tree.DirectoryTree;
|
|
33
31
|
var SubMenu = _Menu.SubMenu;
|
|
@@ -84,8 +82,7 @@ function CWTree(_ref) {
|
|
|
84
82
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
85
83
|
selfSelectedKeys = _useState6[0],
|
|
86
84
|
setSelfSelectedKeys = _useState6[1];
|
|
87
|
-
var
|
|
88
|
-
localeObj = _useLocale.langObj;
|
|
85
|
+
var intl = useIntl();
|
|
89
86
|
useEffect(function () {
|
|
90
87
|
if (selectedKeys !== undefined) {
|
|
91
88
|
setSelfSelectedKeys(selectedKeys);
|
|
@@ -186,7 +183,7 @@ function CWTree(_ref) {
|
|
|
186
183
|
}, title) : title), isDrawer && draggable && _showExtend === key && /*#__PURE__*/React.createElement("span", {
|
|
187
184
|
className: classnames("cw-tree-treenode-drag-icon")
|
|
188
185
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
189
|
-
title:
|
|
186
|
+
title: intl.get("d3158ace-0470-41b5-9f04-0dd8db0137c3").d("拖拽移动")
|
|
190
187
|
}, /*#__PURE__*/React.createElement(DragSvg, null)))), /*#__PURE__*/React.createElement("span", {
|
|
191
188
|
className: "cw-tree-treenode-extend ".concat(_showExtend === key ? "cw-tree-treenode-extend-show" : ""),
|
|
192
189
|
treekey: key
|
|
@@ -196,7 +193,7 @@ function CWTree(_ref) {
|
|
|
196
193
|
className: "cw-tree-treenode-extend-dropdown"
|
|
197
194
|
}, menuDom) : creatButton(icon, title, key, props))));
|
|
198
195
|
return titleDom;
|
|
199
|
-
}, [menuData, extendType, tooltipPlacement, isDrawer, draggable, _showExtend, menuRender,
|
|
196
|
+
}, [menuData, extendType, tooltipPlacement, isDrawer, draggable, _showExtend, menuRender, intl, useTooltipText, creatButton, creatMenu]);
|
|
200
197
|
var innerTreeNode = useMemo(function () {
|
|
201
198
|
function creatTreeNode(data) {
|
|
202
199
|
// 创建树结构
|