@arco-design/mobile-react 2.23.0 → 2.24.1
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/CHANGELOG.md +27 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/render.d.ts +3 -1
- package/cjs/_helpers/render.js +10 -3
- package/cjs/action-sheet/index.d.ts +5 -5
- package/cjs/action-sheet/index.js +4 -3
- package/cjs/action-sheet/methods.d.ts +1 -1
- package/cjs/badge/style/css/index.css +1 -2
- package/cjs/checkbox/checkbox.js +4 -0
- package/cjs/circle-progress/index.js +4 -0
- package/cjs/context-provider/index.d.ts +4 -0
- package/cjs/context-provider/index.js +14 -2
- package/cjs/dialog/index.d.ts +8 -8
- package/cjs/dialog/index.js +3 -2
- package/cjs/dialog/methods.d.ts +3 -3
- package/cjs/dialog/style/css/index.css +1 -2
- package/cjs/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/cjs/ellipsis/components/js-ellipsis.js +14 -1
- package/cjs/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/cjs/ellipsis/components/native-ellipsis.js +6 -1
- package/cjs/ellipsis/demo/style/css/mobile.css +1 -1
- package/cjs/ellipsis/demo/style/mobile.less +3 -1
- package/cjs/ellipsis/index.js +6 -2
- package/cjs/ellipsis/style/css/index.css +14 -1
- package/cjs/ellipsis/style/index.less +15 -1
- package/cjs/ellipsis/type.d.ts +22 -76
- package/cjs/image-preview/index.d.ts +3 -3
- package/cjs/image-preview/index.js +3 -2
- package/cjs/image-preview/methods.d.ts +2 -1
- package/cjs/image-preview/methods.js +2 -2
- package/cjs/input/hooks.js +1 -0
- package/cjs/input/index.d.ts +5 -0
- package/cjs/input/index.js +6 -2
- package/cjs/masking/index.d.ts +4 -14
- package/cjs/masking/index.js +3 -2
- package/cjs/masking/methods.d.ts +3 -2
- package/cjs/masking/methods.js +2 -2
- package/cjs/nav-bar/index.d.ts +12 -0
- package/cjs/nav-bar/index.js +8 -2
- package/cjs/notify/index.d.ts +12 -12
- package/cjs/notify/index.js +3 -2
- package/cjs/notify/methods.d.ts +2 -1
- package/cjs/notify/methods.js +2 -2
- package/cjs/picker-view/components/picker-cell.js +3 -1
- package/cjs/popup/index.d.ts +4 -4
- package/cjs/popup/index.js +3 -2
- package/cjs/popup/methods.d.ts +1 -1
- package/cjs/popup-swiper/index.d.ts +12 -6
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/popup-swiper/methods.d.ts +1 -1
- package/cjs/progress/index.js +4 -0
- package/cjs/rate/index.js +5 -0
- package/cjs/slider/index.js +6 -1
- package/cjs/stepper/index.js +7 -1
- package/cjs/swipe-action/index.d.ts +1 -0
- package/cjs/swipe-action/index.js +10 -0
- package/cjs/switch/index.js +4 -0
- package/cjs/toast/index.d.ts +18 -18
- package/cjs/toast/index.js +3 -2
- package/cjs/toast/methods.d.ts +2 -1
- package/cjs/toast/methods.js +2 -2
- package/dist/index.js +141 -47
- package/dist/index.min.js +3 -3
- package/dist/style.css +26 -114
- package/dist/style.min.css +1 -1
- package/esm/_helpers/render.d.ts +3 -1
- package/esm/_helpers/render.js +10 -3
- package/esm/action-sheet/index.d.ts +5 -5
- package/esm/action-sheet/index.js +4 -3
- package/esm/action-sheet/methods.d.ts +1 -1
- package/esm/badge/style/css/index.css +1 -2
- package/esm/checkbox/checkbox.js +4 -0
- package/esm/circle-progress/index.js +4 -0
- package/esm/context-provider/index.d.ts +4 -0
- package/esm/context-provider/index.js +13 -2
- package/esm/dialog/index.d.ts +8 -8
- package/esm/dialog/index.js +3 -2
- package/esm/dialog/methods.d.ts +3 -3
- package/esm/dialog/style/css/index.css +1 -2
- package/esm/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/esm/ellipsis/components/js-ellipsis.js +14 -1
- package/esm/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/esm/ellipsis/components/native-ellipsis.js +6 -1
- package/esm/ellipsis/demo/style/css/mobile.css +1 -1
- package/esm/ellipsis/demo/style/mobile.less +3 -1
- package/esm/ellipsis/index.js +6 -2
- package/esm/ellipsis/style/css/index.css +14 -1
- package/esm/ellipsis/style/index.less +15 -1
- package/esm/ellipsis/type.d.ts +22 -76
- package/esm/image-preview/index.d.ts +3 -3
- package/esm/image-preview/index.js +3 -2
- package/esm/image-preview/methods.d.ts +2 -1
- package/esm/image-preview/methods.js +2 -2
- package/esm/input/hooks.js +1 -0
- package/esm/input/index.d.ts +5 -0
- package/esm/input/index.js +6 -2
- package/esm/masking/index.d.ts +4 -14
- package/esm/masking/index.js +3 -2
- package/esm/masking/methods.d.ts +3 -2
- package/esm/masking/methods.js +2 -2
- package/esm/nav-bar/index.d.ts +12 -0
- package/esm/nav-bar/index.js +8 -2
- package/esm/notify/index.d.ts +12 -12
- package/esm/notify/index.js +3 -2
- package/esm/notify/methods.d.ts +2 -1
- package/esm/notify/methods.js +2 -2
- package/esm/picker-view/components/picker-cell.js +3 -1
- package/esm/popup/index.d.ts +4 -4
- package/esm/popup/index.js +3 -2
- package/esm/popup/methods.d.ts +1 -1
- package/esm/popup-swiper/index.d.ts +12 -6
- package/esm/popup-swiper/index.js +3 -2
- package/esm/popup-swiper/methods.d.ts +1 -1
- package/esm/progress/index.js +4 -0
- package/esm/rate/index.js +5 -0
- package/esm/slider/index.js +6 -1
- package/esm/stepper/index.js +7 -1
- package/esm/swipe-action/index.d.ts +1 -0
- package/esm/swipe-action/index.js +1 -0
- package/esm/switch/index.js +4 -0
- package/esm/toast/index.d.ts +18 -18
- package/esm/toast/index.js +3 -2
- package/esm/toast/methods.d.ts +2 -1
- package/esm/toast/methods.js +2 -2
- package/package.json +3 -3
- package/style/css/public.css +4 -4
- package/tokens/app/arcodesign/default/css-variables.less +2 -0
- package/tokens/app/arcodesign/default/index.d.ts +2 -0
- package/tokens/app/arcodesign/default/index.js +127 -125
- package/tokens/app/arcodesign/default/index.json +24 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/_helpers/render.d.ts +3 -1
- package/umd/_helpers/render.js +13 -7
- package/umd/action-sheet/index.d.ts +5 -5
- package/umd/action-sheet/index.js +4 -3
- package/umd/action-sheet/methods.d.ts +1 -1
- package/umd/badge/style/css/index.css +1 -2
- package/umd/checkbox/checkbox.js +4 -0
- package/umd/circle-progress/index.js +4 -0
- package/umd/context-provider/index.d.ts +4 -0
- package/umd/context-provider/index.js +13 -1
- package/umd/dialog/index.d.ts +8 -8
- package/umd/dialog/index.js +3 -2
- package/umd/dialog/methods.d.ts +3 -3
- package/umd/dialog/style/css/index.css +1 -2
- package/umd/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/umd/ellipsis/components/js-ellipsis.js +14 -1
- package/umd/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/umd/ellipsis/components/native-ellipsis.js +6 -1
- package/umd/ellipsis/demo/style/css/mobile.css +1 -1
- package/umd/ellipsis/demo/style/mobile.less +3 -1
- package/umd/ellipsis/index.js +6 -2
- package/umd/ellipsis/style/css/index.css +14 -1
- package/umd/ellipsis/style/index.less +15 -1
- package/umd/ellipsis/type.d.ts +22 -76
- package/umd/image-preview/index.d.ts +3 -3
- package/umd/image-preview/index.js +3 -2
- package/umd/image-preview/methods.d.ts +2 -1
- package/umd/image-preview/methods.js +2 -2
- package/umd/input/hooks.js +1 -0
- package/umd/input/index.d.ts +5 -0
- package/umd/input/index.js +6 -2
- package/umd/masking/index.d.ts +4 -14
- package/umd/masking/index.js +3 -2
- package/umd/masking/methods.d.ts +3 -2
- package/umd/masking/methods.js +2 -2
- package/umd/nav-bar/index.d.ts +12 -0
- package/umd/nav-bar/index.js +8 -2
- package/umd/notify/index.d.ts +12 -12
- package/umd/notify/index.js +3 -2
- package/umd/notify/methods.d.ts +2 -1
- package/umd/notify/methods.js +2 -2
- package/umd/picker-view/components/picker-cell.js +3 -1
- package/umd/popup/index.d.ts +4 -4
- package/umd/popup/index.js +3 -2
- package/umd/popup/methods.d.ts +1 -1
- package/umd/popup-swiper/index.d.ts +12 -6
- package/umd/popup-swiper/index.js +3 -2
- package/umd/popup-swiper/methods.d.ts +1 -1
- package/umd/progress/index.js +4 -0
- package/umd/rate/index.js +5 -0
- package/umd/slider/index.js +6 -1
- package/umd/stepper/index.js +7 -1
- package/umd/swipe-action/index.d.ts +1 -0
- package/umd/swipe-action/index.js +11 -4
- package/umd/switch/index.js +4 -0
- package/umd/toast/index.d.ts +18 -18
- package/umd/toast/index.js +3 -2
- package/umd/toast/methods.d.ts +2 -1
- package/umd/toast/methods.js +2 -2
package/esm/checkbox/checkbox.js
CHANGED
@@ -136,6 +136,10 @@ export var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
136
136
|
return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref) {
|
137
137
|
var prefixCls = _ref.prefixCls;
|
138
138
|
return /*#__PURE__*/React.createElement("div", {
|
139
|
+
role: "checkbox",
|
140
|
+
"aria-checked": checked,
|
141
|
+
"aria-disabled": disabled,
|
142
|
+
tabIndex: 0,
|
139
143
|
ref: domRef,
|
140
144
|
style: style,
|
141
145
|
className: cls(className, prefixCls + "-" + componentName, "shape-" + shape, {
|
@@ -149,6 +149,10 @@ var CircleProgress = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
149
149
|
function renderCircleProgress(_ref) {
|
150
150
|
var prefixCls = _ref.prefixCls;
|
151
151
|
return /*#__PURE__*/React.createElement("div", {
|
152
|
+
role: "progressbar",
|
153
|
+
"aria-valuemin": 0,
|
154
|
+
"aria-valuemax": 100,
|
155
|
+
"aria-valuenow": percentage,
|
152
156
|
className: cls(prefixCls + "-circle-progress", disabled ? prefixCls + "-circle-progress-disabled" : '', "" + className),
|
153
157
|
style: _extends({
|
154
158
|
width: circleSize,
|
@@ -41,6 +41,9 @@ export declare const GlobalContext: React.Context<GlobalContextParams>;
|
|
41
41
|
export interface ContextProviderProps extends GlobalContextParams {
|
42
42
|
children: React.ReactNode;
|
43
43
|
}
|
44
|
+
export declare type WithGlobalContext<T> = T & {
|
45
|
+
context?: GlobalContextParams;
|
46
|
+
};
|
44
47
|
/**
|
45
48
|
* 全局数据控制组件,用于替换全局数据。
|
46
49
|
* @en Global data control component, used to replace global data.
|
@@ -51,3 +54,4 @@ export interface ContextProviderProps extends GlobalContextParams {
|
|
51
54
|
*/
|
52
55
|
export default function ContextProvider(props: ContextProviderProps): JSX.Element;
|
53
56
|
export declare const ContextLayout: React.Consumer<GlobalContextParams>;
|
57
|
+
export declare function CompWithGlobalContext<P extends JSX.IntrinsicAttributes>(Component: React.FunctionComponent<P>): (props: WithGlobalContext<P>) => JSX.Element;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
-
var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"]
|
3
|
+
var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"],
|
4
|
+
_excluded2 = ["context"];
|
4
5
|
import React, { createContext, useState, useEffect, useCallback } from 'react';
|
5
6
|
import { addCssRules, removeCssStyleDom, defaultLocale } from '@arco-design/mobile-utils';
|
6
7
|
export var defaultContext = {
|
@@ -78,4 +79,14 @@ export default function ContextProvider(props) {
|
|
78
79
|
})
|
79
80
|
}, children);
|
80
81
|
}
|
81
|
-
export var ContextLayout = GlobalContext.Consumer;
|
82
|
+
export var ContextLayout = GlobalContext.Consumer;
|
83
|
+
export function CompWithGlobalContext(Component) {
|
84
|
+
return function (props) {
|
85
|
+
var propsContext = props.context,
|
86
|
+
others = _objectWithoutPropertiesLoose(props, _excluded2);
|
87
|
+
|
88
|
+
return /*#__PURE__*/React.createElement(ContextLayout, null, function (context) {
|
89
|
+
return /*#__PURE__*/React.createElement(ContextProvider, _extends({}, context, propsContext), /*#__PURE__*/React.createElement(Component, others));
|
90
|
+
});
|
91
|
+
};
|
92
|
+
}
|
package/esm/dialog/index.d.ts
CHANGED
@@ -137,7 +137,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
|
|
137
137
|
* @param {AlertOptions & DialogProps} config Configuration
|
138
138
|
* @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
|
139
139
|
*/
|
140
|
-
alert: (config: A) => {
|
140
|
+
alert: (config: A, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
141
141
|
close: () => void;
|
142
142
|
update: (newConfig: A) => void;
|
143
143
|
};
|
@@ -147,7 +147,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
|
|
147
147
|
* @param {ConfirmOptions & AlertOptions} config Configuration
|
148
148
|
* @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
|
149
149
|
*/
|
150
|
-
confirm: (config: C) => {
|
150
|
+
confirm: (config: C, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
151
151
|
close: () => void;
|
152
152
|
update: (newConfig: C) => void;
|
153
153
|
};
|
@@ -159,7 +159,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
|
|
159
159
|
*/
|
160
160
|
open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
161
161
|
key?: string | undefined;
|
162
|
-
}) => {
|
162
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
163
163
|
close: () => void;
|
164
164
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
165
165
|
key?: string | undefined;
|
@@ -173,7 +173,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
173
173
|
* @param {AlertOptions & DialogProps} config Configuration
|
174
174
|
* @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
|
175
175
|
*/
|
176
|
-
alert: (config: AlertOptions) => {
|
176
|
+
alert: (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
177
177
|
close: () => void;
|
178
178
|
update: (newConfig: AlertOptions) => void;
|
179
179
|
};
|
@@ -183,7 +183,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
183
183
|
* @param {ConfirmOptions & AlertOptions} config Configuration
|
184
184
|
* @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
|
185
185
|
*/
|
186
|
-
confirm: (config: ConfirmOptions) => {
|
186
|
+
confirm: (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
187
187
|
close: () => void;
|
188
188
|
update: (newConfig: ConfirmOptions) => void;
|
189
189
|
};
|
@@ -193,11 +193,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
193
193
|
* @param {DialogProps} config Configuration
|
194
194
|
* @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
|
195
195
|
*/
|
196
|
-
open: (config: Pick<DialogProps & React.RefAttributes<DialogRef
|
196
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
197
197
|
key?: string | undefined;
|
198
|
-
}) => {
|
198
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
199
199
|
close: () => void;
|
200
|
-
update: (newConfig: Pick<DialogProps & React.RefAttributes<DialogRef
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
201
201
|
key?: string | undefined;
|
202
202
|
}) => void;
|
203
203
|
};
|
package/esm/dialog/index.js
CHANGED
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
3
3
|
var _excluded = ["close", "children", "title", "footer", "footerType", "renderFooter", "footerCollapseCount", "titleAlign", "contentAlign", "className", "maskClass", "contentClass", "contentStyle", "contentTransitionType", "maskTransitionTimeout", "contentTransitionTimeout", "extra"];
|
4
4
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
5
5
|
import { cls, componentWrapper } from '@arco-design/mobile-utils';
|
6
|
-
import { ContextLayout } from '../context-provider';
|
6
|
+
import { ContextLayout, CompWithGlobalContext } from '../context-provider';
|
7
7
|
import Masking from '../masking';
|
8
8
|
import { alert, confirm, open } from './methods';
|
9
9
|
import { useSystem } from '../_helpers';
|
@@ -143,6 +143,7 @@ export function methodsGenerator(Comp) {
|
|
143
143
|
open: open(Comp)
|
144
144
|
};
|
145
145
|
}
|
146
|
+
var DialogWithGlobalContext = CompWithGlobalContext(Dialog);
|
146
147
|
/**
|
147
148
|
* 模态对话框,在浮层中显示,引导用户进行相关操作。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
|
148
149
|
* @en A modal dialog, displayed in a floating layer, guides the user to perform related operations. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the bullet layer, you need to pass the scroll container to `getScrollContainer` to release scrolling when it is not scrolled to the top or bottom.
|
@@ -152,4 +153,4 @@ export function methodsGenerator(Comp) {
|
|
152
153
|
* @name_en Dialog
|
153
154
|
*/
|
154
155
|
|
155
|
-
export default componentWrapper(Dialog, methodsGenerator(
|
156
|
+
export default componentWrapper(Dialog, methodsGenerator(DialogWithGlobalContext));
|
package/esm/dialog/methods.d.ts
CHANGED
@@ -2,17 +2,17 @@ import React from 'react';
|
|
2
2
|
import { OpenBaseProps } from '../masking/methods';
|
3
3
|
export declare function normalizeAlert<AlertOptions, P>(config: AlertOptions): P;
|
4
4
|
export declare function normalizeConfirm<ConfirmOptions, P>(config: ConfirmOptions): P;
|
5
|
-
export declare function alert<AlertOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions) => {
|
5
|
+
export declare function alert<AlertOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
6
6
|
close: () => void;
|
7
7
|
update: (newConfig: AlertOptions) => void;
|
8
8
|
};
|
9
|
-
export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions) => {
|
9
|
+
export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
10
10
|
close: () => void;
|
11
11
|
update: (newConfig: ConfirmOptions) => void;
|
12
12
|
};
|
13
13
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
14
14
|
key?: string | undefined;
|
15
|
-
}) => {
|
15
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
16
16
|
close: () => void;
|
17
17
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
18
18
|
key?: string | undefined;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<
|
2
|
+
import { JsEllipsisRef } from '../type';
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("../type").EllipsisBaseProps & {
|
4
|
+
prefixCls: string;
|
5
|
+
} & Pick<import("../type").EllipsisProps, "maxHeight" | "endExcludes" | "reflowOnResize" | "onReflow"> & React.RefAttributes<JsEllipsisRef>>>;
|
4
6
|
export default _default;
|
@@ -206,7 +206,20 @@ var JsEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
206
206
|
}, /*#__PURE__*/React.createElement("span", {
|
207
207
|
ref: textRef,
|
208
208
|
className: prefixCls + "-js-content"
|
209
|
-
}
|
209
|
+
}, dangerouslyUseInnerHTML ? /*#__PURE__*/React.createElement("span", {
|
210
|
+
className: prefixCls + "-js-content-initial",
|
211
|
+
style: {
|
212
|
+
WebkitLineClamp: maxLine
|
213
|
+
},
|
214
|
+
dangerouslySetInnerHTML: {
|
215
|
+
__html: text
|
216
|
+
}
|
217
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
218
|
+
className: prefixCls + "-js-content-initial",
|
219
|
+
style: {
|
220
|
+
WebkitLineClamp: maxLine
|
221
|
+
}
|
222
|
+
}, text)), /*#__PURE__*/React.createElement("span", {
|
210
223
|
ref: ellipsisRef,
|
211
224
|
className: prefixCls + "-js-content-ellipsis",
|
212
225
|
onClick: onEllipsisNodeClick
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { NativeEllipsisProps } from '../type';
|
3
|
-
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, collapseNode, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
3
|
+
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, ellipsisNode, collapseNode, onEllipsisNodeClick, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof NativeEllipsis>;
|
5
5
|
export default _default;
|
@@ -7,8 +7,10 @@ function NativeEllipsis(_ref) {
|
|
7
7
|
dangerouslyUseInnerHTML = _ref.dangerouslyUseInnerHTML,
|
8
8
|
text = _ref.text,
|
9
9
|
maxLine = _ref.maxLine,
|
10
|
+
ellipsisNode = _ref.ellipsisNode,
|
10
11
|
_ref$collapseNode = _ref.collapseNode,
|
11
12
|
collapseNode = _ref$collapseNode === void 0 ? '' : _ref$collapseNode,
|
13
|
+
onEllipsisNodeClick = _ref.onEllipsisNodeClick,
|
12
14
|
onCollapseNodeClick = _ref.onCollapseNodeClick;
|
13
15
|
return /*#__PURE__*/React.createElement("div", {
|
14
16
|
className: cls(prefixCls + "-native", {
|
@@ -27,7 +29,10 @@ function NativeEllipsis(_ref) {
|
|
27
29
|
}) : /*#__PURE__*/React.createElement("span", null, text), !ellipsis && collapseNode && /*#__PURE__*/React.createElement("span", {
|
28
30
|
onClick: onCollapseNodeClick,
|
29
31
|
className: cls(prefixCls + "-native-collapse")
|
30
|
-
}, collapseNode))
|
32
|
+
}, collapseNode), ellipsis && (ellipsisNode !== '...' || onEllipsisNodeClick) ? /*#__PURE__*/React.createElement("span", {
|
33
|
+
onClick: onEllipsisNodeClick,
|
34
|
+
className: cls(prefixCls + "-native-ellipsis-node")
|
35
|
+
}, ellipsisNode) : null);
|
31
36
|
}
|
32
37
|
|
33
38
|
export default /*#__PURE__*/React.memo(NativeEllipsis);
|
package/esm/ellipsis/index.js
CHANGED
@@ -27,15 +27,17 @@ var Ellipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
27
27
|
ellipsisNode = _props$ellipsisNode === void 0 ? '...' : _props$ellipsisNode,
|
28
28
|
_props$collapseNode = props.collapseNode,
|
29
29
|
collapseNode = _props$collapseNode === void 0 ? '' : _props$collapseNode,
|
30
|
-
onCollapseNodeClick = props.onCollapseNodeClick,
|
31
30
|
endExcludes = props.endExcludes,
|
32
31
|
_props$reflowOnResize = props.reflowOnResize,
|
33
32
|
reflowOnResize = _props$reflowOnResize === void 0 ? false : _props$reflowOnResize,
|
33
|
+
_props$floatEllipsisN = props.floatEllipsisNode,
|
34
|
+
floatEllipsisNode = _props$floatEllipsisN === void 0 ? false : _props$floatEllipsisN,
|
34
35
|
onReflow = props.onReflow,
|
36
|
+
onCollapseNodeClick = props.onCollapseNodeClick,
|
35
37
|
onEllipsisNodeClick = props.onEllipsisNodeClick;
|
36
38
|
var domRef = useRef(null);
|
37
39
|
var jsEllipsisRef = useRef(null);
|
38
|
-
var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 &&
|
40
|
+
var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 && (!endExcludes || endExcludes.length === 0) && !onReflow && (floatEllipsisNode || ellipsisNode === '...' && !onEllipsisNodeClick);
|
39
41
|
useImperativeHandle(ref, function () {
|
40
42
|
var _jsEllipsisRef$curren;
|
41
43
|
|
@@ -55,7 +57,9 @@ var Ellipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
55
57
|
dangerouslyUseInnerHTML: dangerouslyUseInnerHTML,
|
56
58
|
text: text,
|
57
59
|
maxLine: maxLine,
|
60
|
+
ellipsisNode: ellipsisNode,
|
58
61
|
collapseNode: collapseNode,
|
62
|
+
onEllipsisNodeClick: onEllipsisNodeClick,
|
59
63
|
onCollapseNodeClick: onCollapseNodeClick
|
60
64
|
}) : /*#__PURE__*/React.createElement(JsEllipsis, {
|
61
65
|
ref: jsEllipsisRef,
|
@@ -1,10 +1,23 @@
|
|
1
1
|
.arco-ellipsis {
|
2
2
|
font-size: 0.32rem ;
|
3
3
|
}
|
4
|
-
.arco-ellipsis-native.ellipsis
|
4
|
+
.arco-ellipsis-native.ellipsis,
|
5
|
+
.arco-ellipsis-js-content-initial {
|
5
6
|
display: -webkit-box;
|
6
7
|
overflow: hidden;
|
7
8
|
text-overflow: ellipsis;
|
8
9
|
word-break: break-word;
|
9
10
|
-webkit-box-orient: vertical;
|
11
|
+
position: relative;
|
12
|
+
}
|
13
|
+
.arco-ellipsis-native-ellipsis-node {
|
14
|
+
position: absolute;
|
15
|
+
right: 0;
|
16
|
+
bottom: 0;
|
17
|
+
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
|
18
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
|
19
|
+
padding-left: 20PX ;
|
20
|
+
}
|
21
|
+
.arco-ellipsis-js-content-ellipsis {
|
22
|
+
display: none;
|
10
23
|
}
|
@@ -3,11 +3,25 @@
|
|
3
3
|
.@{prefix}-ellipsis {
|
4
4
|
.use-var(font-size, ellipsis-default-text-size);
|
5
5
|
|
6
|
-
&-native.ellipsis
|
6
|
+
&-native.ellipsis,
|
7
|
+
&-js-content-initial {
|
7
8
|
display: -webkit-box;
|
8
9
|
overflow: hidden;
|
9
10
|
text-overflow: ellipsis;
|
10
11
|
word-break: break-word;
|
11
12
|
-webkit-box-orient: vertical;
|
13
|
+
position: relative;
|
14
|
+
}
|
15
|
+
|
16
|
+
&-native-ellipsis-node {
|
17
|
+
position: absolute;
|
18
|
+
right: 0;
|
19
|
+
bottom: 0;
|
20
|
+
.use-var(background, ellipsis-float-ellipsis-node-background);
|
21
|
+
.use-var(padding-left, ellipsis-float-ellipsis-node-padding-left);
|
22
|
+
}
|
23
|
+
|
24
|
+
&-js-content-ellipsis {
|
25
|
+
display: none;
|
12
26
|
}
|
13
27
|
}
|
package/esm/ellipsis/type.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ReactNode
|
2
|
-
interface
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export interface EllipsisBaseProps {
|
3
3
|
/**
|
4
4
|
* 需要缩略的文本内容
|
5
5
|
* @en Text content to be omitted
|
@@ -23,68 +23,17 @@ interface BaseProps {
|
|
23
23
|
* @default false
|
24
24
|
*/
|
25
25
|
dangerouslyUseInnerHTML?: boolean;
|
26
|
-
}
|
27
|
-
export interface NativeEllipsisProps extends BaseProps {
|
28
|
-
/**
|
29
|
-
* className 前缀
|
30
|
-
* @en Prefix classname
|
31
|
-
*/
|
32
|
-
prefixCls: string;
|
33
|
-
/**
|
34
|
-
* 自定义收起节点,不为空时文本展开插入文本尾部
|
35
|
-
* @en Customize the collapsed node, when the text is not empty, the text expand Text expand content inserts the end of the text
|
36
|
-
*/
|
37
|
-
collapseNode?: ReactNode;
|
38
|
-
/**
|
39
|
-
* 收起节点点击事件
|
40
|
-
* @en Collapse node click event
|
41
|
-
*/
|
42
|
-
onCollapseNodeClick?: () => void;
|
43
|
-
}
|
44
|
-
export interface JsEllipsisRef {
|
45
|
-
dom: HTMLDivElement | null;
|
46
|
-
reflow: () => void;
|
47
|
-
}
|
48
|
-
export interface JsEllipsisProps extends BaseProps {
|
49
|
-
ref: Ref<HTMLDivElement | null>;
|
50
|
-
/**
|
51
|
-
* className 前缀
|
52
|
-
* @en Prefix classname
|
53
|
-
*/
|
54
|
-
prefixCls: string;
|
55
|
-
/**
|
56
|
-
* 最大显示高度,单位 px,优先级高于 maxLine
|
57
|
-
* @en Maximum display height, unit px, priority higher than maxLine
|
58
|
-
*/
|
59
|
-
maxHeight?: number;
|
60
26
|
/**
|
61
27
|
* 自定义缩略符节点,文本缩略时插入文本尾部
|
62
|
-
* @en Customize the ellipsis node, insert the end of the text when the text is omitted
|
28
|
+
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
63
29
|
* @default "..."
|
64
30
|
*/
|
65
31
|
ellipsisNode?: ReactNode;
|
66
32
|
/**
|
67
33
|
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
68
|
-
* @en Customize the collapse node,
|
34
|
+
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
69
35
|
*/
|
70
36
|
collapseNode?: ReactNode;
|
71
|
-
/**
|
72
|
-
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
73
|
-
* @en Characters that need to be filtered out at the end of the text (before abbreviations)
|
74
|
-
* @default []
|
75
|
-
*/
|
76
|
-
endExcludes?: string[];
|
77
|
-
/**
|
78
|
-
* 容器大小变化时是否自适应,使用原生缩略时默认为 true
|
79
|
-
* @en Whether to adapt when the container size changes, the default is true when using native ellipsis
|
80
|
-
* @default false
|
81
|
-
*/
|
82
|
-
reflowOnResize?: boolean;
|
83
|
-
/**
|
84
|
-
* 文本缩略处理的完成回调
|
85
|
-
* @en Callback when text omission processing is complete
|
86
|
-
*/
|
87
|
-
onReflow?: (ellipsis: boolean, text: string) => void;
|
88
37
|
/**
|
89
38
|
* 缩略节点点击事件
|
90
39
|
* @en Ellipsis node click event
|
@@ -108,7 +57,7 @@ export interface EllipsisRef {
|
|
108
57
|
*/
|
109
58
|
reflow: (() => void) | undefined;
|
110
59
|
}
|
111
|
-
export interface EllipsisProps extends
|
60
|
+
export interface EllipsisProps extends EllipsisBaseProps {
|
112
61
|
/**
|
113
62
|
* 自定义类名
|
114
63
|
* @en Custom classname
|
@@ -119,17 +68,6 @@ export interface EllipsisProps extends BaseProps {
|
|
119
68
|
* @en Maximum display height(unit: px), priority higher than maxLine
|
120
69
|
*/
|
121
70
|
maxHeight?: number;
|
122
|
-
/**
|
123
|
-
* 自定义缩略符节点,文本缩略时插入文本尾部
|
124
|
-
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
125
|
-
* @default "..."
|
126
|
-
*/
|
127
|
-
ellipsisNode?: ReactNode;
|
128
|
-
/**
|
129
|
-
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
130
|
-
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
131
|
-
*/
|
132
|
-
collapseNode?: ReactNode;
|
133
71
|
/**
|
134
72
|
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
135
73
|
* @en Characters to filter out at the end of the text (before the ellipsis)
|
@@ -142,20 +80,28 @@ export interface EllipsisProps extends BaseProps {
|
|
142
80
|
* @default false
|
143
81
|
*/
|
144
82
|
reflowOnResize?: boolean;
|
83
|
+
/**
|
84
|
+
* 文本缩略时,缩略符节点是否浮在文本右下角(默认加渐变色背景)
|
85
|
+
* @en Whether the abbreviation node is floating in the lower right corner of the text (with a gradient background by default)
|
86
|
+
* @default false
|
87
|
+
*/
|
88
|
+
floatEllipsisNode?: boolean;
|
145
89
|
/**
|
146
90
|
* 文本缩略处理的完成回调
|
147
91
|
* @en Callback when text omission processing is complete
|
148
92
|
*/
|
149
93
|
onReflow?: (ellipsis: boolean, text: string) => void;
|
94
|
+
}
|
95
|
+
export declare type EllipsisCommonProps = EllipsisBaseProps & {
|
150
96
|
/**
|
151
|
-
*
|
152
|
-
* @en
|
153
|
-
*/
|
154
|
-
onEllipsisNodeClick?: () => void;
|
155
|
-
/**
|
156
|
-
* 收起节点点击事件
|
157
|
-
* @en Collapse node click event
|
97
|
+
* className 前缀
|
98
|
+
* @en Prefix classname
|
158
99
|
*/
|
159
|
-
|
100
|
+
prefixCls: string;
|
101
|
+
};
|
102
|
+
export declare type NativeEllipsisProps = EllipsisCommonProps;
|
103
|
+
export interface JsEllipsisRef {
|
104
|
+
dom: HTMLDivElement | null;
|
105
|
+
reflow: () => void;
|
160
106
|
}
|
161
|
-
export
|
107
|
+
export declare type JsEllipsisProps = EllipsisCommonProps & Pick<EllipsisProps, 'maxHeight' | 'endExcludes' | 'reflowOnResize' | 'onReflow'>;
|
@@ -252,7 +252,7 @@ export declare function methodsGenerator<P extends ImagePreviewProps>(Comp: Reac
|
|
252
252
|
* @param {ImagePreviewProps} config configuration
|
253
253
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
254
254
|
*/
|
255
|
-
open: (config: Pick<P, Exclude<keyof P, "close"
|
255
|
+
open: (config: Pick<P, Exclude<keyof P, "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
256
256
|
close: () => void;
|
257
257
|
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
258
258
|
};
|
@@ -264,9 +264,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
264
264
|
* @param {ImagePreviewProps} config configuration
|
265
265
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
266
266
|
*/
|
267
|
-
open: (config: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef
|
267
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
268
268
|
close: () => void;
|
269
|
-
update: (newConfig: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef
|
269
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
270
270
|
};
|
271
271
|
};
|
272
272
|
/**
|
@@ -4,7 +4,7 @@ var _excluded = ["style", "className", "images", "loop", "openIndex", "fit", "no
|
|
4
4
|
import React, { useRef, forwardRef, useImperativeHandle, useEffect, useState } from 'react';
|
5
5
|
import { nextTick, componentWrapper, preventEleScroll, freeEleScroll, cls } from '@arco-design/mobile-utils';
|
6
6
|
import TransformAble from '@arco-design/transformable';
|
7
|
-
import { ContextLayout } from '../context-provider';
|
7
|
+
import { ContextLayout, CompWithGlobalContext } from '../context-provider';
|
8
8
|
import Carousel from '../carousel';
|
9
9
|
import Transition from '../transition';
|
10
10
|
import BaseImage from '../image';
|
@@ -980,6 +980,7 @@ export function methodsGenerator(Comp) {
|
|
980
980
|
open: open(Comp)
|
981
981
|
};
|
982
982
|
}
|
983
|
+
var ImagePreviewWithGlobalContext = CompWithGlobalContext(ImagePreview);
|
983
984
|
/**
|
984
985
|
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
985
986
|
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
@@ -989,4 +990,4 @@ export function methodsGenerator(Comp) {
|
|
989
990
|
* @name_en ImagePreview
|
990
991
|
*/
|
991
992
|
|
992
|
-
export default componentWrapper(ImagePreview, methodsGenerator(
|
993
|
+
export default componentWrapper(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { GlobalContextParams } from '../context-provider';
|
2
3
|
export interface OpenBaseProps {
|
3
4
|
onClose?: () => void;
|
4
5
|
close: (e: any) => void;
|
5
6
|
openIndex: number;
|
6
7
|
images: any[];
|
7
8
|
}
|
8
|
-
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close"
|
9
|
+
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close">>, context?: GlobalContextParams | undefined) => {
|
9
10
|
close: () => void;
|
10
11
|
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
11
12
|
};
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { appendElementById, removeElement } from '@arco-design/mobile-utils';
|
3
3
|
import { ReactDOMRender } from '../_helpers/render';
|
4
4
|
export function open(Component) {
|
5
|
-
return function (config) {
|
5
|
+
return function (config, context) {
|
6
6
|
var baseProps = _extends({
|
7
7
|
unmountOnExit: true
|
8
8
|
}, config || {}, {
|
@@ -20,7 +20,7 @@ export function open(Component) {
|
|
20
20
|
|
21
21
|
var leaving = false;
|
22
22
|
|
23
|
-
var _ReactDOMRender = new ReactDOMRender(Component, div),
|
23
|
+
var _ReactDOMRender = new ReactDOMRender(Component, div, context),
|
24
24
|
render = _ReactDOMRender.render;
|
25
25
|
|
26
26
|
function update(newConfig) {
|
package/esm/input/hooks.js
CHANGED
@@ -200,6 +200,7 @@ export function useInputLogic(props, inputRef) {
|
|
200
200
|
|
201
201
|
function renderWrapper(prefixCls, type, children) {
|
202
202
|
return /*#__PURE__*/React.createElement("div", {
|
203
|
+
role: "search",
|
203
204
|
className: prefixCls + "-container all-border-box " + (className || ''),
|
204
205
|
style: style,
|
205
206
|
ref: wrapRef
|
package/esm/input/index.d.ts
CHANGED
@@ -27,6 +27,11 @@ export interface InputProps extends BasicInputProps {
|
|
27
27
|
* @en Other unlisted native properties have lower priority than listed component properties
|
28
28
|
*/
|
29
29
|
nativeProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
30
|
+
/**
|
31
|
+
* 无障碍label
|
32
|
+
* @en accessible label
|
33
|
+
*/
|
34
|
+
ariaLabel?: string;
|
30
35
|
}
|
31
36
|
export interface InputRef {
|
32
37
|
/**
|
package/esm/input/index.js
CHANGED
@@ -27,7 +27,9 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
27
27
|
inputClass = props.inputClass,
|
28
28
|
inputStyle = props.inputStyle,
|
29
29
|
_props$nativeProps = props.nativeProps,
|
30
|
-
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps
|
30
|
+
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps,
|
31
|
+
_props$ariaLabel = props.ariaLabel,
|
32
|
+
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel;
|
31
33
|
var inputRef = useRef(null);
|
32
34
|
|
33
35
|
var _useInputLogic = useInputLogic(props, inputRef),
|
@@ -71,7 +73,9 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
71
73
|
onChange: handleChange,
|
72
74
|
onInput: handleInput,
|
73
75
|
onKeyDown: handleKeyDown,
|
74
|
-
onClick: handleClick
|
76
|
+
onClick: handleClick,
|
77
|
+
"aria-disabled": disabled,
|
78
|
+
"aria-label": ariaLabel
|
75
79
|
})));
|
76
80
|
}
|
77
81
|
|