@apdesign/web-react 1.3.2 → 1.3.3
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 +4 -4
- package/dist/arco.min.js +2 -2
- package/es/Button/index.d.ts +3 -3
- package/es/Modal/modal.js +8 -4
- package/es/Select/option.js +1 -0
- package/es/_util/constant.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/Modal/modal.js +8 -4
- package/lib/Select/option.js +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- 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
|
};
|
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
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" | "onFocus" | "onBlur" | "tabIndex" | "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.3";
|
package/es/index.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
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.3";
|
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.3';
|