@chaoswise/ui 3.1.16 → 3.1.18

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 (57) hide show
  1. package/lib/Antd5/_util/isNumeric.js +4 -0
  2. package/lib/Antd5/avatar/group.js +121 -0
  3. package/lib/Antd5/button/LoadingIcon.js +82 -0
  4. package/lib/Antd5/pagination/Select.js +24 -0
  5. package/lib/BasicLayout/locale/en_US.js +4 -0
  6. package/lib/BasicLayout/locale/index.js +11 -0
  7. package/lib/BasicLayout/locale/zh_CN.js +4 -0
  8. package/lib/BasicLayout/locale/zh_TW.js +4 -0
  9. package/lib/CWColorPicker/index.js +44 -44
  10. package/lib/CWMessage/MessageContent/TabList/index.js +13 -13
  11. package/lib/CWMessage/MessageContent/index.js +25 -25
  12. package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -7
  13. package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +14 -14
  14. package/lib/CWRangePicker/DropdownMenu/index.js +34 -34
  15. package/lib/CWRangePicker/Refresh/index.js +12 -12
  16. package/lib/CWRangePicker/TimeSpan/index.js +14 -14
  17. package/lib/CWRangePicker/index.js +56 -56
  18. package/lib/CWRangePicker/utils/generate/dayjs.js +110 -93
  19. package/lib/CWRangePicker/utils/generate/moment.js +99 -82
  20. package/lib/CWTable/assets/DownGraySvg.js +16 -0
  21. package/lib/CWTable/assets/DownLightSvg.js +16 -0
  22. package/lib/CWTable/assets/SortSvg.js +16 -0
  23. package/lib/CWTable/assets/SortingSvg.js +16 -0
  24. package/lib/CWTable/assets/UpGraySvg.js +15 -0
  25. package/lib/CWTable/assets/UpLightSvg.js +15 -0
  26. package/lib/CWTree/locale/en_US.js +3 -0
  27. package/lib/CWTree/locale/index.js +11 -0
  28. package/lib/CWTree/locale/zh_CN.js +3 -0
  29. package/lib/CWTree/locale/zh_TW.js +3 -0
  30. package/lib/ConfigProvider/ConfigProvider.js +6 -0
  31. package/lib/ConfigProvider/generate/dayjs.js +4 -0
  32. package/lib/Empty/index.js +10 -10
  33. package/lib/ErrorBoundary/ErrorPage.js +10 -10
  34. package/lib/Exception/index.js +22 -22
  35. package/lib/FilterDropDown/index.js +19 -19
  36. package/lib/Header/Document/index.js +5 -5
  37. package/lib/IconSelect/components/CustomImg/index.js +10 -10
  38. package/lib/IconSelect/components/SearchIcon/index.js +8 -8
  39. package/lib/IconSelect/index.js +16 -16
  40. package/lib/Joyride/List.js +11 -11
  41. package/lib/Joyride/index.js +55 -55
  42. package/lib/Pagination/index.js +34 -34
  43. package/lib/QuickTransfer/DragList.js +15 -15
  44. package/lib/QuickTransfer/index.js +59 -59
  45. package/lib/RangePicker/components/ExtraTimeFooter.js +1 -1
  46. package/lib/SearchBar/index.js +40 -40
  47. package/lib/TimeRangeSlider/Refresh/index.js +11 -11
  48. package/lib/TimeRangeSlider/TimeSpan/index.js +13 -13
  49. package/lib/TimeRangeSlider/index.js +32 -32
  50. package/lib/TimeRangeSlider/utils/generate/moment.js +106 -89
  51. package/lib/locales/en_US.json +1 -86
  52. package/lib/locales/index.js +11 -0
  53. package/lib/locales/ja_JP.json +1 -0
  54. package/lib/locales/zh_CN.json +1 -86
  55. package/lib/locales/zh_TW.json +1 -86
  56. package/package.json +2 -1
  57. /package/lib/Antd5/avatar/{Avatar.js → avatar.js} +0 -0
