@chaoswise/ui 2.3.1 → 2.3.3
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/BasicLayout/index.js +16 -3
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +0 -1
- package/lib/CWRangePicker/DropdownMenu/index.js +4 -31
- package/lib/CWRangePicker/Refresh/index.js +34 -19
- package/lib/CWRangePicker/TimeSpan/index.js +11 -12
- package/lib/CWRangePicker/index.js +141 -51
- package/lib/CWRangePicker/locale/en_US.js +2 -1
- package/lib/CWRangePicker/locale/zh_CN.js +2 -1
- package/lib/CWRangePicker/utils/index.js +16 -6
- package/lib/CWSelect/index.js +8 -4
- package/lib/CWTable/header.js +19 -4
- package/lib/Cascader/index.less +4 -0
- package/lib/DropdownDatePicker/assets/Recover.js +18 -0
- package/lib/DropdownDatePicker/index.js +87 -11
- package/lib/DropdownDatePicker/locale/en_US.js +1 -0
- package/lib/DropdownDatePicker/locale/zh_CN.js +1 -0
- package/lib/DropdownDatePicker/utils/index.js +6 -2
- package/lib/Header/TopNavigationMenu/index.js +59 -0
- package/lib/Header/TopNavigationMenu/index.less +41 -0
- package/lib/Header/index.js +12 -4
- package/lib/InputNumber/index.js +4 -0
- package/lib/RangePicker/components/ExtraTimeFooter.js +8 -2
- package/lib/RangePicker/index.js +5 -0
- package/lib/RangePicker/index.less +22 -7
- package/lib/SimplePagination/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
2
3
|
import "@chaoswise/ui/lib/Input/index.less";
|
|
3
4
|
import _Input from "@chaoswise/ui/lib/Input";
|
|
@@ -5,9 +6,18 @@ import "@chaoswise/ui/lib/DatePicker/index.less";
|
|
|
5
6
|
import _DatePicker from "@chaoswise/ui/lib/DatePicker";
|
|
6
7
|
import "@chaoswise/ui/lib/RangePicker/index.less";
|
|
7
8
|
import _RangePicker from "@chaoswise/ui/lib/RangePicker";
|
|
9
|
+
import "@chaoswise/ui/lib/Tooltip/index.less";
|
|
10
|
+
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
8
11
|
import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
|
|
9
|
-
var _excluded = ["inputPrefixIcon", "className"]
|
|
12
|
+
var _excluded = ["inputPrefixIcon", "className"],
|
|
13
|
+
_excluded2 = ["value"],
|
|
14
|
+
_excluded3 = ["value"];
|
|
10
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
22
|
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."); }
|
|
13
23
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -21,8 +31,12 @@ import PropTypes from "prop-types";
|
|
|
21
31
|
import classnames from "classnames";
|
|
22
32
|
import DropDownMenu from "./DropdownMenu";
|
|
23
33
|
import LiveSvg from "./assets/live";
|
|
24
|
-
import
|
|
34
|
+
import RecoverSvg from "./assets/Recover";
|
|
35
|
+
import { getLocale } from "./locale";
|
|
36
|
+
import _ from "lodash";
|
|
37
|
+
import { regroupDataSourceFn, echoInputValue, isEmptyObject, funcValueChangeArrayValue, getCorrectValue } from "./utils";
|
|
25
38
|
import moment from "moment";
|
|
39
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
26
40
|
import "./index.less";
|
|
27
41
|
var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
28
42
|
var defaultValue = props.defaultValue,
|
|
@@ -42,6 +56,7 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
42
56
|
var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
|
|
43
57
|
_ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
|
|
44
58
|
locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
|
|
59
|
+
var localeObj = getLocale(locale);
|
|
45
60
|
var _menuOption$showCalen = menuOption.showCalendar,
|
|
46
61
|
showCalendar = _menuOption$showCalen === void 0 ? true : _menuOption$showCalen,
|
|
47
62
|
_menuOption$isRangePi = menuOption.isRangePickerCalendar,
|
|
@@ -73,14 +88,29 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
73
88
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
74
89
|
recordDateValue = _useState6[0],
|
|
75
90
|
setRecordDateValue = _useState6[1];
|
|
76
|
-
//
|
|
77
|
-
var _useState7 = useState(
|
|
91
|
+
// 当前默认时间项
|
|
92
|
+
var _useState7 = useState({}),
|
|
78
93
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
dateValue = _useState8[0],
|
|
95
|
+
setDateValue = _useState8[1];
|
|
96
|
+
// 是否切换到日历选择
|
|
97
|
+
var _useState9 = useState(false),
|
|
98
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
99
|
+
isCalendar = _useState10[0],
|
|
100
|
+
setIsCalendar = _useState10[1];
|
|
81
101
|
// 特殊时间选择器外壳容器
|
|
82
102
|
var calendarRef = useRef(null);
|
|
83
103
|
// 初始时记录当前时间项
|
|
104
|
+
useEffect(function () {
|
|
105
|
+
var dateValue = {};
|
|
106
|
+
if (value) {
|
|
107
|
+
dateValue = value;
|
|
108
|
+
} else if (defaultValue) {
|
|
109
|
+
dateValue = defaultValue;
|
|
110
|
+
}
|
|
111
|
+
setDateValue(dateValue);
|
|
112
|
+
}, []);
|
|
113
|
+
// 初始时记录当前时间项
|
|
84
114
|
useEffect(function () {
|
|
85
115
|
if (value) {
|
|
86
116
|
setRecordDateValue(value);
|
|
@@ -131,6 +161,45 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
131
161
|
}, inputPrefixIcon ? inputPrefixIcon : /*#__PURE__*/React.createElement(LiveSvg, {
|
|
132
162
|
className: classnames("cw-dropdown-date-picker-prefix-icon")
|
|
133
163
|
}));
|
|
164
|
+
// 恢复默认配置
|
|
165
|
+
var onRecover = function onRecover() {
|
|
166
|
+
var isEmptyObj = isEmptyObject(dateValue);
|
|
167
|
+
var values = dateValue.value,
|
|
168
|
+
key = dateValue.key;
|
|
169
|
+
var returnValue = dateValue;
|
|
170
|
+
if (!isEmptyObj) {
|
|
171
|
+
returnValue = _objectSpread(_objectSpread({}, dateValue), {}, {
|
|
172
|
+
value: funcValueChangeArrayValue(values)
|
|
173
|
+
});
|
|
174
|
+
returnValue = getCorrectValue(returnValue, key);
|
|
175
|
+
}
|
|
176
|
+
_onChange(returnValue);
|
|
177
|
+
if (!value) {
|
|
178
|
+
setRecordDateValue(returnValue);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var isEqual = useMemo(function () {
|
|
182
|
+
var values = recordDateValue.value,
|
|
183
|
+
rest = _objectWithoutProperties(recordDateValue, _excluded2);
|
|
184
|
+
var _values = dateValue.value,
|
|
185
|
+
dateValueRest = _objectWithoutProperties(dateValue, _excluded3);
|
|
186
|
+
if (isEmptyObject(recordDateValue) && isEmptyObject(dateValue)) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (!isEmptyObject(recordDateValue) && !isEmptyObject(dateValue)) {
|
|
190
|
+
if (_.isEqual(rest, dateValueRest)) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}, [recordDateValue, dateValue]);
|
|
196
|
+
// 输入框尾缀图标
|
|
197
|
+
var inputSuffix = !isEqual && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
198
|
+
title: localeObj.recover
|
|
199
|
+
}, /*#__PURE__*/React.createElement(RecoverSvg, {
|
|
200
|
+
onClick: onRecover,
|
|
201
|
+
className: classnames("cw-dropdown-date-picker-suffix-recover")
|
|
202
|
+
}));
|
|
134
203
|
// 输入框获取焦点
|
|
135
204
|
var onInputFocus = function onInputFocus(e) {
|
|
136
205
|
setIsFocus(true);
|
|
@@ -166,12 +235,15 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
166
235
|
setIsCalendar(false);
|
|
167
236
|
setIsFocus(false);
|
|
168
237
|
if (_value) {
|
|
238
|
+
var key = uuidv4();
|
|
169
239
|
_onChange({
|
|
170
|
-
value: _value
|
|
240
|
+
value: _value,
|
|
241
|
+
key: key
|
|
171
242
|
});
|
|
172
243
|
if (!value) {
|
|
173
244
|
setRecordDateValue({
|
|
174
|
-
value: _value
|
|
245
|
+
value: _value,
|
|
246
|
+
key: key
|
|
175
247
|
});
|
|
176
248
|
}
|
|
177
249
|
}
|
|
@@ -202,12 +274,15 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
202
274
|
setIsCalendar(false);
|
|
203
275
|
setIsFocus(false);
|
|
204
276
|
if (_value) {
|
|
277
|
+
var key = uuidv4();
|
|
205
278
|
_onChange({
|
|
206
|
-
value: [_value]
|
|
279
|
+
value: [_value],
|
|
280
|
+
key: key
|
|
207
281
|
});
|
|
208
282
|
if (!value) {
|
|
209
283
|
setRecordDateValue({
|
|
210
|
-
value: [_value]
|
|
284
|
+
value: [_value],
|
|
285
|
+
key: key
|
|
211
286
|
});
|
|
212
287
|
}
|
|
213
288
|
}
|
|
@@ -215,7 +290,8 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
215
290
|
inputReadOnly: true
|
|
216
291
|
}) : null;
|
|
217
292
|
var _renderInputDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Input, _extends({
|
|
218
|
-
prefix: inputPrefix
|
|
293
|
+
prefix: inputPrefix,
|
|
294
|
+
suffix: inputSuffix
|
|
219
295
|
}, _inputOption, {
|
|
220
296
|
className: classnames("cw-dropdown-date-picker-input-wrapper", inputWrapperClassName),
|
|
221
297
|
onFocus: onInputFocus,
|
|
@@ -241,7 +241,11 @@ export var getCorrectValue = function getCorrectValue(value) {
|
|
|
241
241
|
}
|
|
242
242
|
if (!isRule && !returnValue.value) {
|
|
243
243
|
delete returnValue.value;
|
|
244
|
-
delete returnValue.isRecently;
|
|
245
244
|
}
|
|
246
245
|
return returnValue;
|
|
247
|
-
};
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// 判断一个值是否为空对象
|
|
249
|
+
export function isEmptyObject(value) {
|
|
250
|
+
return Object.keys(value).length === 0 && value.constructor === Object;
|
|
251
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _Dropdown from "@chaoswise/ui/lib/Antd/Dropdown";
|
|
2
|
+
import _Icon from "@chaoswise/ui/lib/Antd/Icon";
|
|
3
|
+
import _Menu from "@chaoswise/ui/lib/Menu";
|
|
4
|
+
import "@chaoswise/ui/lib/TooltipText/index.less";
|
|
5
|
+
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
6
|
+
import React, { useMemo } from "react";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import "./index.less";
|
|
9
|
+
// 产品直接在头部容器中展示
|
|
10
|
+
var TopNavigationMenu = function TopNavigationMenu(props) {
|
|
11
|
+
var topNavigation = props.topNavigation,
|
|
12
|
+
onClickTopNavigationSelf = props.onClickTopNavigationSelf,
|
|
13
|
+
topNavigationOption = props.topNavigationOption;
|
|
14
|
+
var _topNavigationOption$ = topNavigationOption.unfoldMaxCount,
|
|
15
|
+
unfoldMaxCount = _topNavigationOption$ === void 0 ? 4 : _topNavigationOption$,
|
|
16
|
+
_topNavigationOption$2 = topNavigationOption.activeKey,
|
|
17
|
+
activeKey = _topNavigationOption$2 === void 0 ? "" : _topNavigationOption$2,
|
|
18
|
+
moreOverlayClassName = topNavigationOption.moreOverlayClassName,
|
|
19
|
+
topNavigationWrapperClassName = topNavigationOption.topNavigationWrapperClassName;
|
|
20
|
+
var _activeKey = useMemo(function () {
|
|
21
|
+
return activeKey;
|
|
22
|
+
}, [activeKey]);
|
|
23
|
+
if (!topNavigation || !topNavigation.length) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var menu = /*#__PURE__*/React.createElement(_Menu, {
|
|
27
|
+
selectable: true,
|
|
28
|
+
selectedKeys: [_activeKey]
|
|
29
|
+
}, topNavigation.slice(unfoldMaxCount).map(function (item) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
31
|
+
onClick: function onClick(_ref) {
|
|
32
|
+
var domEvent = _ref.domEvent;
|
|
33
|
+
onClickTopNavigationSelf(domEvent, item);
|
|
34
|
+
},
|
|
35
|
+
key: item.value
|
|
36
|
+
}, /*#__PURE__*/React.createElement(_TooltipText, null, item.name));
|
|
37
|
+
}));
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: classnames("cw-header-top-navigation-menu-wrapper", topNavigationWrapperClassName)
|
|
40
|
+
}, topNavigation.slice(0, unfoldMaxCount).map(function (item) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
key: item.value,
|
|
43
|
+
onClick: function onClick(e) {
|
|
44
|
+
return onClickTopNavigationSelf(e, item);
|
|
45
|
+
},
|
|
46
|
+
className: classnames("cw-header-top-navigation-menu-item", {
|
|
47
|
+
"cw-header-top-navigation-menu-item-seleted": _activeKey === item.value
|
|
48
|
+
})
|
|
49
|
+
}, item.name);
|
|
50
|
+
}), (topNavigation === null || topNavigation === void 0 ? void 0 : topNavigation.length) > unfoldMaxCount && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
51
|
+
overlay: menu,
|
|
52
|
+
overlayClassName: classnames(moreOverlayClassName)
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "cw-header-top-navigation-menu-more-wrapper"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
56
|
+
type: "ellipsis"
|
|
57
|
+
}))));
|
|
58
|
+
};
|
|
59
|
+
export default TopNavigationMenu;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.cw-header-top-navigation-menu-wrapper {
|
|
2
|
+
margin-left: 16px;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
height: 20px;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
|
|
9
|
+
.cw-header-top-navigation-menu-item {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
height: 20px;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
padding: 0 12px;
|
|
16
|
+
&:hover{
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
&:not(.cw-header-top-navigation-menu-item-seleted):hover {
|
|
20
|
+
color: @primary-5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:not(:first-child) {
|
|
24
|
+
margin-left: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.cw-header-top-navigation-menu-item-seleted {
|
|
28
|
+
background-color: @primary-color;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
border-radius: 10px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cw-header-top-navigation-menu-more-wrapper {
|
|
35
|
+
margin-left: 20px;
|
|
36
|
+
&:hover{
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
color: @primary-5;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/lib/Header/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import PropTypes from 'prop-types';
|
|
|
13
13
|
import { ConfigConsumer } from 'antd/es/config-provider';
|
|
14
14
|
import Message from './Message';
|
|
15
15
|
import Document from './Document';
|
|
16
|
+
import TopNavigationMenu from './TopNavigationMenu';
|
|
16
17
|
import './index.less';
|
|
17
18
|
/**
|
|
18
19
|
*
|
|
@@ -106,7 +107,10 @@ function CWHeader(_ref) {
|
|
|
106
107
|
userSetingOption = _ref.userSetingOption,
|
|
107
108
|
_ref$logoSize = _ref.logoSize,
|
|
108
109
|
logoSize = _ref$logoSize === void 0 ? '50%' : _ref$logoSize,
|
|
109
|
-
homeIcon = _ref.homeIcon
|
|
110
|
+
homeIcon = _ref.homeIcon,
|
|
111
|
+
topNavigationOption = _ref.topNavigationOption;
|
|
112
|
+
var _topNavigationOption$ = topNavigationOption.topNavigationType,
|
|
113
|
+
topNavigationType = _topNavigationOption$ === void 0 ? "fold" : _topNavigationOption$;
|
|
110
114
|
var logoContainerRef = useRef(null);
|
|
111
115
|
var _useState = useState(false),
|
|
112
116
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -224,7 +228,7 @@ function CWHeader(_ref) {
|
|
|
224
228
|
onClick: onClickHome
|
|
225
229
|
}, homeIcon ? homeIcon : /*#__PURE__*/React.createElement(_Icon, {
|
|
226
230
|
component: homeIconSvg
|
|
227
|
-
})) : null, showTopNavigation && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
231
|
+
})) : null, showTopNavigation && (topNavigationType === "fold" ? /*#__PURE__*/React.createElement(_Dropdown, {
|
|
228
232
|
trigger: topNavigationTrigger,
|
|
229
233
|
overlayClassName: "".concat(prefixCls, "-cw-header-dropdown-out-wrapper ").concat(topNavigationClassName !== undefined ? topNavigationClassName : ''),
|
|
230
234
|
overlay: renderTopNavigationMenu(),
|
|
@@ -239,11 +243,15 @@ function CWHeader(_ref) {
|
|
|
239
243
|
}
|
|
240
244
|
}, allProductsTitle, " ", /*#__PURE__*/React.createElement(_Icon, {
|
|
241
245
|
type: "caret-down"
|
|
242
|
-
})))
|
|
246
|
+
}))) : /*#__PURE__*/React.createElement(TopNavigationMenu, {
|
|
247
|
+
onClickTopNavigationSelf: onClickTopNavigationSelf,
|
|
248
|
+
topNavigation: topNavigation,
|
|
249
|
+
topNavigationOption: topNavigationOption
|
|
250
|
+
})), topNavigationType === "fold" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
243
251
|
className: "cw-division"
|
|
244
252
|
}), /*#__PURE__*/React.createElement("div", {
|
|
245
253
|
className: "cw-page-name"
|
|
246
|
-
}, title)), /*#__PURE__*/React.createElement("div", {
|
|
254
|
+
}, title))), /*#__PURE__*/React.createElement("div", {
|
|
247
255
|
className: "cw-header-right"
|
|
248
256
|
}, extra, /*#__PURE__*/React.createElement(Message, {
|
|
249
257
|
option: messageOption
|
package/lib/InputNumber/index.js
CHANGED
|
@@ -25,6 +25,10 @@ var CWInputNumber = /*#__PURE__*/forwardRef(function (props, inputNumberRef) {
|
|
|
25
25
|
var inputNumberInputDom = ReactDom.findDOMNode(ref.current);
|
|
26
26
|
// rc-input-number底层依赖升级以后需要向上查找
|
|
27
27
|
var inputNumberWrapperDom = inputNumberInputDom.closest(".".concat(prefixCls, "-input-number"));
|
|
28
|
+
var ExistingSlotDom = inputNumberWrapperDom.querySelector(".cw-input-number-custom-slot-wrapper");
|
|
29
|
+
if (ExistingSlotDom) {
|
|
30
|
+
inputNumberWrapperDom.removeChild(ExistingSlotDom);
|
|
31
|
+
}
|
|
28
32
|
var divEle = document.createElement("div");
|
|
29
33
|
divEle.className = "cw-input-number-custom-slot-wrapper";
|
|
30
34
|
if (inputNumberWrapperDom) {
|
|
@@ -43,7 +43,10 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
43
43
|
}, showTime && /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
className: "cw-rangePicker-time"
|
|
45
45
|
}, /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: "cw-rangePicker-leftTime"
|
|
46
|
+
className: "cw-rangePicker-leftTime",
|
|
47
|
+
onMouseDown: function onMouseDown(e) {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
}
|
|
47
50
|
}, /*#__PURE__*/React.createElement(_TimePicker, _extends({
|
|
48
51
|
value: startTimeValue,
|
|
49
52
|
onChange: startChange,
|
|
@@ -54,7 +57,10 @@ export default function ExtraTimeFooter(_ref) {
|
|
|
54
57
|
type: "swap-right",
|
|
55
58
|
className: "cw-rangePicker-swap-icon"
|
|
56
59
|
}), /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: "cw-rangePicker-rightTime"
|
|
60
|
+
className: "cw-rangePicker-rightTime",
|
|
61
|
+
onMouseDown: function onMouseDown(e) {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
}
|
|
58
64
|
}, /*#__PURE__*/React.createElement(_TimePicker, _extends({
|
|
59
65
|
getPopupContainer: getPopupContainer,
|
|
60
66
|
value: endTimeValue,
|
package/lib/RangePicker/index.js
CHANGED
|
@@ -165,6 +165,7 @@ var _RangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
165
165
|
};
|
|
166
166
|
// TimePicker开始时间改变触发的事件
|
|
167
167
|
var changeStartTime = function changeStartTime(newStartTime) {
|
|
168
|
+
if (!newStartTime) return;
|
|
168
169
|
setStartTimeParams(newStartTime);
|
|
169
170
|
isBtnRef.current = false;
|
|
170
171
|
if (Array.isArray(dateValue)) {
|
|
@@ -182,6 +183,7 @@ var _RangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
182
183
|
};
|
|
183
184
|
// TimePicker结束时间改变触发的事件
|
|
184
185
|
var changeEndTime = function changeEndTime(newEndTime) {
|
|
186
|
+
if (!newEndTime) return;
|
|
185
187
|
setEndTimeParams(newEndTime);
|
|
186
188
|
isBtnRef.current = false;
|
|
187
189
|
if (Array.isArray(dateValue)) {
|
|
@@ -373,6 +375,9 @@ var _RangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
373
375
|
className: "cw-new-range-picker-wrapper",
|
|
374
376
|
ref: wrapperRef
|
|
375
377
|
}, /*#__PURE__*/React.createElement(RangePicker, _extends({
|
|
378
|
+
popupStyle: {
|
|
379
|
+
zIndex: 9999
|
|
380
|
+
},
|
|
376
381
|
panelRender: panelRender ? panelRender : function (panelNode) {
|
|
377
382
|
var rangesToArray = Object.entries(ranges);
|
|
378
383
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -86,24 +86,39 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.@{ant-prefix}-time-picker-panel {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
bottom: -28px !important;
|
|
90
|
+
top: auto !important;
|
|
91
91
|
.@{ant-prefix}-time-picker-panel-inner {
|
|
92
92
|
border-radius: 2px !important;
|
|
93
93
|
width: 160px;
|
|
94
94
|
left: 0;
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column-reverse;
|
|
95
97
|
.@{ant-prefix}-time-picker-panel-input-wrap {
|
|
96
|
-
display:
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
align-items: center;
|
|
101
|
+
border: @border-width-base @border-style-base @border-color-base;
|
|
102
|
+
padding: 0;
|
|
103
|
+
height: 28px;
|
|
104
|
+
&:hover{
|
|
105
|
+
border-color: @primary-5;
|
|
106
|
+
}
|
|
107
|
+
&:focus-within{
|
|
108
|
+
border-color: @primary-color;
|
|
109
|
+
}
|
|
110
|
+
.@{ant-prefix}-time-picker-panel-input{
|
|
111
|
+
text-align: center;
|
|
112
|
+
}
|
|
97
113
|
}
|
|
98
|
-
|
|
99
114
|
.@{ant-prefix}-time-picker-panel-combobox {
|
|
100
115
|
width: 100%;
|
|
101
|
-
height:
|
|
116
|
+
height: 200px;
|
|
102
117
|
|
|
103
118
|
.@{ant-prefix}-time-picker-panel-select {
|
|
104
119
|
width: 33.3%;
|
|
105
|
-
height:
|
|
106
|
-
max-height:
|
|
120
|
+
height: 200px;
|
|
121
|
+
max-height: 200px;
|
|
107
122
|
|
|
108
123
|
ul {
|
|
109
124
|
width: 100%;
|
|
@@ -91,7 +91,7 @@ function SimplePagination(props) {
|
|
|
91
91
|
}
|
|
92
92
|
if (current_ < 1) return;
|
|
93
93
|
if (current_ > allPage) return;
|
|
94
|
-
if (current_ ===
|
|
94
|
+
if (current_ === _current) return;
|
|
95
95
|
_onChange(current_, _pageSize);
|
|
96
96
|
setPageInfo(_objectSpread(_objectSpread({}, pageInfo), {}, {
|
|
97
97
|
current: current_
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"access": "public"
|
|
141
141
|
},
|
|
142
142
|
"license": "MIT",
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "d4b92c78c796d0e79769112f642e46aaf7453ed5"
|
|
144
144
|
}
|