@apdesign/web-react 1.3.2 → 1.3.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.
- package/dist/arco-icon.min.js +1 -1
- package/dist/arco.development.js +6 -6
- package/dist/arco.min.js +2 -2
- package/es/Button/index.d.ts +3 -3
- package/es/DatePicker/picker-range.d.ts +1 -1
- package/es/Menu/context.d.ts +1 -1
- package/es/Modal/modal.js +8 -4
- package/es/Select/option.js +7 -3
- package/es/Select/select.js +4 -4
- package/es/_util/constant.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/en-US.d.ts +5 -0
- package/es/locale/en-US.js +5 -0
- package/es/locale/interface.d.ts +1 -0
- package/es/locale/zh-CN.d.ts +5 -0
- package/es/locale/zh-CN.js +5 -0
- package/lib/Modal/modal.js +8 -4
- package/lib/Select/option.js +6 -2
- package/lib/Select/select.js +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/en-US.d.ts +5 -0
- package/lib/locale/en-US.js +5 -0
- package/lib/locale/interface.d.ts +1 -0
- package/lib/locale/zh-CN.d.ts +5 -0
- package/lib/locale/zh-CN.js +5 -0
- package/package.json +1 -1
package/es/Button/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import Group from './group';
|
|
3
3
|
import { ButtonProps } from './interface';
|
|
4
4
|
declare const ButtonComponent: React.ForwardRefExoticComponent<Partial<{
|
|
5
|
-
htmlType?: "button" | "
|
|
6
|
-
} & import("./interface").BaseButtonProps & Omit<React.ButtonHTMLAttributes<any>, "className" | "
|
|
5
|
+
htmlType?: "button" | "submit" | "reset";
|
|
6
|
+
} & import("./interface").BaseButtonProps & Omit<React.ButtonHTMLAttributes<any>, "className" | "type" | "onClick"> & {
|
|
7
7
|
href: string;
|
|
8
8
|
target?: string;
|
|
9
9
|
anchorProps?: React.HTMLProps<HTMLAnchorElement>;
|
|
10
|
-
} & Omit<React.AnchorHTMLAttributes<any>, "className" | "
|
|
10
|
+
} & Omit<React.AnchorHTMLAttributes<any>, "className" | "type" | "onClick">> & React.RefAttributes<unknown>> & {
|
|
11
11
|
__BYTE_BUTTON: boolean;
|
|
12
12
|
Group: typeof Group;
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RangePickerHandle } from './interface';
|
|
3
|
-
declare const PickerComponent: React.ForwardRefExoticComponent<import("./interface").BaseRangePickerProps & import("../_util/type").Omit<import("./interface").PickerProps, "onChange" | "onSelect" | "
|
|
3
|
+
declare const PickerComponent: React.ForwardRefExoticComponent<import("./interface").BaseRangePickerProps & import("../_util/type").Omit<import("./interface").PickerProps, "onChange" | "onSelect" | "onOk" | "defaultPickerValue" | "pickerValue" | "onPickerValueChange" | "inputProps"> & React.RefAttributes<RangePickerHandle>>;
|
|
4
4
|
export default PickerComponent;
|
package/es/Menu/context.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare type HotkeyInfo = {
|
|
|
6
6
|
type: 'sibling' | 'generation' | 'enter';
|
|
7
7
|
};
|
|
8
8
|
export declare type ResetHotkeyInfo = (activeKey?: string) => void;
|
|
9
|
-
declare const MenuContext: import("react").Context<Pick<MenuProps, "
|
|
9
|
+
declare const MenuContext: import("react").Context<Pick<MenuProps, "inDropdown" | "theme" | "mode" | "levelIndent" | "icons" | "collapse" | "autoScrollIntoView" | "selectedKeys" | "openKeys" | "scrollConfig" | "triggerProps" | "tooltipProps"> & {
|
|
10
10
|
id?: string;
|
|
11
11
|
prefixCls?: string;
|
|
12
12
|
onClickMenuItem?: (key: string, event: any) => void;
|
package/es/Modal/modal.js
CHANGED
|
@@ -85,7 +85,9 @@ function Modal(baseProps, ref) {
|
|
|
85
85
|
var _c;
|
|
86
86
|
var context = useContext(ConfigContext);
|
|
87
87
|
var props = useMergeProps(baseProps, defaultProps, (_c = context.componentConfig) === null || _c === void 0 ? void 0 : _c.Modal);
|
|
88
|
-
var className = props.className, style = props.style, visible = props.visible, simple = props.simple,
|
|
88
|
+
var className = props.className, style = props.style, visible = props.visible, simple = props.simple, originTitle = props.title, children = props.children, cancelText = props.cancelText, okText = props.okText, okButtonProps = props.okButtonProps, cancelButtonProps = props.cancelButtonProps, _d = props.getPopupContainer, getPopupContainer = _d === void 0 ? function () { return document.body; } : _d, footer = props.footer, afterClose = props.afterClose, confirmLoading = props.confirmLoading, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, afterOpen = props.afterOpen, hideCancel = props.hideCancel, autoFocus = props.autoFocus, focusLock = props.focusLock, maskClosable = props.maskClosable, mask = props.mask, alignCenter = props.alignCenter, getChildrenPopupContainer = props.getChildrenPopupContainer, wrapClassName = props.wrapClassName, escToExit = props.escToExit, modalRender = props.modalRender, maskStyle = props.maskStyle, wrapStyle = props.wrapStyle, closeIcon = props.closeIcon, draggable = props.draggable, draggableProps = props.draggableProps, rest = __rest(props, ["className", "style", "visible", "simple", "title", "children", "cancelText", "okText", "okButtonProps", "cancelButtonProps", "getPopupContainer", "footer", "afterClose", "confirmLoading", "mountOnEnter", "unmountOnExit", "afterOpen", "hideCancel", "autoFocus", "focusLock", "maskClosable", "mask", "alignCenter", "getChildrenPopupContainer", "wrapClassName", "escToExit", "modalRender", "maskStyle", "wrapStyle", "closeIcon", "draggable", "draggableProps"]);
|
|
89
|
+
// 由于draggable是在title上进行,所以这里处理没有title的情况
|
|
90
|
+
var title = draggable ? originTitle || ' ' : originTitle;
|
|
89
91
|
var modalWrapperRef = useRef(null);
|
|
90
92
|
var contentWrapper = useRef(null);
|
|
91
93
|
var modalRef = useRef(null);
|
|
@@ -202,7 +204,7 @@ function Modal(baseProps, ref) {
|
|
|
202
204
|
? getChildrenPopupContainer(node)
|
|
203
205
|
: contentWrapper.current;
|
|
204
206
|
} }),
|
|
205
|
-
title && (React.createElement("div", { className: prefixCls + "-header", style: { cursor: draggable ? 'move' : null } },
|
|
207
|
+
(title || draggable) && (React.createElement("div", { className: prefixCls + "-header", style: { cursor: draggable ? 'move' : null } },
|
|
206
208
|
React.createElement("div", { className: prefixCls + "-title", id: "arco-dialog-" + dialogIndex.current }, title))),
|
|
207
209
|
React.createElement("div", { ref: contentWrapper, className: prefixCls + "-content" }, children),
|
|
208
210
|
renderFooter(),
|
|
@@ -210,10 +212,12 @@ function Modal(baseProps, ref) {
|
|
|
210
212
|
(closeIcon !== undefined ? (React.createElement("span", { onClick: onCancel, className: prefixCls + "-close-icon" }, closeIcon)) : (React.createElement(IconHover, { tabIndex: -1, onClick: onCancel, className: prefixCls + "-close-icon", role: "button", "aria-label": "Close" },
|
|
211
213
|
React.createElement(IconClose, null))))));
|
|
212
214
|
var ariaProps = title ? { 'aria-labelledby': "arco-dialog-" + dialogIndex.current } : {};
|
|
215
|
+
// 将绑定到弹窗的尺寸相关样式移到上层div
|
|
216
|
+
var _h = style || {}, width = _h.width, height = _h.height, restStyle = __rest(_h, ["width", "height"]);
|
|
213
217
|
var modalDom = (React.createElement("div", __assign({ role: "dialog", "aria-modal": "true" }, ariaProps, { className: cs(prefixCls, (_a = {},
|
|
214
218
|
_a[prefixCls + "-simple"] = simple,
|
|
215
219
|
_a[prefixCls + "-rtl"] = rtl,
|
|
216
|
-
_a), className), style: __assign({ display: draggable ? 'block' : null },
|
|
220
|
+
_a), className), style: __assign(__assign({ display: draggable ? 'block' : null }, restStyle), { width: draggable ? '100%' : width, height: draggable ? '100%' : height }), ref: modalRef }), innerFocusLock ? (React.createElement(FocusLock, { crossFrame: false, disabled: !visible, autoFocus: innerAutoFocus, lockProps: {
|
|
217
221
|
tabIndex: -1,
|
|
218
222
|
onKeyDown: onEscExit,
|
|
219
223
|
} }, element)) : (React.createElement(React.Fragment, null, element))));
|
|
@@ -227,7 +231,7 @@ function Modal(baseProps, ref) {
|
|
|
227
231
|
});
|
|
228
232
|
// 包装在Draggable中的modal
|
|
229
233
|
var wrappedModalDom = draggable && title ? (React.createElement(Draggable, __assign({ bounds: "parent", handle: "." + prefixCls + "-header" }, draggableProps),
|
|
230
|
-
React.createElement("div", { style: { top: 0, verticalAlign: 'middle', display: 'inline-block' } }, modalWithMouseEventsDom))) : (modalWithMouseEventsDom);
|
|
234
|
+
React.createElement("div", { style: { top: 0, verticalAlign: 'middle', display: 'inline-block', width: width, height: height } }, modalWithMouseEventsDom))) : (modalWithMouseEventsDom);
|
|
231
235
|
var setTransformOrigin = function (e) {
|
|
232
236
|
if (haveOriginTransformOrigin.current)
|
|
233
237
|
return;
|
package/es/Select/option.js
CHANGED
|
@@ -36,14 +36,17 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
36
36
|
}
|
|
37
37
|
return ar;
|
|
38
38
|
};
|
|
39
|
-
import React, { useState } from 'react';
|
|
39
|
+
import React, { useContext, useState } from 'react';
|
|
40
40
|
import cs from '../_util/classNames';
|
|
41
41
|
import Checkbox from '../Checkbox';
|
|
42
42
|
import omit from '../_util/omit';
|
|
43
|
+
import { ConfigContext } from '../ConfigProvider';
|
|
43
44
|
function Option(props, ref) {
|
|
44
45
|
var _a, _b;
|
|
46
|
+
var _c;
|
|
45
47
|
var style = props.style, className = props.className, wrapperClassName = props.wrapperClassName, disabled = props.disabled, prefixCls = props.prefixCls, rtl = props.rtl, propValue = props.value, propChildren = props.children, _isMultipleMode = props._isMultipleMode, _isMultipleQuickSelectMode = props._isMultipleQuickSelectMode, _onSingleQuickSelect = props._onSingleQuickSelect, _isUserCreatedOption = props._isUserCreatedOption, _isUserCreatingOption = props._isUserCreatingOption, _valueActive = props._valueActive, _valueSelect = props._valueSelect, _onMouseEnter = props._onMouseEnter, _onMouseLeave = props._onMouseLeave, _onClick = props._onClick, rest = __rest(props, ["style", "className", "wrapperClassName", "disabled", "prefixCls", "rtl", "value", "children", "_isMultipleMode", "_isMultipleQuickSelectMode", "_onSingleQuickSelect", "_isUserCreatedOption", "_isUserCreatingOption", "_valueActive", "_valueSelect", "_onMouseEnter", "_onMouseLeave", "_onClick"]);
|
|
46
|
-
var
|
|
48
|
+
var locale = useContext(ConfigContext).locale;
|
|
49
|
+
var _d = __read(useState(false), 2), isHovering = _d[0], setIsHovering = _d[1];
|
|
47
50
|
var value = 'value' in props ? propValue : "" + propChildren;
|
|
48
51
|
var childNode = 'children' in props ? propChildren : "" + propValue;
|
|
49
52
|
var isChecked = _isMultipleMode
|
|
@@ -100,12 +103,13 @@ function Option(props, ref) {
|
|
|
100
103
|
backgroundColor: 'rgb(var(--primary-6))',
|
|
101
104
|
cursor: 'pointer',
|
|
102
105
|
color: 'white',
|
|
106
|
+
fontSize: '12px',
|
|
103
107
|
padding: '7px',
|
|
104
108
|
paddingLeft: '20px',
|
|
105
109
|
marginLeft: '-20px',
|
|
106
110
|
clipPath: 'polygon(12px 50%, 0% 0%, 100% 0%, 100% 100%, 0% 100%)',
|
|
107
111
|
whiteSpace: 'nowrap',
|
|
108
|
-
}, onClick: function () { return _onSingleQuickSelect === null || _onSingleQuickSelect === void 0 ? void 0 : _onSingleQuickSelect(value); } },
|
|
112
|
+
}, onClick: function () { return _onSingleQuickSelect === null || _onSingleQuickSelect === void 0 ? void 0 : _onSingleQuickSelect(value); } }, (_c = locale.Select) === null || _c === void 0 ? void 0 : _c.filterThisItemOnly)))));
|
|
109
113
|
}
|
|
110
114
|
return (React.createElement("li", __assign({}, wrapperProps, optionLabelProps), childNode));
|
|
111
115
|
}
|
package/es/Select/select.js
CHANGED
|
@@ -76,7 +76,7 @@ var defaultProps = {
|
|
|
76
76
|
};
|
|
77
77
|
var triggerPopupAlign = { bottom: 4 };
|
|
78
78
|
function Select(baseProps, ref) {
|
|
79
|
-
var _a = useContext(ConfigContext), getPrefixCls = _a.getPrefixCls, renderEmpty = _a.renderEmpty, componentConfig = _a.componentConfig, rtl = _a.rtl;
|
|
79
|
+
var _a = useContext(ConfigContext), getPrefixCls = _a.getPrefixCls, renderEmpty = _a.renderEmpty, componentConfig = _a.componentConfig, rtl = _a.rtl, locale = _a.locale;
|
|
80
80
|
var props = useMergeProps(baseProps, defaultProps, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.Select);
|
|
81
81
|
var children = props.children, renderFormat = props.renderFormat, defaultActiveFirstOption = props.defaultActiveFirstOption, disabled = props.disabled, unmountOnExit = props.unmountOnExit, notFoundContent = props.notFoundContent, showSearch = props.showSearch, tokenSeparators = props.tokenSeparators, options = props.options, filterOption = props.filterOption, labelInValue = props.labelInValue, getPopupContainer = props.getPopupContainer, isQuickSingleSelectMode = props.isQuickSingleSelectMode, trigger = props.trigger, triggerElement = props.triggerElement, triggerProps = props.triggerProps, dropdownRender = props.dropdownRender, dropdownMenuStyle = props.dropdownMenuStyle, dropdownMenuClassName = props.dropdownMenuClassName, virtualListProps = props.virtualListProps,
|
|
82
82
|
// events
|
|
@@ -501,7 +501,7 @@ function Select(baseProps, ref) {
|
|
|
501
501
|
]));
|
|
502
502
|
var renderPopup = function () {
|
|
503
503
|
var _a;
|
|
504
|
-
var _b, _c;
|
|
504
|
+
var _b, _c, _d, _e;
|
|
505
505
|
// 没有设置弹出框的 width 时,需要在虚拟列表渲染的瞬间获得子元素的最大宽度
|
|
506
506
|
var needMeasureLongestItem = (triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.autoAlignPopupWidth) === false &&
|
|
507
507
|
(!((_b = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.style) === null || _b === void 0 ? void 0 : _b.width) || ((_c = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.style) === null || _c === void 0 ? void 0 : _c.width) === 'auto');
|
|
@@ -554,8 +554,8 @@ function Select(baseProps, ref) {
|
|
|
554
554
|
padding: '8px 16px 4px',
|
|
555
555
|
borderTop: '1px solid var(--color-fill-3)',
|
|
556
556
|
} },
|
|
557
|
-
React.createElement(Button, { size: "mini", onClick: cancelCheck },
|
|
558
|
-
React.createElement(Button, { type: "primary", size: "mini", onClick: confirmCheck },
|
|
557
|
+
React.createElement(Button, { size: "mini", onClick: cancelCheck }, (_d = locale.Select) === null || _d === void 0 ? void 0 : _d.cancelText),
|
|
558
|
+
React.createElement(Button, { type: "primary", size: "mini", onClick: confirmCheck }, (_e = locale.Select) === null || _e === void 0 ? void 0 : _e.okText))))) : null;
|
|
559
559
|
// Avoid drop-down box jitter when user is creating a selection
|
|
560
560
|
var isUserCreating = allowCreate && inputValue;
|
|
561
561
|
// Dropdown-placeholder when there is no options
|
package/es/_util/constant.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const NOOP: () => void;
|
|
2
2
|
export declare function newArray(length: number): any;
|
|
3
|
-
export declare function pickTriggerPropsFromRest(rest: any): Pick<any, "
|
|
3
|
+
export declare function pickTriggerPropsFromRest(rest: any): Pick<any, "onClick" | "tabIndex" | "onFocus" | "onBlur" | "onContextMenu" | "onMouseEnter" | "onMouseLeave" | "onMouseMove">;
|
package/es/index.d.ts
CHANGED
|
@@ -139,4 +139,4 @@ export type { WatermarkProps } from './Watermark/interface';
|
|
|
139
139
|
export { default as Watermark } from './Watermark';
|
|
140
140
|
export type { ImageProps, ImagePreviewProps, ImagePreviewActionProps, ImagePreviewGroupProps } from './Image/interface';
|
|
141
141
|
export { default as Image } from './Image';
|
|
142
|
-
export declare const version = "1.3.
|
|
142
|
+
export declare const version = "1.3.4";
|
package/es/index.js
CHANGED
package/es/locale/en-US.d.ts
CHANGED
package/es/locale/en-US.js
CHANGED
package/es/locale/interface.d.ts
CHANGED
package/es/locale/zh-CN.d.ts
CHANGED
package/es/locale/zh-CN.js
CHANGED
package/lib/Modal/modal.js
CHANGED
|
@@ -109,7 +109,9 @@ function Modal(baseProps, ref) {
|
|
|
109
109
|
var _c;
|
|
110
110
|
var context = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
|
|
111
111
|
var props = (0, useMergeProps_1.default)(baseProps, defaultProps, (_c = context.componentConfig) === null || _c === void 0 ? void 0 : _c.Modal);
|
|
112
|
-
var className = props.className, style = props.style, visible = props.visible, simple = props.simple,
|
|
112
|
+
var className = props.className, style = props.style, visible = props.visible, simple = props.simple, originTitle = props.title, children = props.children, cancelText = props.cancelText, okText = props.okText, okButtonProps = props.okButtonProps, cancelButtonProps = props.cancelButtonProps, _d = props.getPopupContainer, getPopupContainer = _d === void 0 ? function () { return document.body; } : _d, footer = props.footer, afterClose = props.afterClose, confirmLoading = props.confirmLoading, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, afterOpen = props.afterOpen, hideCancel = props.hideCancel, autoFocus = props.autoFocus, focusLock = props.focusLock, maskClosable = props.maskClosable, mask = props.mask, alignCenter = props.alignCenter, getChildrenPopupContainer = props.getChildrenPopupContainer, wrapClassName = props.wrapClassName, escToExit = props.escToExit, modalRender = props.modalRender, maskStyle = props.maskStyle, wrapStyle = props.wrapStyle, closeIcon = props.closeIcon, draggable = props.draggable, draggableProps = props.draggableProps, rest = __rest(props, ["className", "style", "visible", "simple", "title", "children", "cancelText", "okText", "okButtonProps", "cancelButtonProps", "getPopupContainer", "footer", "afterClose", "confirmLoading", "mountOnEnter", "unmountOnExit", "afterOpen", "hideCancel", "autoFocus", "focusLock", "maskClosable", "mask", "alignCenter", "getChildrenPopupContainer", "wrapClassName", "escToExit", "modalRender", "maskStyle", "wrapStyle", "closeIcon", "draggable", "draggableProps"]);
|
|
113
|
+
// 由于draggable是在title上进行,所以这里处理没有title的情况
|
|
114
|
+
var title = draggable ? originTitle || ' ' : originTitle;
|
|
113
115
|
var modalWrapperRef = (0, react_1.useRef)(null);
|
|
114
116
|
var contentWrapper = (0, react_1.useRef)(null);
|
|
115
117
|
var modalRef = (0, react_1.useRef)(null);
|
|
@@ -226,7 +228,7 @@ function Modal(baseProps, ref) {
|
|
|
226
228
|
? getChildrenPopupContainer(node)
|
|
227
229
|
: contentWrapper.current;
|
|
228
230
|
} }),
|
|
229
|
-
title && (react_1.default.createElement("div", { className: prefixCls + "-header", style: { cursor: draggable ? 'move' : null } },
|
|
231
|
+
(title || draggable) && (react_1.default.createElement("div", { className: prefixCls + "-header", style: { cursor: draggable ? 'move' : null } },
|
|
230
232
|
react_1.default.createElement("div", { className: prefixCls + "-title", id: "arco-dialog-" + dialogIndex.current }, title))),
|
|
231
233
|
react_1.default.createElement("div", { ref: contentWrapper, className: prefixCls + "-content" }, children),
|
|
232
234
|
renderFooter(),
|
|
@@ -234,10 +236,12 @@ function Modal(baseProps, ref) {
|
|
|
234
236
|
(closeIcon !== undefined ? (react_1.default.createElement("span", { onClick: onCancel, className: prefixCls + "-close-icon" }, closeIcon)) : (react_1.default.createElement(icon_hover_1.default, { tabIndex: -1, onClick: onCancel, className: prefixCls + "-close-icon", role: "button", "aria-label": "Close" },
|
|
235
237
|
react_1.default.createElement(IconClose_1.default, null))))));
|
|
236
238
|
var ariaProps = title ? { 'aria-labelledby': "arco-dialog-" + dialogIndex.current } : {};
|
|
239
|
+
// 将绑定到弹窗的尺寸相关样式移到上层div
|
|
240
|
+
var _h = style || {}, width = _h.width, height = _h.height, restStyle = __rest(_h, ["width", "height"]);
|
|
237
241
|
var modalDom = (react_1.default.createElement("div", __assign({ role: "dialog", "aria-modal": "true" }, ariaProps, { className: (0, classNames_1.default)(prefixCls, (_a = {},
|
|
238
242
|
_a[prefixCls + "-simple"] = simple,
|
|
239
243
|
_a[prefixCls + "-rtl"] = rtl,
|
|
240
|
-
_a), className), style: __assign({ display: draggable ? 'block' : null },
|
|
244
|
+
_a), className), style: __assign(__assign({ display: draggable ? 'block' : null }, restStyle), { width: draggable ? '100%' : width, height: draggable ? '100%' : height }), ref: modalRef }), innerFocusLock ? (react_1.default.createElement(react_focus_lock_1.default, { crossFrame: false, disabled: !visible, autoFocus: innerAutoFocus, lockProps: {
|
|
241
245
|
tabIndex: -1,
|
|
242
246
|
onKeyDown: onEscExit,
|
|
243
247
|
} }, element)) : (react_1.default.createElement(react_1.default.Fragment, null, element))));
|
|
@@ -251,7 +255,7 @@ function Modal(baseProps, ref) {
|
|
|
251
255
|
});
|
|
252
256
|
// 包装在Draggable中的modal
|
|
253
257
|
var wrappedModalDom = draggable && title ? (react_1.default.createElement(react_draggable_1.default, __assign({ bounds: "parent", handle: "." + prefixCls + "-header" }, draggableProps),
|
|
254
|
-
react_1.default.createElement("div", { style: { top: 0, verticalAlign: 'middle', display: 'inline-block' } }, modalWithMouseEventsDom))) : (modalWithMouseEventsDom);
|
|
258
|
+
react_1.default.createElement("div", { style: { top: 0, verticalAlign: 'middle', display: 'inline-block', width: width, height: height } }, modalWithMouseEventsDom))) : (modalWithMouseEventsDom);
|
|
255
259
|
var setTransformOrigin = function (e) {
|
|
256
260
|
if (haveOriginTransformOrigin.current)
|
|
257
261
|
return;
|
package/lib/Select/option.js
CHANGED
|
@@ -64,10 +64,13 @@ var react_1 = __importStar(require("react"));
|
|
|
64
64
|
var classNames_1 = __importDefault(require("../_util/classNames"));
|
|
65
65
|
var Checkbox_1 = __importDefault(require("../Checkbox"));
|
|
66
66
|
var omit_1 = __importDefault(require("../_util/omit"));
|
|
67
|
+
var ConfigProvider_1 = require("../ConfigProvider");
|
|
67
68
|
function Option(props, ref) {
|
|
68
69
|
var _a, _b;
|
|
70
|
+
var _c;
|
|
69
71
|
var style = props.style, className = props.className, wrapperClassName = props.wrapperClassName, disabled = props.disabled, prefixCls = props.prefixCls, rtl = props.rtl, propValue = props.value, propChildren = props.children, _isMultipleMode = props._isMultipleMode, _isMultipleQuickSelectMode = props._isMultipleQuickSelectMode, _onSingleQuickSelect = props._onSingleQuickSelect, _isUserCreatedOption = props._isUserCreatedOption, _isUserCreatingOption = props._isUserCreatingOption, _valueActive = props._valueActive, _valueSelect = props._valueSelect, _onMouseEnter = props._onMouseEnter, _onMouseLeave = props._onMouseLeave, _onClick = props._onClick, rest = __rest(props, ["style", "className", "wrapperClassName", "disabled", "prefixCls", "rtl", "value", "children", "_isMultipleMode", "_isMultipleQuickSelectMode", "_onSingleQuickSelect", "_isUserCreatedOption", "_isUserCreatingOption", "_valueActive", "_valueSelect", "_onMouseEnter", "_onMouseLeave", "_onClick"]);
|
|
70
|
-
var
|
|
72
|
+
var locale = (0, react_1.useContext)(ConfigProvider_1.ConfigContext).locale;
|
|
73
|
+
var _d = __read((0, react_1.useState)(false), 2), isHovering = _d[0], setIsHovering = _d[1];
|
|
71
74
|
var value = 'value' in props ? propValue : "" + propChildren;
|
|
72
75
|
var childNode = 'children' in props ? propChildren : "" + propValue;
|
|
73
76
|
var isChecked = _isMultipleMode
|
|
@@ -124,12 +127,13 @@ function Option(props, ref) {
|
|
|
124
127
|
backgroundColor: 'rgb(var(--primary-6))',
|
|
125
128
|
cursor: 'pointer',
|
|
126
129
|
color: 'white',
|
|
130
|
+
fontSize: '12px',
|
|
127
131
|
padding: '7px',
|
|
128
132
|
paddingLeft: '20px',
|
|
129
133
|
marginLeft: '-20px',
|
|
130
134
|
clipPath: 'polygon(12px 50%, 0% 0%, 100% 0%, 100% 100%, 0% 100%)',
|
|
131
135
|
whiteSpace: 'nowrap',
|
|
132
|
-
}, onClick: function () { return _onSingleQuickSelect === null || _onSingleQuickSelect === void 0 ? void 0 : _onSingleQuickSelect(value); } },
|
|
136
|
+
}, onClick: function () { return _onSingleQuickSelect === null || _onSingleQuickSelect === void 0 ? void 0 : _onSingleQuickSelect(value); } }, (_c = locale.Select) === null || _c === void 0 ? void 0 : _c.filterThisItemOnly)))));
|
|
133
137
|
}
|
|
134
138
|
return (react_1.default.createElement("li", __assign({}, wrapperProps, optionLabelProps), childNode));
|
|
135
139
|
}
|
package/lib/Select/select.js
CHANGED
|
@@ -100,7 +100,7 @@ var defaultProps = {
|
|
|
100
100
|
};
|
|
101
101
|
var triggerPopupAlign = { bottom: 4 };
|
|
102
102
|
function Select(baseProps, ref) {
|
|
103
|
-
var _a = (0, react_1.useContext)(ConfigProvider_1.ConfigContext), getPrefixCls = _a.getPrefixCls, renderEmpty = _a.renderEmpty, componentConfig = _a.componentConfig, rtl = _a.rtl;
|
|
103
|
+
var _a = (0, react_1.useContext)(ConfigProvider_1.ConfigContext), getPrefixCls = _a.getPrefixCls, renderEmpty = _a.renderEmpty, componentConfig = _a.componentConfig, rtl = _a.rtl, locale = _a.locale;
|
|
104
104
|
var props = (0, useMergeProps_1.default)(baseProps, defaultProps, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.Select);
|
|
105
105
|
var children = props.children, renderFormat = props.renderFormat, defaultActiveFirstOption = props.defaultActiveFirstOption, disabled = props.disabled, unmountOnExit = props.unmountOnExit, notFoundContent = props.notFoundContent, showSearch = props.showSearch, tokenSeparators = props.tokenSeparators, options = props.options, filterOption = props.filterOption, labelInValue = props.labelInValue, getPopupContainer = props.getPopupContainer, isQuickSingleSelectMode = props.isQuickSingleSelectMode, trigger = props.trigger, triggerElement = props.triggerElement, triggerProps = props.triggerProps, dropdownRender = props.dropdownRender, dropdownMenuStyle = props.dropdownMenuStyle, dropdownMenuClassName = props.dropdownMenuClassName, virtualListProps = props.virtualListProps,
|
|
106
106
|
// events
|
|
@@ -525,7 +525,7 @@ function Select(baseProps, ref) {
|
|
|
525
525
|
]));
|
|
526
526
|
var renderPopup = function () {
|
|
527
527
|
var _a;
|
|
528
|
-
var _b, _c;
|
|
528
|
+
var _b, _c, _d, _e;
|
|
529
529
|
// 没有设置弹出框的 width 时,需要在虚拟列表渲染的瞬间获得子元素的最大宽度
|
|
530
530
|
var needMeasureLongestItem = (triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.autoAlignPopupWidth) === false &&
|
|
531
531
|
(!((_b = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.style) === null || _b === void 0 ? void 0 : _b.width) || ((_c = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.style) === null || _c === void 0 ? void 0 : _c.width) === 'auto');
|
|
@@ -578,8 +578,8 @@ function Select(baseProps, ref) {
|
|
|
578
578
|
padding: '8px 16px 4px',
|
|
579
579
|
borderTop: '1px solid var(--color-fill-3)',
|
|
580
580
|
} },
|
|
581
|
-
react_1.default.createElement(index_1.Button, { size: "mini", onClick: cancelCheck },
|
|
582
|
-
react_1.default.createElement(index_1.Button, { type: "primary", size: "mini", onClick: confirmCheck },
|
|
581
|
+
react_1.default.createElement(index_1.Button, { size: "mini", onClick: cancelCheck }, (_d = locale.Select) === null || _d === void 0 ? void 0 : _d.cancelText),
|
|
582
|
+
react_1.default.createElement(index_1.Button, { type: "primary", size: "mini", onClick: confirmCheck }, (_e = locale.Select) === null || _e === void 0 ? void 0 : _e.okText))))) : null;
|
|
583
583
|
// Avoid drop-down box jitter when user is creating a selection
|
|
584
584
|
var isUserCreating = allowCreate && inputValue;
|
|
585
585
|
// Dropdown-placeholder when there is no options
|
package/lib/index.d.ts
CHANGED
|
@@ -139,4 +139,4 @@ export type { WatermarkProps } from './Watermark/interface';
|
|
|
139
139
|
export { default as Watermark } from './Watermark';
|
|
140
140
|
export type { ImageProps, ImagePreviewProps, ImagePreviewActionProps, ImagePreviewGroupProps } from './Image/interface';
|
|
141
141
|
export { default as Image } from './Image';
|
|
142
|
-
export declare const version = "1.3.
|
|
142
|
+
export declare const version = "1.3.4";
|
package/lib/index.js
CHANGED
|
@@ -147,4 +147,4 @@ var Watermark_1 = require("./Watermark");
|
|
|
147
147
|
Object.defineProperty(exports, "Watermark", { enumerable: true, get: function () { return __importDefault(Watermark_1).default; } });
|
|
148
148
|
var Image_1 = require("./Image");
|
|
149
149
|
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(Image_1).default; } });
|
|
150
|
-
exports.version = '1.3.
|
|
150
|
+
exports.version = '1.3.4';
|
package/lib/locale/en-US.d.ts
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/zh-CN.d.ts
CHANGED
package/lib/locale/zh-CN.js
CHANGED