@@ -0,0 +1,4 @@
1
+ var isNumeric = function isNumeric(value) {
2
+ return !isNaN(parseFloat(value)) && isFinite(value);
3
+ };
4
+ export default isNumeric;
@@ -0,0 +1,121 @@
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
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ 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); }
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import * as React from 'react';
15
+ import classNames from 'classnames';
16
+ import toArray from 'rc-util/lib/Children/toArray';
17
+ import { cloneElement } from '../_util/reactNode';
18
+ import { devUseWarning } from '../_util/warning';
19
+ import { ConfigContext } from '../config-provider';
20
+ import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
21
+ import Popover from '../popover';
22
+ import Avatar from './avatar';
23
+ import AvatarContext from './AvatarContext';
24
+ import useStyle from './style';
25
+ var AvatarContextProvider = function AvatarContextProvider(props) {
26
+ var _React$useContext = React.useContext(AvatarContext),
27
+ size = _React$useContext.size,
28
+ shape = _React$useContext.shape;
29
+ var avatarContextValue = React.useMemo(function () {
30
+ return {
31
+ size: props.size || size,
32
+ shape: props.shape || shape
33
+ };
34
+ }, [props.size, props.shape, size, shape]);
35
+ return _jsx(AvatarContext.Provider, {
36
+ value: avatarContextValue,
37
+ children: props.children
38
+ });
39
+ };
40
+ var Group = function Group(props) {
41
+ var _React$useContext2 = React.useContext(ConfigContext),
42
+ getPrefixCls = _React$useContext2.getPrefixCls,
43
+ direction = _React$useContext2.direction;
44
+ var customizePrefixCls = props.prefixCls,
45
+ className = props.className,
46
+ rootClassName = props.rootClassName,
47
+ style = props.style,
48
+ maxCount = props.maxCount,
49
+ maxStyle = props.maxStyle,
50
+ size = props.size,
51
+ shape = props.shape,
52
+ maxPopoverPlacement = props.maxPopoverPlacement,
53
+ maxPopoverTrigger = props.maxPopoverTrigger,
54
+ children = props.children,
55
+ max = props.max;
56
+ if (process.env.NODE_ENV !== 'production') {
57
+ var warning = devUseWarning('Avatar.Group');
58
+ warning.deprecated(!maxCount, 'maxCount', 'max={{ count: number }}');
59
+ warning.deprecated(!maxStyle, 'maxStyle', 'max={{ style: CSSProperties }}');
60
+ warning.deprecated(!maxPopoverPlacement, 'maxPopoverPlacement', 'max={{ popover: PopoverProps }}');
61
+ warning.deprecated(!maxPopoverTrigger, 'maxPopoverTrigger', 'max={{ popover: PopoverProps }}');
62
+ }
63
+ var prefixCls = getPrefixCls('avatar', customizePrefixCls);
64
+ var groupPrefixCls = "".concat(prefixCls, "-group");
65
+ var rootCls = useCSSVarCls(prefixCls);
66
+ var _useStyle = useStyle(prefixCls, rootCls),
67
+ _useStyle2 = _slicedToArray(_useStyle, 3),
68
+ wrapCSSVar = _useStyle2[0],
69
+ hashId = _useStyle2[1],
70
+ cssVarCls = _useStyle2[2];
71
+ var cls = classNames(groupPrefixCls, _defineProperty({}, "".concat(groupPrefixCls, "-rtl"), direction === 'rtl'), cssVarCls, rootCls, className, rootClassName, hashId);
72
+ var childrenWithProps = toArray(children).map(function (child, index) {
73
+ return cloneElement(child, {
74
+ key: "avatar-key-".concat(index)
75
+ });
76
+ });
77
+ var mergeCount = (max === null || max === void 0 ? void 0 : max.count) || maxCount;
78
+ var numOfChildren = childrenWithProps.length;
79
+ if (mergeCount && mergeCount < numOfChildren) {
80
+ var _max$popover, _max$popover2, _max$popover3;
81
+ var childrenShow = childrenWithProps.slice(0, mergeCount);
82
+ var childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);
83
+ var mergeStyle = (max === null || max === void 0 ? void 0 : max.style) || maxStyle;
84
+ var mergePopoverTrigger = (max === null || max === void 0 || (_max$popover = max.popover) === null || _max$popover === void 0 ? void 0 : _max$popover.trigger) || maxPopoverTrigger || 'hover';
85
+ var mergePopoverPlacement = (max === null || max === void 0 || (_max$popover2 = max.popover) === null || _max$popover2 === void 0 ? void 0 : _max$popover2.placement) || maxPopoverPlacement || 'top';
86
+ var mergeProps = _objectSpread(_objectSpread({
87
+ content: childrenHidden
88
+ }, max === null || max === void 0 ? void 0 : max.popover), {}, {
89
+ overlayClassName: classNames("".concat(groupPrefixCls, "-popover"), max === null || max === void 0 || (_max$popover3 = max.popover) === null || _max$popover3 === void 0 ? void 0 : _max$popover3.overlayClassName),
90
+ placement: mergePopoverPlacement,
91
+ trigger: mergePopoverTrigger
92
+ });
93
+ childrenShow.push(_jsx(Popover, _objectSpread(_objectSpread({
94
+ destroyTooltipOnHide: true
95
+ }, mergeProps), {}, {
96
+ children: _jsx(Avatar, {
97
+ style: mergeStyle,
98
+ children: "+".concat(numOfChildren - mergeCount)
99
+ })
100
+ }), "avatar-popover-key"));
101
+ return wrapCSSVar(_jsx(AvatarContextProvider, {
102
+ shape: shape,
103
+ size: size,
104
+ children: _jsx("div", {
105
+ className: cls,
106
+ style: style,
107
+ children: childrenShow
108
+ })
109
+ }));
110
+ }
111
+ return wrapCSSVar(_jsx(AvatarContextProvider, {
112
+ shape: shape,
113
+ size: size,
114
+ children: _jsx("div", {
115
+ className: cls,
116
+ style: style,
117
+ children: childrenWithProps
118
+ })
119
+ }));
120
+ };
121
+ export default Group;
@@ -0,0 +1,82 @@
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
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ 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); }
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import React, { forwardRef } from 'react';
9
+ import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
10
+ import classNames from 'classnames';
11
+ import CSSMotion from 'rc-motion';
12
+ import IconWrapper from './IconWrapper';
13
+ var InnerLoadingIcon = /*#__PURE__*/forwardRef(function (props, ref) {
14
+ var prefixCls = props.prefixCls,
15
+ className = props.className,
16
+ style = props.style,
17
+ iconClassName = props.iconClassName;
18
+ var mergedIconCls = classNames("".concat(prefixCls, "-loading-icon"), className);
19
+ return _jsx(IconWrapper, {
20
+ prefixCls: prefixCls,
21
+ className: mergedIconCls,
22
+ style: style,
23
+ ref: ref,
24
+ children: _jsx(LoadingOutlined, {
25
+ className: iconClassName
26
+ })
27
+ });
28
+ });
29
+ var getCollapsedWidth = function getCollapsedWidth() {
30
+ return {
31
+ width: 0,
32
+ opacity: 0,
33
+ transform: 'scale(0)'
34
+ };
35
+ };
36
+ var getRealWidth = function getRealWidth(node) {
37
+ return {
38
+ width: node.scrollWidth,
39
+ opacity: 1,
40
+ transform: 'scale(1)'
41
+ };
42
+ };
43
+ var LoadingIcon = function LoadingIcon(props) {
44
+ var prefixCls = props.prefixCls,
45
+ loading = props.loading,
46
+ existIcon = props.existIcon,
47
+ className = props.className,
48
+ style = props.style;
49
+ var visible = !!loading;
50
+ if (existIcon) {
51
+ return _jsx(InnerLoadingIcon, {
52
+ prefixCls: prefixCls,
53
+ className: className,
54
+ style: style
55
+ });
56
+ }
57
+ return _jsx(CSSMotion, {
58
+ visible: visible,
59
+ // We do not really use this motionName
60
+ motionName: "".concat(prefixCls, "-loading-icon-motion"),
61
+ motionLeave: visible,
62
+ removeOnLeave: true,
63
+ onAppearStart: getCollapsedWidth,
64
+ onAppearActive: getRealWidth,
65
+ onEnterStart: getCollapsedWidth,
66
+ onEnterActive: getRealWidth,
67
+ onLeaveStart: getRealWidth,
68
+ onLeaveActive: getCollapsedWidth,
69
+ children: function children(_ref, ref) {
70
+ var motionCls = _ref.className,
71
+ motionStyle = _ref.style;
72
+ return _jsx(InnerLoadingIcon, {
73
+ prefixCls: prefixCls,
74
+ className: className,
75
+ style: _objectSpread(_objectSpread({}, style), motionStyle),
76
+ ref: ref,
77
+ iconClassName: motionCls
78
+ });
79
+ }
80
+ });
81
+ };
82
+ export default LoadingIcon;
@@ -0,0 +1,24 @@
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
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ 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); }
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import * as React from 'react';
9
+ import Select from '../select';
10
+ var MiniSelect = function MiniSelect(props) {
11
+ return _jsx(Select, _objectSpread(_objectSpread({}, props), {}, {
12
+ showSearch: true,
13
+ size: "small"
14
+ }));
15
+ };
16
+ var MiddleSelect = function MiddleSelect(props) {
17
+ return _jsx(Select, _objectSpread(_objectSpread({}, props), {}, {
18
+ showSearch: true,
19
+ size: "middle"
20
+ }));
21
+ };
22
+ MiniSelect.Option = Select.Option;
23
+ MiddleSelect.Option = Select.Option;
24
+ export { MiniSelect, MiddleSelect };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ back: 'Back',
3
+ allProductsTitle: 'Products'
4
+ };
@@ -0,0 +1,11 @@
1
+ import zh_CN from './zh_CN.js';
2
+ import en_US from './en_US.js';
3
+ import zh_TW from './zh_TW.js';
4
+ export default {
5
+ zh_CN: zh_CN,
6
+ en_US: en_US,
7
+ zh_TW: zh_TW,
8
+ // 兼容
9
+ zh: zh_CN,
10
+ en: en_US
11
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ back: '返回',
3
+ allProductsTitle: '所有产品'
4
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ back: '返回',
3
+ allProductsTitle: '所有產品'
4
+ };
@@ -16,15 +16,15 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
16
16
  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; }
