@chaoswise/ui 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/Button/index.js +0 -8
  2. package/lib/CWCascader/index.js +56 -1
  3. package/lib/CWCascader/index.less +22 -0
  4. package/lib/CWCascader/rc-cascader/Cascader.js +45 -21
  5. package/lib/CWCascader/rc-cascader/OptionList/Column.js +115 -48
  6. package/lib/CWCascader/rc-cascader/OptionList/index.js +11 -5
  7. package/lib/CWCascader/rc-cascader/OptionList/useKeyboard.js +64 -68
  8. package/lib/CWCascader/rc-cascader/hooks/useDisplayValues.js +45 -16
  9. package/lib/CWCascader/rc-cascader/hooks/useEntities.js +0 -8
  10. package/lib/CWCascader/rc-cascader/utils/treeUtil.js +45 -1
  11. package/lib/CWRangePicker/DropdownMenu/index.js +1 -1
  12. package/lib/CWRangePicker/DropdownMenu/index.less +11 -7
  13. package/lib/CWRangePicker/index.js +24 -28
  14. package/lib/CWSelect/index.less +1 -1
  15. package/lib/Cascader/index.less +20 -2
  16. package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +46 -0
  17. package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.less +14 -0
  18. package/lib/DropdownDatePicker/DropdownMenu/index.js +126 -0
  19. package/lib/DropdownDatePicker/DropdownMenu/index.less +68 -0
  20. package/lib/DropdownDatePicker/assets/Calendar2.js +15 -0
  21. package/lib/DropdownDatePicker/assets/live.js +19 -0
  22. package/lib/DropdownDatePicker/assets/more.js +23 -0
  23. package/lib/DropdownDatePicker/index.js +281 -0
  24. package/lib/DropdownDatePicker/index.less +34 -0
  25. package/lib/DropdownDatePicker/locale/en_US.js +20 -0
  26. package/lib/DropdownDatePicker/locale/index.js +12 -0
  27. package/lib/DropdownDatePicker/locale/zh_CN.js +20 -0
  28. package/lib/DropdownDatePicker/utils/index.js +247 -0
  29. package/lib/InputNumber/index.js +15 -11
  30. package/lib/ModuleFederation/ErrorBoundary/index.js +54 -0
  31. package/lib/ModuleFederation/index.js +10 -0
  32. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +185 -0
  33. package/lib/ModuleFederation/react-dynamic-remote-component/attach-script.js +42 -0
  34. package/lib/ModuleFederation/react-dynamic-remote-component/index.js +1 -0
  35. package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +44 -0
  36. package/lib/ModuleFederation/react-dynamic-remote-component/loading-script.js +35 -0
  37. package/lib/ModuleFederation/react-dynamic-remote-component/suspend.js +28 -0
  38. package/lib/ModuleFederation/react-dynamic-remote-component/utils.js +7 -0
  39. package/lib/QuickTransfer/locale/index.js +1 -4
  40. package/lib/QuickTransfer/locale/zh_CN.js +0 -8
  41. package/package.json +3 -2
