@chaoswise/ui 3.1.15 → 3.1.17

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.
Files changed (58) hide show
  1. package/lib/Antd5/_util/isNumeric.js +4 -0
  2. package/lib/Antd5/avatar/group.js +121 -0
  3. package/lib/Antd5/button/LoadingIcon.js +82 -0
  4. package/lib/Antd5/pagination/Select.js +24 -0
  5. package/lib/BasicLayout/locale/en_US.js +4 -0
  6. package/lib/BasicLayout/locale/index.js +11 -0
  7. package/lib/BasicLayout/locale/zh_CN.js +4 -0
  8. package/lib/BasicLayout/locale/zh_TW.js +4 -0
  9. package/lib/CWColorPicker/index.js +44 -44
  10. package/lib/CWMessage/MessageContent/TabList/index.js +13 -13
  11. package/lib/CWMessage/MessageContent/index.js +24 -24
  12. package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -7
  13. package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +14 -14
  14. package/lib/CWRangePicker/DropdownMenu/index.js +34 -34
  15. package/lib/CWRangePicker/Refresh/index.js +12 -12
  16. package/lib/CWRangePicker/TimeSpan/index.js +14 -14
  17. package/lib/CWRangePicker/index.js +56 -56
  18. package/lib/CWRangePicker/utils/generate/dayjs.js +110 -93
  19. package/lib/CWRangePicker/utils/generate/moment.js +99 -82
  20. package/lib/CWTable/assets/DownGraySvg.js +16 -0
  21. package/lib/CWTable/assets/DownLightSvg.js +16 -0
  22. package/lib/CWTable/assets/SortSvg.js +16 -0
  23. package/lib/CWTable/assets/SortingSvg.js +16 -0
  24. package/lib/CWTable/assets/UpGraySvg.js +15 -0
  25. package/lib/CWTable/assets/UpLightSvg.js +15 -0
  26. package/lib/CWTree/index.js +19 -5
  27. package/lib/CWTree/locale/en_US.js +3 -0
  28. package/lib/CWTree/locale/index.js +11 -0
  29. package/lib/CWTree/locale/zh_CN.js +3 -0
  30. package/lib/CWTree/locale/zh_TW.js +3 -0
  31. package/lib/ConfigProvider/ConfigProvider.js +6 -0
  32. package/lib/ConfigProvider/generate/dayjs.js +4 -0
  33. package/lib/Empty/index.js +10 -10
  34. package/lib/ErrorBoundary/ErrorPage.js +10 -10
  35. package/lib/Exception/index.js +22 -22
  36. package/lib/FilterDropDown/index.js +19 -19
  37. package/lib/Header/Document/index.js +5 -5
  38. package/lib/IconSelect/components/CustomImg/index.js +10 -10
  39. package/lib/IconSelect/components/SearchIcon/index.js +8 -8
  40. package/lib/IconSelect/index.js +16 -16
  41. package/lib/Joyride/List.js +11 -11
  42. package/lib/Joyride/index.js +55 -55
  43. package/lib/Pagination/index.js +34 -34
  44. package/lib/QuickTransfer/DragList.js +15 -15
  45. package/lib/QuickTransfer/index.js +62 -63
  46. package/lib/RangePicker/components/ExtraTimeFooter.js +1 -1
  47. package/lib/SearchBar/index.js +40 -40
  48. package/lib/TimeRangeSlider/Refresh/index.js +11 -11
  49. package/lib/TimeRangeSlider/TimeSpan/index.js +13 -13
  50. package/lib/TimeRangeSlider/index.js +32 -32
  51. package/lib/TimeRangeSlider/utils/generate/moment.js +106 -89
  52. package/lib/locales/en_US.json +1 -86
  53. package/lib/locales/index.js +11 -0
  54. package/lib/locales/ja_JP.json +1 -0
  55. package/lib/locales/zh_CN.json +1 -86
  56. package/lib/locales/zh_TW.json +1 -86
  57. package/package.json +2 -1
  58. /package/lib/Antd5/avatar/{Avatar.js → avatar.js} +0 -0
@@ -10,63 +10,69 @@ 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 moment from "moment";
13
+ import moment from 'moment';
14
14
  import { v4 as uuidv4 } from 'uuid';
15
15
  // 枚举时间单位
