@qsxy/element-plus-react 1.0.0-next.15 → 1.0.0-next.16
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/Button/Button.js +5 -3
- package/dist/Button/typings.d.ts +3 -1
- package/dist/ColorPicker/AlphaSlider.d.ts +0 -7
- package/dist/ColorPicker/AlphaSlider.js +0 -7
- package/dist/ColorPicker/HueSlider.d.ts +0 -7
- package/dist/ColorPicker/HueSlider.js +0 -7
- package/dist/ColorPicker/Predefine.d.ts +0 -7
- package/dist/ColorPicker/Predefine.js +0 -7
- package/dist/ColorPicker/SvPanel.d.ts +0 -7
- package/dist/ColorPicker/SvPanel.js +0 -7
- package/dist/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/dist/Descriptions/Descriptions.d.ts +2 -2
- package/dist/Descriptions/Descriptions.js +7 -6
- package/dist/Descriptions/DescriptionsCell.d.ts +11 -12
- package/dist/Descriptions/DescriptionsCell.js +13 -6
- package/dist/Descriptions/DescriptionsItem.js +1 -1
- package/dist/Descriptions/DescriptionsRow.d.ts +2 -5
- package/dist/Descriptions/DescriptionsRow.js +11 -4
- package/dist/Drawer/typings.d.ts +10 -10
- package/dist/Dropdown/Dropdown.js +7 -7
- package/dist/Dropdown/DropdownItem.js +1 -1
- package/dist/Dropdown/DropdownMenu.d.ts +5 -2
- package/dist/Dropdown/DropdownMenu.js +5 -3
- package/dist/Dropdown/typings.d.ts +3 -1
- package/dist/MessageBox/MessageBox.js +6 -1
- package/dist/Notification/Notification.js +6 -3
- package/dist/Notification/index.d.ts +0 -8
- package/dist/Notification/index.js +0 -9
- package/dist/Notification/typings.d.ts +0 -2
- package/dist/Pagination/Options.js +2 -1
- package/dist/Popconfirm/Popconfirm.d.ts +3 -2
- package/dist/Popconfirm/Popconfirm.js +15 -8
- package/dist/Popconfirm/typings.d.ts +2 -1
- package/dist/Popover/Popover.js +7 -5
- package/dist/Popover/typings.d.ts +1 -1
- package/dist/Select/Option.js +1 -1
- package/dist/Select/OptionGroup.js +1 -1
- package/dist/Select/Select.d.ts +3 -15
- package/dist/Select/Select.js +3 -9
- package/dist/Select/SelectCore.js +52 -27
- package/dist/Select/index.d.ts +1 -0
- package/dist/Select/index.js +1 -0
- package/dist/Select/typings.d.ts +13 -1
- package/dist/Skeleton/typings.d.ts +2 -2
- package/dist/Table/TableColumn.js +2 -2
- package/dist/Table/TableHeaderCell.js +16 -16
- package/dist/Table/hooks/useTable.d.ts +0 -7
- package/dist/Table/hooks/useTable.js +1 -9
- package/dist/Table/typings.d.ts +1 -1
- package/dist/Tabs/TabPane.js +1 -1
- package/dist/Tabs/Tabs.d.ts +2 -2
- package/dist/Tabs/Tabs.js +8 -4
- package/dist/Tabs/typings.d.ts +2 -0
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.js +5 -5
- package/dist/Tag/typings.d.ts +1 -1
- package/dist/TimeLine/TimeLine.js +1 -0
- package/dist/TimeLine/TimeLineItem.js +1 -0
- package/dist/TimeLine/typings.d.ts +2 -2
- package/dist/TimePicker/useTimePicker.d.ts +0 -7
- package/dist/TimePicker/useTimePicker.js +1 -8
- package/dist/hooks/animationPropsUtils.d.ts +0 -4
- package/dist/hooks/animationPropsUtils.js +0 -4
- package/dist/hooks/popperPropsUtils.d.ts +0 -4
- package/dist/hooks/popperPropsUtils.js +0 -4
- package/dist/hooks/useChildrenInstance.d.ts +0 -4
- package/dist/hooks/useChildrenInstance.js +0 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.scss +1 -1
- package/theme-chalk/skeleton/index.scss +120 -0
- package/theme-chalk/tabs/index.scss +3 -3
- package/theme-chalk/tag/index.scss +5 -162
- package/theme-chalk/time-line/_timeline-item.scss +1 -1
|
@@ -22,8 +22,6 @@ export interface NotificationProps extends BaseProps, NativeProps, AnimationEven
|
|
|
22
22
|
title?: string;
|
|
23
23
|
/** 通知栏正文内容 */
|
|
24
24
|
message?: string | React.ReactElement;
|
|
25
|
-
/** 是否将 message 属性作为 HTML 片段处理 */
|
|
26
|
-
dangerouslyUseHTMLString?: boolean;
|
|
27
25
|
/** 通知的类型 */
|
|
28
26
|
type?: 'success' | 'warning' | 'info' | 'error' | '';
|
|
29
27
|
/** 显示时间, 单位为毫秒。 值为 0 则不会自动关闭 */
|
|
@@ -7,6 +7,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7
7
|
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; } }
|
|
8
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
9
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
10
|
+
import ElOption from "../Select/Option";
|
|
10
11
|
import Select from "../Select/Select";
|
|
11
12
|
import { useClassNames } from "../hooks";
|
|
12
13
|
var Options = function Options(props) {
|
|
@@ -77,7 +78,7 @@ var Options = function Options(props) {
|
|
|
77
78
|
,
|
|
78
79
|
onChange: handleChangeSize
|
|
79
80
|
}, pageSizeOptions.map(function (opt, i) {
|
|
80
|
-
return /*#__PURE__*/React.createElement(
|
|
81
|
+
return /*#__PURE__*/React.createElement(ElOption, {
|
|
81
82
|
key: i,
|
|
82
83
|
value: opt,
|
|
83
84
|
label: "".concat(opt, " \u6761/\u9875")
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipRef } from '../Tooltip/typings';
|
|
2
3
|
import { PopconfirmProps } from './typings';
|
|
3
|
-
declare const Popconfirm:
|
|
4
|
+
declare const Popconfirm: React.MemoExoticComponent<React.ForwardRefExoticComponent<PopconfirmProps & React.RefAttributes<TooltipRef>>>;
|
|
4
5
|
export default Popconfirm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _templateObject, _templateObject2, _templateObject3;
|
|
2
|
-
var _excluded = ["title", "confirmButtonText", "confirmButtonType", "cancelButtonText", "cancelButtonType", "onCancel", "onConfirm", "icon", "iconColor", "hideIcon", "classPrefix"];
|
|
2
|
+
var _excluded = ["title", "confirmButtonText", "confirmButtonType", "cancelButtonText", "cancelButtonType", "onCancel", "onConfirm", "icon", "iconColor", "hideIcon", "classPrefix", "width"];
|
|
3
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); }
|
|
4
4
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -11,13 +11,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import React, { useState } from 'react';
|
|
14
|
+
import React, { forwardRef, memo, useImperativeHandle, useRef, useState } from 'react';
|
|
15
15
|
import Button from "../Button/Button";
|
|
16
16
|
import Icon from "../Icon/Icon";
|
|
17
17
|
import Tooltip from "../Tooltip/Tooltip";
|
|
18
|
-
import { mergeDefaultProps } from "../Util";
|
|
18
|
+
import { addUnit, mergeDefaultProps } from "../Util";
|
|
19
19
|
import { partitionAnimationProps, partitionPopperPropsUtils, useClassNames } from "../hooks";
|
|
20
|
-
var Popconfirm = function
|
|
20
|
+
var Popconfirm = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
21
|
props = mergeDefaultProps({
|
|
22
22
|
showArrow: true,
|
|
23
23
|
confirmButtonText: '确 定',
|
|
@@ -25,7 +25,8 @@ var Popconfirm = function Popconfirm(props) {
|
|
|
25
25
|
confirmButtonType: 'primary',
|
|
26
26
|
cancelButtonType: 'primary',
|
|
27
27
|
icon: 'circle-question',
|
|
28
|
-
iconColor: '#f90'
|
|
28
|
+
iconColor: '#f90',
|
|
29
|
+
width: 150
|
|
29
30
|
}, props);
|
|
30
31
|
var _props = props,
|
|
31
32
|
title = _props.title,
|
|
@@ -40,6 +41,7 @@ var Popconfirm = function Popconfirm(props) {
|
|
|
40
41
|
hideIcon = _props.hideIcon,
|
|
41
42
|
_props$classPrefix = _props.classPrefix,
|
|
42
43
|
classPrefix = _props$classPrefix === void 0 ? 'popconfirm' : _props$classPrefix,
|
|
44
|
+
width = _props.width,
|
|
43
45
|
rest = _objectWithoutProperties(_props, _excluded);
|
|
44
46
|
var _partitionPopperProps = partitionPopperPropsUtils(rest),
|
|
45
47
|
_partitionPopperProps2 = _slicedToArray(_partitionPopperProps, 1),
|
|
@@ -54,12 +56,17 @@ var Popconfirm = function Popconfirm(props) {
|
|
|
54
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
57
|
visible = _useState2[0],
|
|
56
58
|
setVisible = _useState2[1];
|
|
59
|
+
var tooltipRef = useRef(null);
|
|
60
|
+
useImperativeHandle(ref, function () {
|
|
61
|
+
return tooltipRef.current;
|
|
62
|
+
});
|
|
57
63
|
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
64
|
+
ref: tooltipRef,
|
|
58
65
|
visible: visible,
|
|
59
66
|
classPrefix: classPrefix,
|
|
60
67
|
popperClass: b('popover', false),
|
|
61
68
|
popperStyle: {
|
|
62
|
-
minWidth:
|
|
69
|
+
minWidth: addUnit(width)
|
|
63
70
|
},
|
|
64
71
|
triggerRef: props.children,
|
|
65
72
|
enterable: true,
|
|
@@ -105,6 +112,6 @@ var Popconfirm = function Popconfirm(props) {
|
|
|
105
112
|
}, confirmButtonText))),
|
|
106
113
|
unmountOnExit: true
|
|
107
114
|
}, popperProps, transitionProps));
|
|
108
|
-
};
|
|
109
|
-
Popconfirm.displayName = '
|
|
115
|
+
}));
|
|
116
|
+
Popconfirm.displayName = 'ElPopconfirm';
|
|
110
117
|
export default Popconfirm;
|
|
@@ -3,7 +3,6 @@ import { IconName } from '../Icon';
|
|
|
3
3
|
import { PopperOptions } from '../Popper';
|
|
4
4
|
import { BaseProps, NativeProps, TypeAttributes } from '../types/common';
|
|
5
5
|
export interface PopconfirmProps extends BaseProps<React.ReactElement>, NativeProps, PopperOptions {
|
|
6
|
-
classPrefix?: string;
|
|
7
6
|
/** 显示的内容 */
|
|
8
7
|
title: string;
|
|
9
8
|
/** 确认按钮文字 */
|
|
@@ -20,6 +19,8 @@ export interface PopconfirmProps extends BaseProps<React.ReactElement>, NativePr
|
|
|
20
19
|
iconColor?: string;
|
|
21
20
|
/** 是否隐藏 Icon */
|
|
22
21
|
hideIcon?: boolean;
|
|
22
|
+
/** 弹层宽度,最小宽度 150px */
|
|
23
|
+
width?: number;
|
|
23
24
|
/** 点击确认按钮时触发 */
|
|
24
25
|
onConfirm?: () => void;
|
|
25
26
|
/** 点击取消按钮时触发 */
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -2,6 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
3
|
var _excluded = ["title", "classPrefix", "plain", "width", "showTimeout", "hideTimeout", "offset", "trigger", "content", "onEnter", "onMouseEnter", "onMouseLeave", "placement"];
|
|
4
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); }
|
|
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; }
|
|
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; }
|
|
5
7
|
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; }
|
|
6
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
9
|
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); }
|
|
@@ -17,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
19
|
import classNames from 'classnames';
|
|
18
20
|
import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react';
|
|
19
21
|
import Tooltip from "../Tooltip/Tooltip";
|
|
20
|
-
import { mergeDefaultProps } from "../Util";
|
|
22
|
+
import { addUnit, mergeDefaultProps } from "../Util";
|
|
21
23
|
import { partitionAnimationProps, partitionPopperPropsUtils, useClassNames } from "../hooks";
|
|
22
24
|
var Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
25
|
props = mergeDefaultProps({
|
|
@@ -71,10 +73,10 @@ var Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
71
73
|
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
72
74
|
ref: tooltipRef,
|
|
73
75
|
classPrefix: classPrefix,
|
|
74
|
-
popperClass: classNames(b(), _defineProperty({}, m(_templateObject || (_templateObject = _taggedTemplateLiteral(["plain"]))), plain)),
|
|
75
|
-
popperStyle: {
|
|
76
|
-
width: width
|
|
77
|
-
},
|
|
76
|
+
popperClass: classNames(b(), _defineProperty({}, m(_templateObject || (_templateObject = _taggedTemplateLiteral(["plain"]))), plain), props.className),
|
|
77
|
+
popperStyle: _objectSpread({
|
|
78
|
+
width: addUnit(width)
|
|
79
|
+
}, props.style),
|
|
78
80
|
triggerRef: props.children,
|
|
79
81
|
enterable: true,
|
|
80
82
|
effect: "light",
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { PopperOptions } from '../Popper';
|
|
3
3
|
import { TransitionProps } from '../Transition';
|
|
4
4
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
5
|
-
export interface PopoverProps extends BaseProps<React.ReactElement>, NativeProps
|
|
5
|
+
export interface PopoverProps extends BaseProps<React.ReactElement>, NativeProps<'--el-popover-bg-color' | '--el-popover-font-size' | '--el-popover-border-color' | '--el-popover-padding' | '--el-popover-title-font-size' | '--el-popover-title-text-color' | '--el-popover-text-color' | '--el-popover-border-radius'>, PopperOptions, AnimationEventProps, Omit<TransitionProps, 'children'> {
|
|
6
6
|
/** 触发下拉的行为 */
|
|
7
7
|
trigger?: 'hover' | 'click' | 'contextmenu';
|
|
8
8
|
/** 标题 */
|
package/dist/Select/Option.js
CHANGED
package/dist/Select/Select.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { SelectProps } from './typings';
|
|
5
|
-
declare const Comp: (props: SelectProps & {
|
|
6
|
-
ref?: RefObject<SelectProps> | React.ForwardedRef<SelectProps>;
|
|
7
|
-
}) => React.ReactElement;
|
|
8
|
-
type InternalType = typeof Comp;
|
|
9
|
-
interface CompInterface extends InternalType {
|
|
10
|
-
displayName?: string;
|
|
11
|
-
defaultProps?: Partial<SelectProps>;
|
|
12
|
-
OptionGroup: typeof OptionGroup;
|
|
13
|
-
Option: typeof Option;
|
|
14
|
-
}
|
|
15
|
-
declare const Select: CompInterface;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps, SelectRef } from './typings';
|
|
3
|
+
declare const Select: React.MemoExoticComponent<React.ForwardRefExoticComponent<SelectProps<import("./typings").ValueType> & React.RefAttributes<SelectRef>>>;
|
|
16
4
|
export default Select;
|
package/dist/Select/Select.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
import React, { forwardRef, memo, useRef } from 'react';
|
|
3
3
|
import { InputGroup } from "../Input";
|
|
4
|
-
import Option from "./Option";
|
|
5
|
-
import OptionGroup from "./OptionGroup";
|
|
6
4
|
import SelectCore from "./SelectCore";
|
|
7
|
-
function
|
|
5
|
+
var Select = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
6
|
var groupRef = useRef(null);
|
|
9
7
|
var append = props.append,
|
|
10
8
|
prepend = props.prepend;
|
|
@@ -22,10 +20,6 @@ function InternalSelect(props, ref) {
|
|
|
22
20
|
ref: ref
|
|
23
21
|
}, props));
|
|
24
22
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var Select = Comp;
|
|
28
|
-
Select.OptionGroup = OptionGroup;
|
|
29
|
-
Select.Option = Option;
|
|
30
|
-
Select.displayName = 'Select';
|
|
23
|
+
}));
|
|
24
|
+
Select.displayName = 'ElSelect';
|
|
31
25
|
export default Select;
|
|
@@ -1,6 +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
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
-
var _excluded = ["filterable", "clearable", "error", "warning", "multiple", "collapseTags", "maxCollapseTags", "collapseTagsTooltip", "collapseTips", "filterMethod", "onChange", "allowCreate", "onEnter", "afterLeave", "prepend", "append", "onLoadSuccess"];
|
|
3
|
+
var _excluded = ["filterable", "clearable", "error", "warning", "multiple", "collapseTags", "maxCollapseTags", "collapseTagsTooltip", "tagType", "tagEffect", "showArrow", "collapseTips", "filterMethod", "onChange", "allowCreate", "onEnter", "afterLeave", "prepend", "append", "onLoadSuccess", "onVisibleChange", "onRemoveTag", "onClear"];
|
|
4
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); }
|
|
5
5
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
6
6
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -45,6 +45,7 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
45
45
|
name: "spinner",
|
|
46
46
|
spin: true
|
|
47
47
|
}), " \u52A0\u8F7D\u4E2D..."),
|
|
48
|
+
showArrow: true,
|
|
48
49
|
clearable: true,
|
|
49
50
|
filterable: false,
|
|
50
51
|
error: false,
|
|
@@ -52,7 +53,9 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
52
53
|
disabled: false,
|
|
53
54
|
maxWidth: 500,
|
|
54
55
|
collapseTagsTooltip: true,
|
|
55
|
-
maxCollapseTags: 1
|
|
56
|
+
maxCollapseTags: 1,
|
|
57
|
+
tagType: 'info',
|
|
58
|
+
tagEffect: 'light'
|
|
56
59
|
}, props);
|
|
57
60
|
var _useClassNames = useClassNames('select'),
|
|
58
61
|
b = _useClassNames.b,
|
|
@@ -70,6 +73,7 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
70
73
|
var selectDropdownRef = useRef(null);
|
|
71
74
|
var inputInstance = useRef(null);
|
|
72
75
|
var searchInstance = useRef(null);
|
|
76
|
+
var tagTooltipRef = useRef(null);
|
|
73
77
|
var _props = props,
|
|
74
78
|
filterable = _props.filterable,
|
|
75
79
|
clearable = _props.clearable,
|
|
@@ -80,6 +84,9 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
80
84
|
collapseTags = _props$collapseTags === void 0 ? false : _props$collapseTags,
|
|
81
85
|
maxCollapseTags = _props.maxCollapseTags,
|
|
82
86
|
collapseTagsTooltip = _props.collapseTagsTooltip,
|
|
87
|
+
tagType = _props.tagType,
|
|
88
|
+
tagEffect = _props.tagEffect,
|
|
89
|
+
showArrow = _props.showArrow,
|
|
83
90
|
collapseTips = _props.collapseTips,
|
|
84
91
|
filterMethod = _props.filterMethod,
|
|
85
92
|
onChange = _props.onChange,
|
|
@@ -89,6 +96,9 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
89
96
|
prepend = _props.prepend,
|
|
90
97
|
append = _props.append,
|
|
91
98
|
onLoadSuccess = _props.onLoadSuccess,
|
|
99
|
+
onVisibleChange = _props.onVisibleChange,
|
|
100
|
+
onRemoveTag = _props.onRemoveTag,
|
|
101
|
+
onClearProp = _props.onClear,
|
|
92
102
|
rest = _objectWithoutProperties(_props, _excluded);
|
|
93
103
|
var _partitionHTMLProps = partitionHTMLProps(rest),
|
|
94
104
|
_partitionHTMLProps2 = _slicedToArray(_partitionHTMLProps, 1),
|
|
@@ -145,7 +155,7 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
145
155
|
}, [createItem, multiValue, multiple, props.placeholder]);
|
|
146
156
|
|
|
147
157
|
/** 获取所有的option组件 */
|
|
148
|
-
var getOptionInstance = useChildrenInstance('
|
|
158
|
+
var getOptionInstance = useChildrenInstance('ElOption', 'ElOptionGroup');
|
|
149
159
|
var optionData = useMemo(function () {
|
|
150
160
|
if (props.children) {
|
|
151
161
|
var componentChildren = getOptionInstance(props.children);
|
|
@@ -225,7 +235,13 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
225
235
|
});
|
|
226
236
|
setValue(res);
|
|
227
237
|
onChange === null || onChange === void 0 || onChange(res, multiLabel);
|
|
228
|
-
|
|
238
|
+
onRemoveTag === null || onRemoveTag === void 0 || onRemoveTag(item);
|
|
239
|
+
setTimeout(function () {
|
|
240
|
+
if (tagTooltipRef.current) {
|
|
241
|
+
tagTooltipRef.current.updatePopper();
|
|
242
|
+
}
|
|
243
|
+
}, 50);
|
|
244
|
+
}, [multiLabel, multiValue, onChange, onRemoveTag, setValue]);
|
|
229
245
|
|
|
230
246
|
/** 重置值 */
|
|
231
247
|
var onClear = useCallback(function () {
|
|
@@ -235,7 +251,8 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
235
251
|
(_selectDropdownRef$cu3 = selectDropdownRef.current) === null || _selectDropdownRef$cu3 === void 0 || _selectDropdownRef$cu3.hover('');
|
|
236
252
|
onChange === null || onChange === void 0 || onChange(multiple ? [] : '', multiple ? [] : '');
|
|
237
253
|
setCreateItem('');
|
|
238
|
-
|
|
254
|
+
onClearProp === null || onClearProp === void 0 || onClearProp();
|
|
255
|
+
}, [multiple, onChange, onClearProp, setValue]);
|
|
239
256
|
|
|
240
257
|
/** 选中项回调 */
|
|
241
258
|
var onChoose = useCallback(function (val, text, event) {
|
|
@@ -282,6 +299,7 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
282
299
|
var _searchInstance$curre;
|
|
283
300
|
(_searchInstance$curre = searchInstance.current) === null || _searchInstance$curre === void 0 || _searchInstance$curre.focus();
|
|
284
301
|
}
|
|
302
|
+
onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(visible);
|
|
285
303
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
286
304
|
}, [visible]);
|
|
287
305
|
|
|
@@ -295,15 +313,17 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
295
313
|
|
|
296
314
|
/** 多选框选择选项后,动态调整input框高度 */
|
|
297
315
|
useEffect(function () {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
316
|
+
setTimeout(function () {
|
|
317
|
+
if (wrapperRef.current) {
|
|
318
|
+
var _wrapperRef$current;
|
|
319
|
+
var height = ((_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.clientHeight) + 4;
|
|
320
|
+
setInputHeight(height <= 32 ? 32 : height);
|
|
321
|
+
}
|
|
322
|
+
if (popperInstRef.current && popperInstRef.current.update) {
|
|
323
|
+
var _popperInstRef$curren2;
|
|
324
|
+
(_popperInstRef$curren2 = popperInstRef.current) === null || _popperInstRef$curren2 === void 0 || _popperInstRef$curren2.update();
|
|
325
|
+
}
|
|
326
|
+
}, 50);
|
|
307
327
|
}, [multiValue]);
|
|
308
328
|
|
|
309
329
|
/** 初次加载时反显选中文本 */
|
|
@@ -330,7 +350,7 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
330
350
|
useImperativeHandle(ref, function () {
|
|
331
351
|
return {
|
|
332
352
|
popperInstRef: popperInstRef,
|
|
333
|
-
|
|
353
|
+
selectedLabel: label,
|
|
334
354
|
setLabel: setLabel,
|
|
335
355
|
inputInstance: inputInstance,
|
|
336
356
|
searchInstance: searchInstance,
|
|
@@ -343,11 +363,6 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
343
363
|
setVisible: setVisible
|
|
344
364
|
};
|
|
345
365
|
});
|
|
346
|
-
|
|
347
|
-
// @ts-ignore
|
|
348
|
-
useImperativeHandle(ref, function () {
|
|
349
|
-
return containerRef.current;
|
|
350
|
-
});
|
|
351
366
|
return /*#__PURE__*/React.createElement("div", {
|
|
352
367
|
className: classNames(b(), e(_templateObject || (_templateObject = _taggedTemplateLiteral(["default"]))), is({
|
|
353
368
|
disabled: disabled
|
|
@@ -372,9 +387,10 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
372
387
|
ref: wrapperRef
|
|
373
388
|
}, (collapseTags ? multiLabel.slice(0, maxCollapseTags) : multiLabel).map(function (item, i) {
|
|
374
389
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
375
|
-
type:
|
|
390
|
+
type: tagType,
|
|
376
391
|
key: multiValue[i],
|
|
377
392
|
closable: !disabled,
|
|
393
|
+
effect: tagEffect,
|
|
378
394
|
onClick: onClick,
|
|
379
395
|
onClose: function onClose() {
|
|
380
396
|
return onCloseTag(multiValue[i]);
|
|
@@ -382,22 +398,30 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
382
398
|
disableTransitions: true
|
|
383
399
|
}, item);
|
|
384
400
|
}), collapseTags && (multiValue === null || multiValue === void 0 ? void 0 : multiValue.length) > maxCollapseTags && /*#__PURE__*/React.createElement(Tooltip, {
|
|
401
|
+
ref: tagTooltipRef,
|
|
385
402
|
popperClass: e(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["tooltip"]))),
|
|
386
403
|
placement: "top",
|
|
387
404
|
disabled: !collapseTagsTooltip,
|
|
388
|
-
content: /*#__PURE__*/React.createElement(React.Fragment, null, multiLabel.slice(maxCollapseTags, multiLabel.length).map(function (item) {
|
|
405
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, multiLabel.slice(maxCollapseTags, multiLabel.length).map(function (item, i) {
|
|
389
406
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
390
407
|
key: item,
|
|
391
|
-
type:
|
|
392
|
-
disableTransitions: true
|
|
408
|
+
type: tagType,
|
|
409
|
+
disableTransitions: true,
|
|
410
|
+
closable: !disabled,
|
|
411
|
+
effect: tagEffect,
|
|
412
|
+
onClick: onClick,
|
|
413
|
+
onClose: function onClose() {
|
|
414
|
+
return onCloseTag(multiValue[i + maxCollapseTags]);
|
|
415
|
+
}
|
|
393
416
|
}, item);
|
|
394
417
|
})),
|
|
395
418
|
effect: "light",
|
|
396
419
|
enterable: true
|
|
397
420
|
}, /*#__PURE__*/React.createElement(Tag, {
|
|
398
|
-
type:
|
|
421
|
+
type: tagType,
|
|
399
422
|
onClick: onClick,
|
|
400
|
-
disableTransitions: true
|
|
423
|
+
disableTransitions: true,
|
|
424
|
+
effect: tagEffect
|
|
401
425
|
}, collapseTips ? collapseTips(multiLabel.length - maxCollapseTags, multiLabel.length) : "+ ".concat(multiLabel.length - maxCollapseTags)))), allowCreate && /*#__PURE__*/React.createElement("input", {
|
|
402
426
|
type: "text",
|
|
403
427
|
className: e(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["input"]))),
|
|
@@ -488,7 +512,8 @@ var SelectCore = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
488
512
|
afterLeave: handleAfterLeave,
|
|
489
513
|
placement: 'bottom-start',
|
|
490
514
|
transitionAppear: true,
|
|
491
|
-
unmountOnExit: true
|
|
515
|
+
unmountOnExit: true,
|
|
516
|
+
showArrow: showArrow
|
|
492
517
|
}, transitionProps, popperProps), /*#__PURE__*/React.createElement(SelectDropdown, _extends({
|
|
493
518
|
ref: selectDropdownRef,
|
|
494
519
|
value: value,
|
package/dist/Select/index.d.ts
CHANGED
package/dist/Select/index.js
CHANGED
package/dist/Select/typings.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type SelectRef = {
|
|
|
7
7
|
inputInstance?: RefObject<InputRef>;
|
|
8
8
|
searchInstance?: RefObject<InputRef>;
|
|
9
9
|
popperInstRef: RefObject<PopperOptionRef>;
|
|
10
|
-
|
|
10
|
+
selectedLabel: string | string[];
|
|
11
11
|
setLabel: (label: string) => void;
|
|
12
12
|
getValue: () => ValueType;
|
|
13
13
|
setValue: (value: ValueType) => void;
|
|
@@ -40,6 +40,8 @@ export interface SelectProps<V = ValueType> extends Omit<FormControlBaseProps<V>
|
|
|
40
40
|
loadingText?: React.ReactElement | string;
|
|
41
41
|
/** */
|
|
42
42
|
max?: boolean;
|
|
43
|
+
/** 下拉菜单的内容是否有箭头 */
|
|
44
|
+
showArrow?: boolean;
|
|
43
45
|
/** */
|
|
44
46
|
required?: boolean;
|
|
45
47
|
/** 表单校验错误提示 */
|
|
@@ -68,8 +70,18 @@ export interface SelectProps<V = ValueType> extends Omit<FormControlBaseProps<V>
|
|
|
68
70
|
size?: TypeAttributes.Size;
|
|
69
71
|
/** 是否追加到body下 */
|
|
70
72
|
appendToBody?: boolean;
|
|
73
|
+
/** 标签类型 */
|
|
74
|
+
tagType?: TypeAttributes.Appearance;
|
|
75
|
+
/** 标签效果 */
|
|
76
|
+
tagEffect?: 'light' | 'dark' | 'plain';
|
|
71
77
|
/** 选中值发生变化时触发 */
|
|
72
78
|
onChange?: (value: ValueType, label?: string | (string | number)[]) => void;
|
|
79
|
+
/** 下拉框出现/隐藏时触发 */
|
|
80
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
81
|
+
/** 多选模式下移除tag时触发/隐藏时触发 */
|
|
82
|
+
onRemoveTag?: (tagValue: any) => void;
|
|
83
|
+
/** 可清空的单选模式下用户点击清空按钮时触发 */
|
|
84
|
+
onClear?: () => void;
|
|
73
85
|
/** 数据加载成功时调用 */
|
|
74
86
|
onLoadSuccess?: (value: ValueType, label?: (string | number | undefined)[]) => void;
|
|
75
87
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { BaseProps, NativeProps } from '../types/common';
|
|
3
3
|
export interface SkeletonProps extends BaseProps, NativeProps {
|
|
4
|
-
/**
|
|
4
|
+
/** 是否显示骨架屏(可控) */
|
|
5
5
|
visible?: boolean;
|
|
6
|
-
/**
|
|
6
|
+
/** 默认是否显示骨架屏 */
|
|
7
7
|
defaultVisible?: boolean;
|
|
8
8
|
/** 骨架屏段落数量 */
|
|
9
9
|
rows?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useChildrenInstance } from "../hooks";
|
|
3
3
|
var TableColumn = function TableColumn(props) {
|
|
4
|
-
var getChildren = useChildrenInstance('
|
|
4
|
+
var getChildren = useChildrenInstance('ElTableColumn');
|
|
5
5
|
if (props.children instanceof Function) {
|
|
6
6
|
return /*#__PURE__*/React.createElement("div", null);
|
|
7
7
|
} else {
|
|
@@ -9,5 +9,5 @@ var TableColumn = function TableColumn(props) {
|
|
|
9
9
|
return /*#__PURE__*/React.createElement("div", null, columns);
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
TableColumn.displayName = '
|
|
12
|
+
TableColumn.displayName = 'ElTableColumn';
|
|
13
13
|
export default TableColumn;
|
|
@@ -123,33 +123,33 @@ var TableHeaderCell = function TableHeaderCell(p) {
|
|
|
123
123
|
/** 排序 */
|
|
124
124
|
var handleSort = useCallback(function (_sort) {
|
|
125
125
|
if (column.sortable === 'custom' && sortProp && _sort) {
|
|
126
|
-
|
|
126
|
+
onSortChange === null || onSortChange === void 0 || onSortChange({
|
|
127
127
|
column: column,
|
|
128
128
|
prop: sortProp,
|
|
129
129
|
order: _sort
|
|
130
130
|
});
|
|
131
|
-
if (_data && _data instanceof Array) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
} else {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
131
|
+
// if (_data && _data instanceof Array) {
|
|
132
|
+
// try {
|
|
133
|
+
// setData(mergeTreeData(initialData.current, treeNodes.current, treeProps, rowKey));
|
|
134
|
+
// } catch (error) {
|
|
135
|
+
// // eslint-disable-next-line no-console
|
|
136
|
+
// console.warn('warning: 返回的数据似乎有问题');
|
|
137
|
+
// }
|
|
138
|
+
// } else {
|
|
139
|
+
// // eslint-disable-next-line no-console
|
|
140
|
+
// console.warn('warning: 返回的数据格式有问题');
|
|
141
|
+
// }
|
|
142
142
|
} else if (column.sortMethod) {
|
|
143
|
-
var
|
|
143
|
+
var _data = initialData.current.sort(function (a, b) {
|
|
144
144
|
return column.sortMethod(a, b);
|
|
145
145
|
});
|
|
146
|
-
setData(mergeTreeData(
|
|
146
|
+
setData(mergeTreeData(_data, treeNodes.current, treeProps, rowKey));
|
|
147
147
|
} else if (isEmpty(_sort)) {
|
|
148
148
|
// 没有排序,恢复到原始顺序
|
|
149
149
|
setData(mergeTreeData(initialData.current, treeNodes.current, treeProps, rowKey));
|
|
150
150
|
} else {
|
|
151
|
-
var
|
|
152
|
-
sortedData.current = _sort === 'descending' ?
|
|
151
|
+
var _data2 = sortBy(initialData.current, column.sortBy ? column.sortBy : column.prop || column.name);
|
|
152
|
+
sortedData.current = _sort === 'descending' ? _data2.reverse() : _data2;
|
|
153
153
|
setData(mergeTreeData(sortedData.current, treeNodes.current, treeProps, rowKey));
|
|
154
154
|
}
|
|
155
155
|
}, [column, sortProp, onSortChange, initialData, setData, treeNodes, treeProps, rowKey, sortedData]);
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableColumnCtx, TableColumnProps, TableProps, TableRefs, TreeNode } from '../typings';
|
|
3
|
-
/**
|
|
4
|
-
* @author Parker
|
|
5
|
-
* @CreateTime 2022/9/11 12:24:23
|
|
6
|
-
* @LastEditor Parker
|
|
7
|
-
* @LastEditor Parker
|
|
8
|
-
* @ModifyTime 2022/11/19 23:23:42
|
|
9
|
-
*/
|
|
10
3
|
export declare const useTable: <T extends object>(props: TableProps<T>, refs: TableRefs, tableId: string) => {
|
|
11
4
|
data: T[];
|
|
12
5
|
setData: React.Dispatch<React.SetStateAction<T[]>>;
|
|
@@ -18,16 +18,8 @@ import { isNotEmpty } from "../../Util";
|
|
|
18
18
|
import { useChildrenInstance } from "../../hooks";
|
|
19
19
|
import { flatTreeData } from "../treeUtil";
|
|
20
20
|
import { TableIdManager, getRowIdentity } from "../util";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @author Parker
|
|
24
|
-
* @CreateTime 2022/9/11 12:24:23
|
|
25
|
-
* @LastEditor Parker
|
|
26
|
-
* @LastEditor Parker
|
|
27
|
-
* @ModifyTime 2022/11/19 23:23:42
|
|
28
|
-
*/
|
|
29
21
|
export var useTable = function useTable(props, refs, tableId) {
|
|
30
|
-
var getChildren = useChildrenInstance('
|
|
22
|
+
var getChildren = useChildrenInstance('ElTableColumn');
|
|
31
23
|
var _children = getChildren(props.children);
|
|
32
24
|
var maxLevel = useRef(0);
|
|
33
25
|
var flatColumns = useRef([]);
|
package/dist/Table/typings.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ export interface TableEvents<T> {
|
|
|
160
160
|
column: TableColumnCtx<T>;
|
|
161
161
|
prop: string;
|
|
162
162
|
order: 'ascending' | 'descending';
|
|
163
|
-
}) =>
|
|
163
|
+
}) => void;
|
|
164
164
|
/** column 的 key, 如果需要使用 filterChange 事件,则需要此属性标识是哪个 column 的筛选条件 */
|
|
165
165
|
onFilterChange?: (filters: any) => void;
|
|
166
166
|
/** 当表格的当前行发生变化的时候会触发该事件,如果要高亮当前行,请打开表格的 highlightCurrentRow 属性 */
|
package/dist/Tabs/TabPane.js
CHANGED
package/dist/Tabs/Tabs.d.ts
CHANGED