@@ -102,74 +102,70 @@ export default (function (ref, options, fieldNames, activeValueCells, setActiveV
102
102
  return {
103
103
  // scrollTo: treeRef.current?.scrollTo,
104
104
  onKeyDown: function onKeyDown(event) {
105
- var which = event.which;
106
- switch (which) {
107
- // >>> Arrow keys
108
- case KeyCode.UP:
109
- case KeyCode.DOWN:
110
- {
111
- var offset = 0;
112
- if (which === KeyCode.UP) {
113
- offset = -1;
114
- } else if (which === KeyCode.DOWN) {
115
- offset = 1;
116
- }
117
- if (offset !== 0) {
118
- offsetActiveOption(offset);
119
- }
120
- break;
121
- }
122
- case KeyCode.LEFT:
123
- {
124
- if (rtl) {
125
- nextColumn();
126
- } else {
127
- prevColumn();
128
- }
129
- break;
130
- }
131
- case KeyCode.RIGHT:
132
- {
133
- if (rtl) {
134
- prevColumn();
135
- } else {
136
- nextColumn();
137
- }
138
- break;
139
- }
140
- case KeyCode.BACKSPACE:
141
- {
142
- if (!searchValue) {
143
- prevColumn();
144
- }
145
- break;
146
- }
147
- // >>> Select
148
- case KeyCode.ENTER:
149
- {
150
- if (validActiveValueCells.length) {
151
- var option = lastActiveOptions[lastActiveIndex];
152
- // Search option should revert back of origin options
153
- var originOptions = (option === null || option === void 0 ? void 0 : option[SEARCH_MARK]) || [];
154
- if (originOptions.length) {
155
- onKeyBoardSelect(originOptions.map(function (opt) {
156
- return opt[fieldNames.value];
157
- }), originOptions[originOptions.length - 1]);
158
- } else {
159
- onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
160
- }
161
- }
162
- break;
163
- }
164
- // >>> Close
165
- case KeyCode.ESC:
166
- {
167
- toggleOpen(false);
168
- if (open) {
169
- event.stopPropagation();
170
- }
171
- }
172
- }
105
+ // const { which } = event;
106
+ // switch (which) {
107
+ // // >>> Arrow keys
108
+ // case KeyCode.UP:
109
+ // case KeyCode.DOWN: {
110
+ // let offset = 0;
111
+ // if (which === KeyCode.UP) {
112
+ // offset = -1;
113
+ // }
114
+ // else if (which === KeyCode.DOWN) {
115
+ // offset = 1;
116
+ // }
117
+ // if (offset !== 0) {
118
+ // offsetActiveOption(offset);
119
+ // }
120
+ // break;
121
+ // }
122
+ // case KeyCode.LEFT: {
123
+ // if (rtl) {
124
+ // nextColumn();
125
+ // }
126
+ // else {
127
+ // prevColumn();
128
+ // }
129
+ // break;
130
+ // }
131
+ // case KeyCode.RIGHT: {
132
+ // if (rtl) {
133
+ // prevColumn();
134
+ // }
135
+ // else {
136
+ // nextColumn();
137
+ // }
138
+ // break;
139
+ // }
140
+ // case KeyCode.BACKSPACE: {
141
+ // if (!searchValue) {
142
+ // prevColumn();
143
+ // }
144
+ // break;
145
+ // }
146
+ // // >>> Select
147
+ // case KeyCode.ENTER: {
148
+ // if (validActiveValueCells.length) {
149
+ // const option = lastActiveOptions[lastActiveIndex];
150
+ // // Search option should revert back of origin options
151
+ // const originOptions = option?.[SEARCH_MARK] || [];
152
+ // if (originOptions.length) {
153
+ // onKeyBoardSelect(originOptions.map(opt => opt[fieldNames.value]), originOptions[originOptions.length - 1]);
154
+ // }
155
+ // else {
156
+ // onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
157
+ // }
158
+ // }
159
+ // break;
160
+ // }
161
+ // // >>> Close
162
+ // case KeyCode.ESC: {
163
+ // toggleOpen(false);
164
+ // if (open) {
165
+ // event.stopPropagation();
166
+ // }
167
+ // }
168
+ // }
173
169
  },
174
170
  onKeyUp: function onKeyUp() {}
175
171
  };
@@ -5,18 +5,18 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
- import { toPathOptions } from '../utils/treeUtil';
9
- import * as React from 'react';
10
- import { toPathKey } from '../utils/commonUtil';
11
- export default (function (rawValues, options, fieldNames, multiple, displayRender) {
8
+ import { toPathOptions } from "../utils/treeUtil";
9
+ import * as React from "react";
10
+ import { toPathKey } from "../utils/commonUtil";
11
+ export default (function (rawValues, options, fieldNames, multiple, displayRender, labelInValueOption) {
12
12
  return React.useMemo(function () {
13
13
  var mergedDisplayRender = displayRender ||
14
14
  // Default displayRender
15
15
  function (labels) {
16
16
  var mergedLabels = multiple ? labels.slice(-1) : labels;
17
- var SPLIT = ' / ';
17
+ var SPLIT = " / ";
18
18
  if (mergedLabels.every(function (label) {
19
- return ['string', 'number'].includes(_typeof(label));
19
+ return ["string", "number"].includes(_typeof(label));
20
20
  })) {
21
21
  return mergedLabels.join(SPLIT);
22
22
  }
@@ -34,15 +34,44 @@ export default (function (rawValues, options, fieldNames, multiple, displayRende
34
34
  return rawValues.map(function (valueCells) {
35
35
  var _valueOptions, _valueOptions$option;
36
36
  var valueOptions = toPathOptions(valueCells, options, fieldNames);
37
- var label = mergedDisplayRender(valueOptions.map(function (_ref) {
38
- var _option$fieldNames$la;
39
- var option = _ref.option,
40
- value = _ref.value;
41
- return (_option$fieldNames$la = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _option$fieldNames$la !== void 0 ? _option$fieldNames$la : value;
42
- }), valueOptions.map(function (_ref2) {
43
- var option = _ref2.option;
44
- return option;
45
- }));
37
+ var isBackEndQuery = false;
38
+ if (valueOptions.length && (valueOptions[valueOptions.length - 1].index === -1 || valueOptions[valueOptions.length - 1].index === undefined)) {
39
+ var findItem = labelInValueOption.find(function (item) {
40
+ return item.value == valueCells;
41
+ });
42
+ if (findItem) {
43
+ isBackEndQuery = true;
44
+ valueOptions[valueOptions.length - 1].option = {
45
+ value: valueOptions[valueOptions.length - 1].value,
46
+ label: findItem.label
47
+ };
48
+ }
49
+ }
50
+ var label;
51
+ if (isBackEndQuery) {
52
+ label = mergedDisplayRender(valueOptions.map(function (_ref) {
53
+ var option = _ref.option,
54
+ value = _ref.value;
55
+ return option === null || option === void 0 ? void 0 : option[fieldNames.label];
56
+ }).filter(Boolean), valueOptions.map(function (_ref2) {
57
+ var option = _ref2.option,
58
+ value = _ref2.value;
59
+ return option !== null && option !== void 0 ? option : {
60
+ label: undefined,
61
+ value: value
62
+ };
63
+ }));
64
+ } else {
65
+ label = mergedDisplayRender(valueOptions.map(function (_ref3) {
66
+ var _option$fieldNames$la;
67
+ var option = _ref3.option,
68
+ value = _ref3.value;
69
+ return (_option$fieldNames$la = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _option$fieldNames$la !== void 0 ? _option$fieldNames$la : value;
70
+ }), valueOptions.map(function (_ref4) {
71
+ var option = _ref4.option;
72
+ return option;
73
+ }));
74
+ }
46
75
  var value = toPathKey(valueCells);
47
76
  return {
48
77
  label: label,
@@ -52,5 +81,5 @@ export default (function (rawValues, options, fieldNames, multiple, displayRende
52
81
  disabled: (_valueOptions = valueOptions[valueOptions.length - 1]) === null || _valueOptions === void 0 ? void 0 : (_valueOptions$option = _valueOptions.option) === null || _valueOptions$option === void 0 ? void 0 : _valueOptions$option.disabled
53
82
  };
54
83
  });
55
- }, [rawValues, options, fieldNames, displayRender, multiple]);
84
+ }, [rawValues, options, fieldNames, displayRender, multiple, labelInValueOption]);
56
85
  });
@@ -4,14 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- /*
8
- * @Author: andrew.qiao andrew.qiao@cloudwise.com
9
- * @Date: 2023-05-30 06:35:28
10
- * @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
11
- * @LastEditTime: 2023-05-30 06:48:47
12
- * @FilePath: /change_01/aops_web_commons/packages/ui/components/Cascaders copy/rc-cascader/hooks/useEntities.js
13
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
14
- */
15
7
  import * as React from 'react';
16
8
  import { convertDataToEntities } from 'rc-cascader/node_modules/rc-tree/lib/utils/treeUtil';
17
9
  import { VALUE_SPLIT } from '../utils/commonUtil';
@@ -1,4 +1,4 @@
1
- import { SHOW_CHILD } from './commonUtil';
1
+ import { SHOW_CHILD } from "./commonUtil";
2
2
  export function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {
3
3
  var valueSet = new Set(pathKeys);
4
4
  var keyPathEntities = getKeyPathEntities();
@@ -13,8 +13,11 @@ export function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedSt
13
13
  }
14
14
  export function toPathOptions(valueCells, options, fieldNames) {
15
15
  var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
16
+ var labelInValue = arguments.length > 4 ? arguments[4] : undefined;
17
+ var labelInValueOption = arguments.length > 5 ? arguments[5] : undefined;
16
18
  var currentList = options;
17
19
  var valueOptions = [];
20
+ var isHit = true;
18
21
  var _loop = function _loop() {
19
22
  var _currentList, _currentList2, _foundOption$fieldNam;
20
23
  var valueCell = valueCells[i];
@@ -23,6 +26,9 @@ export function toPathOptions(valueCells, options, fieldNames) {
23
26
  return stringMode ? String(val) === String(valueCell) : val === valueCell;
24
27
  });
25
28
  var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _currentList2 === void 0 ? void 0 : _currentList2[foundIndex] : null;
29
+ if (foundIndex === -1) {
30
+ isHit = false;
31
+ }
26
32
  valueOptions.push({
27
33
  value: (_foundOption$fieldNam = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _foundOption$fieldNam !== void 0 ? _foundOption$fieldNam : valueCell,
28
34
  index: foundIndex,
@@ -33,5 +39,43 @@ export function toPathOptions(valueCells, options, fieldNames) {
33
39
  for (var i = 0; i < valueCells.length; i += 1) {
34
40
  _loop();
35
41
  }
42
+ if (!isHit && labelInValue) {
43
+ var findOption = labelInValueOption.find(function (item) {
44
+ return item.value === valueCells;
45
+ });
46
+ if (findOption) {
47
+ valueOptions = [{
48
+ option: {
49
+ value: findOption.value,
50
+ label: findOption.label,
51
+ backEndQuery: true
52
+ }
53
+ }];
54
+ }
55
+ }
36
56
  return valueOptions;
57
+ }
58
+ export function toValueAndLabel(valueOptions) {
59
+ var triggerValues = [];
60
+ valueOptions.forEach(function (item) {
61
+ var isBackEndQuery = item.some(function (i) {
62
+ return i.backEndQuery;
63
+ });
64
+ if (isBackEndQuery) {
65
+ triggerValues.push({
66
+ label: item[0].label,
67
+ value: item[0].value
68
+ });
69
+ } else {
70
+ var value = [];
71
+ item.forEach(function (i) {
72
+ value.push(i.value);
73
+ });
74
+ triggerValues.push({
75
+ label: item[item.length - 1].label,
76
+ value: value
77
+ });
78
+ }
79
+ });
80
+ return triggerValues;
37
81
  }
@@ -190,7 +190,7 @@ var DropdownMenu = function DropdownMenu(props) {
190
190
  "cw-dropdown-menu-more-wrapper-left": moreItemDropdownPosition === "left"
191
191
  }),
192
192
  getPopupContainer: function getPopupContainer(triggerNode) {
193
- return triggerNode.parentNode;
193
+ return triggerNode;
194
194
  }
195
195
  }, /*#__PURE__*/React.createElement("div", {
196
196
  className: classnames("cw-dropdown-menu-_item", "cw-dropdown-menu-item-more")
@@ -26,7 +26,7 @@
26
26
  color: @text-color;
27
27
  font-weight: normal;
28
28
  font-size: @dropdown-font-size;
29
- line-height: @dropdown-line-height;
29
+ line-height: 22px; // 整体32px的高度
30
30
 
31
31
  .cw-range-picker-menu-item-calendar {
32
32
  width: 14px;
@@ -46,19 +46,22 @@
46
46
  }
47
47
 
48
48
  .cw-dropdown-menu-item-more {
49
+ position: relative;
49
50
  justify-content: space-between;
50
-
51
+ overflow: visible;
51
52
  }
52
53
 
53
54
 
54
55
  .cw-dropdown-menu-more-wrapper {
55
56
  width: 384px;
56
- top: 0 !important;
57
- left: 362px !important;
57
+ top: auto !important;
58
+ bottom: -32px !important;
59
+ left: calc(100% + 2px) !important;
58
60
  box-shadow: @box-shadow-base;
59
61
 
60
62
  &.cw-dropdown-menu-more-wrapper-left {
61
- left: -386px !important;
63
+ right: calc(100% + 2px) !important;
64
+ left: auto !important;
62
65
  }
63
66
  }
64
67
  .cw-dropdown-menu-history-outer-wrapper{
@@ -102,10 +105,11 @@
102
105
  .cw-dropdown-menu-history-more-wrapper {
103
106
  width: 384px;
104
107
  top: 0 !important;
105
- left: 362px !important;
108
+ left: calc(100% + 2px) !important;
106
109
  box-shadow: @box-shadow-base;
107
110
  &.cw-dropdown-menu-history-more-wrapper-left {
108
- left: -386px !important;
111
+ right: calc(100% + 2px) !important;
112
+ left: auto !important;
109
113
  }
110
114
  }
111
115
  }
@@ -252,16 +252,23 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
252
252
  };
253
253
  }, []);
254
254
  // 日期是否存在
255
- var isHasDate = useMemo(function () {
256
- // 不符合最近时间格式和没有日期数据返回false
257
- var values = recordDateValue.value;
258
- var _judgeType7 = judgeType(recordDateValue),
259
- _judgeType8 = _slicedToArray(_judgeType7, 1),
260
- isRule = _judgeType8[0];
261
- values = funcValueChangeArrayValue(values);
262
- if (!isRule && !values) return false;
263
- return true;
264
- }, [recordDateValue]);
255
+ var _useMemo = useMemo(function () {
256
+ // 不符合最近时间格式和没有日期数据返回false
257
+ var values = recordDateValue.value;
258
+ var _judgeType7 = judgeType(recordDateValue),
259
+ _judgeType8 = _slicedToArray(_judgeType7, 2),
260
+ isRule = _judgeType8[0],
261
+ captureUnit = _judgeType8[1];
262
+ values = funcValueChangeArrayValue(values);
263
+ if (isRule) {
264
+ values = getChangeUnitDate(captureUnit[0], captureUnit[1]);
265
+ }
266
+ if (!isRule && !values) return [false, undefined];
267
+ return [true, values];
268
+ }, [recordDateValue]),
269
+ _useMemo2 = _slicedToArray(_useMemo, 2),
270
+ isHasDate = _useMemo2[0],
271
+ _defaultValue = _useMemo2[1];
265
272
  // 重组数据源
266
273
  var regroupDataSource = useMemo(function () {
267
274
  if (exceedShowInMore) {
@@ -353,9 +360,9 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
353
360
  e.target.select();
354
361
  }, 100);
355
362
  };
356
- // 输入框失去焦点
357
- var onInputBlur = function onInputBlur(e) {
358
- isInputRef.current = false;
363
+ // 输入框按下Enter
364
+ var onPressEnter = function onPressEnter(e) {
365
+ onInputBlur();
359
366
  };
360
367
  // 外部获取ref停止自动刷新
361
368
  var onStop = function onStop() {
@@ -368,8 +375,8 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
368
375
  var _refreshRef$current4, _refreshRef$current5;
369
376
  ((_refreshRef$current4 = refreshRef.current) === null || _refreshRef$current4 === void 0 ? void 0 : _refreshRef$current4.onAutoRefresh) && ((_refreshRef$current5 = refreshRef.current) === null || _refreshRef$current5 === void 0 ? void 0 : _refreshRef$current5.onAutoRefresh());
370
377
  };
371
- // 输入框回车按下
372
- var onPressEnter = function onPressEnter(e) {
378
+ // 输入框失去焦点
379
+ var onInputBlur = function onInputBlur(e) {
373
380
  if (!isInputRef.current) return;
374
381
  var _getUnit = getUnit(inputValue),
375
382
  isRule = _getUnit.isRule,
@@ -381,9 +388,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
381
388
  }, inputValue);
382
389
  var isInvalidDate_ = isInvalidDate(returnValue.value);
383
390
  if (!isInvalidDate_) {
384
- var _inputRef$current;
385
391
  // message.success(localeObj["fit-the-input-format"]);
386
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
387
392
  _onChange(returnValue);
388
393
  setIsFocus(false);
389
394
  var _getHistoryInfo = getHistoryInfo(returnValue, historyList, locale, format),
@@ -406,11 +411,9 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
406
411
  var _dateValue2 = finalDateOption.dateValue;
407
412
  var dateCount = getTruthDateCount(_dateValue2);
408
413
  if (dateCount === 2) {
409
- var _inputRef$current2;
410
414
  var _returnValue = getCorrectValue({
411
415
  value: _dateValue2
412
416
  });
413
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
414
417
  _onChange(_returnValue);
415
418
  setIsFocus(false);
416
419
  var _getHistoryInfo3 = getHistoryInfo(_returnValue, historyList, locale, format),
@@ -550,15 +553,8 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
550
553
  }
551
554
  }
552
555
  },
553
- defaultTimeOption: {
554
- startTimeOption: moment("00:00:00", "HH:mm:ss"),
555
- endTimeOption: moment("23:59:59", "HH:mm:ss")
556
- },
557
- defaultValue: [moment().subtract(1, "months").startOf("month"), moment().subtract(1, "months").startOf("month").add(1, "d").set({
558
- "hour": 23,
559
- "minute": 59,
560
- "second": 59
561
- })],
556
+ defaultValue: _defaultValue // 默认为当前已经选择的时间
557
+ ,
562
558
  showTime: {
563
559
  hideDisabledOptions: true
564
560
  }
@@ -661,7 +661,7 @@
661
661
  font-weight: @select-item-selected-font-weight; // UI规范
662
662
  background-color: @select-selected-enable-bg; // UI规范
663
663
  }
664
- &.cw-select-dropdown-multiple{
664
+ &.cw-select-dropdown-multiple.cw-select-dropdown-has-checkbox{
665
665
  .@{select-prefix-cls}-item-option.@{select-prefix-cls}-item-option-selected:not(.@{select-prefix-cls}-item-option-disabled){
666
666
  color: @text-color; // UI规范
667
667
  font-weight: 400; // UI规范
@@ -2,9 +2,27 @@
2
2
 
3
3
  .@{cascader-prefix-cls}-menus {
4
4
  position: static !important;
5
+
6
+ .@{cascader-prefix-cls}-menu {
7
+ .@{cascader-prefix-cls}-menu-item {
8
+
9
+ .@{cascader-prefix-cls}-menu-item-expand-icon,
10
+ .@{cascader-prefix-cls}-menu-item-loading-icon {
11
+ position: static;
12
+ }
13
+ }
14
+ }
5
15
  }
6
- .@{cascader-prefix-cls}.@{ant-prefix}-select{
7
- .@{ant-prefix}-select-selection-overflow{
16
+
17
+ .@{cascader-prefix-cls}.@{ant-prefix}-select {
18
+ .@{ant-prefix}-select-selection-overflow {
8
19
  flex: 0 1 auto;
20
+
21
+ .@{ant-prefix}-select-selection-overflow-item {
22
+
23
+ .@{ant-prefix}-select-selection-search {
24
+ margin: 0;
25
+ }
26
+ }
9
27
  }
10
28
  }
@@ -0,0 +1,46 @@
1
+ import _Row from "@chaoswise/ui/lib/Antd/Row";
2
+ import _Col from "@chaoswise/ui/lib/Antd/Col";
3
+ import "@chaoswise/ui/lib/TooltipText/index.less";
4
+ import _TooltipText from "@chaoswise/ui/lib/TooltipText";
5
+ import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
6
+ import React from "react";
7
+ import classnames from "classnames";
8
+ import { getLocale } from "../../locale";
9
+ import _ from "lodash";
10
+ import "./index.less";
11
+ var MoreTimeList = function MoreTimeList(props) {
12
+ var regroupDataSource = props.regroupDataSource,
13
+ recordDateValue = props.recordDateValue,
14
+ onClickItem = props.onClickItem;
15
+ var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
16
+ _ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
17
+ locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
18
+ var localeObj = getLocale(locale);
19
+ // 点击Menu.Item中切换常规模式
20
+ var onClickMoreItem = function onClickMoreItem(item) {
21
+ onClickItem(item);
22
+ };
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: classnames("cw-dropdown-date-picker-popup-more-content")
25
+ }, regroupDataSource.map(function (timeTypeItem, index) {
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ style: {
28
+ padding: "8px 0",
29
+ borderBottom: regroupDataSource.length - 1 !== index ? "1px solid rgba(0,0,0,0.06)" : ""
30
+ },
31
+ key: timeTypeItem.type
32
+ }, /*#__PURE__*/React.createElement("h3", null, localeObj[timeTypeItem.type]), /*#__PURE__*/React.createElement(_Row, null, timeTypeItem.timeList.map(function (item) {
33
+ return /*#__PURE__*/React.createElement(_Col, {
34
+ key: item.key,
35
+ span: timeTypeItem.type === "absolute" || timeTypeItem.type == "unixTimestamp" ? 12 : 8,
36
+ className: classnames("more-col-item", {
37
+ "cw-dropdown-date-picker-dropdown-menu-item-selected": (recordDateValue === null || recordDateValue === void 0 ? void 0 : recordDateValue.key) === item.key
38
+ }),
39
+ onClick: function onClick() {
40
+ return onClickMoreItem(item);
41
+ }
42
+ }, /*#__PURE__*/React.createElement(_TooltipText, null, item.render ? item.render(item) : item.title));
43
+ })));
44
+ }));
45
+ };
46
+ export default MoreTimeList;
@@ -0,0 +1,14 @@
1
+ .cw-dropdown-date-picker-popup-more-content {
2
+ padding: 12px 16px 8px;
3
+ background-color: @component-background;
4
+ .more-col-item{
5
+ cursor: pointer;
6
+ color:@text-color-show;
7
+ &.cw-dropdown-date-picker-dropdown-menu-item-selected{
8
+ background: @select-selected-enable-bg;
9
+ }
10
+ }
11
+ .more-col-item:hover {
12
+ color: @primary-5;
13
+ }
14
+ }