16
16
  var ENUM_TimeUnit = {
17
17
  s: {
18
- zh_CN: "秒",
18
+ zh_CN: '秒',
19
19
  en_US: {
20
- singular: "Second",
21
- plural: "Seconds"
20
+ singular: 'Second',
21
+ plural: 'Seconds'
22
22
  },
23
- zh_TW: "秒",
24
- unit: "seconds"
23
+ zh_TW: '秒',
24
+ ja_JP: '秒',
25
+ unit: 'seconds'
25
26
  },
26
27
  m: {
27
- zh_CN: "分钟",
28
+ zh_CN: '分钟',
28
29
  en_US: {
29
- singular: "Minute",
30
- plural: "Minutes"
30
+ singular: 'Minute',
31
+ plural: 'Minutes'
31
32
  },
32
- zh_TW: "分鐘",
33
- unit: "minutes"
33
+ zh_TW: '分鐘',
34
+ ja_JP: '分',
35
+ unit: 'minutes'
34
36
  },
35
37
  h: {
36
- zh_CN: "小时",
38
+ zh_CN: '小时',
37
39
  en_US: {
38
- singular: "Hour",
39
- plural: "Hours"
40
+ singular: 'Hour',
41
+ plural: 'Hours'
40
42
  },
41
- zh_TW: "小時",
42
- unit: "hours"
43
+ zh_TW: '小時',
44
+ ja_JP: '時間',
45
+ unit: 'hours'
43
46
  },
44
47
  d: {
45
- zh_CN: "天",
48
+ zh_CN: '天',
46
49
  en_US: {
47
- singular: "Day",
48
- plural: "Days"
50
+ singular: 'Day',
51
+ plural: 'Days'
49
52
  },
50
- zh_TW: "天",
51
- unit: "days"
53
+ zh_TW: '天',
54
+ ja_JP: '日',
55
+ unit: 'days'
52
56
  },
53
57
  mo: {
54
- zh_CN: "月",
58
+ zh_CN: '月',
55
59
  en_US: {
56
- singular: "Month",
57
- plural: "Months"
60
+ singular: 'Month',
61
+ plural: 'Months'
58
62
  },
59
- zh_TW: "月",
60
- unit: "mo"
63
+ zh_TW: '月',
64
+ ja_JP: 'ヶ月',
65
+ unit: 'mo'
61
66
  },
62
67
  y: {
63
- zh_CN: "年",
68
+ zh_CN: '年',
64
69
  en_US: {
65
- singular: "Year",
66
- plural: "Years"
70
+ singular: 'Year',
71
+ plural: 'Years'
67
72
  },
68
- zh_TW: "年",
69
- unit: "years"
73
+ zh_TW: '年',
74
+ ja_JP: '年',
75
+ unit: 'years'
70
76
  }
71
77
  };