17
17
  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; } }
18
18
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19
- import React, { useState, useEffect } from "react";
20
- import SketchPicker from "./SketchPicker/components/sketch";
21
- import useConfigContext from "../useConfigContext";
22
- import classnames from "classnames";
23
- import { formatRgbaObj, hexToRgba } from "./utils";
24
- import PropTypes from "prop-types";
25
- import { DownOutlined } from "@ant-design/icons";
26
- import { useIntl } from "../locales";
27
- import useStyle from "./index.style";
19
+ import React, { useState, useEffect } from 'react';
20
+ import SketchPicker from './SketchPicker/components/sketch';
21
+ import useConfigContext from '../useConfigContext';
22
+ import classnames from 'classnames';
23
+ import { formatRgbaObj, hexToRgba } from './utils';
24
+ import PropTypes from 'prop-types';
25
+ import { DownOutlined } from '@ant-design/icons';
26
+ import { useIntl } from '../locales';
27
+ import useStyle from './index.style';
28
28
  var ColorPicker = function ColorPicker(_ref) {
29
29
  var value = _ref.value,
30
30
  _ref$onChange = _ref.onChange,
@@ -35,43 +35,43 @@ var ColorPicker = function ColorPicker(_ref) {
35
35
  colorRender = _ref.colorRender,
36
36
  _ref$dropdownProps = _ref.dropdownProps,
37
37
  dropdownProps = _ref$dropdownProps === void 0 ? {
38
- trigger: ["click"]
38
+ trigger: ['click']
39
39
  } : _ref$dropdownProps;
40
40
  var intl = useIntl();
41
41
  var _useConfigContext = useConfigContext(),
42
42
  getPrefixCls = _useConfigContext.getPrefixCls;
43
- var prefixCls = getPrefixCls("color-picker");
43
+ var prefixCls = getPrefixCls('color-picker');
44
44
  var _useStyle = useStyle(prefixCls),
45
45
  _useStyle2 = _slicedToArray(_useStyle, 3),
46
46
  wrapCSSVar = _useStyle2[0],
47
47
  hashId = _useStyle2[1],
48
48
  cssVarCls = _useStyle2[2];
49
- var _useState = useState("single"),
49
+ var _useState = useState('single'),
50
50
  _useState2 = _slicedToArray(_useState, 2),
51
51
  colorType = _useState2[0],
52
52
  setColorType = _useState2[1]; //单色渐变选中key 单色single 渐变gradient
53
53
  var _useState3 = useState({
54
- color: "rgba(255,255,255,1)",
54
+ color: 'rgba(255,255,255,1)',
55
55
  //组件单色值rgb格式
56
- hexColor: "#ffffff",
56
+ hexColor: '#ffffff',
57
57
  //组件单色输入框值
58
- gradientColorStart: "rgba(255,255,255,1)",
58
+ gradientColorStart: 'rgba(255,255,255,1)',
59
59
  //渐变色左侧rgb颜色值
60
- gradientColorEnd: "rgba(255,255,255,1)",
60
+ gradientColorEnd: 'rgba(255,255,255,1)',
61
61
  //渐变色右侧rgb颜色值
62
- gradientHexColorStart: "#ffffff",
62
+ gradientHexColorStart: '#ffffff',
63
63
  //渐变色左端点输入框16进制值
64
- gradientHexColorEnd: "#ffffff" //渐变色右端点输入框16进制值
64
+ gradientHexColorEnd: '#ffffff' //渐变色右端点输入框16进制值
65
65
  }),
66
66
  _useState4 = _slicedToArray(_useState3, 2),
67
67
  colorInfo = _useState4[0],
68
68
  setColorInfo = _useState4[1];
69
- var _useState5 = useState("l"),
69
+ var _useState5 = useState('l'),
70
70
  _useState6 = _slicedToArray(_useState5, 2),
71
71
  activeColor = _useState6[0],
72
72
  setActiveColor = _useState6[1]; //当前设置的颜色是左侧颜色值还是右侧颜色值
73
73
 
74
- var _useState7 = useState(""),
74
+ var _useState7 = useState(''),
75
75
  _useState8 = _slicedToArray(_useState7, 2),
76
76
  gradientColorValue = _useState8[0],
77
77
  setGradientColorValue = _useState8[1]; //组件渐变色值
@@ -79,19 +79,19 @@ var ColorPicker = function ColorPicker(_ref) {
79
79
  useEffect(function () {
80
80
  if (_value) {
81
81
  var _value$colorType = _value.colorType,
82
- _colorType = _value$colorType === void 0 ? "single" : _value$colorType,
82
+ _colorType = _value$colorType === void 0 ? 'single' : _value$colorType,
83
83
  _value$color = _value.color,
84
- color = _value$color === void 0 ? "" : _value$color,
84
+ color = _value$color === void 0 ? '' : _value$color,
85
85
  _value$gradientColorS = _value.gradientColorStart,
86
- gradientColorStart = _value$gradientColorS === void 0 ? "" : _value$gradientColorS,
86
+ gradientColorStart = _value$gradientColorS === void 0 ? '' : _value$gradientColorS,
87
87
  _value$gradientColorE = _value.gradientColorEnd,
88
- gradientColorEnd = _value$gradientColorE === void 0 ? "" : _value$gradientColorE,
88
+ gradientColorEnd = _value$gradientColorE === void 0 ? '' : _value$gradientColorE,
89
89
  _value$hexColor = _value.hexColor,
90
- hexColor = _value$hexColor === void 0 ? "" : _value$hexColor,
90
+ hexColor = _value$hexColor === void 0 ? '' : _value$hexColor,
91
91
  _value$gradientHexCol = _value.gradientHexColorStart,
92
- gradientHexColorStart = _value$gradientHexCol === void 0 ? "" : _value$gradientHexCol,
92
+ gradientHexColorStart = _value$gradientHexCol === void 0 ? '' : _value$gradientHexCol,
93
93
  _value$gradientHexCol2 = _value.gradientHexColorEnd,
94
- gradientHexColorEnd = _value$gradientHexCol2 === void 0 ? "" : _value$gradientHexCol2;
94
+ gradientHexColorEnd = _value$gradientHexCol2 === void 0 ? '' : _value$gradientHexCol2;
95
95
  setColorType(_colorType);
96
96
  setColorInfo({
97
97
  color: color,
@@ -109,8 +109,8 @@ var ColorPicker = function ColorPicker(_ref) {
109
109
  }, [colorInfo]);
110
110
  //颜色变化触发值改变
111
111
  var onChangeColor = function onChangeColor(colorObj) {
112
- var rgbColor = typeof colorObj.rgb == "string" ? colorObj.rgb : formatRgbaObj(colorObj.rgb);
113
- if (colorType === "single") {
112
+ var rgbColor = typeof colorObj.rgb == 'string' ? colorObj.rgb : formatRgbaObj(colorObj.rgb);
113
+ if (colorType === 'single') {
114
114
  setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
115
115
  color: rgbColor,
116
116
  hexColor: colorObj.hex
@@ -121,7 +121,7 @@ var ColorPicker = function ColorPicker(_ref) {
121
121
  hexColor: colorObj.hex
122
122
  }));
123
123
  } else {
124
- if (activeColor === "l") {
124
+ if (activeColor === 'l') {
125
125
  setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
126
126
  gradientColorStart: rgbColor,
127
127
  gradientHexColorStart: colorObj.hex
@@ -157,12 +157,12 @@ var ColorPicker = function ColorPicker(_ref) {
157
157
  var onChangeInputColor = function onChangeInputColor(e) {
158
158
  //十六进制颜色校验
159
159
  var reg = /^#([0-9a-f]{6}){1,2}$/i;
160
- if (colorType === "single") {
160
+ if (colorType === 'single') {
161
161
  setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
162
162
  hexColor: e.target.value
163
163
  }));
164
164
  } else {
165
- activeColor === "l" ? setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
165
+ activeColor === 'l' ? setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
166
166
  gradientHexColorStart: e.target.value
167
167
  })) : setColorInfo(_objectSpread(_objectSpread({}, colorInfo), {}, {
168
168
  gradientHexColorEnd: e.target.value
@@ -177,8 +177,8 @@ var ColorPicker = function ColorPicker(_ref) {
177
177
  }
178
178
  };
179
179
  var items = [{
180
- key: "single",
181
- label: intl.get("94482e5c-d90c-49f7-87b0-9877dc8e3824").d("单色"),
180
+ key: 'single',
181
+ label: intl.get('94482e5c-d90c-49f7-87b0-9877dc8e3824').d('单色'),
182
182
  children: /*#__PURE__*/React.createElement("div", {
183
183
  className: prefixCls
184
184
  }, /*#__PURE__*/React.createElement(_Input, {
@@ -190,8 +190,8 @@ var ColorPicker = function ColorPicker(_ref) {
190
190
  onChange: onChangeColor
191
191
  }))
192
192
  }, {
193
- key: "gradient",
194
- label: intl.get("4cba455a-5fc7-4174-9a67-8395150a3222").d("渐变"),
193
+ key: 'gradient',
194
+ label: intl.get('4cba455a-5fc7-4174-9a67-8395150a3222').d('渐变'),
195
195
  children: /*#__PURE__*/React.createElement("div", {
196
196
  className: prefixCls
197
197
  }, /*#__PURE__*/React.createElement("div", {
@@ -200,9 +200,9 @@ var ColorPicker = function ColorPicker(_ref) {
200
200
  background: gradientColorValue
201
201
  }
202
202
  }, /*#__PURE__*/React.createElement("div", {
203
- className: classnames("".concat(prefixCls, "-gradient-l"), _defineProperty({}, "".concat(prefixCls, "-gradient-active"), activeColor === "l")),
203
+ className: classnames("".concat(prefixCls, "-gradient-l"), _defineProperty({}, "".concat(prefixCls, "-gradient-active"), activeColor === 'l')),
204
204
  onClick: function onClick() {
205
- setActiveColor("l");
205
+ setActiveColor('l');
206
206
  }
207
207
  }, /*#__PURE__*/React.createElement("span", {
208
208
  className: "".concat(prefixCls, "-gradient-btn"),
@@ -210,9 +210,9 @@ var ColorPicker = function ColorPicker(_ref) {
210
210
  background: colorInfo.gradientColorStart
211
211
  }
212
212
  })), /*#__PURE__*/React.createElement("div", {
213
- className: classnames("".concat(prefixCls, "-gradient-r"), _defineProperty({}, "".concat(prefixCls, "-gradient-active"), activeColor === "r")),
213
+ className: classnames("".concat(prefixCls, "-gradient-r"), _defineProperty({}, "".concat(prefixCls, "-gradient-active"), activeColor === 'r')),
214
214
  onClick: function onClick() {
215
- setActiveColor("r");
215
+ setActiveColor('r');
216
216
  }
217
217
  }, /*#__PURE__*/React.createElement("span", {
218
218
  className: "".concat(prefixCls, "-gradient-btn"),
@@ -220,17 +220,17 @@ var ColorPicker = function ColorPicker(_ref) {
220
220
  background: colorInfo.gradientColorEnd
221
221
  }
222
222
  }))), /*#__PURE__*/React.createElement(_Input, {
223
- value: activeColor === "l" ? colorInfo.gradientHexColorStart : colorInfo.gradientHexColorEnd,
223
+ value: activeColor === 'l' ? colorInfo.gradientHexColorStart : colorInfo.gradientHexColorEnd,
224
224
  onChange: onChangeInputColor,
225
225
  className: "".concat(prefixCls, "-input")
226
226
  }), /*#__PURE__*/React.createElement(SketchPicker, {
227
- color: activeColor === "l" ? colorInfo.gradientColorStart : colorInfo.gradientColorEnd,
227
+ color: activeColor === 'l' ? colorInfo.gradientColorStart : colorInfo.gradientColorEnd,
228
228
  onChange: onChangeColor
229
229
  }))
230
230
  }];
231
231
  if (!showGradient) {
232
232
  items = items.filter(function (item) {
233
- return item.key !== "gradient";
233
+ return item.key !== 'gradient';
234
234
  });
235
235
  }
236
236
  var menu = /*#__PURE__*/React.createElement("div", {
@@ -255,7 +255,7 @@ var ColorPicker = function ColorPicker(_ref) {
255
255
  }), colorRender ? colorRender() : /*#__PURE__*/React.createElement(_Button, null, /*#__PURE__*/React.createElement(_Space, null, /*#__PURE__*/React.createElement("div", {
256
256
  className: "".concat(prefixCls, "-select-value"),
257
257
  style: {
258
- background: colorType === "single" ? colorInfo.color : gradientColorValue
258
+ background: colorType === 'single' ? colorInfo.color : gradientColorValue
259
259
  }
260
260
  }), /*#__PURE__*/React.createElement(DownOutlined, null))))));
261
261
  };
@@ -10,11 +10,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
10
10
  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); }
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
- import React from "react";
14
- import dayjs from "../../utils/generate/dayjs";
15
- import classnames from "classnames";
16
- import { readInnerMessageApi } from "../../service";
17
- import { useIntl } from "../../../locales";
13
+ import React from 'react';
14
+ import dayjs from '../../utils/generate/dayjs';
15
+ import classnames from 'classnames';
16
+ import { readInnerMessageApi } from '../../service';
17
+ import { useIntl } from '../../../locales';
18
18
  var TabList = function TabList(props) {
19
19
  var _props$messages = props.messages,
20
20
  messages = _props$messages === void 0 ? [] : _props$messages,
@@ -43,7 +43,7 @@ var TabList = function TabList(props) {
43
43
  };
44
44
  readInnerMessage(params);
45
45
  // 撤回消息不操作
46
- if (showMode === "invalid") return;
46
+ if (showMode === 'invalid') return;
47
47
  var _isClose = onTabListItem(message);
48
48
  if (isClose || _isClose) {
49
49
  setVisible(false);
@@ -71,7 +71,7 @@ var TabList = function TabList(props) {
71
71
  return resRequestApi(params, gatewayPrefix);
72
72
  case 1:
73
73
  res = _context.v;
74
- if (res.status == "success") {
74
+ if (res.status == 'success') {
75
75
  _params = {};
76
76
  if (pageInfo.current > 1 && messages.length === 1) {
77
77
  _params = {
@@ -98,24 +98,24 @@ var TabList = function TabList(props) {
98
98
  var messageList = messages.map(function (message) {
99
99
  var _message$title, _message$summary;
100
100
  return /*#__PURE__*/React.createElement("div", {
101
- className: classnames("".concat(messagePrefixCls, "-content-tabs-list"), _defineProperty({}, "".concat(messagePrefixCls, "-content-tabs-list-invalid"), message.showMode === "invalid")),
101
+ className: classnames("".concat(messagePrefixCls, "-content-tabs-list"), _defineProperty({}, "".concat(messagePrefixCls, "-content-tabs-list-invalid"), message.showMode === 'invalid')),
102
102
  key: message.userMessageId
103
103
  }, /*#__PURE__*/React.createElement("div", {
104
104
  className: "".concat(messagePrefixCls, "-content-tabs-list-title"),
105
105
  onClick: function onClick() {
106
106
  return onHandleMessage(message);
107
107
  }
108
- }, message.showMode === "top" && /*#__PURE__*/React.createElement(_Tag, {
108
+ }, message.showMode === 'top' && /*#__PURE__*/React.createElement(_Tag, {
109
109
  className: "".concat(messagePrefixCls, "-content-tabs-list-title-top")
110
- }, intl.get("5cc44ee5-8da3-446b-b962-3fe7f77d4f38").d("置顶")), (_message$title = message.title) !== null && _message$title !== void 0 ? _message$title : ""), /*#__PURE__*/React.createElement("div", {
110
+ }, intl.get('5cc44ee5-8da3-446b-b962-3fe7f77d4f38').d('置顶')), (_message$title = message.title) !== null && _message$title !== void 0 ? _message$title : ''), /*#__PURE__*/React.createElement("div", {
111
111
  className: "".concat(messagePrefixCls, "-content-tabs-list-desc")
112
- }, (_message$summary = message.summary) !== null && _message$summary !== void 0 ? _message$summary : ""), /*#__PURE__*/React.createElement("div", {
112
+ }, (_message$summary = message.summary) !== null && _message$summary !== void 0 ? _message$summary : ''), /*#__PURE__*/React.createElement("div", {
113
113
  className: "".concat(messagePrefixCls, "-content-tabs-list-date")
114
- }, message.time ? renderMessageDateFormat ? renderMessageDateFormat(Number(message.time)) : dayjs(Number(message.time)).format("YYYY-MM-DD HH:mm:ss") : ""));
114
+ }, message.time ? renderMessageDateFormat ? renderMessageDateFormat(Number(message.time)) : dayjs(Number(message.time)).format('YYYY-MM-DD HH:mm:ss') : ''));
115
115
  });
116
116
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
117
117
  className: "".concat(messagePrefixCls, "-content-all-read"),
118
118
  onClick: onHandleReadAllMessage
119
- }, intl.get("58bc27cb-aac5-49f8-8c9e-3b0fbb9d9c61").d("全部已读")), messageList);
119
+ }, intl.get('58bc27cb-aac5-49f8-8c9e-3b0fbb9d9c61').d('全部已读')), messageList);
120
120
  };
121
121
  export default TabList;