@chaoswise/ui 2.6.4 → 2.6.6

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 (54) hide show
  1. package/lib/AbreastLayout/index.js +3 -1
  2. package/lib/Antd3/es/alert/index.js +1 -1
  3. package/lib/Antd3/es/auto-complete/index.js +1 -1
  4. package/lib/Antd3/es/badge/ScrollNumber.js +1 -1
  5. package/lib/Antd3/es/breadcrumb/Breadcrumb.js +1 -1
  6. package/lib/Antd3/es/calendar/Header.js +2 -2
  7. package/lib/Antd3/es/cascader/index.js +1 -1
  8. package/lib/Antd3/es/date-picker/InputIcon.js +1 -1
  9. package/lib/Antd3/es/date-picker/createPicker.js +1 -1
  10. package/lib/Antd3/es/descriptions/index.js +1 -1
  11. package/lib/Antd3/es/form/FormItem.js +2 -2
  12. package/lib/Antd3/es/list/index.js +1 -1
  13. package/lib/Antd3/es/modal/confirm.js +1 -1
  14. package/lib/Antd3/es/select/index.js +3 -3
  15. package/lib/Antd3/es/spin/index.js +2 -2
  16. package/lib/Antd3/es/table/filterDropdown.js +1 -1
  17. package/lib/Antd3/es/tabs/index.js +1 -1
  18. package/lib/Antd3/es/tooltip/index.js +1 -1
  19. package/lib/Antd3/es/typography/util.js +1 -1
  20. package/lib/Antd4/avatar/group.js +1 -1
  21. package/lib/Antd4/input/Password.js +1 -1
  22. package/lib/Antd4/modal/confirm.js +1 -1
  23. package/lib/Antd4/modal/useModal/index.js +1 -1
  24. package/lib/Antd4/popconfirm/index.js +1 -1
  25. package/lib/Antd4/progress/Steps.js +1 -1
  26. package/lib/Antd4/select/utils/iconUtil.js +3 -3
  27. package/lib/BasicLayout/Sider.js +1 -1
  28. package/lib/BasicLayout/index.js +1 -1
  29. package/lib/CWCascader/rc-cascader/OptionList/Column.js +3 -3
  30. package/lib/CWMessage/MessageContent/TabList/index.js +5 -4
  31. package/lib/CWMessage/MessageContent/index.js +3 -3
  32. package/lib/CWMessage/index.js +4 -4
  33. package/lib/CWSelect/antd-select.js +3 -3
  34. package/lib/CWTable/CWTable.js +3 -3
  35. package/lib/CWTable/EditLine.js +1 -1
  36. package/lib/CWUpload/upload/Dragger.js +1 -1
  37. package/lib/CWUpload/upload/Upload.js +1 -1
  38. package/lib/CWUpload/upload/UploadList.js +17 -17
  39. package/lib/CustomNotification/index.js +1 -1
  40. package/lib/DateRangePicker/components/ExtraTimeFooter.js +0 -1
  41. package/lib/Documentation/index.js +11 -4
  42. package/lib/Documentation/index.less +4 -0
  43. package/lib/FilterDropDown/index.js +2 -2
  44. package/lib/Formily/FormItem/items/Password.js +1 -1
  45. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +3 -3
  46. package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +1 -1
  47. package/lib/PolymerizationSearch/DropdownMenu.js +2 -2
  48. package/lib/SelectBackup/select/index.js +3 -3
  49. package/lib/SingleSpa/index.js +1 -1
  50. package/lib/TimeZoneSelect/index.js +122 -0
  51. package/lib/TreeSelect111/utils/index.js +1 -1
  52. package/lib/Watermark/index.js +1 -1
  53. package/lib/utils/index.js +32 -0
  54. package/package.json +3 -2
@@ -23,6 +23,7 @@ import useConfigContext from '../useConfigContext';
23
23
  import classnames from 'classnames';
24
24
  import CollapsedBtn from "./CollapsedBtn";
25
25
  import { eventManager } from '../utils';
26
+ import { omit } from "lodash-es";
26
27
  import './index.less';
27
28
 
