@chaoswise/ui 3.0.12 → 3.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AppHolder/index.js +19 -0
- package/lib/Badge/index.style.js +42 -10
- package/lib/BasicLayout/Sider.js +6 -2
- package/lib/BasicLayout/style/sider.js +53 -49
- package/lib/CWMessage/MessageContent/TabList/index.js +2 -2
- package/lib/CWMessage/MessageContent/index.js +6 -6
- package/lib/CWMessage/index.js +80 -90
- package/lib/CWMessage/index.style.js +1 -3
- package/lib/CWRangePicker/DropdownMenu/index.js +39 -35
- package/lib/CWRangePicker/DropdownMenu/index.style.js +129 -130
- package/lib/CWRangePicker/Refresh/index.js +6 -2
- package/lib/CWRangePicker/Refresh/index.style.js +16 -19
- package/lib/CWRangePicker/TimeSpan/index.js +7 -2
- package/lib/CWRangePicker/TimeSpan/index.style.js +9 -12
- package/lib/CWRangePicker/index.js +6 -2
- package/lib/CWRangePicker/index.style.js +47 -52
- package/lib/CWTable/CWTable.js +1 -1
- package/lib/CWTree/index.js +6 -2
- package/lib/CWTree/index.style.js +97 -99
- package/lib/ChangeIcon/index.js +1 -1
- package/lib/ConfigProvider/ConfigProvider.js +15 -3
- package/lib/Exception/index.js +1 -1
- package/lib/FilterDropDown/index.js +1 -1
- package/lib/Header/TopNavigationMenu/index.js +1 -1
- package/lib/Header/UserSetting/index.js +1 -1
- package/lib/Header/index.js +1 -1
- package/lib/IconSelect/index.js +1 -1
- package/lib/LayoutWrapper/Footer.js +5 -1
- package/lib/LayoutWrapper/Header.js +5 -1
- package/lib/LayoutWrapper/index.js +5 -2
- package/lib/LeftNavigation/index.js +1 -1
- package/lib/QuickTransfer/index.js +5 -1
- package/lib/SearchBar/index.js +1 -1
- package/lib/SimplePagination/index.js +1 -1
- package/lib/Tag/index.style.js +41 -9
- package/lib/Tooltip/index.js +2 -2
- package/lib/TooltipText/index.js +1 -1
- package/lib/UniversalLayout/index.js +5 -1
- package/lib/antd-style/functions/index.js +6 -5
- package/package.json +1 -1
|
@@ -19,18 +19,19 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
19
19
|
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; }
|
|
20
20
|
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; } }
|
|
21
21
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
-
import React from
|
|
23
|
-
import { RightOutlined } from
|
|
24
|
-
import classnames from
|
|
25
|
-
import CalendarSvg from
|
|
26
|
-
import Calendar2Svg from
|
|
27
|
-
import LiveSvg from
|
|
28
|
-
import MoreSvg from
|
|
29
|
-
import MoreTimeList from
|
|
30
|
-
import MoreHistoryList from
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
22
|
+
import React from "react";
|
|
23
|
+
import { RightOutlined } from "@ant-design/icons";
|
|
24
|
+
import classnames from "classnames";
|
|
25
|
+
import CalendarSvg from "../assets/Calendar";
|
|
26
|
+
import Calendar2Svg from "../assets/Calendar2";
|
|
27
|
+
import LiveSvg from "../assets/live";
|
|
28
|
+
import MoreSvg from "../assets/more";
|
|
29
|
+
import MoreTimeList from "./MoreTimeList";
|
|
30
|
+
import MoreHistoryList from "./MoreHistoryList";
|
|
31
|
+
import useConfigContext from "../../useConfigContext";
|
|
32
|
+
import { judgeType, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo } from "../utils";
|
|
33
|
+
import { useIntl } from "../../locales";
|
|
34
|
+
import useStyle from "./index.style";
|
|
34
35
|
var DropdownMenu = function DropdownMenu(props) {
|
|
35
36
|
var dataSource = props.dataSource,
|
|
36
37
|
regroupDataSource = props.regroupDataSource,
|
|
@@ -46,7 +47,10 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
46
47
|
setHistoryList = props.setHistoryList,
|
|
47
48
|
format = props.format,
|
|
48
49
|
timeSpanOption = props.timeSpanOption;
|
|
49
|
-
var
|
|
50
|
+
var _useConfigContext = useConfigContext(),
|
|
51
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
52
|
+
var prefixCls = getPrefixCls();
|
|
53
|
+
var _useStyle = useStyle("".concat(prefixCls, "-cw-dropdown-menu")),
|
|
50
54
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
51
55
|
wrapCSSVar = _useStyle2[0],
|
|
52
56
|
hashId = _useStyle2[1],
|
|
@@ -54,7 +58,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
54
58
|
var intl = useIntl();
|
|
55
59
|
var _ref = (intl === null || intl === void 0 ? void 0 : intl.options) || {},
|
|
56
60
|
_ref$currentLocale = _ref.currentLocale,
|
|
57
|
-
locale = _ref$currentLocale === void 0 ?
|
|
61
|
+
locale = _ref$currentLocale === void 0 ? "zh_CN" : _ref$currentLocale;
|
|
58
62
|
var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
59
63
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
60
64
|
var _menuOption$showCalen = menuOption.showCalendar,
|
|
@@ -66,7 +70,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
66
70
|
_menuOption$showDefau2 = menuOption.showDefaultHistoryCount,
|
|
67
71
|
showDefaultHistoryCount = _menuOption$showDefau2 === void 0 ? 5 : _menuOption$showDefau2,
|
|
68
72
|
_menuOption$moreHisto = menuOption.moreHistoryDropdownPosition,
|
|
69
|
-
moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ?
|
|
73
|
+
moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ? "left" : _menuOption$moreHisto;
|
|
70
74
|
// 点击Menu.Item中切换选项列表
|
|
71
75
|
var onClickItem = function onClickItem(item) {
|
|
72
76
|
var timeDomain = recordDateValue.timeDomain,
|
|
@@ -137,7 +141,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
137
141
|
setHistoryList([]);
|
|
138
142
|
};
|
|
139
143
|
return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: classnames(hashId, cssVarCls,
|
|
144
|
+
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-dropdown-menu-wrapper"))
|
|
141
145
|
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.slice(0, showDefaultCount).map(function (item) {
|
|
142
146
|
var values = item.value;
|
|
143
147
|
var _judgeType = judgeType(item),
|
|
@@ -148,8 +152,8 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
148
152
|
isHasDate = false;
|
|
149
153
|
}
|
|
150
154
|
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: classnames(
|
|
152
|
-
|
|
155
|
+
className: classnames("cw-dropdown-menu-_item", {
|
|
156
|
+
"cw-dropdown-menu-item-selected": (recordDateValue === null || recordDateValue === void 0 ? void 0 : recordDateValue.key) === item.key
|
|
153
157
|
}),
|
|
154
158
|
key: item.key,
|
|
155
159
|
onClick: function onClick() {
|
|
@@ -159,7 +163,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
159
163
|
className: "cw-range-picker-prefix-icon"
|
|
160
164
|
}) : /*#__PURE__*/React.createElement(LiveSvg, null), /*#__PURE__*/React.createElement("span", {
|
|
161
165
|
style: {
|
|
162
|
-
marginLeft:
|
|
166
|
+
marginLeft: "4px"
|
|
163
167
|
}
|
|
164
168
|
}, item.render ? item.render(item) : item.title));
|
|
165
169
|
}), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > showDefaultCount && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
@@ -168,28 +172,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
168
172
|
recordDateValue: recordDateValue,
|
|
169
173
|
onClickItem: onClickItem
|
|
170
174
|
}),
|
|
171
|
-
overlayClassName: classnames(
|
|
172
|
-
|
|
175
|
+
overlayClassName: classnames("cw-dropdown-menu-more-wrapper", {
|
|
176
|
+
"cw-dropdown-menu-more-wrapper-left": moreItemDropdownPosition === "left"
|
|
173
177
|
}),
|
|
174
178
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
175
179
|
return triggerNode;
|
|
176
180
|
}
|
|
177
181
|
}, /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: classnames(
|
|
182
|
+
className: classnames("cw-dropdown-menu-_item", "cw-dropdown-menu-item-more")
|
|
179
183
|
}, /*#__PURE__*/React.createElement("div", {
|
|
180
184
|
style: {
|
|
181
|
-
display:
|
|
182
|
-
alignItems:
|
|
185
|
+
display: "flex",
|
|
186
|
+
alignItems: "center"
|
|
183
187
|
}
|
|
184
188
|
}, /*#__PURE__*/React.createElement(MoreSvg, {
|
|
185
189
|
className: "cw-range-picker-prefix-icon"
|
|
186
190
|
}), /*#__PURE__*/React.createElement("span", {
|
|
187
191
|
style: {
|
|
188
|
-
marginLeft:
|
|
192
|
+
marginLeft: "4px"
|
|
189
193
|
}
|
|
190
|
-
}, intl.get(
|
|
191
|
-
className: classnames(
|
|
192
|
-
key:
|
|
194
|
+
}, intl.get("a30db643-5238-42bc-bc5e-98a9d0c7df51").d("更多"))), /*#__PURE__*/React.createElement(RightOutlined, null))), showCalendar && /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: classnames("cw-dropdown-menu-_item"),
|
|
196
|
+
key: "unique-calendar",
|
|
193
197
|
onClick: onClickSelectCalendar
|
|
194
198
|
}, /*#__PURE__*/React.createElement("div", {
|
|
195
199
|
className: "cw-range-picker-menu-item-calendar"
|
|
@@ -197,28 +201,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
197
201
|
className: "cw-range-picker-prefix-icon"
|
|
198
202
|
})), /*#__PURE__*/React.createElement("span", {
|
|
199
203
|
style: {
|
|
200
|
-
marginLeft:
|
|
204
|
+
marginLeft: "4px"
|
|
201
205
|
}
|
|
202
|
-
}, intl.get(
|
|
206
|
+
}, intl.get("711fdb26-65b9-48da-ba3c-363f5ab8218c").d("日历选择"))), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
203
207
|
overlay: /*#__PURE__*/React.createElement(MoreHistoryList, {
|
|
204
208
|
historyList: historyList,
|
|
205
209
|
onClickTag: onClickTag,
|
|
206
210
|
onCloseTag: onCloseTag,
|
|
207
211
|
onCloseAllTag: onCloseAllTag
|
|
208
212
|
}),
|
|
209
|
-
overlayClassName: classnames(
|
|
210
|
-
|
|
213
|
+
overlayClassName: classnames("cw-dropdown-menu-history-more-wrapper", {
|
|
214
|
+
"cw-dropdown-menu-history-more-wrapper-left": moreHistoryDropdownPosition === "left"
|
|
211
215
|
}),
|
|
212
216
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
213
217
|
return triggerNode;
|
|
214
218
|
}
|
|
215
219
|
}, /*#__PURE__*/React.createElement("div", {
|
|
216
|
-
className: classnames(
|
|
220
|
+
className: classnames("cw-dropdown-menu-history-outer-wrapper")
|
|
217
221
|
}, /*#__PURE__*/React.createElement("div", {
|
|
218
|
-
className: classnames(
|
|
222
|
+
className: classnames("cw-dropdown-menu-history-wrapper")
|
|
219
223
|
}, /*#__PURE__*/React.createElement("span", {
|
|
220
224
|
className: "cw-dropdown-menu-history-title"
|
|
221
|
-
}, intl.get(
|
|
225
|
+
}, intl.get("294afc43-e2de-4d72-ba99-1f25d6f7a1d7").d("历史记录")), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
|
|
222
226
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
223
227
|
type: "custom_type01",
|
|
224
228
|
closable: true,
|
|
@@ -1,155 +1,154 @@
|
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
|
+
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); }
|
|
1
5
|
import { genStyleHooks } from "../../Antd5/theme/internal";
|
|
2
6
|
var genCustomDropdownMenuStyle = function genCustomDropdownMenuStyle(token) {
|
|
3
|
-
var prefixCls = token.antCls
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
7
|
+
var prefixCls = token.antCls;
|
|
8
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-cw-dropdown-menu-wrapper"), {
|
|
9
|
+
width: "360px",
|
|
10
|
+
padding: "4px 0",
|
|
11
|
+
textAlign: "left",
|
|
12
|
+
listStyleType: "none",
|
|
13
|
+
boxShadow: token.boxShadow,
|
|
14
|
+
backgroundColor: token.colorBgContainer,
|
|
15
|
+
borderRadius: token.borderRadius,
|
|
16
|
+
outline: "none",
|
|
17
|
+
backgroundClip: "padding-box",
|
|
18
|
+
WebkitTransform: "translate3d(0, 0, 0)",
|
|
19
|
+
position: "relative",
|
|
20
|
+
".cw-dropdown-menu-_item": {
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
whiteSpace: "nowrap",
|
|
25
|
+
textOverflow: "ellipsis",
|
|
26
|
+
padding: "5px 10px",
|
|
27
|
+
cursor: "pointer",
|
|
28
|
+
transition: "all 0.3s",
|
|
29
|
+
color: token.colorText,
|
|
30
|
+
fontWeight: "normal",
|
|
31
|
+
fontSize: "12px",
|
|
32
|
+
lineHeight: "22px",
|
|
33
|
+
".cw-range-picker-menu-item-calendar": {
|
|
34
|
+
width: "14px",
|
|
35
|
+
height: "14px",
|
|
19
36
|
display: "flex",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
whiteSpace: "nowrap",
|
|
23
|
-
textOverflow: "ellipsis",
|
|
24
|
-
padding: "5px 10px",
|
|
25
|
-
cursor: "pointer",
|
|
26
|
-
transition: "all 0.3s",
|
|
27
|
-
color: token.colorText,
|
|
28
|
-
fontWeight: "normal",
|
|
29
|
-
fontSize: "12px",
|
|
30
|
-
lineHeight: "22px",
|
|
31
|
-
".cw-range-picker-menu-item-calendar": {
|
|
32
|
-
width: "14px",
|
|
33
|
-
height: "14px",
|
|
34
|
-
display: "flex",
|
|
35
|
-
justifyContent: "center",
|
|
36
|
-
alignItems: "center"
|
|
37
|
-
},
|
|
38
|
-
"&.cw-dropdown-menu-item-selected": {
|
|
39
|
-
backgroundColor: token.colorPrimaryBg
|
|
40
|
-
},
|
|
41
|
-
"&:hover": {
|
|
42
|
-
backgroundColor: token.colorPrimaryBg
|
|
43
|
-
}
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center"
|
|
44
39
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
justifyContent: "space-between",
|
|
48
|
-
overflow: "visible"
|
|
40
|
+
"&.cw-dropdown-menu-item-selected": {
|
|
41
|
+
backgroundColor: token.colorPrimaryBg
|
|
49
42
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
top: "auto !important",
|
|
53
|
-
bottom: "-32px !important",
|
|
54
|
-
left: "calc(100% + 2px) !important",
|
|
55
|
-
boxShadow: token.boxShadow,
|
|
56
|
-
"&.cw-dropdown-menu-more-wrapper-left": {
|
|
57
|
-
right: "calc(100% + 2px) !important",
|
|
58
|
-
left: "auto !important"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
".cw-dropdown-menu-history-outer-wrapper": {
|
|
62
|
-
borderTop: "1px solid rgba(0, 0, 0, 0.06)",
|
|
63
|
-
marginTop: "12px",
|
|
64
|
-
padding: "12px 10px 0",
|
|
65
|
-
display: "flex",
|
|
66
|
-
justifyContent: "space-between",
|
|
67
|
-
alignItems: "flex-start",
|
|
68
|
-
position: "relative",
|
|
69
|
-
"&:hover": {
|
|
70
|
-
backgroundColor: token.colorPrimaryBg
|
|
71
|
-
},
|
|
72
|
-
".cw-dropdown-menu-history-wrapper": {
|
|
73
|
-
display: "flex",
|
|
74
|
-
flexWrap: "wrap",
|
|
75
|
-
lineHeight: "20px",
|
|
76
|
-
".cw-dropdown-menu-history-title": {
|
|
77
|
-
marginRight: "6px",
|
|
78
|
-
marginBottom: "8px"
|
|
79
|
-
},
|
|
80
|
-
".cw-dropdown-menu-history-tag-title": {
|
|
81
|
-
marginBottom: "8px",
|
|
82
|
-
marginRight: "4px",
|
|
83
|
-
"&:hover": {
|
|
84
|
-
boxShadow: "0 0 0 1px ".concat(token.colorPrimary),
|
|
85
|
-
color: token.colorPrimary
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
".cw-dropdown-menu-history-more-ellipsis": {
|
|
89
|
-
marginLeft: "4px"
|
|
90
|
-
},
|
|
91
|
-
"[ant-click-animating-without-extra-node]::after": {
|
|
92
|
-
boxShadow: "none !important"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
".cw-dropdown-menu-history-arrow": {
|
|
96
|
-
transform: "translateY(4px)"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
".cw-dropdown-menu-history-more-wrapper": {
|
|
100
|
-
width: "384px",
|
|
101
|
-
top: "0 !important",
|
|
102
|
-
left: "calc(100% + 2px) !important",
|
|
103
|
-
boxShadow: token.boxShadow,
|
|
104
|
-
"&.cw-dropdown-menu-history-more-wrapper-left": {
|
|
105
|
-
right: "calc(100% + 2px) !important",
|
|
106
|
-
left: "auto !important"
|
|
107
|
-
}
|
|
43
|
+
"&:hover": {
|
|
44
|
+
backgroundColor: token.colorPrimaryBg
|
|
108
45
|
}
|
|
109
46
|
},
|
|
110
|
-
".cw-
|
|
47
|
+
".cw-dropdown-menu-item-more": {
|
|
48
|
+
position: "relative",
|
|
49
|
+
justifyContent: "space-between",
|
|
50
|
+
overflow: "visible"
|
|
51
|
+
},
|
|
52
|
+
".cw-dropdown-menu-more-wrapper": {
|
|
111
53
|
width: "384px",
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
".more-col-item:hover": {
|
|
122
|
-
color: token.colorPrimaryHover
|
|
54
|
+
top: "auto !important",
|
|
55
|
+
bottom: "-32px !important",
|
|
56
|
+
left: "calc(100% + 2px) !important",
|
|
57
|
+
boxShadow: token.boxShadow,
|
|
58
|
+
"&.cw-dropdown-menu-more-wrapper-left": {
|
|
59
|
+
right: "calc(100% + 2px) !important",
|
|
60
|
+
left: "auto !important"
|
|
123
61
|
}
|
|
124
62
|
},
|
|
125
|
-
".cw-dropdown-menu-history-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
63
|
+
".cw-dropdown-menu-history-outer-wrapper": {
|
|
64
|
+
borderTop: "1px solid rgba(0, 0, 0, 0.06)",
|
|
65
|
+
marginTop: "12px",
|
|
66
|
+
padding: "12px 10px 0",
|
|
67
|
+
display: "flex",
|
|
68
|
+
justifyContent: "space-between",
|
|
69
|
+
alignItems: "flex-start",
|
|
70
|
+
position: "relative",
|
|
71
|
+
"&:hover": {
|
|
72
|
+
backgroundColor: token.colorPrimaryBg
|
|
135
73
|
},
|
|
136
|
-
".cw-dropdown-menu-history-
|
|
74
|
+
".cw-dropdown-menu-history-wrapper": {
|
|
137
75
|
display: "flex",
|
|
138
76
|
flexWrap: "wrap",
|
|
139
|
-
"
|
|
140
|
-
|
|
77
|
+
lineHeight: "20px",
|
|
78
|
+
".cw-dropdown-menu-history-title": {
|
|
79
|
+
marginRight: "6px",
|
|
80
|
+
marginBottom: "8px"
|
|
141
81
|
},
|
|
142
|
-
".cw-dropdown-menu-history-
|
|
143
|
-
|
|
82
|
+
".cw-dropdown-menu-history-tag-title": {
|
|
83
|
+
marginBottom: "8px",
|
|
144
84
|
marginRight: "4px",
|
|
145
85
|
"&:hover": {
|
|
146
86
|
boxShadow: "0 0 0 1px ".concat(token.colorPrimary),
|
|
147
87
|
color: token.colorPrimary
|
|
148
88
|
}
|
|
89
|
+
},
|
|
90
|
+
".cw-dropdown-menu-history-more-ellipsis": {
|
|
91
|
+
marginLeft: "4px"
|
|
92
|
+
},
|
|
93
|
+
"[ant-click-animating-without-extra-node]::after": {
|
|
94
|
+
boxShadow: "none !important"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
".cw-dropdown-menu-history-arrow": {
|
|
98
|
+
transform: "translateY(4px)"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
".cw-dropdown-menu-history-more-wrapper": {
|
|
102
|
+
width: "384px",
|
|
103
|
+
top: "0 !important",
|
|
104
|
+
left: "calc(100% + 2px) !important",
|
|
105
|
+
boxShadow: token.boxShadow,
|
|
106
|
+
"&.cw-dropdown-menu-history-more-wrapper-left": {
|
|
107
|
+
right: "calc(100% + 2px) !important",
|
|
108
|
+
left: "auto !important"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}), ".cw-range-picker-popup-more-content", {
|
|
112
|
+
width: "384px",
|
|
113
|
+
padding: "12px 16px 8px",
|
|
114
|
+
backgroundColor: token.colorBgContainer,
|
|
115
|
+
".more-col-item": {
|
|
116
|
+
cursor: "pointer",
|
|
117
|
+
color: token.boxShadow,
|
|
118
|
+
"&.cw-dropdown-menu-item-selected": {
|
|
119
|
+
background: token.colorPrimaryBg
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
".more-col-item:hover": {
|
|
123
|
+
color: token.colorPrimaryHover
|
|
124
|
+
}
|
|
125
|
+
}), ".cw-dropdown-menu-history-popup-more-wrapper", {
|
|
126
|
+
padding: "12px 16px 16px",
|
|
127
|
+
backgroundColor: token.colorBgContainer,
|
|
128
|
+
".cw-dropdown-menu-history-popup-more-header": {
|
|
129
|
+
display: "flex",
|
|
130
|
+
justifyContent: "space-between",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
fontSize: "12px",
|
|
133
|
+
lineHeight: "20px",
|
|
134
|
+
marginBottom: "4px"
|
|
135
|
+
},
|
|
136
|
+
".cw-dropdown-menu-history-popup-more-content": {
|
|
137
|
+
display: "flex",
|
|
138
|
+
flexWrap: "wrap",
|
|
139
|
+
"[ant-click-animating-without-extra-node]::after": {
|
|
140
|
+
boxShadow: "none !important"
|
|
141
|
+
},
|
|
142
|
+
".cw-dropdown-menu-history-popup-more-content-tag-title": {
|
|
143
|
+
marginTop: "8px",
|
|
144
|
+
marginRight: "4px",
|
|
145
|
+
"&:hover": {
|
|
146
|
+
boxShadow: "0 0 0 1px ".concat(token.colorPrimary),
|
|
147
|
+
color: token.colorPrimary
|
|
149
148
|
}
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
|
-
};
|
|
151
|
+
});
|
|
153
152
|
};
|
|
154
153
|
// ============================== Export ==============================
|
|
155
154
|
export default genStyleHooks(["CWRangePicker", "DropdownMenu"], function (token) {
|
|
@@ -21,6 +21,7 @@ import Refresh1Svg from "../assets/Refresh1";
|
|
|
21
21
|
import Refresh2Svg from "../assets/Refresh2";
|
|
22
22
|
import Refresh3Svg from "../assets/Refresh3";
|
|
23
23
|
import { getChangeUnitDate, funcValueChangeArrayValue, getTimeSpanFromValue, computedRecentlyValue, judgeType } from "../utils";
|
|
24
|
+
import useConfigContext from "../../useConfigContext";
|
|
24
25
|
import { useIntl } from "../../locales";
|
|
25
26
|
import useStyle from "./index.style";
|
|
26
27
|
var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -34,7 +35,10 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
34
35
|
enableAutoRefresh = props.enableAutoRefresh,
|
|
35
36
|
isClickAutoRefresh = props.isClickAutoRefresh,
|
|
36
37
|
timeSpanOption = props.timeSpanOption;
|
|
37
|
-
var
|
|
38
|
+
var _useConfigContext = useConfigContext(),
|
|
39
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
40
|
+
var prefixCls = getPrefixCls();
|
|
41
|
+
var _useStyle = useStyle("".concat(prefixCls, "-cw-range-picker-refresh")),
|
|
38
42
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
39
43
|
wrapCSSVar = _useStyle2[0],
|
|
40
44
|
hashId = _useStyle2[1],
|
|
@@ -140,7 +144,7 @@ var Refresh = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
140
144
|
};
|
|
141
145
|
});
|
|
142
146
|
return wrapCSSVar((showRefresh || showAutoRefresh) && /*#__PURE__*/React.createElement(_Button.Group, {
|
|
143
|
-
className: "cw-range-picker-refresh-wrapper"
|
|
147
|
+
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-range-picker-refresh-wrapper"))
|
|
144
148
|
}, showRefresh && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
145
149
|
title: intl.get("1d0f3c0c-188f-4f83-bff0-2792dffcdc2d").d("刷新")
|
|
146
150
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
@@ -8,26 +8,23 @@ import { genStyleHooks } from "../../Antd5/theme/internal";
|
|
|
8
8
|
import { keyframes } from "../../antd-style";
|
|
9
9
|
var autoRefresh = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 100% {\n transform: rotate(360deg);\n }\n"])));
|
|
10
10
|
var genCustomRefreshStyle = function genCustomRefreshStyle(token) {
|
|
11
|
-
var prefixCls = token.antCls
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
".cw-range-picker-auto-refresh": {
|
|
26
|
-
color: token.colorPrimary
|
|
27
|
-
}
|
|
11
|
+
var prefixCls = token.antCls;
|
|
12
|
+
return _defineProperty({}, "".concat(prefixCls, "-cw-range-picker-refresh-wrapper"), _defineProperty(_defineProperty(_defineProperty({
|
|
13
|
+
marginLeft: "8px !important",
|
|
14
|
+
display: "flex"
|
|
15
|
+
}, "".concat(prefixCls, "-btn"), {
|
|
16
|
+
width: "28px",
|
|
17
|
+
padding: "0"
|
|
18
|
+
}), ".cw-range-picker-auto-refresh", {
|
|
19
|
+
animation: "".concat(autoRefresh, " 2s linear infinite")
|
|
20
|
+
}), ".cw-range-picker-auto-refresh-wrapper", {
|
|
21
|
+
"&:not(&[disabled])": {
|
|
22
|
+
borderColor: "".concat(token.colorPrimary, " !important"),
|
|
23
|
+
".cw-range-picker-auto-refresh": {
|
|
24
|
+
color: token.colorPrimary
|
|
28
25
|
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
31
28
|
};
|
|
32
29
|
// ============================== Export ==============================
|
|
33
30
|
export default genStyleHooks(["CWRangePicker", "Refresh"], function (token) {
|
|
@@ -9,6 +9,8 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
9
9
|
import React from "react";
|
|
10
10
|
import { CaretLeftOutlined, CaretRightOutlined, ZoomInOutlined } from "@ant-design/icons";
|
|
11
11
|
import { getChangeDate } from "../utils";
|
|
12
|
+
import classnames from "classnames";
|
|
13
|
+
import useConfigContext from "../../useConfigContext";
|
|
12
14
|
import { useIntl } from "../../locales";
|
|
13
15
|
import useStyle from "./index.style";
|
|
14
16
|
_Button.__ANT_BUTTON = true;
|
|
@@ -22,7 +24,10 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
22
24
|
timeSpanOption = props.timeSpanOption,
|
|
23
25
|
isRightDisabled = props.isRightDisabled,
|
|
24
26
|
isDisabledEnlargeBtn = props.isDisabledEnlargeBtn;
|
|
25
|
-
var
|
|
27
|
+
var _useConfigContext = useConfigContext(),
|
|
28
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
29
|
+
var prefixCls = getPrefixCls();
|
|
30
|
+
var _useStyle = useStyle("".concat(prefixCls, "-cw-range-picker-time-span")),
|
|
26
31
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
27
32
|
wrapCSSVar = _useStyle2[0],
|
|
28
33
|
hashId = _useStyle2[1],
|
|
@@ -67,7 +72,7 @@ var TimeSpan = function TimeSpan(props) {
|
|
|
67
72
|
};
|
|
68
73
|
var showTimeSpan = showForwardBtn || showBackwardBtn || showEnlargeBtn;
|
|
69
74
|
return wrapCSSVar(isHasDate && showTimeSpan && /*#__PURE__*/React.createElement(_Button.Group, {
|
|
70
|
-
className: "cw-range-picker-time-span-wrapper"
|
|
75
|
+
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-range-picker-time-span-wrapper"))
|
|
71
76
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
72
77
|
title: forwardTitle
|
|
73
78
|
}, showForwardBtn && /*#__PURE__*/React.createElement(_Button, {
|
|
@@ -4,18 +4,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
4
4
|
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); }
|
|
5
5
|
import { genStyleHooks } from "../../Antd5/theme/internal";
|
|
6
6
|
var genCustomTimeSpanStyle = function genCustomTimeSpanStyle(token) {
|
|
7
|
-
var prefixCls = token.antCls
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
fontSize: "14px !important"
|
|
17
|
-
}))
|
|
18
|
-
};
|
|
7
|
+
var prefixCls = token.antCls;
|
|
8
|
+
return _defineProperty({}, "".concat(prefixCls, "-cw-range-picker-time-span-wrapper"), _defineProperty({
|
|
9
|
+
marginLeft: "8px",
|
|
10
|
+
display: "flex"
|
|
11
|
+
}, "".concat(prefixCls, "-btn-icon-only"), _defineProperty({}, token.iconCls, {
|
|
12
|
+
width: "14px !important",
|
|
13
|
+
height: "14px !important",
|
|
14
|
+
fontSize: "14px !important"
|
|
15
|
+
})));
|
|
19
16
|
};
|
|
20
17
|
// ============================== Export ==============================
|
|
21
18
|
export default genStyleHooks(["CWRangePicker", "TimeSpan"], function (token) {
|
|
@@ -35,6 +35,7 @@ import Refresh from "./Refresh";
|
|
|
35
35
|
import CalendarSvg from "./assets/Calendar";
|
|
36
36
|
import LiveSvg from "./assets/live";
|
|
37
37
|
import RecoverSvg from "./assets/Recover";
|
|
38
|
+
import useConfigContext from "../useConfigContext";
|
|
38
39
|
import { regroupDataSourceFn, echoInputValue, getUnit, judgeType, getChangeUnitDate, isInvalidDate, range, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo, getFinalDateOption, getTruthDateCount, isAfterDate, isSameDate, isExceedMaxTimeSpan, getYears, computedRecentlyValue } from "./utils";
|
|
39
40
|
import _ from "lodash";
|
|
40
41
|
import moment from "moment";
|
|
@@ -98,7 +99,10 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
98
99
|
dropdownCalendarClassName = menuOption.dropdownCalendarClassName,
|
|
99
100
|
disabledDate = menuOption.disabledDate,
|
|
100
101
|
disabledTime = menuOption.disabledTime;
|
|
101
|
-
var
|
|
102
|
+
var _useConfigContext = useConfigContext(),
|
|
103
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
104
|
+
var prefixCls = getPrefixCls();
|
|
105
|
+
var _useStyle = useStyle("".concat(prefixCls, "-cw-range-picker")),
|
|
102
106
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
103
107
|
wrapCSSVar = _useStyle2[0],
|
|
104
108
|
hashId = _useStyle2[1],
|
|
@@ -533,7 +537,7 @@ var CWRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
533
537
|
isClickAutoRefresh: isClickAutoRefresh
|
|
534
538
|
});
|
|
535
539
|
return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
|
|
536
|
-
className: classnames(hashId, cssVarCls, "cw-range-picker-wrapper", classNameWrapper),
|
|
540
|
+
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-range-picker-wrapper"), classNameWrapper),
|
|
537
541
|
ref: calendarRef
|
|
538
542
|
}, /*#__PURE__*/React.createElement("div", {
|
|
539
543
|
className: "cw-range-picker-box-wrapper"
|