hc-busin-components 1.0.3 → 1.0.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.
- package/dist/Actions/index.js +46 -87
- package/dist/Actions/index.less +33 -0
- package/dist/CascaderCluster/index.js +46 -37
- package/dist/DateRangePicker/index.d.ts +17 -1
- package/dist/DateRangePicker/index.js +221 -103
- package/dist/DateRangePicker/index.less +50 -17
- package/dist/DeleteConfirm/index.js +4 -3
- package/dist/DeleteConfirm/index.less +8 -0
- package/dist/HCDrawer/index.d.ts +14 -0
- package/dist/HCDrawer/index.js +307 -0
- package/dist/HCDrawer/index.less +30 -0
- package/dist/HCModal/index.d.ts +9 -0
- package/dist/HCModal/index.js +50 -0
- package/dist/HCModal/index.less +29 -0
- package/dist/PageHeader/index.less +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +4 -0
- package/dist/utils/storage/index.d.ts +11 -0
- package/dist/utils/storage/index.js +67 -0
- package/dist/utils/tree/index.d.ts +59 -0
- package/dist/utils/tree/index.js +375 -0
- package/package.json +1 -1
package/dist/Actions/index.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
var _excluded = ["disabled", "children", "onClick", "style"],
|
|
2
|
-
_excluded2 = ["onClick", "disabled", "children"]
|
|
3
|
-
_excluded3 = ["onClick", "disabled", "style", "children"],
|
|
4
|
-
_excluded4 = ["onClick", "disabled", "children"];
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
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."); }
|
|
7
|
-
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); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
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; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
2
|
+
_excluded2 = ["onClick", "disabled", "children"];
|
|
11
3
|
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); }
|
|
12
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
6
|
import { MoreOutlined } from '@ant-design/icons';
|
|
15
7
|
import { Divider, Dropdown, Space } from 'antd';
|
|
16
|
-
import React
|
|
8
|
+
import React from 'react';
|
|
17
9
|
import "./index.less";
|
|
18
10
|
var LinkButton = function LinkButton(_ref) {
|
|
19
11
|
var _ref$disabled = _ref.disabled,
|
|
@@ -28,29 +20,38 @@ var LinkButton = function LinkButton(_ref) {
|
|
|
28
20
|
onClick: disabled ? undefined : onClick
|
|
29
21
|
}, args), linkChildren);
|
|
30
22
|
};
|
|
23
|
+
var isLinkButtonElement = function isLinkButtonElement(item) {
|
|
24
|
+
return /*#__PURE__*/React.isValidElement(item) && item.type === LinkButton;
|
|
25
|
+
};
|
|
26
|
+
var normalizeChildren = function normalizeChildren(children) {
|
|
27
|
+
return React.Children.toArray(children).filter(React.isValidElement);
|
|
28
|
+
};
|
|
29
|
+
var renderInlineAction = function renderInlineAction(item, index) {
|
|
30
|
+
var _item$key2;
|
|
31
|
+
if (isLinkButtonElement(item)) {
|
|
32
|
+
var _item$key;
|
|
33
|
+
var _item$props = item.props,
|
|
34
|
+
onClick = _item$props.onClick,
|
|
35
|
+
_item$props$disabled = _item$props.disabled,
|
|
36
|
+
disabled = _item$props$disabled === void 0 ? false : _item$props$disabled,
|
|
37
|
+
linkChildren = _item$props.children,
|
|
38
|
+
rest = _objectWithoutProperties(_item$props, _excluded2);
|
|
39
|
+
return /*#__PURE__*/React.createElement(LinkButton, _extends({
|
|
40
|
+
key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : index,
|
|
41
|
+
onClick: onClick,
|
|
42
|
+
disabled: disabled
|
|
43
|
+
}, rest), linkChildren);
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
46
|
+
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : index
|
|
47
|
+
}, item);
|
|
48
|
+
};
|
|
31
49
|
var Actions = function Actions(_ref2) {
|
|
32
50
|
var children = _ref2.children,
|
|
33
51
|
_ref2$threshold = _ref2.threshold,
|
|
34
52
|
threshold = _ref2$threshold === void 0 ? 3 : _ref2$threshold;
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
list = _useState2[0],
|
|
38
|
-
setList = _useState2[1];
|
|
39
|
-
useEffect(function () {
|
|
40
|
-
if (!children) {
|
|
41
|
-
setList([]);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (Array.isArray(children)) {
|
|
45
|
-
var lt = children.filter(function (item) {
|
|
46
|
-
return item !== null && typeof item !== 'boolean' && /*#__PURE__*/React.isValidElement(item);
|
|
47
|
-
});
|
|
48
|
-
setList(lt);
|
|
49
|
-
} else if ( /*#__PURE__*/React.isValidElement(children) && children.props.children) {
|
|
50
|
-
setList([children]);
|
|
51
|
-
} else {
|
|
52
|
-
setList([]);
|
|
53
|
-
}
|
|
53
|
+
var list = React.useMemo(function () {
|
|
54
|
+
return normalizeChildren(children);
|
|
54
55
|
}, [children]);
|
|
55
56
|
if (list.length <= threshold) {
|
|
56
57
|
return /*#__PURE__*/React.createElement(Space, {
|
|
@@ -61,51 +62,10 @@ var Actions = function Actions(_ref2) {
|
|
|
61
62
|
split: /*#__PURE__*/React.createElement(Divider, {
|
|
62
63
|
type: "vertical"
|
|
63
64
|
})
|
|
64
|
-
}, list.map(
|
|
65
|
-
var _item$props = item.props,
|
|
66
|
-
onClick = _item$props.onClick,
|
|
67
|
-
_item$props$disabled = _item$props.disabled,
|
|
68
|
-
disabled = _item$props$disabled === void 0 ? false : _item$props$disabled,
|
|
69
|
-
linkChildren = _item$props.children,
|
|
70
|
-
rest = _objectWithoutProperties(_item$props, _excluded2);
|
|
71
|
-
return /*#__PURE__*/React.createElement(LinkButton, _extends({
|
|
72
|
-
key: index,
|
|
73
|
-
onClick: onClick,
|
|
74
|
-
disabled: disabled
|
|
75
|
-
}, rest), linkChildren);
|
|
76
|
-
}));
|
|
65
|
+
}, list.map(renderInlineAction));
|
|
77
66
|
}
|
|
78
67
|
var l1 = list.slice(0, threshold);
|
|
79
68
|
var l2 = list.slice(threshold);
|
|
80
|
-
var items = l2.map(function (item, index) {
|
|
81
|
-
var _item$props2 = item.props,
|
|
82
|
-
onClick = _item$props2.onClick,
|
|
83
|
-
_item$props2$disabled = _item$props2.disabled,
|
|
84
|
-
disabled = _item$props2$disabled === void 0 ? false : _item$props2$disabled,
|
|
85
|
-
style = _item$props2.style,
|
|
86
|
-
labelChildren = _item$props2.children,
|
|
87
|
-
rest = _objectWithoutProperties(_item$props2, _excluded3);
|
|
88
|
-
void onClick;
|
|
89
|
-
return {
|
|
90
|
-
key: String(index),
|
|
91
|
-
disabled: disabled,
|
|
92
|
-
label: /*#__PURE__*/React.createElement("span", _extends({
|
|
93
|
-
className: disabled ? 'displayed-name' : '',
|
|
94
|
-
style: style
|
|
95
|
-
}, rest), labelChildren)
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
var onMenuClick = function onMenuClick(_ref3) {
|
|
99
|
-
var key = _ref3.key,
|
|
100
|
-
domEvent = _ref3.domEvent;
|
|
101
|
-
domEvent === null || domEvent === void 0 || domEvent.stopPropagation();
|
|
102
|
-
var idx = Number(key);
|
|
103
|
-
var item = l2[idx];
|
|
104
|
-
if (item && !item.props.disabled) {
|
|
105
|
-
var _item$props$onClick, _item$props3;
|
|
106
|
-
(_item$props$onClick = (_item$props3 = item.props).onClick) === null || _item$props$onClick === void 0 || _item$props$onClick.call(_item$props3);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
69
|
return /*#__PURE__*/React.createElement(Space, {
|
|
110
70
|
align: "center",
|
|
111
71
|
style: {
|
|
@@ -114,23 +74,22 @@ var Actions = function Actions(_ref2) {
|
|
|
114
74
|
split: /*#__PURE__*/React.createElement(Divider, {
|
|
115
75
|
type: "vertical"
|
|
116
76
|
})
|
|
117
|
-
}, l1.map(
|
|
118
|
-
var _item$props4 = item.props,
|
|
119
|
-
onClick = _item$props4.onClick,
|
|
120
|
-
_item$props4$disabled = _item$props4.disabled,
|
|
121
|
-
disabled = _item$props4$disabled === void 0 ? false : _item$props4$disabled,
|
|
122
|
-
linkChildren = _item$props4.children,
|
|
123
|
-
rest = _objectWithoutProperties(_item$props4, _excluded4);
|
|
124
|
-
return /*#__PURE__*/React.createElement(LinkButton, _extends({
|
|
125
|
-
key: index,
|
|
126
|
-
onClick: onClick,
|
|
127
|
-
disabled: disabled
|
|
128
|
-
}, rest), linkChildren);
|
|
129
|
-
}), /*#__PURE__*/React.createElement(Dropdown, {
|
|
77
|
+
}, l1.map(renderInlineAction), /*#__PURE__*/React.createElement(Dropdown, {
|
|
130
78
|
trigger: ['click'],
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
79
|
+
overlayClassName: "actions-dropdown",
|
|
80
|
+
dropdownRender: function dropdownRender() {
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: "actions-dropdown-content",
|
|
83
|
+
onClick: function onClick(event) {
|
|
84
|
+
return event.stopPropagation();
|
|
85
|
+
}
|
|
86
|
+
}, l2.map(function (item, index) {
|
|
87
|
+
var _item$key3;
|
|
88
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : index,
|
|
90
|
+
className: "actions-dropdown-item"
|
|
91
|
+
}, renderInlineAction(item, index));
|
|
92
|
+
}));
|
|
134
93
|
}
|
|
135
94
|
}, /*#__PURE__*/React.createElement(MoreOutlined, {
|
|
136
95
|
style: {
|
package/dist/Actions/index.less
CHANGED
|
@@ -7,3 +7,36 @@
|
|
|
7
7
|
color: var(--ant-color-text-disabled);
|
|
8
8
|
cursor: not-allowed;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
.actions-dropdown-content {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
width: fit-content;
|
|
14
|
+
min-width: unset;
|
|
15
|
+
max-width: max-content;
|
|
16
|
+
padding: 4px 0;
|
|
17
|
+
background: var(--ant-color-bg-elevated, #fff);
|
|
18
|
+
border-radius: var(--ant-border-radius-lg, 8px);
|
|
19
|
+
box-shadow: var(--ant-box-shadow-secondary, 0 6px 16px 0 rgb(0 0 0 / 8%));
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.actions-dropdown-item {
|
|
24
|
+
padding: 5px 12px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
line-height: 22px;
|
|
27
|
+
transition: background-color 0.2s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.actions-dropdown-item:hover {
|
|
31
|
+
background: var(--ant-control-item-bg-hover, rgb(0 0 0 / 4%));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.actions-dropdown-item .name-link,
|
|
35
|
+
.actions-dropdown-item .displayed-name {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.actions-dropdown .ant-dropdown-arrow::before {
|
|
41
|
+
background: var(--ant-color-bg-elevated, #fff);
|
|
42
|
+
}
|
|
@@ -15,7 +15,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
15
15
|
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); }
|
|
16
16
|
import { SearchOutlined } from '@ant-design/icons';
|
|
17
17
|
import { ConfigProvider, Divider, Dropdown, Input, Popover } from 'antd';
|
|
18
|
-
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
18
|
+
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
19
|
import ComponentUninstalled from "../ComponentUninstalled";
|
|
20
20
|
import Icon from "../Icon";
|
|
21
21
|
import TextEllipsis from "../TextEllipsis";
|
|
@@ -91,6 +91,10 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
91
91
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
92
92
|
currentCluster = _useState12[0],
|
|
93
93
|
setCurrentCluster = _useState12[1];
|
|
94
|
+
var onClusterChangeRef = useRef(onClusterChange);
|
|
95
|
+
useEffect(function () {
|
|
96
|
+
onClusterChangeRef.current = onClusterChange;
|
|
97
|
+
}, [onClusterChange]);
|
|
94
98
|
var resolvedDataInterface = useMemo(function () {
|
|
95
99
|
if (dataInterfaceProp) return dataInterfaceProp;
|
|
96
100
|
if (services) return buildCascaderClusterDataInterface(space, isBackend, storage, services);
|
|
@@ -103,6 +107,9 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
103
107
|
writeFilterCache(storage, isBackend, pathname, params);
|
|
104
108
|
onFilterCacheChange === null || onFilterCacheChange === void 0 || onFilterCacheChange(params);
|
|
105
109
|
}, [storage, isBackend, pathname, onFilterCacheChange]);
|
|
110
|
+
var emitClusterChange = useCallback(function (clusterName) {
|
|
111
|
+
onClusterChangeRef.current(clusterName);
|
|
112
|
+
}, []);
|
|
106
113
|
var getInitCluster = useCallback(function (list, dcData) {
|
|
107
114
|
var cachedClusterName = getCache().clusterName;
|
|
108
115
|
var all = list || [];
|
|
@@ -120,43 +127,45 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
120
127
|
var clusterName = cluster.clusterName || '';
|
|
121
128
|
setCurrentCluster(clusterName);
|
|
122
129
|
if (clusterName) {
|
|
123
|
-
|
|
130
|
+
emitClusterChange(clusterName);
|
|
124
131
|
}
|
|
125
132
|
saveCache(_objectSpread(_objectSpread({}, dcData), {}, {
|
|
126
133
|
clusterName: clusterName
|
|
127
134
|
}));
|
|
128
|
-
}, [
|
|
129
|
-
var fetchClusterList = useCallback( /*#__PURE__*/
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
list
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
135
|
+
}, [emitClusterChange, getCache, saveCache]);
|
|
136
|
+
var fetchClusterList = useCallback( /*#__PURE__*/function () {
|
|
137
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
138
|
+
var _resolvedDataInterfac;
|
|
139
|
+
var list;
|
|
140
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
141
|
+
while (1) switch (_context.prev = _context.next) {
|
|
142
|
+
case 0:
|
|
143
|
+
if (resolvedDataInterface !== null && resolvedDataInterface !== void 0 && (_resolvedDataInterfac = resolvedDataInterface.resource) !== null && _resolvedDataInterfac !== void 0 && _resolvedDataInterfac.service) {
|
|
144
|
+
_context.next = 2;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
return _context.abrupt("return");
|
|
148
|
+
case 2:
|
|
149
|
+
_context.next = 4;
|
|
150
|
+
return resolvedDataInterface.resource.service(_objectSpread(_objectSpread({}, resolvedDataInterface.resource.params || {}), {}, {
|
|
151
|
+
dataCenterId: params === null || params === void 0 ? void 0 : params.dataCenterId,
|
|
152
|
+
logicalUnitId: params === null || params === void 0 ? void 0 : params.logicalUnitId
|
|
153
|
+
}));
|
|
154
|
+
case 4:
|
|
155
|
+
list = _context.sent;
|
|
156
|
+
setAllClusters(list);
|
|
157
|
+
setClusterList(list);
|
|
158
|
+
getInitCluster(list, params);
|
|
159
|
+
case 8:
|
|
160
|
+
case "end":
|
|
161
|
+
return _context.stop();
|
|
162
|
+
}
|
|
163
|
+
}, _callee);
|
|
164
|
+
}));
|
|
165
|
+
return function (_x) {
|
|
166
|
+
return _ref.apply(this, arguments);
|
|
167
|
+
};
|
|
168
|
+
}(), [resolvedDataInterface, getInitCluster]);
|
|
160
169
|
var getLdcWriteBack = useCallback(function (list) {
|
|
161
170
|
var cache = getCache();
|
|
162
171
|
if (cache.id === '-1') {
|
|
@@ -257,7 +266,7 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
257
266
|
if (space === 'cluster') {
|
|
258
267
|
var cluster = String(storage.getSession('clusterName') || '');
|
|
259
268
|
setCurrentCluster(cluster);
|
|
260
|
-
|
|
269
|
+
emitClusterChange(cluster);
|
|
261
270
|
setDatacenterList([]);
|
|
262
271
|
setClusterList([]);
|
|
263
272
|
setAllClusters([]);
|
|
@@ -269,7 +278,7 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
269
278
|
return;
|
|
270
279
|
}
|
|
271
280
|
fetchDatacenterList();
|
|
272
|
-
}, [space, datacenters, clusters, compoKey, fetchDatacenterList, getInitDatacenter,
|
|
281
|
+
}, [space, datacenters, clusters, compoKey, fetchDatacenterList, getInitDatacenter, emitClusterChange, storage]);
|
|
273
282
|
useEffect(function () {
|
|
274
283
|
if (!pathname.includes('resourceQuotaCenter')) return;
|
|
275
284
|
var timer = setTimeout(function () {
|
|
@@ -331,7 +340,7 @@ var CascaderCluster = function CascaderCluster(props) {
|
|
|
331
340
|
};
|
|
332
341
|
var handleChangeCluster = function handleChangeCluster(cluster) {
|
|
333
342
|
setCurrentCluster(cluster.clusterName);
|
|
334
|
-
|
|
343
|
+
emitClusterChange(cluster.clusterName);
|
|
335
344
|
saveCache(_objectSpread(_objectSpread({}, currentDatacenter), {}, {
|
|
336
345
|
clusterName: cluster.clusterName
|
|
337
346
|
}));
|
|
@@ -13,6 +13,16 @@ export interface TimeRangeInfo {
|
|
|
13
13
|
timeUnitId?: number;
|
|
14
14
|
id?: number;
|
|
15
15
|
}
|
|
16
|
+
export interface DateRangePickerValue {
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
inputValue?: string;
|
|
20
|
+
diff?: number;
|
|
21
|
+
sliderValue?: number | null;
|
|
22
|
+
interval?: number;
|
|
23
|
+
timeUnitId?: number;
|
|
24
|
+
id?: number;
|
|
25
|
+
}
|
|
16
26
|
export interface QuickTimeOption {
|
|
17
27
|
id: number;
|
|
18
28
|
value: number;
|
|
@@ -21,9 +31,14 @@ export interface QuickTimeOption {
|
|
|
21
31
|
interval?: number;
|
|
22
32
|
timeUnitId?: number;
|
|
23
33
|
}
|
|
34
|
+
export interface DateRangePickerLocale {
|
|
35
|
+
recent: React.ReactNode;
|
|
36
|
+
custom: React.ReactNode;
|
|
37
|
+
confirm: React.ReactNode;
|
|
38
|
+
}
|
|
24
39
|
export interface DateRangePickerProps {
|
|
25
40
|
onChange?: (timeInfo: TimeRangeInfo) => void;
|
|
26
|
-
value?:
|
|
41
|
+
value?: DateRangePickerValue;
|
|
27
42
|
format?: string;
|
|
28
43
|
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
29
44
|
quickTimeOptions?: QuickTimeOption[];
|
|
@@ -33,6 +48,7 @@ export interface DateRangePickerProps {
|
|
|
33
48
|
width?: number | string;
|
|
34
49
|
disabled?: boolean;
|
|
35
50
|
flat?: boolean;
|
|
51
|
+
locale?: Partial<DateRangePickerLocale>;
|
|
36
52
|
}
|
|
37
53
|
declare const DateRangePicker: React.FC<DateRangePickerProps>;
|
|
38
54
|
export default DateRangePicker;
|