@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.
@@ -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" | "reset" | "submit";
6
- } & import("./interface").BaseButtonProps & Omit<React.ButtonHTMLAttributes<any>, "className" | "onClick" | "type"> & {
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" | "onClick" | "type">> & React.RefAttributes<unknown>> & {
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" | "inputProps" | "onOk" | "defaultPickerValue" | "pickerValue" | "onPickerValueChange"> & React.RefAttributes<RangePickerHandle>>;
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;
@@ -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, "mode" | "triggerProps" | "collapse" | "inDropdown" | "theme" | "levelIndent" | "icons" | "autoScrollIntoView" | "selectedKeys" | "openKeys" | "scrollConfig" | "tooltipProps"> & {
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, title = 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"]);
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 }, style), ref: modalRef }), innerFocusLock ? (React.createElement(FocusLock, { crossFrame: false, disabled: !visible, autoFocus: innerAutoFocus, lockProps: {
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;
@@ -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 _c = __read(useState(false), 2), isHovering = _c[0], setIsHovering = _c[1];
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); } }, "\u4EC5\u7B5B\u9009\u6B64\u9879")))));
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
  }
@@ -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 }, "\u53D6\u6D88"),
558
- React.createElement(Button, { type: "primary", size: "mini", onClick: confirmCheck }, "\u786E\u5B9A"))))) : null;
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
@@ -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, "onFocus" | "onBlur" | "onClick" | "tabIndex" | "onContextMenu" | "onMouseEnter" | "onMouseLeave" | "onMouseMove">;
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.2";
142
+ export declare const version = "1.3.4";
package/es/index.js CHANGED
@@ -69,4 +69,4 @@ export { default as Upload } from './Upload';
69
69
  export { default as Mentions } from './Mentions';
70
70
  export { default as Watermark } from './Watermark';
71
71
  export { default as Image } from './Image';
72
- export var version = '1.3.2';
72
+ export var version = '1.3.4';
@@ -230,5 +230,10 @@ declare const _default: {
230
230
  preset: string;
231
231
  empty: string;
232
232
  };
233
+ Select: {
234
+ cancelText: string;
235
+ okText: string;
236
+ filterThisItemOnly: string;
237
+ };
233
238
  };
234
239
  export default _default;
@@ -169,4 +169,9 @@ export default {
169
169
  preset: 'Preset Colors',
170
170
  empty: 'Empty',
171
171
  },
172
+ Select: {
173
+ cancelText: 'Cancel',
174
+ okText: 'OK',
175
+ filterThisItemOnly: 'Filter this item only',
176
+ },
172
177
  };
@@ -34,6 +34,7 @@ export interface Locale {
34
34
  Transfer: Record<string, any>;
35
35
  ImagePreview: Record<string, any>;
36
36
  Form?: Record<string, any>;
37
+ Select?: Record<string, any>;
37
38
  ColorPicker: Record<string, any>;
38
39
  }
39
40
  export {};
@@ -277,5 +277,10 @@ declare const _default: {
277
277
  preset: string;
278
278
  empty: string;
279
279
  };
280
+ Select: {
281
+ cancelText: string;
282
+ okText: string;
283
+ filterThisItemOnly: string;
284
+ };
280
285
  };
281
286
  export default _default;
@@ -216,4 +216,9 @@ export default {
216
216
  preset: '系统预设颜色',
217
217
  empty: '暂无',
218
218
  },
219
+ Select: {
220
+ cancelText: '取消',
221
+ okText: '确定',
222
+ filterThisItemOnly: '仅筛选此项',
223
+ },
219
224
  };
@@ -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, title = 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"]);
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 }, style), ref: modalRef }), innerFocusLock ? (react_1.default.createElement(react_focus_lock_1.default, { crossFrame: false, disabled: !visible, autoFocus: innerAutoFocus, lockProps: {
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;
@@ -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 _c = __read((0, react_1.useState)(false), 2), isHovering = _c[0], setIsHovering = _c[1];
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); } }, "\u4EC5\u7B5B\u9009\u6B64\u9879")))));
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
  }
@@ -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 }, "\u53D6\u6D88"),
582
- react_1.default.createElement(index_1.Button, { type: "primary", size: "mini", onClick: confirmCheck }, "\u786E\u5B9A"))))) : null;
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.2";
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.2';
150
+ exports.version = '1.3.4';
@@ -230,5 +230,10 @@ declare const _default: {
230
230
  preset: string;
231
231
  empty: string;
232
232
  };
233
+ Select: {
234
+ cancelText: string;
235
+ okText: string;
236
+ filterThisItemOnly: string;
237
+ };
233
238
  };
234
239
  export default _default;
@@ -171,4 +171,9 @@ exports.default = {
171
171
  preset: 'Preset Colors',
172
172
  empty: 'Empty',
173
173
  },
174
+ Select: {
175
+ cancelText: 'Cancel',
176
+ okText: 'OK',
177
+ filterThisItemOnly: 'Filter this item only',
178
+ },
174
179
  };
@@ -34,6 +34,7 @@ export interface Locale {
34
34
  Transfer: Record<string, any>;
35
35
  ImagePreview: Record<string, any>;
36
36
  Form?: Record<string, any>;
37
+ Select?: Record<string, any>;
37
38
  ColorPicker: Record<string, any>;
38
39
  }
39
40
  export {};
@@ -277,5 +277,10 @@ declare const _default: {
277
277
  preset: string;
278
278
  empty: string;
279
279
  };
280
+ Select: {
281
+ cancelText: string;
282
+ okText: string;
283
+ filterThisItemOnly: string;
284
+ };
280
285
  };
281
286
  export default _default;
@@ -218,4 +218,9 @@ exports.default = {
218
218
  preset: '系统预设颜色',
219
219
  empty: '暂无',
220
220
  },
221
+ Select: {
222
+ cancelText: '取消',
223
+ okText: '确定',
224
+ filterThisItemOnly: '仅筛选此项',
225
+ },
221
226
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apdesign/web-react",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "AP Design React UI Library.",
5
5
  "module": "./es/index.js",
6
6
  "main": "./lib/index.js",