28
29
  /**
@@ -61,6 +62,7 @@ function AbreastLayout(_ref) {
61
62
  var isLeft = type === 'rightNavigation' || type === 'rightOperationArea';
62
63
  var isRight = type === 'leftNavigation' || type === 'leftOperationArea';
63
64
  var finalCollapsed = rest.collapsed !== undefined ? rest.collapsed : collapsed;
65
+ var omitRest = type === "rightOperationArea" || type === "leftOperationArea" ? omit(rest, ['minWidth', 'maxWidth']) : rest;
64
66
  var onCollapse = function onCollapse() {
65
67
  setCollapsed(function (pre) {
66
68
  return !pre;
@@ -94,7 +96,7 @@ function AbreastLayout(_ref) {
94
96
  })), /*#__PURE__*/React.createElement(Resizable, _extends({
95
97
  boundsByDirection: type === 'rightNavigation',
96
98
  bounds: "parent"
97
- }, rest, {
99
+ }, omitRest, {
98
100
  className: classnames({
99
101
  'cw-abreast-layout-sider': true,
100
102
  'cw-abreast-layout-left-navigation': isRight,
@@ -221,7 +221,7 @@ var Alert = /*#__PURE__*/function (_React$Component) {
221
221
  type: "close"
222
222
  })) : null;
223
223
  var dataOrAriaProps = getDataOrAriaProps(_this.props);
224
- var iconNode = icon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) ? /*#__PURE__*/React.cloneElement(icon, {
224
+ var iconNode = icon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) ? /*#__PURE__*/React.cloneElement(icon, {
225
225
  className: classNames("".concat(prefixCls, "-icon"), _defineProperty({}, icon.props.className, icon.props.className))
226
226
  }) : /*#__PURE__*/React.createElement("span", {
227
227
  className: "".concat(prefixCls, "-icon")
@@ -169,7 +169,7 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
169
169
  options = children;
170
170
  } else {
171
171
  options = dataSource ? dataSource.map(function (item) {
172
- if ( /*#__PURE__*/React.isValidElement(item)) {
172
+ if (/*#__PURE__*/React.isValidElement(item)) {
173
173
  return item;
174
174
  }
175
175
  switch (_typeof(item)) {
@@ -122,7 +122,7 @@ function getNumberArray(num) {
122
122
  function renderNumberList(position, className) {
123
123
  var childrenToReturn = [];
124
124
  for (var i = 0; i < 30; i++) {
125
- childrenToReturn.push( /*#__PURE__*/React.createElement("p", {
125
+ childrenToReturn.push(/*#__PURE__*/React.createElement("p", {
126
126
  key: i.toString(),
127
127
  className: classNames(className, {
128
128
  current: position === i
@@ -173,7 +173,7 @@ function defaultItemRender(route, params, routes, paths) {
173
173
  }
174
174
  function filterFragment(children) {
175
175
  return toArray(children).map(function (element) {
176
- if ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(element) && element.type === React.Fragment) {
176
+ if (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(element) && element.type === React.Fragment) {
177
177
  var props = element.props;
178
178
  return props.children;
179
179
  }
@@ -286,7 +286,7 @@ var Header = /*#__PURE__*/function (_React$Component) {
286
286
  var suffix = locale.year === '年' ? '年' : '';
287
287
  var options = [];
288
288
  for (var index = start; index < end; index++) {
289
- options.push( /*#__PURE__*/React.createElement(Option, {
289
+ options.push(/*#__PURE__*/React.createElement(Option, {
290
290
  key: "".concat(index)
291
291
  }, index + suffix));
292
292
  }
@@ -325,7 +325,7 @@ var Header = /*#__PURE__*/function (_React$Component) {
325
325
  }
326
326
  }
327
327
  for (var index = start; index < end; index++) {
328
- options.push( /*#__PURE__*/React.createElement(Option, {
328
+ options.push(/*#__PURE__*/React.createElement(Option, {
329
329
  key: "".concat(index)
330
330
  }, months[index]));
331
331
  }
@@ -371,7 +371,7 @@ var Cascader = /*#__PURE__*/function (_React$Component) {
371
371
  if (resultListMatchInputWidth && (state.inputValue || isNotFound) && _this.input) {
372
372
  dropdownMenuColumnStyle.width = _this.input.input.offsetWidth;
373
373
  }
374
- var inputIcon = suffixIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
374
+ var inputIcon = suffixIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
375
375
  className: classNames((_classNames4 = {}, _defineProperty(_classNames4, suffixIcon.props.className, suffixIcon.props.className), _defineProperty(_classNames4, "".concat(prefixCls, "-picker-arrow"), true), _classNames4))
376
376
  }) : /*#__PURE__*/React.createElement("span", {
377
377
  className: "".concat(prefixCls, "-picker-arrow")
@@ -18,7 +18,7 @@ export default function InputIcon(props) {
18
18
  var _classNames;
19
19
  var suffixIcon = props.suffixIcon,
20
20
  prefixCls = props.prefixCls;
21
- return suffixIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
21
+ return suffixIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
22
22
  className: classNames((_classNames = {}, _defineProperty(_classNames, suffixIcon.props.className, suffixIcon.props.className), _defineProperty(_classNames, "".concat(prefixCls, "-picker-icon"), true), _classNames))
23
23
  }) : /*#__PURE__*/React.createElement("span", {
24
24
  className: "".concat(prefixCls, "-picker-icon")
@@ -251,7 +251,7 @@ export default function createPicker(TheCalendar) {
251
251
  onClick: _this.clearSelection,
252
252
  theme: "filled"
253
253
  }) : null;
254
- var inputIcon = suffixIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
254
+ var inputIcon = suffixIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {
255
255
  className: classNames((_classNames2 = {}, _defineProperty(_classNames2, suffixIcon.props.className, suffixIcon.props.className), _defineProperty(_classNames2, "".concat(prefixCls, "-picker-icon"), true), _classNames2))
256
256
  }) : /*#__PURE__*/React.createElement("span", {
257
257
  className: "".concat(prefixCls, "-picker-icon")
@@ -288,7 +288,7 @@ var Descriptions = /*#__PURE__*/function (_React$Component) {
288
288
  var prefixCls = getPrefixCls('descriptions', customizePrefixCls);
289
289
  var column = _this3.getColumn();
290
290
  var cloneChildren = flattenChildren(children).map(function (child) {
291
- if ( /*#__PURE__*/React.isValidElement(child)) {
291
+ if (/*#__PURE__*/React.isValidElement(child)) {
292
292
  return /*#__PURE__*/React.cloneElement(child, {
293
293
  prefixCls: prefixCls
294
294
  });
@@ -247,9 +247,9 @@ var FormItem = /*#__PURE__*/function (_React$Component) {
247
247
  if (errors) {
248
248
  return intersperseSpace(errors.map(function (e, index) {
249
249
  var node = null;
250
- if ( /*#__PURE__*/React.isValidElement(e)) {
250
+ if (/*#__PURE__*/React.isValidElement(e)) {
251
251
  node = e;
252
- } else if ( /*#__PURE__*/React.isValidElement(e.message)) {
252
+ } else if (/*#__PURE__*/React.isValidElement(e.message)) {
253
253
  node = e.message;
254
254
  } // eslint-disable-next-line react/no-array-index-key
255
255
 
@@ -285,7 +285,7 @@ var List = /*#__PURE__*/function (_React$Component) {
285
285
  });
286
286
  var childrenList = [];
287
287
  React.Children.forEach(items, function (child, index) {
288
- childrenList.push( /*#__PURE__*/React.cloneElement(child, {
288
+ childrenList.push(/*#__PURE__*/React.cloneElement(child, {
289
289
  key: _this.keys[index]
290
290
  }));
291
291
  });
@@ -152,7 +152,7 @@ export default function confirm(config) {
152
152
  }
153
153
  }
154
154
  function render(props) {
155
- ReactDOM.render( /*#__PURE__*/React.createElement(ConfirmDialog, props), div);
155
+ ReactDOM.render(/*#__PURE__*/React.createElement(ConfirmDialog, props), div);
156
156
  }
157
157
  function close() {
158
158
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
@@ -193,20 +193,20 @@ var Select = /*#__PURE__*/function (_React$Component) {
193
193
  tags: mode === 'tags',
194
194
  combobox: _this.isCombobox()
195
195
  };
196
- var finalRemoveIcon = removeIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(removeIcon) ? /*#__PURE__*/React.cloneElement(removeIcon, {
196
+ var finalRemoveIcon = removeIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(removeIcon) ? /*#__PURE__*/React.cloneElement(removeIcon, {
197
197
  className: classNames(removeIcon.props.className, "".concat(prefixCls, "-remove-icon"))
198
198
  }) : removeIcon) || /*#__PURE__*/React.createElement(Icon, {
199
199
  type: "close",
200
200
  className: "".concat(prefixCls, "-remove-icon")
201
201
  });
202
- var finalClearIcon = clearIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(clearIcon) ? /*#__PURE__*/React.cloneElement(clearIcon, {
202
+ var finalClearIcon = clearIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(clearIcon) ? /*#__PURE__*/React.cloneElement(clearIcon, {
203
203
  className: classNames(clearIcon.props.className, "".concat(prefixCls, "-clear-icon"))
204
204
  }) : clearIcon) || /*#__PURE__*/React.createElement(Icon, {
205
205
  type: "close-circle",
206
206
  theme: "filled",
207
207
  className: "".concat(prefixCls, "-clear-icon")
208
208
  });
209
- var finalMenuItemSelectedIcon = menuItemSelectedIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) ? /*#__PURE__*/React.cloneElement(menuItemSelectedIcon, {
209
+ var finalMenuItemSelectedIcon = menuItemSelectedIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) ? /*#__PURE__*/React.cloneElement(menuItemSelectedIcon, {
210
210
  className: classNames(menuItemSelectedIcon.props.className, "".concat(prefixCls, "-selected-icon"))
211
211
  }) : menuItemSelectedIcon) || /*#__PURE__*/React.createElement(Icon, {
212
212
  type: "check",
@@ -148,12 +148,12 @@ function renderIndicator(prefixCls, props) {
148
148
  if (indicator === null) {
149
149
  return null;
150
150
  }
151
- if ( /*#__PURE__*/React.isValidElement(indicator)) {
151
+ if (/*#__PURE__*/React.isValidElement(indicator)) {
152
152
  return /*#__PURE__*/React.cloneElement(indicator, {
153
153
  className: classNames(indicator.props.className, dotClassName)
154
154
  });
155
155
  }
156
- if ( /*#__PURE__*/React.isValidElement(defaultIndicator)) {
156
+ if (/*#__PURE__*/React.isValidElement(defaultIndicator)) {
157
157
  return /*#__PURE__*/React.cloneElement(defaultIndicator, {
158
158
  className: classNames(defaultIndicator.props.className, dotClassName)
159
159
  });
@@ -208,7 +208,7 @@ var FilterMenu = /*#__PURE__*/function (_React$Component) {
208
208
  onClick: stopPropagation
209
209
  });
210
210
  }
211
- if ( /*#__PURE__*/React.isValidElement(filterIcon)) {
211
+ if (/*#__PURE__*/React.isValidElement(filterIcon)) {
212
212
  return /*#__PURE__*/React.cloneElement(filterIcon, {
213
213
  title: filterIcon.props.title || locale.filterTitle,
214
214
  className: classNames("".concat(prefixCls, "-icon"), dropdownIconClass, filterIcon.props.className),
@@ -210,7 +210,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
210
210
  return _this.removeTab(child.key, e);
211
211
  }
212
212
  }) : null;
213
- childrenWithClose.push( /*#__PURE__*/React.cloneElement(child, {
213
+ childrenWithClose.push(/*#__PURE__*/React.cloneElement(child, {
214
214
  tab: /*#__PURE__*/React.createElement("div", {
215
215
  className: closable ? undefined : "".concat(prefixCls, "-tab-unclosable")
216
216
  }, child.props.tab, closeIcon),
@@ -238,7 +238,7 @@ var Tooltip = /*#__PURE__*/function (_React$Component) {
238
238
  if (!('visible' in props) && _this.isNoTitle()) {
239
239
  visible = false;
240
240
  }
241
- var child = getDisabledCompatibleChildren( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(children) ? children : /*#__PURE__*/React.createElement("span", null, children));
241
+ var child = getDisabledCompatibleChildren(/*#__PURE__*/ /*#__PURE__*/React.isValidElement(children) ? children : /*#__PURE__*/React.createElement("span", null, children));
242
242
  var childProps = child.props;
243
243
  var childCls = classNames(childProps.className, _defineProperty({}, openClassName || "".concat(prefixCls, "-open"), true));
244
244
  return /*#__PURE__*/React.createElement(RcTooltip, _extends({}, _this.props, {
@@ -63,7 +63,7 @@ export default (function (originEle, rows, content, fixedContent, ellipsisStr) {
63
63
  ellipsisContainer.style.webkitLineClamp = 'none'; // Render in the fake container
64
64
 
65
65
  var contentList = mergeChildren(toArray(content));
66
- render( /*#__PURE__*/React.createElement("div", {
66
+ render(/*#__PURE__*/React.createElement("div", {
67
67
  style: wrapperStyle
68
68
  }, /*#__PURE__*/React.createElement("span", {
69
69
  style: wrapperStyle
@@ -33,7 +33,7 @@ var Group = function Group(props) {
33
33
  if (maxCount && maxCount < numOfChildren) {
34
34
  var childrenShow = childrenWithProps.slice(0, maxCount);
35
35
  var childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);
36
- childrenShow.push( /*#__PURE__*/React.createElement(Popover, {
36
+ childrenShow.push(/*#__PURE__*/React.createElement(Popover, {
37
37
  key: "avatar-popover-key",
38
38
  content: childrenHidden,
39
39
  trigger: maxPopoverTrigger,
@@ -53,7 +53,7 @@ var Password = /*#__PURE__*/React.forwardRef(function (props, ref) {
53
53
  // https://github.com/ant-design/ant-design/issues/23524
54
54
  e.preventDefault();
55
55
  }), _iconProps);
56
- return /*#__PURE__*/React.cloneElement( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement("span", null, icon), iconProps);
56
+ return /*#__PURE__*/React.cloneElement(/*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement("span", null, icon), iconProps);
57
57
  };
58
58
  var renderPassword = function renderPassword(_ref) {
59
59
  var getPrefixCls = _ref.getPrefixCls;
@@ -71,7 +71,7 @@ export default function confirm(config) {
71
71
  var rootPrefixCls = getPrefixCls(undefined, getRootPrefixCls());
72
72
  var prefixCls = customizePrefixCls || "".concat(rootPrefixCls, "-modal");
73
73
  var iconPrefixCls = getIconPrefixCls();
74
- ReactDOM.render( /*#__PURE__*/React.createElement(ConfirmDialog, _extends({}, props, {
74
+ ReactDOM.render(/*#__PURE__*/React.createElement(ConfirmDialog, _extends({}, props, {
75
75
  prefixCls: prefixCls,
76
76
  rootPrefixCls: rootPrefixCls,
77
77
  iconPrefixCls: iconPrefixCls,
@@ -5,7 +5,7 @@ import usePatchElement from '../../_util/hooks/usePatchElement';
5
5
  import HookModal from './HookModal';
6
6
  import { withConfirm, withInfo, withSuccess, withError, withWarn } from '../confirm';
7
7
  var uuid = 0;
8
- var ElementsHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_props, ref) {
8
+ var ElementsHolder = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function (_props, ref) {
9
9
  var _usePatchElement = usePatchElement(),
10
10
  _usePatchElement2 = _slicedToArray(_usePatchElement, 2),
11
11
  elements = _usePatchElement2[0],
@@ -125,7 +125,7 @@ var Popconfirm = /*#__PURE__*/React.forwardRef(function (props, ref) {
125
125
  }), cloneElement(children, {
126
126
  onKeyDown: function onKeyDown(e) {
127
127
  var _a, _b;
128
- if ( /*#__PURE__*/React.isValidElement(children)) {
128
+ if (/*#__PURE__*/React.isValidElement(children)) {
129
129
  (_b = children === null || children === void 0 ? void 0 : (_a = children.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
130
130
  }
131
131
  _onKeyDown(e);
@@ -16,7 +16,7 @@ var Steps = function Steps(props) {
16
16
  var stepWidth = size === 'small' ? 2 : 14;
17
17
  var styledSteps = [];
18
18
  for (var i = 0; i < steps; i += 1) {
19
- styledSteps.push( /*#__PURE__*/React.createElement("div", {
19
+ styledSteps.push(/*#__PURE__*/React.createElement("div", {
20
20
  key: i,
21
21
  className: classNames("".concat(prefixCls, "-steps-item"), _defineProperty({}, "".concat(prefixCls, "-steps-item-active"), i <= current - 1)),
22
22
  style: {
@@ -31,7 +31,7 @@ export default function getIcons(_ref) {
31
31
  if (suffixIcon !== undefined) {
32
32
  mergedSuffixIcon = getSuffixIconNode(suffixIcon);
33
33
  } else if (loading) {
34
- mergedSuffixIcon = getSuffixIconNode( /*#__PURE__*/React.createElement(LoadingOutlined, {
34
+ mergedSuffixIcon = getSuffixIconNode(/*#__PURE__*/React.createElement(LoadingOutlined, {
35
35
  spin: true
36
36
  }));
37
37
  } else {
@@ -40,11 +40,11 @@ export default function getIcons(_ref) {
40
40
  var open = _ref2.open,
41
41
  showSearch = _ref2.showSearch;
42
42
  if (open && showSearch) {
43
- return getSuffixIconNode( /*#__PURE__*/React.createElement(SearchOutlined, {
43
+ return getSuffixIconNode(/*#__PURE__*/React.createElement(SearchOutlined, {
44
44
  className: iconCls
45
45
  }));
46
46
  }
47
- return getSuffixIconNode( /*#__PURE__*/React.createElement(DownOutlined, {
47
+ return getSuffixIconNode(/*#__PURE__*/React.createElement(DownOutlined, {
48
48
  className: iconCls
49
49
  }));
50
50
  };
@@ -95,7 +95,7 @@ function Sider(_ref) {
95
95
  className: "cw-side-menu-box"
96
96
  }, /*#__PURE__*/React.createElement("div", {
97
97
  className: "cw-side-menu"
98
- }, siderMenu ? ( /*#__PURE__*/React.cloneElement(siderMenu, {
98
+ }, siderMenu ? (/*#__PURE__*/React.cloneElement(siderMenu, {
99
99
  collapsed: collapsed
100
100
  }) // 自定义传入的Menu注入collapsed属性
101
101
  ) : /*#__PURE__*/React.createElement(_SiderMenu, _extends({
@@ -223,7 +223,7 @@ var BasicLayout = function BasicLayout(_ref) {
223
223
  var children = _ref3.children,
224
224
  dom = _ref3.dom,
225
225
  props = _ref3.props;
226
- setCloneFooter( /*#__PURE__*/React.createElement("div", _extends({
226
+ setCloneFooter(/*#__PURE__*/React.createElement("div", _extends({
227
227
  className: "".concat(prefixCls, "-cw-layout-bottom-footer")
228
228
  }, props), children));
229
229
 
@@ -114,7 +114,7 @@ export default function Column(_ref) {
114
114
  });
115
115
  }, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
116
116
  var onChange = /*#__PURE__*/function () {
117
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
117
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
118
118
  return _regeneratorRuntime().wrap(function _callee$(_context) {
119
119
  while (1) switch (_context.prev = _context.next) {
120
120
  case 0:
@@ -143,8 +143,8 @@ export default function Column(_ref) {
143
143
  style: {
144
144
  flex: 1
145
145
  },
146
- onScroll: ( /*#__PURE__*/function () {
147
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
146
+ onScroll: (/*#__PURE__*/function () {
147
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
148
148
  var isScrollBottom;
149
149
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
150
150
  while (1) switch (_context2.prev = _context2.next) {
@@ -11,10 +11,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
11
11
  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); }
12
12
  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); }); }; }
13
13
  import React from "react";
14
- import moment from "moment";
14
+ // import moment from "moment";
15
+
15
16
  import { readInnerMessageApi } from "../../service";
16
17
  import langConfig from "../../locale";
17
- import { formatMessage } from "../../../utils";
18
+ import { formatMessage, setMomentByTimeZone, getFormatByLocalStorage } from "../../../utils";
18
19
  import "./index.less";
19
20
  var TabList = function TabList(props) {
20
21
  var _props$messages = props.messages,
@@ -58,7 +59,7 @@ var TabList = function TabList(props) {
58
59
  }
59
60
  };
60
61
  var readInnerMessage = /*#__PURE__*/function () {
61
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
62
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
62
63
  var resRequestApi, res, _params;
63
64
  return _regeneratorRuntime().wrap(function _callee$(_context) {
64
65
  while (1) switch (_context.prev = _context.next) {
@@ -107,7 +108,7 @@ var TabList = function TabList(props) {
107
108
  className: "cw-message-content-tabs-list-desc"
108
109
  }, (_message$summary = message.summary) !== null && _message$summary !== void 0 ? _message$summary : ""), /*#__PURE__*/React.createElement("div", {
109
110
  className: "cw-message-content-tabs-list-date"
110
- }, message.time ? moment(Number(message.time)).format("YYYY/MM/DD HH:mm:ss") : ""));
111
+ }, message.time ? setMomentByTimeZone(Number(message.time)).format(getFormatByLocalStorage("YYYY/MM/DD HH:mm:ss")) : ""));
111
112
  });
112
113
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
113
114
  className: "cw-message-content-all-read",
@@ -84,7 +84,7 @@ var MessageContent = function MessageContent(props) {
84
84
  _getMessageListApi = requestOption.getMessageListApi,
85
85
  _getMessageUnreadCountApi = requestOption.getMessageUnreadCountApi;
86
86
  useEffect(function () {
87
- _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
87
+ _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
88
88
  var resRequestApi, res, _data$, data, params;
89
89
  return _regeneratorRuntime().wrap(function _callee$(_context) {
90
90
  while (1) switch (_context.prev = _context.next) {
@@ -116,7 +116,7 @@ var MessageContent = function MessageContent(props) {
116
116
  locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
117
117
  // 查询消息列表(接口)
118
118
  var getMessageList = /*#__PURE__*/function () {
119
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
119
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
120
120
  var resRequestApi, res, _res$data, _total, _res$data$records, records;
121
121
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
122
122
  while (1) switch (_context2.prev = _context2.next) {
@@ -146,7 +146,7 @@ var MessageContent = function MessageContent(props) {
146
146
  }();
147
147
  // 查询所有类型的未读消息数(接口)
148
148
  var getMessageUnreadCount = /*#__PURE__*/function () {
149
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
149
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
150
150
  var resRequestApi, res, _res$data$byType, byType, _unreadTypeArr;
151
151
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
152
152
  while (1) switch (_context3.prev = _context3.next) {
@@ -161,7 +161,7 @@ function Message(props) {
161
161
  setVisible(true);
162
162
  };
163
163
  var openNotification = /*#__PURE__*/function () {
164
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(time, id) {
164
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(time, id) {
165
165
  var params, resRequestApi, res, data, _ref2, userMessageId, title, summary;
166
166
  return _regeneratorRuntime().wrap(function _callee$(_context) {
167
167
  while (1) switch (_context.prev = _context.next) {
@@ -207,7 +207,7 @@ function Message(props) {
207
207
  };
208
208
  }();
209
209
  var readInnerMessage = /*#__PURE__*/function () {
210
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
210
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
211
211
  var resRequestApi;
212
212
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
213
213
  while (1) switch (_context2.prev = _context2.next) {
@@ -253,7 +253,7 @@ function Message(props) {
253
253
  }
254
254
  };
255
255
  var connectSocket = /*#__PURE__*/function () {
256
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
256
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
257
257
  var resRequestApi, res, finalOrigin, socket;
258
258
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
259
259
  while (1) switch (_context3.prev = _context3.next) {
@@ -296,7 +296,7 @@ function Message(props) {
296
296
  };
297
297
  }();
298
298
  var getMessageQuerySettings = /*#__PURE__*/function () {
299
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
299
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
300
300
  var resRequestApi, res, data;
301
301
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
302
302
  while (1) switch (_context4.prev = _context4.next) {
@@ -99,7 +99,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
99
99
  var isChecked = labelInValue ? activeKey.map(function (item) {
100
100
  return item.value;
101
101
  }).includes(child.props.value) : activeKey.includes(child.props.value);
102
- newChildren.push( /*#__PURE__*/React.cloneElement(child, {}, /*#__PURE__*/React.createElement("div", {
102
+ newChildren.push(/*#__PURE__*/React.cloneElement(child, {}, /*#__PURE__*/React.createElement("div", {
103
103
  key: child.key,
104
104
  className: 'cw-select-checkbox-item'
105
105
  }, /*#__PURE__*/React.createElement(_Checkbox, {
@@ -114,7 +114,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
114
114
  var isChecked = labelInValue ? activeKey.map(function (item) {
115
115
  return item.value;
116
116
  }).includes(optGroupChild.props.value) : activeKey.includes(optGroupChild.props.value);
117
- _newChildren.push( /*#__PURE__*/React.cloneElement(optGroupChild, {}, /*#__PURE__*/React.createElement("div", {
117
+ _newChildren.push(/*#__PURE__*/React.cloneElement(optGroupChild, {}, /*#__PURE__*/React.createElement("div", {
118
118
  key: optGroupChild.key,
119
119
  className: 'cw-select-checkbox-item'
120
120
  }, /*#__PURE__*/React.createElement(_Checkbox, {
@@ -124,7 +124,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
124
124
  className: "cw-select-item-children"
125
125
  }, optGroupChild.props.children))));
126
126
  });
127
- newChildren.push( /*#__PURE__*/React.cloneElement(child, {}, _newChildren));
127
+ newChildren.push(/*#__PURE__*/React.cloneElement(child, {}, _newChildren));
128
128
  }
129
129
  });
130
130
  finalChildren = newChildren;
@@ -700,8 +700,8 @@ var CWTable = function CWTable(_ref, ref) {
700
700
  var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
701
701
  oldValue = _ref4.oldValue,
702
702
  cb = _ref4.cb;
703
- tableForm.current.validateFields( /*#__PURE__*/function () {
704
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(error, values) {
703
+ tableForm.current.validateFields(/*#__PURE__*/function () {
704
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(error, values) {
705
705
  var oldValue_, isOk;
706
706
  return _regeneratorRuntime().wrap(function _callee$(_context) {
707
707
  while (1) switch (_context.prev = _context.next) {
@@ -839,4 +839,4 @@ var CWTable = function CWTable(_ref, ref) {
839
839
  ref: paginationContainerRef
840
840
  }, /*#__PURE__*/React.createElement(_Pagination, getPaginationOption())));
841
841
  };
842
- export default _configHoc( /*#__PURE__*/forwardRef(CWTable));
842
+ export default _configHoc(/*#__PURE__*/forwardRef(CWTable));
@@ -144,7 +144,7 @@ var EditableRowCell = function EditableRowCell(props) {
144
144
  }, getFieldDecorator(column.dataIndex, {
145
145
  rules: rules || [],
146
146
  initialValue: record[column.dataIndex]
147
- })( /*#__PURE__*/React.createElement(CustomComponent, inputProps)));
147
+ })(/*#__PURE__*/React.createElement(CustomComponent, inputProps)));
148
148
  if (editMode === 'line' && editingKey === CWRecordKey) {
149
149
  return editingCell;
150
150
  }
@@ -57,7 +57,7 @@ var Dragger = /*#__PURE__*/React.forwardRef(function (props, ref) {
57
57
  height: height
58
58
  }),
59
59
  ref: ref
60
- }), children ? children : ( /*#__PURE__*/React.createElement(DefaultChildren, {
60
+ }), children ? children : (/*#__PURE__*/React.createElement(DefaultChildren, {
61
61
  description: description,
62
62
  title: title
63
63
  })));
@@ -355,7 +355,7 @@ var Upload = /*#__PURE__*/function (_React$Component) {
355
355
  if (!children || disabled) {
356
356
  delete rcUploadProps.id;
357
357
  }
358
- var uploadList = showUploadList ? ( /*#__PURE__*/React.createElement(LocaleReceiver, {
358
+ var uploadList = showUploadList ? (/*#__PURE__*/React.createElement(LocaleReceiver, {
359
359
  componentName: "Upload",
360
360
  defaultLocale: defaultLocale.Upload
361
361
  }, _this.renderUploadList)) : null;
@@ -115,11 +115,11 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
115
115
  theme: "twoTone"
116
116
  });
117
117
  } else {
118
- var thumbnail = isImageUrl(file) ? ( /*#__PURE__*/React.createElement("img", {
118
+ var thumbnail = isImageUrl(file) ? (/*#__PURE__*/React.createElement("img", {
119
119
  src: file.thumbUrl || file.url,
120
120
  alt: file.name,
121
121
  className: "".concat(prefixCls, "-list-item-image")
122
- })) : ( /*#__PURE__*/React.createElement(_Icon, {
122
+ })) : (/*#__PURE__*/React.createElement(_Icon, {
123
123
  type: "file",
124
124
  className: "".concat(prefixCls, "-list-item-icon"),
125
125
  theme: "twoTone"
@@ -139,7 +139,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
139
139
  // show loading icon if upload progress listener is disabled
140
140
  var _renderMethod = _this.props.renderMethod;
141
141
  var infoClass = classNames(_defineProperty({}, "".concat(prefixCls, "-list-item-").concat(_renderMethod ? "drag" : "progress"), true));
142
- var loadingProgress = "percent" in file ? ( /*#__PURE__*/React.createElement(_Progress, Object.assign({
142
+ var loadingProgress = "percent" in file ? (/*#__PURE__*/React.createElement(_Progress, Object.assign({
143
143
  type: "line"
144
144
  }, progressAttr, {
145
145
  percent: file.percent,
@@ -152,32 +152,32 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
152
152
  }
153
153
  var infoUploadingClass = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-list-item"), true), "".concat(prefixCls, "-list-item-").concat(file.status), true), "".concat(prefixCls, "-list-item-list-type-").concat(listType), true));
154
154
  var linkProps = typeof file.linkProps === "string" ? JSON.parse(file.linkProps) : file.linkProps;
155
- var removeIcon = showRemoveIcon ? ( /*#__PURE__*/React.createElement(_Icon, {
155
+ var removeIcon = showRemoveIcon ? (/*#__PURE__*/React.createElement(_Icon, {
156
156
  type: "delete",
157
157
  title: locale.removeFile,
158
158
  onClick: function onClick() {
159
159
  return _this.handleClose(file);
160
160
  }
161
161
  })) : null;
162
- var downloadIcon = showDownloadIcon && file.status === "done" ? ( /*#__PURE__*/React.createElement(_Icon, {
162
+ var downloadIcon = showDownloadIcon && file.status === "done" ? (/*#__PURE__*/React.createElement(_Icon, {
163
163
  type: "download",
164
164
  title: locale.downloadFile,
165
165
  onClick: function onClick() {
166
166
  return _this.handleDownload(file);
167
167
  }
168
168
  })) : null;
169
- var downloadOrDelete = listType !== "picture-card" && ( /*#__PURE__*/React.createElement("span", {
169
+ var downloadOrDelete = listType !== "picture-card" && (/*#__PURE__*/React.createElement("span", {
170
170
  key: "download-delete",
171
171
  className: "".concat(prefixCls, "-list-item-card-actions ").concat(listType === "picture" ? "picture" : "")
172
172
  }, downloadIcon && /*#__PURE__*/React.createElement("a", {
173
173
  title: locale.downloadFile
174
- }, downloadIcon), file.status === "error" && ( /*#__PURE__*/React.createElement("a", {
174
+ }, downloadIcon), file.status === "error" && (/*#__PURE__*/React.createElement("a", {
175
175
  onClick: function onClick() {
176
176
  _this.props.reUpload(file);
177
177
  }
178
178
  }, /*#__PURE__*/React.createElement(_Icon, {
179
179
  type: "reload"
180
- }))), removeIcon && ( /*#__PURE__*/React.createElement("a", {
180
+ }))), removeIcon && (/*#__PURE__*/React.createElement("a", {
181
181
  title: locale.removeFile,
182
182
  className: "".concat(prefixCls, "-list-item-card-actions-delete ")
183
183
  }, removeIcon))));
@@ -207,7 +207,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
207
207
  pointerEvents: "none",
208
208
  opacity: 0.5
209
209
  };
210
- var previewIcon = showPreviewIcon ? ( /*#__PURE__*/React.createElement("a", {
210
+ var previewIcon = showPreviewIcon ? (/*#__PURE__*/React.createElement("a", {
211
211
  href: file.url || file.thumbUrl,
212
212
  target: "_blank",
213
213
  rel: "noopener noreferrer",
@@ -219,9 +219,9 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
219
219
  }, /*#__PURE__*/React.createElement(_Icon, {
220
220
  type: "eye-o"
221
221
  }))) : null;
222
- var actions = listType === "picture-card" && file.status !== "uploading" && ( /*#__PURE__*/React.createElement("span", {
222
+ var actions = listType === "picture-card" && file.status !== "uploading" && (/*#__PURE__*/React.createElement("span", {
223
223
  className: "".concat(prefixCls, "-list-item-actions")
224
- }, previewIcon, file.status === "done" && downloadIcon, file.status === "error" && ( /*#__PURE__*/React.createElement("a", {
224
+ }, previewIcon, file.status === "done" && downloadIcon, file.status === "error" && (/*#__PURE__*/React.createElement("a", {
225
225
  onClick: function onClick() {
226
226
  _this.props.reUpload(file);
227
227
  }
@@ -243,7 +243,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
243
243
  className: classNames("cw-upload-drag-wrapper", {
244
244
  "cw-upload-drag-wrapper-custom": (errorMessage || successMessage) && !isCustomErrorMessage
245
245
  })
246
- }, file.status === "error" && isCustomErrorMessage && ( /*#__PURE__*/React.createElement("div", {
246
+ }, file.status === "error" && isCustomErrorMessage && (/*#__PURE__*/React.createElement("div", {
247
247
  className: classNames("cw-upload-drag-custom-box-wrapper", {
248
248
  "cw-upload-drag-custom-box-wrapper-disabled": disabled
249
249
  })
@@ -277,7 +277,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
277
277
  onDownloadExceptionReport(file);
278
278
  }
279
279
  }
280
- }, operateTitle.downloadExceptionReportTitle)))), file.status === "error" && errorMessage && !isCustomErrorMessage, file.status === "error" && !errorMessage && !isCustomErrorMessage && ( /*#__PURE__*/React.createElement("div", {
280
+ }, operateTitle.downloadExceptionReportTitle)))), file.status === "error" && errorMessage && !isCustomErrorMessage, file.status === "error" && !errorMessage && !isCustomErrorMessage && (/*#__PURE__*/React.createElement("div", {
281
281
  className: "".concat(prefixCls, "-one-drag-uploading")
282
282
  }, /*#__PURE__*/React.createElement("div", {
283
283
  className: "".concat(prefixCls, "-one-drag-icon-wrapper")
@@ -285,7 +285,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
285
285
  type: "reload"
286
286
  })), /*#__PURE__*/React.createElement("div", {
287
287
  className: "".concat(prefixCls, "-one-drag-error")
288
- }, formatMessage(localeObj["reUpload"])))), file.status === "done" && successMessage, (file.status === "done" && !successMessage || file.status == "removed" || !file.status) && ( /*#__PURE__*/React.createElement("div", {
288
+ }, formatMessage(localeObj["reUpload"])))), file.status === "done" && successMessage, (file.status === "done" && !successMessage || file.status == "removed" || !file.status) && (/*#__PURE__*/React.createElement("div", {
289
289
  className: "".concat(prefixCls, "-one-drag-uploading")
290
290
  }, /*#__PURE__*/React.createElement("div", {
291
291
  className: listItemNameClass,
@@ -343,7 +343,7 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
343
343
  fontSize: "16px",
344
344
  marginRight: "4px"
345
345
  }
346
- }), formatMessage(localeObj["delete"]))))), file.status === "uploading" && ( /*#__PURE__*/React.createElement("div", {
346
+ }), formatMessage(localeObj["delete"]))))), file.status === "uploading" && (/*#__PURE__*/React.createElement("div", {
347
347
  className: "".concat(prefixCls, "-one-drag-uploading"),
348
348
  style: {
349
349
  height: "76px",
@@ -375,9 +375,9 @@ var IUploadList = /*#__PURE__*/function (_React$Component) {
375
375
  return /*#__PURE__*/React.createElement("div", {
376
376
  key: file.uid,
377
377
  className: listContainerNameClass
378
- }, file.status === "error" ? renderMethod ? ( /*#__PURE__*/React.createElement("div", null, dragDom)) : ( /*#__PURE__*/React.createElement(_Tooltip, {
378
+ }, file.status === "error" ? renderMethod ? (/*#__PURE__*/React.createElement("div", null, dragDom)) : (/*#__PURE__*/React.createElement(_Tooltip, {
379
379
  title: message
380
- }, dom)) : ( /*#__PURE__*/React.createElement("span", null, renderMethod ? dragDom : dom)));
380
+ }, dom)) : (/*#__PURE__*/React.createElement("span", null, renderMethod ? dragDom : dom)));
381
381
  });
382
382
  var listClassNames = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-list"), true), "".concat(prefixCls, "-list-").concat(listType), true), "".concat(prefixCls, "-list-").concat(_this.props.type), true));
383
383
  var animationDirection = listType === "picture-card" ? "animate-inline" : "animate";
@@ -96,7 +96,7 @@ function flushNotice() {
96
96
  notification = newNotification;
97
97
  // Delay render to avoid sync issue
98
98
  act(function () {
99
- render( /*#__PURE__*/React.createElement(GlobalHolderWrapper, {
99
+ render(/*#__PURE__*/React.createElement(GlobalHolderWrapper, {
100
100
  ref: function ref(node) {
101
101
  var _ref = node || {},
102
102
  instance = _ref.instance,
@@ -8,7 +8,6 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  import React from 'react';
11
- import moment from 'moment';
12
11
  export default function ExtraTimeFooter(_ref) {
13
12
  var startTimeValue = _ref.startTimeValue,
14
13
  endTimeValue = _ref.endTimeValue,
@@ -1,6 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  import "@chaoswise/ui/lib/AbreastLayout/index.less";
3
3
  import _AbreastLayout from "@chaoswise/ui/lib/AbreastLayout";
4
+ var _excluded = ["md", "style", "className", "siderWidth"];
5
+ 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); }
4
6
  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; }
5
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -12,6 +14,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
12
14
  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; }
13
15
  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; } }
14
16
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
17
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
18
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
15
19
  import React, { useRef, useEffect, useState } from 'react';
16
20
  import { marked } from 'marked';
17
21
  import PropTypes from 'prop-types';
@@ -30,7 +34,8 @@ var Documentation = function Documentation(_ref) {
30
34
  _ref$className = _ref.className,
31
35
  className = _ref$className === void 0 ? '' : _ref$className,
32
36
  _ref$siderWidth = _ref.siderWidth,
33
- siderWidth = _ref$siderWidth === void 0 ? 184 : _ref$siderWidth;
37
+ siderWidth = _ref$siderWidth === void 0 ? 184 : _ref$siderWidth,
38
+ rest = _objectWithoutProperties(_ref, _excluded);
34
39
  var markdownContainer = useRef(null);
35
40
  var timer = useRef(null);
36
41
  var tocify = useRef(null);
@@ -108,13 +113,15 @@ var Documentation = function Documentation(_ref) {
108
113
  width: '100%',
109
114
  height: '100%'
110
115
  }, style)
111
- }, /*#__PURE__*/React.createElement(_AbreastLayout, {
116
+ }, /*#__PURE__*/React.createElement(_AbreastLayout, _extends({
112
117
  SiderWidth: items.length ? siderWidth : 0,
113
118
  Siderbar: /*#__PURE__*/React.createElement("div", {
114
- className: "cw-documentation-sider"
119
+ className: classNames("cw-documentation-sider", {
120
+ "cw-documentation-nosider": siderWidth === 0
121
+ })
115
122
  }, tocify.current && tocify.current.render(items, markdownContainer.current, scrollToAnchor)),
116
123
  type: "rightOperationArea"
117
- }, /*#__PURE__*/React.createElement("div", {
124
+ }, rest), /*#__PURE__*/React.createElement("div", {
118
125
  ref: markdownContainer,
119
126
  className: "cw-documentation-container"
120
127
  })));
@@ -4,6 +4,10 @@
4
4
  height: 100%;
5
5
  overflow: auto;
6
6
  padding-left: 4px;
7
+ &.cw-documentation-nosider{
8
+ display: none;
9
+ padding-left: 0;
10
+ }
7
11
  }
8
12
  .cw-abreast-layout-content{
9
13
  overflow: hidden;
@@ -142,7 +142,7 @@ function FilterDropDown(props) {
142
142
  filterOptions.forEach(function (option, index) {
143
143
  if (option instanceof Object) {
144
144
  if (isDrag) {
145
- checkOptions.push( /*#__PURE__*/React.createElement(DragList, {
145
+ checkOptions.push(/*#__PURE__*/React.createElement(DragList, {
146
146
  key: option.id,
147
147
  option: option,
148
148
  index: index,
@@ -151,7 +151,7 @@ function FilterDropDown(props) {
151
151
  isHoverSwitching: isHoverSwitching
152
152
  }));
153
153
  } else {
154
- checkOptions.push( /*#__PURE__*/React.createElement("div", {
154
+ checkOptions.push(/*#__PURE__*/React.createElement("div", {
155
155
  className: "cw-dropdown-nodrag",
156
156
  key: option.id
157
157
  }, /*#__PURE__*/React.createElement(_Checkbox, {
@@ -46,7 +46,7 @@ export var Password = connect({
46
46
  className: className
47
47
  }, /*#__PURE__*/React.createElement(InputPassword, __assign({}, others, {
48
48
  value: value
49
- })), checkStrength && ( /*#__PURE__*/React.createElement(PasswordStrength, {
49
+ })), checkStrength && (/*#__PURE__*/React.createElement(PasswordStrength, {
50
50
  value: String(value)
51
51
  }, function (score) {
52
52
  return /*#__PURE__*/React.createElement("div", {
@@ -35,7 +35,7 @@ export var getModule = function getModule(remoteModule) {
35
35
  } else {
36
36
  window.remoteModuleDictionary[id] = new Promise(function (resolve, reject) {
37
37
  var asyncFunc = /*#__PURE__*/function () {
38
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
38
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
39
39
  var _module;
40
40
  return _regeneratorRuntime().wrap(function _callee$(_context) {
41
41
  while (1) switch (_context.prev = _context.next) {
@@ -133,8 +133,8 @@ export var RemoteComponent = function RemoteComponent(props) {
133
133
 
134
134
  // 通过mount函数注入组件所需属性
135
135
 
136
- var getMountedProps = useCallback( /*#__PURE__*/function () {
137
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(Component) {
136
+ var getMountedProps = useCallback(/*#__PURE__*/function () {
137
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(Component) {
138
138
  var _props;
139
139
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
140
140
  while (1) switch (_context2.prev = _context2.next) {
@@ -4,7 +4,7 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
4
4
  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); }); }; }
5
5
  // 加载指定组件
6
6
  export var loadModule = function loadModule(url, scope, module) {
7
- return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7
+ return /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8
8
  var container, factory, Module, error;
9
9
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10
10
  while (1) switch (_context.prev = _context.next) {
@@ -24,12 +24,12 @@ var DropdownMenu = function DropdownMenu(props) {
24
24
  // 外侧传的列表数据
25
25
  var outList = [];
26
26
  if (Array.isArray(list) && list.length) {
27
- outList.push( /*#__PURE__*/React.createElement(_Menu.Divider, null));
27
+ outList.push(/*#__PURE__*/React.createElement(_Menu.Divider, null));
28
28
  list.forEach(function (item, index) {
29
29
  var onSelect = function onSelect() {
30
30
  return props.onSelect(item.value);
31
31
  };
32
- outList.push( /*#__PURE__*/React.createElement(_Menu.Item, {
32
+ outList.push(/*#__PURE__*/React.createElement(_Menu.Item, {
33
33
  className: "".concat(itemClassName, " ").concat(selectIndex === index ? "".concat(itemClassName, "-hight") : ''),
34
34
  onMouseDown: onSelect
35
35
  }, item.label || typeof item.render === 'function' && item.render({
@@ -193,20 +193,20 @@ var Select = /*#__PURE__*/function (_React$Component) {
193
193
  // tags: mode === 'tags',
194
194
  // combobox: _this.isCombobox()
195
195
  };
196
- var finalRemoveIcon = removeIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(removeIcon) ? /*#__PURE__*/React.cloneElement(removeIcon, {
196
+ var finalRemoveIcon = removeIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(removeIcon) ? /*#__PURE__*/React.cloneElement(removeIcon, {
197
197
  className: classNames(removeIcon.props.className, "".concat(prefixCls, "-remove-icon"))
198
198
  }) : removeIcon) || /*#__PURE__*/React.createElement(Icon, {
199
199
  type: "close",
200
200
  className: "".concat(prefixCls, "-remove-icon")
201
201
  });
202
- var finalClearIcon = clearIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(clearIcon) ? /*#__PURE__*/React.cloneElement(clearIcon, {
202
+ var finalClearIcon = clearIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(clearIcon) ? /*#__PURE__*/React.cloneElement(clearIcon, {
203
203
  className: classNames(clearIcon.props.className, "".concat(prefixCls, "-clear-icon"))
204
204
  }) : clearIcon) || /*#__PURE__*/React.createElement(Icon, {
205
205
  type: "close-circle",
206
206
  theme: "filled",
207
207
  className: "".concat(prefixCls, "-clear-icon")
208
208
  });
209
- var finalMenuItemSelectedIcon = menuItemSelectedIcon && ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) ? /*#__PURE__*/React.cloneElement(menuItemSelectedIcon, {
209
+ var finalMenuItemSelectedIcon = menuItemSelectedIcon && (/*#__PURE__*/ /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) ? /*#__PURE__*/React.cloneElement(menuItemSelectedIcon, {
210
210
  className: classNames(menuItemSelectedIcon.props.className, "".concat(prefixCls, "-selected-icon"))
211
211
  }) : menuItemSelectedIcon) || /*#__PURE__*/React.createElement(Icon, {
212
212
  type: "check",
@@ -64,7 +64,7 @@ var SingleSpa = function SingleSpa(_ref) {
64
64
  return;
65
65
  }
66
66
  // 注册微应用
67
- registerApplication(project.id, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
67
+ registerApplication(project.id, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
68
68
  var indexInfo, style, script, _res;
69
69
  return _regeneratorRuntime().wrap(function _callee$(_context) {
70
70
  while (1) switch (_context.prev = _context.next) {
@@ -0,0 +1,122 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ import "@chaoswise/ui/lib/CWSelect/index.less";
3
+ import _CWSelect from "@chaoswise/ui/lib/CWSelect";
4
+ var _excluded = ["getSystemTimeZoneInfoApi", "onInitialChange", "getOptions"],
5
+ _excluded2 = ["isSelected"];
6
+ 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); }
7
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
8
+ 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); }
9
+ 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); }); }; }
10
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
11
+ 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."); }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ 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; }
14
+ 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; } }
15
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
16
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
18
+ // TimeZoneSelect.js
19
+ import React, { useState, useEffect } from "react";
20
+ import PropTypes from "prop-types";
21
+ var Option = _CWSelect.Option;
22
+ var TimeZoneSelect = function TimeZoneSelect(_ref) {
23
+ var getSystemTimeZoneInfoApi = _ref.getSystemTimeZoneInfoApi,
24
+ onInitialChange = _ref.onInitialChange,
25
+ getOptions = _ref.getOptions,
26
+ rest = _objectWithoutProperties(_ref, _excluded);
27
+ var _useState = useState([]),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ timeZones = _useState2[0],
30
+ setTimeZones = _useState2[1];
31
+ var _useState3 = useState(false),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ loading = _useState4[0],
34
+ setLoading = _useState4[1];
35
+ useEffect(function () {
36
+ // 组件初始化时调用接口获取时区列表
37
+ var fetchTimeZones = /*#__PURE__*/function () {
38
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
39
+ var response, data, timeZoneData, _timeZoneData, initialTimeZone;
40
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
41
+ while (1) switch (_context.prev = _context.next) {
42
+ case 0:
43
+ setLoading(true);
44
+ _context.prev = 1;
45
+ _context.next = 4;
46
+ return getSystemTimeZoneInfoApi();
47
+ case 4:
48
+ response = _context.sent;
49
+ if (response.status === "success" && response.code == 100000) {
50
+ data = response.data;
51
+ timeZoneData = (data || []).map(function (item) {
52
+ return {
53
+ countryCity: item.countryCity,
54
+ countryCityCode: item.countryCityCode,
55
+ timeZone: item.timeZone,
56
+ label: "(".concat(item.timeZone, ") ").concat(item.countryCity),
57
+ isSelected: item.isSelected
58
+ };
59
+ });
60
+ _timeZoneData = timeZoneData.map(function (item) {
61
+ var isSelected = item.isSelected,
62
+ restTimeZoneData = _objectWithoutProperties(item, _excluded2);
63
+ return restTimeZoneData;
64
+ });
65
+ setTimeZones(_timeZoneData);
66
+
67
+ // 获取初始的时区值并传递给 onInitialChange
68
+ initialTimeZone = timeZoneData.find(function (item) {
69
+ return item.isSelected;
70
+ });
71
+ onInitialChange && onInitialChange(initialTimeZone ? initialTimeZone.countryCityCode : undefined);
72
+
73
+ // 提供选项数据给外部使用
74
+ if (getOptions) {
75
+ getOptions(_timeZoneData);
76
+ }
77
+ }
78
+ _context.next = 11;
79
+ break;
80
+ case 8:
81
+ _context.prev = 8;
82
+ _context.t0 = _context["catch"](1);
83
+ console.error("获取时区列表失败:", _context.t0);
84
+ case 11:
85
+ _context.prev = 11;
86
+ setLoading(false);
87
+ return _context.finish(11);
88
+ case 14:
89
+ case "end":
90
+ return _context.stop();
91
+ }
92
+ }, _callee, null, [[1, 8, 11, 14]]);
93
+ }));
94
+ return function fetchTimeZones() {
95
+ return _ref2.apply(this, arguments);
96
+ };
97
+ }();
98
+ fetchTimeZones();
99
+ }, []);
100
+ return /*#__PURE__*/React.createElement(_CWSelect, _extends({
101
+ loading: loading
102
+ }, rest), timeZones.map(function (tz) {
103
+ return /*#__PURE__*/React.createElement(Option, {
104
+ key: tz.countryCityCode,
105
+ value: tz.countryCityCode
106
+ }, tz.label);
107
+ }));
108
+ };
109
+
110
+ // 为 props 添加类型检查
111
+ TimeZoneSelect.propTypes = {
112
+ getSystemTimeZoneInfoApi: PropTypes.func.isRequired,
113
+ // 获取时区列表的接口方法
114
+ value: PropTypes.string,
115
+ // 当前选择的时区值
116
+ onChange: PropTypes.func,
117
+ // 时区改变回调函数
118
+ onInitialChange: PropTypes.func,
119
+ // 接口初始值回调
120
+ getOptions: PropTypes.func // 获取选项数据
121
+ };
122
+ export default TimeZoneSelect;
@@ -21,7 +21,7 @@ import { uniq } from "lodash-es";
21
21
  var _getTreeData = function getTreeData(children) {
22
22
  var treeData = [];
23
23
  React.Children.map(children, function (child) {
24
- if ( /*#__PURE__*/React.isValidElement(child)) {
24
+ if (/*#__PURE__*/React.isValidElement(child)) {
25
25
  var key = child.key,
26
26
  props = child.props;
27
27
  var treeObj = {};
@@ -224,7 +224,7 @@ var Watermark = function Watermark(props) {
224
224
  };
225
225
  }, []);
226
226
  // ============================= Render =============================
227
- var childNode = inherit ? ( /*#__PURE__*/React.createElement(WatermarkContext.Provider, {
227
+ var childNode = inherit ? (/*#__PURE__*/React.createElement(WatermarkContext.Provider, {
228
228
  value: watermarkContext
229
229
  }, children)) : children;
230
230
  return /*#__PURE__*/React.createElement("div", {
@@ -1,3 +1,4 @@
1
+ import moment from 'moment-timezone';
1
2
  /**
2
3
  * 复制组件其它属性到目标组件
3
4
  */
@@ -86,4 +87,35 @@ export var formatMessage = function formatMessage(message) {
86
87
  } else {
87
88
  return "未找到对应的翻译信息";
88
89
  }
90
+ };
91
+
92
+ /**
93
+ * 根据特定时区将时间戳转换为固定时间偏移量的时间对象
94
+ * @param {*} time 时间参数 作为moment的值
95
+ * @param {*} countryCityCode 自定义时区 需要转化的时区值
96
+ * @returns {moment.Moment} 返回的moment对象
97
+ */
98
+ export var setMomentByTimeZone = function setMomentByTimeZone(time, countryCityCode) {
99
+ // 从localStorage获取时区信息
100
+ var timeZoneData = JSON.parse(localStorage.getItem('cw_timeZone'));
101
+
102
+ // 如果 localStorage 中找不到时区信息,则使用 moment.tz.guess() 自动推测本地时区
103
+ var timezone = timeZoneData ? timeZoneData.countryCityCode : moment.tz.guess();
104
+ var _timezone = countryCityCode ? countryCityCode : timezone;
105
+ // (如时间戳或moment对象)
106
+ return moment.tz(time, _timezone); // 直接使用时区创建moment对象
107
+ };
108
+
109
+ /**
110
+ * 从localStorage获取format信息,直接获取字符串
111
+ * @param {*} format 默认的format配置
112
+ * @returns {format} 返回format信息
113
+ */
114
+ export var getFormatByLocalStorage = function getFormatByLocalStorage() {
115
+ var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "YYYY-MM-DD HH:mm:ss";
116
+ // 从localStorage获取format信息,直接获取字符串
117
+ var formatData = localStorage.getItem('cw_timeFormat');
118
+
119
+ // 如果localStorage中存在formatData,则返回它,否则返回默认的format
120
+ return formatData ? formatData : format;
89
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/ui",
3
- "version": "2.6.4",
3
+ "version": "2.6.6",
4
4
  "description": "公共UI库",
5
5
  "keywords": [
6
6
  "ui",
@@ -89,6 +89,7 @@
89
89
  "immutability-helper": "^3.1.1",
90
90
  "intl": "^1.2.5",
91
91
  "marked": "^4.2.3",
92
+ "moment-timezone": "^0.5.45",
92
93
  "prop-types": "^15.7.2",
93
94
  "rc-cascader": "~3.9.0",
94
95
  "rc-field-form": "~1.27.0",
@@ -148,5 +149,5 @@
148
149
  "access": "public"
149
150
  },
150
151
  "license": "MIT",
151
- "gitHead": "a3ae4f5a2ca5bf1dd7570ada3b781dac5284c61c"
152
+ "gitHead": "d8ab9b19eea2bb894165d1797057153592cb85f7"
152
153
  }