hc-busin-components 1.0.2 → 1.0.4

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.
@@ -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
- onClusterChange(clusterName);
130
+ emitClusterChange(clusterName);
124
131
  }
125
132
  saveCache(_objectSpread(_objectSpread({}, dcData), {}, {
126
133
  clusterName: clusterName
127
134
  }));
128
- }, [getCache, onClusterChange, saveCache]);
129
- var fetchClusterList = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
130
- var _resolvedDataInterfac;
131
- var params,
132
- list,
133
- _args = arguments;
134
- return _regeneratorRuntime().wrap(function _callee$(_context) {
135
- while (1) switch (_context.prev = _context.next) {
136
- case 0:
137
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : currentDatacenter;
138
- if (resolvedDataInterface !== null && resolvedDataInterface !== void 0 && (_resolvedDataInterfac = resolvedDataInterface.resource) !== null && _resolvedDataInterfac !== void 0 && _resolvedDataInterfac.service) {
139
- _context.next = 3;
140
- break;
141
- }
142
- return _context.abrupt("return");
143
- case 3:
144
- _context.next = 5;
145
- return resolvedDataInterface.resource.service(_objectSpread(_objectSpread({}, resolvedDataInterface.resource.params || {}), {}, {
146
- dataCenterId: params === null || params === void 0 ? void 0 : params.dataCenterId,
147
- logicalUnitId: params === null || params === void 0 ? void 0 : params.logicalUnitId
148
- }));
149
- case 5:
150
- list = _context.sent;
151
- setAllClusters(list);
152
- setClusterList(list);
153
- getInitCluster(list, params);
154
- case 9:
155
- case "end":
156
- return _context.stop();
157
- }
158
- }, _callee);
159
- })), [resolvedDataInterface, currentDatacenter, getInitCluster]);
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
- onClusterChange(cluster);
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, onClusterChange, storage]);
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
- onClusterChange(cluster.clusterName);
343
+ emitClusterChange(cluster.clusterName);
335
344
  saveCache(_objectSpread(_objectSpread({}, currentDatacenter), {}, {
336
345
  clusterName: cluster.clusterName
337
346
  }));
@@ -1,5 +1,6 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["columns", "search", "fieldNames", "placeholder", "border", "prefixIcon", "addonBefore", "addonAfter", "request", "values", "setValues", "setting", "refresh", "topNode", "defaultAfterChange", "defaultSelectKey"];
2
+ var _excluded = ["columns", "search", "fieldNames", "placeholder", "border", "prefixIcon", "addonBefore", "addonAfter", "request", "values", "setValues", "setting", "refresh", "topNode", "defaultAfterChange", "defaultSelectKey", "pagination"],
3
+ _excluded2 = ["onChange", "className", "plain"];
3
4
  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); }
4
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
6
  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; }
@@ -19,6 +20,13 @@ import React, { useEffect, useMemo, useState } from 'react';
19
20
  import CombineSearch from "../CombineSearch";
20
21
  import Icon from "../Icon";
21
22
  import RenderContent from "./components/RenderContent";
