@qsxy/element-plus-react 1.0.0-next.15 → 1.0.0-next.17
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/Dialog/Dialog.js +3 -1
- 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/Empty/Empty.js +1 -1
- package/dist/Empty/ImgEmpty.js +5 -5
- package/dist/Form/Form.d.ts +9 -4
- package/dist/Form/Form.js +6 -4
- package/dist/Form/typings.d.ts +2 -2
- 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/useSelection.d.ts +1 -1
- 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
package/dist/Form/Form.js
CHANGED
|
@@ -1,7 +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 _templateObject;
|
|
2
3
|
var _excluded = ["colon", "inline", "labelPosition", "cols", "flat", "formStyle", "name", "initialValues", "fields", "component", "preserve", "children", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "className", "disabled", "labelWidth", "size", "rules", "hideRequiredAsterisk", "requireAsteriskPosition", "showMessage", "scrollToError"];
|
|
3
|
-
var _this = this,
|
|
4
|
-
_templateObject;
|
|
5
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); }
|
|
6
5
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
7
6
|
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; }
|
|
@@ -29,7 +28,8 @@ import List from "./List";
|
|
|
29
28
|
import useForm from "./useForm";
|
|
30
29
|
import useWatch from "./useWatch";
|
|
31
30
|
import { isSimilar } from "./utils/valueUtil";
|
|
32
|
-
|
|
31
|
+
function InternalForm(props, ref) {
|
|
32
|
+
var _this = this;
|
|
33
33
|
props = mergeDefaultProps({
|
|
34
34
|
inline: false,
|
|
35
35
|
cols: 0,
|
|
@@ -189,7 +189,9 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
189
189
|
restProps === null || restProps === void 0 || (_restProps$onReset = restProps.onReset) === null || _restProps$onReset === void 0 || _restProps$onReset.call(_this, event);
|
|
190
190
|
}
|
|
191
191
|
}), wrapperNode);
|
|
192
|
-
}
|
|
192
|
+
}
|
|
193
|
+
var ForwardForm = /*#__PURE__*/forwardRef(InternalForm);
|
|
194
|
+
var Form = ForwardForm;
|
|
193
195
|
Form.FormProvider = FormProvider;
|
|
194
196
|
Form.Item = Field;
|
|
195
197
|
Form.List = List;
|
package/dist/Form/typings.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { InternalFieldProps } from './FormItem';
|
|
|
5
5
|
type BaseFormProps = Omit<React.AllHTMLAttributes<HTMLFormElement>, 'onSubmit' | 'form' | 'size' | 'children'>;
|
|
6
6
|
type RenderProps = (values: Store, form: FormInstance) => React.ReactElement;
|
|
7
7
|
export type FormRules = Record<string, Rule[] | Record<string, Rule[]>>;
|
|
8
|
-
export interface FormProps<Values =
|
|
8
|
+
export interface FormProps<Values = Store> extends BaseFormProps {
|
|
9
9
|
/** 经 Form.useForm() 创建的 form 控制实例,不提供时会自动创建 */
|
|
10
10
|
form?: FormInstance<Values>;
|
|
11
11
|
children?: RenderProps | ComponentChildren;
|
|
@@ -25,7 +25,7 @@ export interface FormProps<Values = any> extends BaseFormProps {
|
|
|
25
25
|
/** 配置 Form.Item 的 colon 的默认值。表示是否显示 label 后面的冒号 */
|
|
26
26
|
colon?: boolean;
|
|
27
27
|
/** 表单默认值,只有初始化以及重置时生效 */
|
|
28
|
-
initialValues?:
|
|
28
|
+
initialValues?: Values;
|
|
29
29
|
/** 表单域标签的位置, 如果值为 left 或者 right 时,则需要设置 label-width */
|
|
30
30
|
labelPosition?: 'left' | 'right' | 'top';
|
|
31
31
|
/** 表单域标签的宽度,例如 '50px'。 作为 Form 直接子元素的 form-item 会继承该值。 支持 auto。 */
|
|
@@ -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, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
3
|
-
var _excluded = ["title", "message", "type", "icon", "width", "callback", "showClose", "beforeClose", "showCancelButton", "showConfirmButton", "cancelButtonText", "cancelButtonClass", "confirmButtonClass", "buttonSize", "buttonPosition", "overflow", "showInput", "inputType", "inputPlaceholder", "inputPattern", "inputErrorMessage", "inputValidator", "distinguishCancelAndClose", "classPrefix", "className", "style", "padding"];
|
|
3
|
+
var _excluded = ["title", "message", "type", "icon", "width", "callback", "showClose", "beforeClose", "showCancelButton", "showConfirmButton", "cancelButtonText", "cancelButtonClass", "confirmButtonClass", "buttonSize", "buttonPosition", "draggable", "overflow", "showInput", "inputType", "inputPlaceholder", "inputPattern", "inputErrorMessage", "inputValidator", "distinguishCancelAndClose", "classPrefix", "className", "style", "padding", "roundButton"];
|
|
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 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
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; }
|
|
@@ -51,6 +51,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
|
|
|
51
51
|
buttonSize = options.buttonSize,
|
|
52
52
|
_options$buttonPositi = options.buttonPosition,
|
|
53
53
|
buttonPosition = _options$buttonPositi === void 0 ? 'right' : _options$buttonPositi,
|
|
54
|
+
draggable = options.draggable,
|
|
54
55
|
overflow = options.overflow,
|
|
55
56
|
showInput = options.showInput,
|
|
56
57
|
inputType = options.inputType,
|
|
@@ -64,6 +65,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
|
|
|
64
65
|
className = options.className,
|
|
65
66
|
style = options.style,
|
|
66
67
|
padding = options.padding,
|
|
68
|
+
roundButton = options.roundButton,
|
|
67
69
|
rest = _objectWithoutProperties(options, _excluded);
|
|
68
70
|
var _useClassNames = useClassNames(classPrefix),
|
|
69
71
|
e = _useClassNames.e,
|
|
@@ -220,6 +222,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
|
|
|
220
222
|
,
|
|
221
223
|
style: _objectSpread(_objectSpread({}, style), {}, _defineProperty({}, "--".concat(namespace, "-messagebox-width"), addUnit(width))),
|
|
222
224
|
modal: true,
|
|
225
|
+
draggable: draggable,
|
|
223
226
|
overflow: overflow,
|
|
224
227
|
showClose: showClose,
|
|
225
228
|
title: title,
|
|
@@ -252,6 +255,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
|
|
|
252
255
|
}, showCancelButton && /*#__PURE__*/React.createElement(Button, {
|
|
253
256
|
className: cancelButtonClass,
|
|
254
257
|
size: buttonSize,
|
|
258
|
+
round: roundButton,
|
|
255
259
|
onClick: function onClick() {
|
|
256
260
|
return handleAction('cancel');
|
|
257
261
|
}
|
|
@@ -259,6 +263,7 @@ var MessageBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
|
|
|
259
263
|
className: confirmButtonClass,
|
|
260
264
|
type: "primary",
|
|
261
265
|
size: buttonSize,
|
|
266
|
+
round: roundButton,
|
|
262
267
|
loading: confirmButtonLoading,
|
|
263
268
|
onClick: function onClick() {
|
|
264
269
|
return handleAction('confirm');
|
|
@@ -1,5 +1,7 @@
|
|
|
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;
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
3
5
|
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; }
|
|
4
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
7
|
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); }
|
|
@@ -144,12 +146,13 @@ var Notification = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
144
146
|
afterLeave: afterLeave
|
|
145
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
146
148
|
ref: notificationRef,
|
|
147
|
-
className: classNames(b(), position.indexOf('right') > 1 ? 'right' : 'left'),
|
|
148
|
-
style: _defineProperty(_defineProperty({}, verticalProperty, offset), "zIndex", PopupManager.nextZIndex())
|
|
149
|
+
className: classNames(b(), position.indexOf('right') > 1 ? 'right' : 'left', props.className),
|
|
150
|
+
style: _objectSpread(_defineProperty(_defineProperty({}, verticalProperty, offset), "zIndex", PopupManager.nextZIndex()), props.style)
|
|
149
151
|
// 鼠标悬浮停止自动关闭
|
|
150
152
|
,
|
|
151
153
|
onMouseEnter: clearTimer,
|
|
152
|
-
onMouseLeave: startTimer
|
|
154
|
+
onMouseLeave: startTimer,
|
|
155
|
+
onClick: props.onClick
|
|
153
156
|
}, (type || iconClass) && /*#__PURE__*/React.createElement("i", {
|
|
154
157
|
className: classNames(e(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["icon"]))), typeClass, iconClass)
|
|
155
158
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import type { INotification, NotificationRef, Position } from './typings';
|
|
2
|
-
/**
|
|
3
|
-
* 通知组件
|
|
4
|
-
* @author Parker
|
|
5
|
-
* @CreateTime 2022/3/10 12:45:48
|
|
6
|
-
* @LastEditor Parker
|
|
7
|
-
* @ModifyTime 2022/5/3 13:43:28
|
|
8
|
-
* @Description Element Plus 通知组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
|
|
9
|
-
*/
|
|
10
2
|
export declare const Notification: INotification;
|
|
11
3
|
/**
|
|
12
4
|
*
|
|
@@ -16,15 +16,6 @@ var notifications = {
|
|
|
16
16
|
// the gap size between each notification
|
|
17
17
|
var GAP_SIZE = 16;
|
|
18
18
|
var seed = 1;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 通知组件
|
|
22
|
-
* @author Parker
|
|
23
|
-
* @CreateTime 2022/3/10 12:45:48
|
|
24
|
-
* @LastEditor Parker
|
|
25
|
-
* @ModifyTime 2022/5/3 13:43:28
|
|
26
|
-
* @Description Element Plus 通知组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
|
|
27
|
-
*/
|
|
28
19
|
export var Notification = function Notification(options) {
|
|
29
20
|
var _ref$current, _ref$current2;
|
|
30
21
|
var position = options.position || 'top-right';
|
|
@@ -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