72
78
  /**
@@ -87,7 +93,7 @@ export var regroupDataSourceFn = function regroupDataSourceFn(dataSource) {
87
93
  if (Object.keys(EnumTimeTypeData).includes(item.type)) {
88
94
  EnumTimeTypeData[item.type].push(item);
89
95
  } else {
90
- EnumTimeTypeData["other"].push(item);
96
+ EnumTimeTypeData['other'].push(item);
91
97
  }
92
98
  });
93
99
  Object.entries(EnumTimeTypeData).forEach(function (item) {
@@ -128,10 +134,10 @@ export var getUnit = function getUnit(unit) {
128
134
  export var judgeType = function judgeType(recordDateValue) {
129
135
  var key = recordDateValue.key,
130
136
  _recordDateValue$time = recordDateValue.timeDomain,
131
- timeDomain = _recordDateValue$time === void 0 ? "" : _recordDateValue$time;
137
+ timeDomain = _recordDateValue$time === void 0 ? '' : _recordDateValue$time;
132
138
  var isRule = false;
133
139
  var captureUnit = [];
134
- var recordUnit = "";
140
+ var recordUnit = '';
135
141
  var _getUnit = getUnit(key),
136
142
  _isRule = _getUnit.isRule,
137
143
  _captureUnit = _getUnit.captureUnit;
@@ -191,6 +197,14 @@ export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captur
191
197
  return timeUnit.zh_TW;
192
198
  }
193
199
  },
200
+ ja_JP: {
201
+ template: function template(count, unitText) {
202
+ return "\u904E\u53BB".concat(count).concat(unitText);
203
+ },
204
+ getUnitText: function getUnitText() {
205
+ return timeUnit.ja_JP;
206
+ }
207
+ },
194
208
  "default": {
195
209
  template: function template(count, unitText) {
196
210
  return "Past ".concat(count, " ").concat(unitText);
@@ -219,8 +233,8 @@ export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format)
219
233
  export var echoInputValue = function echoInputValue() {
220
234
  var recordDateValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
221
235
  var isFoucs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
222
- var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "zh_CN";
223
- var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "YYYY/MM/DD HH:mm:ss";
236
+ var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'zh_CN';
237
+ var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'YYYY/MM/DD HH:mm:ss';
224
238
  var forceRenderTitle = arguments.length > 4 ? arguments[4] : undefined;
225
239
  var isAutoRefresh = arguments.length > 5 ? arguments[5] : undefined;
226
240
  var timeSpanBoundary = arguments.length > 6 ? arguments[6] : undefined;
@@ -244,9 +258,9 @@ export var echoInputValue = function echoInputValue() {
244
258
  if (Array.isArray(value) && (_value2 = value) !== null && _value2 !== void 0 && _value2.length) {
245
259
  return echoAbsoluteTimeTitle(value, format, true, timeSpanBoundary);
246
260
  }
247
- return "";
261
+ return '';
248
262
  }
249
- if (!isRule && !values) return title || "Live Tail";
263
+ if (!isRule && !values) return title || 'Live Tail';
250
264
  if (isAutoRefresh) {
251
265
  var _value3;
252
266
  if (isRule) {
@@ -274,7 +288,7 @@ export var echoInputValue = function echoInputValue() {
274
288
 
275
289
  // 计算两个moment日期的时间差(时间戳)
276
290
  export var computeTimeDiff = function computeTimeDiff(value) {
277
- var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "ms";
291
+ var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ms';
278
292
  return value[1].diff(value[0], unit);
279
293
  };
280
294
  export var getYears = function getYears(seconds) {
@@ -285,11 +299,11 @@ export var getYears = function getYears(seconds) {
285
299
  // 计算输入框时间跨度
286
300
  export var computeTimeSpan = function computeTimeSpan(value, timeSpanBoundary) {
287
301
  // 当前传入日期的时间
288
- var timeDiff = computeTimeDiff(value, "s");
302
+ var timeDiff = computeTimeDiff(value, 's');
289
303
  if (timeDiff >= 60) {
290
304
  timeDiff = Number(timeDiff + 1);
291
305
  }
292
- var duration = moment.duration(timeDiff, "s");
306
+ var duration = moment.duration(timeDiff, 's');
293
307
  var _duration$_data = duration._data,
294
308
  years = _duration$_data.years,
295
309
  months = _duration$_data.months,
@@ -309,7 +323,7 @@ export var computeTimeSpan = function computeTimeSpan(value, timeSpanBoundary) {
309
323
  if (hours) return "".concat(hours, "h");
310
324
  if (minutes) return "".concat(minutes, "m");
311
325
  if (seconds) return "".concat(seconds, "s");
312
- return "";
326
+ return '';
313
327
  };
314
328
 
315
329
  /**
@@ -325,7 +339,7 @@ export var getTimeSpanFromValue = function getTimeSpanFromValue(value, timeSpanB
325
339
  value: value,
326
340
  timeDomain: timeDomain,
327
341
  number: captureUnit[0],
328
- unit: captureUnit[1] === "mo" ? "M" : captureUnit[1]
342
+ unit: captureUnit[1] === 'mo' ? 'M' : captureUnit[1]
329
343
  };
330
344
  };
331
345
 
@@ -352,10 +366,10 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
352
366
  var cloneCurrentDate_1 = currentDate_1.clone();
353
367
  // 是否切换到最近时间
354
368
  var switchInitial = false;
355
- if (direction == "left") {
369
+ if (direction == 'left') {
356
370
  cloneCurrentDate_0.subtract(duration);
357
371
  cloneCurrentDate_1.subtract(duration);
358
- } else if (direction == "right") {
372
+ } else if (direction == 'right') {
359
373
  cloneCurrentDate_0.add(duration);
360
374
  cloneCurrentDate_1.add(duration);
361
375
  // 计算最大值的时间差
@@ -377,36 +391,36 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
377
391
  if (_maxTimeDiff <= 0) {
378
392
  // 当前时间已经是极限了
379
393
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
380
- cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, "s"));
394
+ cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, 's'));
381
395
  cloneCurrentDate_1 = moment();
382
396
  switchInitial = true;
383
397
  } else {
384
398
  var clone0 = currentDate_0.clone();
385
399
  var clone1 = currentDate_1.clone();
386
- var initialTimeDiff = computeTimeDiff([clone0, clone1], "s");
400
+ var initialTimeDiff = computeTimeDiff([clone0, clone1], 's');
387
401
  if (timeSpanBoundary > initialTimeDiff) {
388
402
  var needChangeTimeDiff = Math.ceil(timeSpanBoundary - initialTimeDiff) / 2;
389
- cloneCurrentDate_0 = clone0.subtract(moment.duration(needChangeTimeDiff, "s"));
390
- cloneCurrentDate_1 = clone1.add(moment.duration(needChangeTimeDiff, "s"));
403
+ cloneCurrentDate_0 = clone0.subtract(moment.duration(needChangeTimeDiff, 's'));
404
+ cloneCurrentDate_1 = clone1.add(moment.duration(needChangeTimeDiff, 's'));
391
405
  // 计算最大值的时间差
392
406
  var _maxTimeDiff2 = computeTimeDiff([cloneCurrentDate_1, moment()]);
393
407
  if (_maxTimeDiff2 <= 0) {
394
408
  // 当前时间已经是极限了
395
409
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
396
- cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, "s"));
410
+ cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, 's'));
397
411
  cloneCurrentDate_1 = moment();
398
412
  switchInitial = true;
399
413
  }
400
414
  } else {
401
- cloneCurrentDate_1 = clone1.add(moment.duration(timeSpanBoundary, "s"));
415
+ cloneCurrentDate_1 = clone1.add(moment.duration(timeSpanBoundary, 's'));
402
416
  var clone = cloneCurrentDate_1.clone();
403
- cloneCurrentDate_0 = clone.subtract(moment.duration(timeSpanBoundary, "s"));
417
+ cloneCurrentDate_0 = clone.subtract(moment.duration(timeSpanBoundary, 's'));
404
418
  // 计算最大值的时间差
405
419
  var _maxTimeDiff3 = computeTimeDiff([cloneCurrentDate_1, moment()]);
406
420
  if (_maxTimeDiff3 <= 0) {
407
421
  // 当前时间已经是极限了
408
422
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
409
- cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, "s"));
423
+ cloneCurrentDate_0 = moment().subtract(moment.duration(timeSpanBoundary, 's'));
410
424
  cloneCurrentDate_1 = moment();
411
425
  switchInitial = true;
412
426
  }
@@ -436,8 +450,8 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
436
450
  */