23
+ import { useCombinTableStyles } from "./styles";
24
+ var DEFAULT_PAGINATION = {
25
+ hideOnSinglePage: false,
26
+ showSizeChanger: true,
27
+ showQuickJumper: true,
28
+ pageSize: 10
29
+ };
22
30
  var CombinTable = function CombinTable(props) {
23
31
  var columns = props.columns,
24
32
  _props$search = props.search,
@@ -43,7 +51,11 @@ var CombinTable = function CombinTable(props) {
43
51
  topNode = props.topNode,
44
52
  defaultAfterChange = props.defaultAfterChange,
45
53
  defaultSelectKey = props.defaultSelectKey,
54
+ paginationProp = props.pagination,
46
55
  tableProps = _objectWithoutProperties(props, _excluded);
56
+ var _useCombinTableStyles = useCombinTableStyles(),
57
+ styles = _useCombinTableStyles.styles,
58
+ cx = _useCombinTableStyles.cx;
47
59
  var SearchProps = {
48
60
  fieldNames: fieldNames,
49
61
  placeholder: placeholder,
@@ -171,6 +183,22 @@ var CombinTable = function CombinTable(props) {
171
183
  }
172
184
  return doms;
173
185
  }, [setting, refresh, values, search, request]);
186
+ var paginationConfig = useMemo(function () {
187
+ if (paginationProp === false) {
188
+ return false;
189
+ }
190
+ var userPagination = paginationProp === undefined ? DEFAULT_PAGINATION : paginationProp;
191
+ var userOnChange = userPagination.onChange,
192
+ className = userPagination.className,
193
+ plain = userPagination.plain,
194
+ restPagination = _objectWithoutProperties(userPagination, _excluded2);
195
+ return _objectSpread(_objectSpread({}, restPagination), {}, {
196
+ className: cx(!plain && styles.paginationHighlight, className),
197
+ onChange: function onChange(page, size) {
198
+ userOnChange === null || userOnChange === void 0 || userOnChange(page, size, values);
199
+ }
200
+ });
201
+ }, [paginationProp, values, styles.paginationHighlight, cx]);
174
202
 
175
203
  // 获取表头筛选项
176
204
  useEffect(function () {
@@ -201,13 +229,7 @@ var CombinTable = function CombinTable(props) {
201
229
  }, topNode) : null, /*#__PURE__*/React.createElement(Table, _extends({
202
230
  columns: resetColumns
203
231
  }, tableProps, {
204
- pagination: _objectSpread(_objectSpread({}, tableProps.pagination), {}, {
205
- onChange: function onChange(page, size) {
206
- if (tableProps !== null && tableProps !== void 0 && tableProps.pagination && tableProps !== null && tableProps !== void 0 && tableProps.pagination.onChange) {
207
- tableProps === null || tableProps === void 0 || tableProps.pagination.onChange(page, size, values);
208
- }
209
- }
210
- })
232
+ pagination: paginationConfig
211
233
  })), /*#__PURE__*/React.createElement(Modal, {
212
234
  title: localStorage.getItem('i18nextLng') === 'en-US' || localStorage.getItem('language') === 'en-US' ? 'Table Header Setting' : '表头设置',
213
235
  destroyOnClose: true,
@@ -1,3 +1,9 @@
1
+ export declare const useCombinTableStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ container: import("antd-style").SerializedStyles;
3
+ paginationHighlight: import("antd-style").SerializedStyles;
4
+ }>;
5
+ /** @deprecated 使用 useCombinTableStyles */
1
6
  export declare const useFilterStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
7
  container: import("antd-style").SerializedStyles;
8
+ paginationHighlight: import("antd-style").SerializedStyles;
3
9
  }>;
@@ -1,11 +1,15 @@
1
- var _templateObject;
1
+ var _templateObject, _templateObject2;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from "antd-style";
4
- export var useFilterStyles = createStyles(function (_ref) {
3
+ import { createStyles } from 'antd-style';
4
+ export var useCombinTableStyles = createStyles(function (_ref) {
5
5
  var prefixCls = _ref.prefixCls,
6
6
  token = _ref.token,
7
7
  css = _ref.css;
8
8
  return {
9
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* transform: translateY(); */\n "])))
9
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* transform: translateY(); */\n "]))),
10
+ paginationHighlight: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-pagination-item:not(.", "-pagination-item-active):hover {\n border-color: ", ";\n background: ", ";\n\n a {\n color: ", ";\n }\n }\n\n .", "-pagination-item-active {\n border-color: ", ";\n background: ", ";\n\n a {\n color: #fff;\n }\n\n &:hover {\n border-color: ", ";\n background: ", ";\n\n a {\n color: #fff;\n }\n }\n }\n\n .", "-pagination-prev:hover .", "-pagination-item-link,\n .", "-pagination-next:hover .", "-pagination-item-link,\n .", "-pagination-jump-prev:hover .", "-pagination-item-link,\n .", "-pagination-jump-next:hover .", "-pagination-item-link {\n border-color: ", ";\n color: ", ";\n }\n "])), prefixCls, prefixCls, token.colorPrimary, token.colorPrimaryBg, token.colorPrimary, prefixCls, token.colorPrimary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryHover, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, token.colorPrimary, token.colorPrimary)
10
11
  };
11
- });
12
+ });
13
+
14
+ /** @deprecated 使用 useCombinTableStyles */
15
+ export var useFilterStyles = useCombinTableStyles;
@@ -3,13 +3,16 @@ import { GetProp, GetProps, Table, TablePaginationConfig } from 'antd';
3
3
  import ComBineSearchProps, { CombineOptionsType } from "../../CombineSearch/types";
4
4
  type TableProps = GetProps<typeof Table>;
5
5
  type column = GetProp<typeof Table, 'columns'>[number];
6
- type pagination = false | Omit<TablePaginationConfig, 'onChange'>;
6
+ export type CombinTablePaginationConfig = Omit<TablePaginationConfig, 'onChange'> & {
7
+ /** 朴素分页风格;`true` 为 antd 默认样式,不传或为 `false` 时高亮当前页 */
8
+ plain?: boolean;
9
+ onChange?: (page: number, size: number, values: Record<string, any>) => void;
10
+ };
11
+ type pagination = false | CombinTablePaginationConfig;
7
12
  export type ColumnProps = column & CombineOptionsType;
8
13
  interface AntTableProps extends Omit<TableProps, 'columns' | 'pagination'> {
9
14
  columns?: ColumnProps[];
10
- pagination?: pagination & {
11
- onChange?: (page: number, size: number, values: Record<string, any>) => void;
12
- };
15
+ pagination?: pagination;
13
16
  setting?: boolean;
14
17
  refresh?: boolean;
15
18
  topNode?: React.ReactNode;
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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
7
  /* eslint-disable no-case-declarations */
8
- import { CloseCircleOutlined } from '@ant-design/icons';
8
+
9
9
  import { Divider, Space, Tag } from 'antd';
10
10
  import React, { useCallback, useMemo } from 'react';
11
11
  import Icon from "../../Icon";
@@ -64,7 +64,11 @@ var CombineTags = function CombineTags(_ref) {
64
64
  },
65
65
  className: styles.currentTag,
66
66
  key: key,
67
- closeIcon: /*#__PURE__*/React.createElement(CloseCircleOutlined, null),
67
+ closeIcon: /*#__PURE__*/React.createElement("span", {
68
+ className: styles.closeIcon
69
+ }, /*#__PURE__*/React.createElement(Icon, {
70
+ name: "v35_Failure_Filled"
71
+ })),
68
72
  onClose: function onClose() {
69
73
  setCombineValues(function (values) {
70
74
  return JSON.parse(JSON.stringify(_objectSpread(_objectSpread({}, values), {}, _defineProperty({}, key, undefined))));
@@ -97,7 +101,11 @@ var CombineTags = function CombineTags(_ref) {
97
101
  style: {
98
102
  display: 'flex',
99
103
  alignItems: 'center',
100
- width: '50px'
104
+ width: '60px'
105
+ },
106
+ onClick: function onClick() {
107
+ setCombineValues({});
108
+ setCurrent('');
101
109
  }
102
110
  }, /*#__PURE__*/React.createElement(Divider, {
103
111
  type: "vertical"
@@ -105,11 +113,13 @@ var CombineTags = function CombineTags(_ref) {
105
113
  name: "v35_TrashCan",
106
114
  style: {
107
115
  cursor: 'pointer'
108
- },
109
- onClick: function onClick() {
110
- setCombineValues({});
111
- setCurrent('');
112
116
  }
113
- })) : null);
117
+ }), /*#__PURE__*/React.createElement("p", {
118
+ style: {
119
+ fontSize: '12px',
120
+ marginLeft: '4px',
121
+ cursor: 'pointer'
122
+ }
123
+ }, "\u6E05\u7A7A")) : null);
114
124
  };
115
125
  export default CombineTags;
@@ -11,4 +11,5 @@ export declare const useTagsStyles: (props?: unknown) => import("antd-style").Re
11
11
  label: import("antd-style").SerializedStyles;
12
12
  value: import("antd-style").SerializedStyles;
13
13
  currentTag: import("antd-style").SerializedStyles;
14
+ closeIcon: import("antd-style").SerializedStyles;
14
15
  }>;
@@ -1,4 +1,4 @@
1
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import { createStyles } from "antd-style";
4
4
  import edit from "./edit.svg";
@@ -8,7 +8,7 @@ export var useCombineBoxStyles = createStyles(function (_ref, props) {
8
8
  token = _ref.token,
9
9
  stylish = _ref.stylish;
10
10
  return {
11
- card: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n min-width: 300px;\n background-color: #f7f7f7;\n border: ", ";\n .icon-span {\n width: 28px;\n min-width: 28px;\n display: flex;\n justify-content: end;\n align-items: center;\n transform: translateX(5px)\n }\n .select-no-padding {\n .", "-select-selector {\n padding: 0 0 0 12px !important\n }\n }\n "])), token.borderRadius, props.focus ? "1px solid ".concat(token.colorPrimary) : "1px solid ".concat(props.border ? token.colorBorder : 'transparent'), prefixCls),
11
+ card: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n min-width: 300px;\n background-color: #f7f7f7;\n border: ", ";\n .icon-span {\n width: 28px;\n min-width: 28px;\n display: flex;\n justify-content: center;\n align-items: center;\n .hc-icon {\n transform: translateX(2px)\n }\n }\n .select-no-padding {\n .", "-select-selector {\n padding: 0px !important\n }\n }\n "])), token.borderRadius, props.focus ? "1px solid ".concat(token.colorPrimary) : "1px solid ".concat(props.border ? token.colorBorder : 'transparent'), prefixCls),
12
12
  box: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: space-between;\n "]))),
13
13
  left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: wrap;\n "]))),
14
14
  right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: 2px;\n align-items: center;\n "])))
@@ -21,6 +21,7 @@ export var useTagsStyles = createStyles(function (_ref2) {
21
21
  return {
22
22
  label: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: rgba(0, 0, 0, 0.3);\n cursor: url(", "), pointer;\n "])), edit),
23
23
  value: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: rgba(89, 89, 89, 1);\n padding-right: 12px;\n overflow: hidden;\n cursor: url(", "), pointer;\n "])), edit),
24
- currentTag: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n max-width: 350px;\n overflow: hidden;\n "])))
24
+ currentTag: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n max-width: 350px;\n background-color: #f4f4f4;\n border-color: #E0E0E0;\n display: flex;\n align-items: center;\n justify-content: center;\n "]))),
25
+ closeIcon: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n font-size: 12px;\n\n /* Icon \u4E3A 1em\uFF0C\u9700\u76F4\u63A5\u6539 svg \u5C3A\u5BF8 */\n .hc-icon {\n width: 12px;\n height: 12px;\n font-size: 12px;\n vertical-align: middle;\n }\n "])))
25
26
  };
26
27
  });
@@ -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?: TimeRangeInfo;
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;