437
451
  export var getChangeUnitDate = function getChangeUnitDate(unitFigure, unit) {
438
452
  var value = [moment().subtract(unitFigure, unit), moment()];
439
- if (unit === "mo") {
440
- value[0] = moment().subtract(unitFigure * 31, "d");
453
+ if (unit === 'mo') {
454
+ value[0] = moment().subtract(unitFigure * 31, 'd');
441
455
  }
442
456
  return value;
443
457
  };
@@ -486,7 +500,7 @@ export var getChangeDate = function getChangeDate(recordDateValue, direction) {
486
500
  };
487
501
  };
488
502
  export var isInvalidDate = function isInvalidDate(value) {
489
- return moment(value[0]).toDate() == "Invalid Date" || moment(value[1]).toDate() == "Invalid Date" || !computeTimeDiff(value);
503
+ return moment(value[0]).toDate() == 'Invalid Date' || moment(value[1]).toDate() == 'Invalid Date' || !computeTimeDiff(value);
490
504
  };
491
505
 
492
506
  // 符合禁用规则的时间集合
@@ -501,7 +515,7 @@ export function range(start, end) {
501
515
  // 判断value值是否是函数形式,并将函数形式执行之后转化为数组形式的value值
502
516
  export var funcValueChangeArrayValue = function funcValueChangeArrayValue(value) {
503
517
  if (!value) return;
504
- var isFunc = Object.prototype.toString.call(value) == "[object Function]";
518
+ var isFunc = Object.prototype.toString.call(value) == '[object Function]';
505
519
  var finalValue = value;
506
520
  if (isFunc) {
507
521
  finalValue = [value()[0], value()[1]];
@@ -511,7 +525,7 @@ export var funcValueChangeArrayValue = function funcValueChangeArrayValue(value)
511
525
 
512
526
  // 判断是否为最近时间规则,并返回矫正之后的value值
513
527
  export var getCorrectValue = function getCorrectValue(value) {
514
- var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
528
+ var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
515
529
  var _getUnit5 = getUnit(key),
516
530
  isRule = _getUnit5.isRule,
517
531
  captureUnit = _getUnit5.captureUnit;
@@ -522,7 +536,7 @@ export var getCorrectValue = function getCorrectValue(value) {
522
536
  returnValue = _objectSpread(_objectSpread({}, returnValue), {}, {
523
537
  timeDomain: key,
524
538
  number: captureUnit[0],
525
- unit: captureUnit[1] === "mo" ? "M" : captureUnit[1],
539
+ unit: captureUnit[1] === 'mo' ? 'M' : captureUnit[1],
526
540
  isRecently: true
527
541
  });
528
542
  if (!returnValue.value) {
@@ -549,7 +563,7 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
549
563
  var key = recordValue.key,
550
564
  value = recordValue.value,
551
565
  _recordValue$title = recordValue.title,
552
- title = _recordValue$title === void 0 ? "" : _recordValue$title;
566
+ title = _recordValue$title === void 0 ? '' : _recordValue$title;
553
567
  var _judgeType3 = judgeType(recordValue),
554
568
  _judgeType4 = _slicedToArray(_judgeType3, 2),
555
569
  isRule = _judgeType4[0],
@@ -565,7 +579,7 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
565
579
  }
566
580
  }
567
581
  if (!values && !isRule && !_title) {
568
- _title = intl.get("bbf8ccde-ab7c-4040-97eb-35b56742de27").d("未转化标题");
582
+ _title = intl.get('bbf8ccde-ab7c-4040-97eb-35b56742de27').d('未转化标题');
569
583
  }
570
584
  var isRepeat = Boolean(historyList.find(function (item) {
571
585
  return item.key === key || item.title === _title;
@@ -578,11 +592,14 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
578
592
  };
579
593
 
580
594
  // ----------------------------------时间输入绝对时间----------------------------------
581
- var FORMATS = ["YYYY/MM/DD HH:mm:ss", "YYYY/M/D H:m:s", "YYYY/MM/DD HH:mm", "YYYY/M/D H:m", "MM/DD HH:mm:ss", "M/D H:m:s", "MM/DD HH:mm", "M/D H:m", "YYYY/MM/DD", "YYYY/M/D", "MM/DD", "M/D", "HH:mm:ss", "H:m:s", "HH:mm", "H:m", "X"];
595
+ var FORMATS = ['YYYY/MM/DD HH:mm:ss', 'YYYY/M/D H:m:s', 'YYYY/MM/DD HH:mm', 'YYYY/M/D H:m', 'MM/DD HH:mm:ss', 'M/D H:m:s', 'MM/DD HH:mm', 'M/D H:m', 'YYYY/MM/DD', 'YYYY/M/D', 'MM/DD', 'M/D', 'HH:mm:ss', 'H:m:s', 'HH:mm', 'H:m', 'X'];
596
+
582
597
  // 不需要二次操作
583
- var NOT_CHANGE_FORMATS = ["YYYY/MM/DD HH:mm:ss", "YYYY/M/D H:m:s", "YYYY/MM/DD HH:mm", "YYYY/M/D H:m", "MM/DD HH:mm:ss", "M/D H:m:s", "MM/DD HH:mm", "M/D H:m", "X"];
598
+ var NOT_CHANGE_FORMATS = ['YYYY/MM/DD HH:mm:ss', 'YYYY/M/D H:m:s', 'YYYY/MM/DD HH:mm', 'YYYY/M/D H:m', 'MM/DD HH:mm:ss', 'M/D H:m:s', 'MM/DD HH:mm', 'M/D H:m', 'X'];
599
+
584
600
  // 需要二次操作
585
- var NEED_CHANGE_FORMATS = ["YYYY/MM/DD", "YYYY/M/D", "MM/DD", "M/D", "HH:mm:ss", "H:m:s", "HH:mm", "H:m"];
601
+ var NEED_CHANGE_FORMATS = ['YYYY/MM/DD', 'YYYY/M/D', 'MM/DD', 'M/D', 'HH:mm:ss', 'H:m:s', 'HH:mm', 'H:m'];
602
+
586
603
  // 判断数组中有几个真值
587
604
  export var getTruthDateCount = function getTruthDateCount(dateArray) {
588
605
  var truthDate = dateArray.filter(Boolean);
@@ -627,7 +644,7 @@ var getFormatParseDate = function getFormatParseDate() {
627
644
  });
628
645
  if (isAfterDate(cloneEndDate, cloneStartDate)) {
629
646
  if (!isAfterCurrentDate(cloneStartDate, cloneEndDate)) {
630
- if (cloneEndDate.isSame(moment(), "day")) {
647
+ if (cloneEndDate.isSame(moment(), 'day')) {
631
648
  cloneEndDate = moment();
632
649
  } else {
633
650
  cloneStartDate = null;
@@ -641,8 +658,8 @@ var getFormatParseDate = function getFormatParseDate() {
641
658
  } else if (NEED_CHANGE_FORMATS.slice(4).includes(format)) {
642
659
  if (isAfterDate(cloneEndDate, cloneStartDate)) {
643
660
  if (!isAfterCurrentDate(cloneStartDate, cloneEndDate)) {
644
- cloneStartDate.subtract(1, "days");
645
- cloneEndDate.subtract(1, "days");
661
+ cloneStartDate.subtract(1, 'days');
662
+ cloneEndDate.subtract(1, 'days');
646
663
  }
647
664
  } else {
648
665
  cloneStartDate = null;
@@ -659,7 +676,7 @@ var getFormatParseDate = function getFormatParseDate() {
659
676
  _endDate = _date2[0];
660
677
  var _cloneStartDate = null;
661
678
  var _cloneEndDate = null;
662
- if (format !== "X") {
679
+ if (format !== 'X') {
663
680
  _cloneStartDate = _endDate.clone();
664
681
  _cloneEndDate = _endDate.clone();
665
682
  _cloneStartDate.set({
@@ -680,7 +697,7 @@ var getFormatParseDate = function getFormatParseDate() {
680
697
  second: 59
681
698
  });
682
699
  if (!isAfterCurrentDate(_cloneStartDate, _cloneEndDate, true)) {
683
- if (_cloneEndDate.isSame(moment(), "day")) {
700
+ if (_cloneEndDate.isSame(moment(), 'day')) {
684
701
  _cloneEndDate = moment();
685
702
  } else {
686
703
  _cloneStartDate = null;
@@ -690,8 +707,8 @@ var getFormatParseDate = function getFormatParseDate() {
690
707
  }
691
708
  if (NEED_CHANGE_FORMATS.slice(4).includes(format)) {
692
709
  if (!isAfterCurrentDate(_cloneStartDate, _cloneEndDate, true)) {
693
- _cloneStartDate.subtract(1, "days");
694
- _cloneEndDate.subtract(1, "days");
710
+ _cloneStartDate.subtract(1, 'days');
711
+ _cloneEndDate.subtract(1, 'days');
695
712
  }
696
713
  }
697
714
  }
@@ -704,17 +721,17 @@ var getFormatParseDate = function getFormatParseDate() {
704
721
  // 转换输入日期并返回符合规则的日期和format格式
705
722
  var parseInputDate = function parseInputDate(text) {
706
723
  var finalDate = null;
707
- var finalFormat = "";
724
+ var finalFormat = '';
708
725
  for (var i = 0; i < FORMATS.length; i += 1) {
709
726
  var format = FORMATS[i];
710
727
  var date = moment(text, format, true);
711
728
  if (date.isValid()) {
712
729
  finalDate = date;
713
730
  finalFormat = format;
714
- if (format === "X") {
731
+ if (format === 'X') {
715
732
  if (text.length !== 10) {
716
733
  finalDate = null;
717
- finalFormat = "";
734
+ finalFormat = '';
718
735
  }
719
736
  }
720
737
  return {
@@ -729,7 +746,7 @@ var parseInputDate = function parseInputDate(text) {
729
746
  };
730
747
  };
731
748
  function getCharCount(str, _char) {
732
- var regex = new RegExp(_char, "g");
749
+ var regex = new RegExp(_char, 'g');
733
750
  var result = str.match(regex);
734
751
  var count = !result ? 0 : result.length;
735
752
  return count;
@@ -737,13 +754,13 @@ function getCharCount(str, _char) {
737
754
  function getCheckableDateInfo(inputStr) {
738
755
  // 替换时间跨度为空字符串
739
756
  // "[21mo] 2023/03/01 00:00:00 - 2023/03/22 10:38:00"-》2023/03/01 00:00:00 - 2023/03/22 10:38:00
740
- var deleteSpanStr = inputStr.replace(/^\[[1-9][0-9]*([s|m|h|d|y]|mo)\]\s/, "");
757
+ var deleteSpanStr = inputStr.replace(/^\[[1-9][0-9]*([s|m|h|d|y]|mo)\]\s/, '');
741
758
  var dateArray = [];
742
- var count = getCharCount(deleteSpanStr, "-");
759
+ var count = getCharCount(deleteSpanStr, '-');
743
760
  if (count === 1) {
744
- dateArray = deleteSpanStr.split("-");
745
- dateArray[0] = dateArray[0].replace(/\s$/, "");
746
- dateArray[1] = dateArray[1].replace(/^\s/, "");
761
+ dateArray = deleteSpanStr.split('-');
762
+ dateArray[0] = dateArray[0].replace(/\s$/, '');
763
+ dateArray[1] = dateArray[1].replace(/^\s/, '');
747
764
  } else {
748
765
  dateArray = [deleteSpanStr];
749
766
  }
@@ -754,7 +771,7 @@ export function getFinalDateOption(inputStr) {
754
771
  var dateArray = getCheckableDateInfo(inputStr);
755
772
  var finalDateOption = {
756
773
  dateValue: [null, null],
757
- format: ""
774
+ format: ''
758
775
  };
759
776
  if (dateArray.length === 2) {
760
777
  // ['2023/03/01 00:00:00', '2023/03/22 10:38:00']
@@ -790,6 +807,6 @@ export function getFinalDateOption(inputStr) {
790
807
  * 是否超过了最大的时间跨度
791
808
  */
792
809
  export var isExceedMaxTimeSpan = function isExceedMaxTimeSpan(value, timeSpanBoundary) {
793
- return computeTimeDiff(value, "s") > timeSpanBoundary;
810
+ return computeTimeDiff(value, 's') > timeSpanBoundary;
794
811
  };
795
812
  export default moment;
@@ -0,0 +1,16 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgDownGray = function SvgDownGray(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 7,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorTextTertiary"]),
12
+ fillRule: "evenodd",
13
+ d: "M3.667.833A.5.5 0 0 1 4.02.98l2.4 2.4a.5.5 0 0 1-.707.707L4.167 2.54v8.127a.5.5 0 0 1-1 0V2.54L1.62 4.087a.5.5 0 0 1-.707-.707l2.4-2.4a.5.5 0 0 1 .354-.147"
14
+ }));
15
+ };
16
+ export default SvgDownGray;
@@ -0,0 +1,16 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgDownLight = function SvgDownLight(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 7,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorPrimary"]),
12
+ fillRule: "evenodd",
13
+ d: "M3.667.833A.5.5 0 0 1 4.02.98l2.4 2.4a.5.5 0 0 1-.707.707L4.167 2.54v8.127a.5.5 0 0 1-1 0V2.54L1.62 4.087a.5.5 0 0 1-.707-.707l2.4-2.4a.5.5 0 0 1 .354-.147"
14
+ }));
15
+ };
16
+ export default SvgDownLight;
@@ -0,0 +1,16 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgSort = function SvgSort(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 14,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorTextTertiary"]),
12
+ fillRule: "evenodd",
13
+ d: "M3.667.833A.5.5 0 0 1 4.02.98l2.4 2.4a.5.5 0 0 1-.707.707L4.167 2.54v8.127a.5.5 0 0 1-1 0V2.54L1.62 4.087a.5.5 0 0 1-.707-.707l2.4-2.4a.5.5 0 0 1 .354-.147m6.666 0a.5.5 0 0 1 .5.5V9.46l1.547-1.547a.5.5 0 0 1 .707.707l-2.4 2.4a.5.5 0 0 1-.707 0l-2.4-2.4a.5.5 0 0 1 .707-.707L9.833 9.46V1.333a.5.5 0 0 1 .5-.5"
14
+ }));
15
+ };
16
+ export default SvgSort;
@@ -0,0 +1,16 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgSorting = function SvgSorting(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 14,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorPrimary"]),
12
+ fillRule: "evenodd",
13
+ d: "M3.667.833A.5.5 0 0 1 4.02.98l2.4 2.4a.5.5 0 0 1-.707.707L4.167 2.54v8.127a.5.5 0 0 1-1 0V2.54L1.62 4.087a.5.5 0 0 1-.707-.707l2.4-2.4a.5.5 0 0 1 .354-.147m6.666 0a.5.5 0 0 1 .5.5V9.46l1.547-1.547a.5.5 0 0 1 .707.707l-2.4 2.4a.5.5 0 0 1-.707 0l-2.4-2.4a.5.5 0 0 1 .707-.707L9.833 9.46V1.333a.5.5 0 0 1 .5-.5"
14
+ }));
15
+ };
16
+ export default SvgSorting;
@@ -0,0 +1,15 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgUpGray = function SvgUpGray(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 7,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorTextTertiary"]),
12
+ d: "M3.333.833a.5.5 0 0 1 .5.5V9.46L5.38 7.913a.5.5 0 0 1 .707.707l-2.4 2.4a.5.5 0 0 1-.707 0l-2.4-2.4a.5.5 0 0 1 .707-.707L2.833 9.46V1.333a.5.5 0 0 1 .5-.5"
13
+ }));
14
+ };
15
+ export default SvgUpGray;
@@ -0,0 +1,15 @@
1
+ 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); }
2
+ import * as React from "react";
3
+ import { useTheme } from "../../antd-style";
4
+ var SvgUpLight = function SvgUpLight(props) {
5
+ var theme = useTheme();
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: 7,
9
+ height: 12
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "".concat(theme["colorPrimary"]),
12
+ d: "M3.333.833a.5.5 0 0 1 .5.5V9.46L5.38 7.913a.5.5 0 0 1 .707.707l-2.4 2.4a.5.5 0 0 1-.707 0l-2.4-2.4a.5.5 0 0 1 .707-.707L2.833 9.46V1.333a.5.5 0 0 1 .5-.5"
13
+ }));
14
+ };
15
+ export default SvgUpLight;
@@ -1,8 +1,10 @@
1
+ import _Empty from "@chaoswise/ui/lib/Empty";
1
2
  import _Dropdown from "@chaoswise/ui/lib/Dropdown";
2
3
  import _TooltipText from "@chaoswise/ui/lib/TooltipText";
4
+ import _useConfigContext2 from "@chaoswise/ui/lib/useConfigContext";
3
5
  import _Menu from "@chaoswise/ui/lib/Menu";
4
6
  import _Tree from "@chaoswise/ui/lib/Tree";
5
- var _excluded = ["children", "treeData", "menuData", "extendType", "onClickMenu", "menuStyle", "menuRender", "extraFooter", "tooltipPlacement", "searchValue", "multiple", "selectedKeys", "defaultSelectedKeys", "onSelect", "searchHighlight", "draggable", "searchHighlightStyle", "className", "caseSensitive", "onExpand", "renderItem", "useTooltipText", "fieldNames"],
7
+ var _excluded = ["children", "treeData", "menuData", "extendType", "onClickMenu", "menuStyle", "menuRender", "extraFooter", "tooltipPlacement", "searchValue", "multiple", "selectedKeys", "defaultSelectedKeys", "onSelect", "searchHighlight", "draggable", "searchHighlightStyle", "className", "caseSensitive", "onExpand", "renderItem", "useTooltipText", "fieldNames", "emptyContent"],
6
8
  _excluded2 = ["key", "title", "children"],
7
9
  _excluded3 = ["icon", "title", "key"];
8
10
  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; }
@@ -26,7 +28,6 @@ import PropTypes from "prop-types";
26
28
  import classnames from "classnames";
27
29
  import DragSvg from "./assets/Drag";
28
30
  import { createTitle, processTreeData } from "./utils";
29
- import useConfigContext from "../useConfigContext";
30
31
  import useStyle from "./index.style";
31
32
  var TreeNode = _Tree.TreeNode,
32
33
  DirectoryTree = _Tree.DirectoryTree;
@@ -75,8 +76,9 @@ function CWTree(_ref) {
75
76
  _ref$useTooltipText = _ref.useTooltipText,
76
77
  useTooltipText = _ref$useTooltipText === void 0 ? true : _ref$useTooltipText,
77
78
  fieldNames = _ref.fieldNames,
79
+ emptyContent = _ref.emptyContent,
78
80
  rest = _objectWithoutProperties(_ref, _excluded);
79
- var _useConfigContext = useConfigContext(),
81
+ var _useConfigContext = _useConfigContext2(),
80
82
  getPrefixCls = _useConfigContext.getPrefixCls;
81
83
  var prefixCls = getPrefixCls();
82
84
  var _useStyle = useStyle("".concat(prefixCls, "-tree")),
@@ -329,6 +331,13 @@ function CWTree(_ref) {
329
331
  if (!children) return false;
330
332
  return true;
331
333
  }, [children]);
334
+ // 判断是否为空数据
335
+ var isEmpty = useMemo(function () {
336
+ // 如果有children,则不为空
337
+ if (hasChildren) return false;
338
+ // 如果没有children,使用processedTreeData判断(经过搜索过滤后的最终数据)
339
+ return !processedTreeData || processedTreeData.length === 0;
340
+ }, [hasChildren, processedTreeData]);
332
341
 
333
342
  // 根据是否有children来决定渲染配置
334
343
  var treeProps = useMemo(function () {
@@ -361,7 +370,7 @@ function CWTree(_ref) {
361
370
  className: "cw-tree-inner-wrapper"
362
371
  }, /*#__PURE__*/React.createElement("div", {
363
372
  className: "cw-tree-location-box"
364
- }, /*#__PURE__*/React.createElement(DirectoryTree, treeProps, children))), extraFooter && /*#__PURE__*/React.createElement("div", {
373
+ }, isEmpty ? emptyContent ? emptyContent : /*#__PURE__*/React.createElement(_Empty, null) : /*#__PURE__*/React.createElement(DirectoryTree, treeProps, children))), extraFooter && /*#__PURE__*/React.createElement("div", {
365
374
  className: "cw-tree-footer"
366
375
  }, extraFooter)));
367
376
  }
@@ -458,7 +467,12 @@ CWTree.propTypes = {
458
467
  * 自定义渲染整个节点(完全自定义,可获得内部渲染结果作为参考)
459
468
  * function(nodeData, internalResult) => ReactNode
460
469
  */
461
- titleRender: PropTypes.func
470
+ titleRender: PropTypes.func,
471
+ /**
472
+ * 自定义空状态内容,当没有数据或搜索无结果时显示
473
+ * 可以传入React节点,如果不传则使用默认的Empty组件
474
+ */
475
+ emptyContent: PropTypes.node
462
476
  };
463
477
  CWTree.TreeNode = TreeNode;
464
478
  CWTree.DirectoryTree = DirectoryTree;
@@ -0,0 +1,3 @@
1
+ export default {
2
+ "dragMove": "Drag Move"
3
+ };
@@ -0,0 +1,11 @@
1
+ import zh_CN from './zh_CN.js';
2
+ import en_US from './en_US.js';
3
+ import zh_TW from './zh_TW.js';
4
+ export default {
5
+ zh_CN: zh_CN,
6
+ en_US: en_US,
7
+ zh_TW: zh_TW,
8
+ // 兼容
9
+ zh: zh_CN,
10
+ en: en_US
11
+ };
@@ -0,0 +1,3 @@
1
+ export default {
2
+ "dragMove": "拖拽移动"
3
+ };