@arco-design/mobile-react 2.19.1-941e02b.7 → 2.20.0
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 +36 -0
- package/README.en-US.md +6 -6
- package/README.md +6 -6
- package/cjs/_helpers/type.d.ts +1 -1
- package/cjs/avatar/group.js +1 -1
- package/cjs/avatar/index.js +10 -13
- package/cjs/avatar/style/css/index.css +96 -126
- package/cjs/avatar/style/index.less +54 -72
- package/cjs/badge/index.js +6 -8
- package/cjs/badge/style/css/index.css +5 -5
- package/cjs/badge/style/index.less +5 -5
- package/cjs/button/hooks.d.ts +1 -2
- package/cjs/button/hooks.js +5 -3
- package/cjs/button/index.d.ts +12 -0
- package/cjs/button/index.js +40 -33
- package/cjs/button/style/css/index.css +75 -310
- package/cjs/button/style/index.less +32 -38
- package/cjs/count-down/demo/style/mobile.less +1 -1
- package/cjs/dropdown/dropdown.d.ts +3 -0
- package/cjs/dropdown/dropdown.js +306 -0
- package/cjs/dropdown/index.d.ts +3 -4
- package/cjs/dropdown/index.js +3 -303
- package/cjs/dropdown/options.js +2 -1
- package/cjs/dropdown/type.d.ts +20 -9
- package/cjs/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/cjs/dropdown-menu/dropdown-menu.js +273 -0
- package/cjs/dropdown-menu/helper.d.ts +1 -1
- package/cjs/dropdown-menu/index.d.ts +2 -3
- package/cjs/dropdown-menu/index.js +2 -245
- package/cjs/dropdown-menu/type.d.ts +21 -20
- package/cjs/image/index.js +4 -1
- package/cjs/image/style/css/index.css +2 -1
- package/cjs/image/style/index.less +2 -1
- package/cjs/image-picker/index.d.ts +11 -8
- package/cjs/image-picker/index.js +19 -12
- package/cjs/image-picker/style/index.less +1 -1
- package/cjs/nav-bar/index.js +7 -2
- package/cjs/notify/index.d.ts +1 -0
- package/cjs/notify/index.js +12 -0
- package/cjs/notify/type.d.ts +1 -0
- package/cjs/show-monitor/index.js +31 -3
- package/cjs/transition/index.js +4 -2
- package/dist/index.js +677 -617
- package/dist/index.min.js +4 -4
- package/dist/style.css +174 -438
- package/dist/style.min.css +1 -1
- package/esm/_helpers/type.d.ts +1 -1
- package/esm/avatar/group.js +1 -1
- package/esm/avatar/index.js +10 -13
- package/esm/avatar/style/css/index.css +96 -126
- package/esm/avatar/style/index.less +54 -72
- package/esm/badge/index.js +6 -8
- package/esm/badge/style/css/index.css +5 -5
- package/esm/badge/style/index.less +5 -5
- package/esm/button/hooks.d.ts +1 -2
- package/esm/button/hooks.js +5 -3
- package/esm/button/index.d.ts +12 -0
- package/esm/button/index.js +42 -35
- package/esm/button/style/css/index.css +75 -310
- package/esm/button/style/index.less +32 -38
- package/esm/count-down/demo/style/mobile.less +1 -1
- package/esm/dropdown/dropdown.d.ts +3 -0
- package/esm/dropdown/dropdown.js +288 -0
- package/esm/dropdown/index.d.ts +3 -4
- package/esm/dropdown/index.js +3 -293
- package/esm/dropdown/options.js +2 -1
- package/esm/dropdown/type.d.ts +20 -9
- package/esm/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/esm/dropdown-menu/dropdown-menu.js +256 -0
- package/esm/dropdown-menu/helper.d.ts +1 -1
- package/esm/dropdown-menu/index.d.ts +2 -3
- package/esm/dropdown-menu/index.js +2 -237
- package/esm/dropdown-menu/type.d.ts +21 -20
- package/esm/image/index.js +4 -1
- package/esm/image/style/css/index.css +2 -1
- package/esm/image/style/index.less +2 -1
- package/esm/image-picker/index.d.ts +11 -8
- package/esm/image-picker/index.js +19 -12
- package/esm/image-picker/style/index.less +1 -1
- package/esm/nav-bar/index.js +6 -2
- package/esm/notify/index.d.ts +1 -0
- package/esm/notify/index.js +1 -0
- package/esm/notify/type.d.ts +1 -0
- package/esm/show-monitor/index.js +31 -3
- package/esm/transition/index.js +4 -2
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +2 -1
- package/tokens/app/arcodesign/default/index.d.ts +2 -1
- package/tokens/app/arcodesign/default/index.js +2 -1
- package/tokens/app/arcodesign/default/index.json +123 -47
- package/tokens/app/arcodesign/default/index.less +2 -1
- package/umd/_helpers/type.d.ts +1 -1
- package/umd/avatar/group.js +1 -1
- package/umd/avatar/index.js +10 -13
- package/umd/avatar/style/css/index.css +96 -126
- package/umd/avatar/style/index.less +54 -72
- package/umd/badge/index.js +6 -8
- package/umd/badge/style/css/index.css +5 -5
- package/umd/badge/style/index.less +5 -5
- package/umd/button/hooks.d.ts +1 -2
- package/umd/button/hooks.js +5 -3
- package/umd/button/index.d.ts +12 -0
- package/umd/button/index.js +40 -33
- package/umd/button/style/css/index.css +75 -310
- package/umd/button/style/index.less +32 -38
- package/umd/count-down/demo/style/mobile.less +1 -1
- package/umd/dropdown/dropdown.d.ts +3 -0
- package/umd/dropdown/dropdown.js +309 -0
- package/umd/dropdown/index.d.ts +3 -4
- package/umd/dropdown/index.js +5 -298
- package/umd/dropdown/options.js +2 -1
- package/umd/dropdown/type.d.ts +20 -9
- package/umd/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/umd/dropdown-menu/dropdown-menu.js +278 -0
- package/umd/dropdown-menu/helper.d.ts +1 -1
- package/umd/dropdown-menu/index.d.ts +2 -3
- package/umd/dropdown-menu/index.js +5 -241
- package/umd/dropdown-menu/type.d.ts +21 -20
- package/umd/image/index.js +4 -1
- package/umd/image/style/css/index.css +2 -1
- package/umd/image/style/index.less +2 -1
- package/umd/image-picker/index.d.ts +11 -8
- package/umd/image-picker/index.js +19 -12
- package/umd/image-picker/style/index.less +1 -1
- package/umd/nav-bar/index.js +9 -6
- package/umd/notify/index.d.ts +1 -0
- package/umd/notify/index.js +13 -4
- package/umd/notify/type.d.ts +1 -0
- package/umd/show-monitor/index.js +31 -3
- package/umd/transition/index.js +4 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
2
|
-
import { OptionsItem, DropdownCommonProps } from '../dropdown';
|
2
|
+
import { OptionsItem, DropdownCommonProps, OptionValueType } from '../dropdown';
|
3
3
|
export type { OptionsItem, DropdownCommonProps };
|
4
4
|
export interface CascadeOptions extends OptionsItem {
|
5
5
|
/**
|
@@ -29,11 +29,6 @@ export interface DropdownMenuBasicProps {
|
|
29
29
|
* @en The selected number of selector (controlled)
|
30
30
|
*/
|
31
31
|
selectIndex?: number;
|
32
|
-
/**
|
33
|
-
* 自定义选择器
|
34
|
-
* @en Custom selector
|
35
|
-
*/
|
36
|
-
renderSelectLabel?: (op: OptionsItem, index: number) => ReactNode;
|
37
32
|
/**
|
38
33
|
* 选择器禁用状态
|
39
34
|
* @en Selector disabled state
|
@@ -112,47 +107,53 @@ export interface SingleOptionProps {
|
|
112
107
|
* 初始选择项
|
113
108
|
* @en initial selection item
|
114
109
|
* */
|
115
|
-
defaultValues?:
|
110
|
+
defaultValues?: OptionValueType[];
|
116
111
|
/**
|
117
112
|
* (受控) 每个选择器选中的项
|
118
113
|
* @en (Controlled) The item selected by each selector
|
119
114
|
* */
|
120
|
-
values?:
|
115
|
+
values?: OptionValueType[];
|
116
|
+
/**
|
117
|
+
* 自定义选择器
|
118
|
+
* @en Custom selector
|
119
|
+
*/
|
120
|
+
renderSelectLabel?: (op: OptionsItem, index: number) => ReactNode;
|
121
121
|
/**
|
122
122
|
* 点击选项时触发的回调函数
|
123
123
|
* @en Callback when clicking option
|
124
124
|
* */
|
125
|
-
onOptionClick?: (value:
|
125
|
+
onOptionClick?: (value: OptionValueType, item: OptionsItem, selectIndex?: number) => void;
|
126
126
|
/**
|
127
127
|
* 选项改变时触发的回调函数
|
128
128
|
* @en Callback when options change
|
129
129
|
* */
|
130
|
-
onOptionChange?: (value:
|
130
|
+
onOptionChange?: (value: OptionValueType, item: OptionsItem, selectIndex?: number) => void;
|
131
131
|
/**
|
132
132
|
* 所有选择器选项总值改变时的回调函数
|
133
133
|
* @en Callback when the total value of all selector options changes
|
134
134
|
* */
|
135
|
-
onValuesChange?: (values:
|
135
|
+
onValuesChange?: (values: OptionValueType[]) => void;
|
136
136
|
/**
|
137
137
|
* 格式化传入的options
|
138
138
|
* @en Format the input options
|
139
139
|
* */
|
140
|
-
getFormattedOptions?: (options: SingleOptionProps['options'], values?:
|
140
|
+
getFormattedOptions?: (options: SingleOptionProps['options'], values?: OptionValueType[]) => {
|
141
141
|
formattedOptions: OptionsItem[][];
|
142
|
-
formattedValue:
|
142
|
+
formattedValue: OptionValueType[];
|
143
143
|
};
|
144
144
|
}
|
145
145
|
export interface MultipleOptionProps {
|
146
146
|
multiple: true;
|
147
147
|
options: string[] | OptionsItem[][];
|
148
|
-
defaultValues?:
|
149
|
-
values?:
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
148
|
+
defaultValues?: OptionValueType[][];
|
149
|
+
values?: OptionValueType[][];
|
150
|
+
renderSelectLabel?: (op: OptionsItem[], index: number) => ReactNode;
|
151
|
+
onOptionClick?: (selected: boolean, val: OptionValueType, item: OptionsItem, selectIndex?: number) => void;
|
152
|
+
onOptionChange?: (vals: OptionValueType[], item: OptionsItem, selectIndex?: number) => void;
|
153
|
+
onValuesChange?: (values: OptionValueType[][]) => void;
|
154
|
+
getFormattedOptions?: (options: SingleOptionProps['options'], values?: OptionValueType[][]) => {
|
154
155
|
formattedOptions: OptionsItem[][];
|
155
|
-
formattedValue:
|
156
|
+
formattedValue: OptionValueType[][];
|
156
157
|
};
|
157
158
|
}
|
158
159
|
export declare type OptionProps = SingleOptionProps | MultipleOptionProps;
|
package/cjs/image/index.js
CHANGED
@@ -53,6 +53,7 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
53
53
|
var wrapRef = (0, _react.useRef)(null);
|
54
54
|
var retryCountRef = (0, _react.useRef)(0);
|
55
55
|
var loadingImageRef = (0, _react.useRef)(null);
|
56
|
+
var hasLoadedRef = (0, _react.useRef)(false);
|
56
57
|
var style = props.style,
|
57
58
|
className = props.className,
|
58
59
|
status = props.status,
|
@@ -176,6 +177,7 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
176
177
|
image.onload = function (evt) {
|
177
178
|
loadingImageRef.current = null;
|
178
179
|
imageDomRef.current = image;
|
180
|
+
hasLoadedRef.current = true;
|
179
181
|
changeStatus('loaded');
|
180
182
|
var _image$width = image.width,
|
181
183
|
imageWidth = _image$width === void 0 ? 0 : _image$width,
|
@@ -290,7 +292,8 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
290
292
|
})) : null, /*#__PURE__*/_react.default.createElement("div", {
|
291
293
|
className: (0, _mobileUtils.cls)('image-container', validStatus, {
|
292
294
|
animate: Boolean(animateDuration),
|
293
|
-
'static-label': staticLabel
|
295
|
+
'static-label': staticLabel,
|
296
|
+
'has-loaded': hasLoadedRef.current
|
294
297
|
}),
|
295
298
|
style: (0, _helpers.getStyleWithVendor)({
|
296
299
|
transitionDuration: animateDuration + "ms"
|
@@ -66,7 +66,8 @@
|
|
66
66
|
}
|
67
67
|
.arco-image .image-container.static-label,
|
68
68
|
.arco-image .image-container.loaded,
|
69
|
-
.arco-image .image-container.error
|
69
|
+
.arco-image .image-container.error,
|
70
|
+
.arco-image .image-container.has-loaded {
|
70
71
|
opacity: 1;
|
71
72
|
}
|
72
73
|
.arco-image .image-container.animate {
|
@@ -14,9 +14,10 @@ export interface ImagePickItem {
|
|
14
14
|
/**
|
15
15
|
* 图片状态
|
16
16
|
* @en Image Status
|
17
|
-
* @default
|
17
|
+
* @default 以图片自身加载状态而定
|
18
|
+
* @default_en According to inner status of the image
|
18
19
|
*/
|
19
|
-
status
|
20
|
+
status?: 'loaded' | 'loading' | 'error';
|
20
21
|
}
|
21
22
|
export interface AdapterFile {
|
22
23
|
url?: string;
|
@@ -117,7 +118,7 @@ export interface ImagePickerProps {
|
|
117
118
|
* 透传给图片的属性
|
118
119
|
* @en Attributes passed through to the image
|
119
120
|
*/
|
120
|
-
imageProps?: ImageProps
|
121
|
+
imageProps?: Partial<ImageProps>;
|
121
122
|
/**
|
122
123
|
* 自定义上传失败展示
|
123
124
|
* @en Defined upload failed display
|
@@ -133,12 +134,11 @@ export interface ImagePickerProps {
|
|
133
134
|
* @en upload function
|
134
135
|
*/
|
135
136
|
upload?: (file: ImagePickItem) => Promise<ImagePickItem | null>;
|
136
|
-
onSelect?: (...args: any[]) => void;
|
137
137
|
/**
|
138
138
|
* 已选图片列表发生变化
|
139
139
|
* @en The list of selected images changes
|
140
140
|
*/
|
141
|
-
onChange?: (fileList: ImagePickItem[]) =>
|
141
|
+
onChange?: (fileList: ImagePickItem[]) => void;
|
142
142
|
/**
|
143
143
|
* 图片超过限制大小
|
144
144
|
* @en Image exceeds size limit
|
@@ -158,15 +158,18 @@ export interface ImagePickerProps {
|
|
158
158
|
* 图片长按事件
|
159
159
|
* @en long press event
|
160
160
|
*/
|
161
|
-
onLongPress?: (e: React.
|
161
|
+
onLongPress?: (e: React.TouchEvent<HTMLElement>, image: ImagePickItem, index: number) => void;
|
162
162
|
/**
|
163
163
|
* 图片选择适配器
|
164
164
|
* @en Select Adaptor
|
165
165
|
*/
|
166
|
-
selectAdapter
|
166
|
+
selectAdapter?: () => Promise<SelectCallback>;
|
167
167
|
}
|
168
168
|
export interface ImagePickerRef {
|
169
|
-
/**
|
169
|
+
/**
|
170
|
+
* 最外层 DOM 元素
|
171
|
+
* @en The outer DOM element of the component
|
172
|
+
*/
|
170
173
|
dom: HTMLDivElement | null;
|
171
174
|
}
|
172
175
|
/**
|
@@ -109,7 +109,7 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
109
109
|
});
|
110
110
|
};
|
111
111
|
|
112
|
-
var handleChange = function handleChange(event) {
|
112
|
+
var handleChange = function handleChange(event, fromAdapter) {
|
113
113
|
var files = [].concat(event.target.files || []).filter(function (file) {
|
114
114
|
// 过滤maxSize
|
115
115
|
if (maxSize && file.size > maxSize * 1024) {
|
@@ -119,7 +119,11 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
119
119
|
|
120
120
|
return true;
|
121
121
|
}) || [];
|
122
|
-
|
122
|
+
|
123
|
+
if (!fromAdapter) {
|
124
|
+
event.target.value = '';
|
125
|
+
} // 截断limit
|
126
|
+
|
123
127
|
|
124
128
|
if (limit !== 0 && files.length + images.length > limit) {
|
125
129
|
onLimitExceed && onLimitExceed(files);
|
@@ -133,7 +137,7 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
133
137
|
var res = parseFiles.map(function (url, index) {
|
134
138
|
return {
|
135
139
|
url: url,
|
136
|
-
status: upload ? 'loading' : 'loaded',
|
140
|
+
status: typeof upload === 'function' ? 'loading' : 'loaded',
|
137
141
|
file: files[index]
|
138
142
|
};
|
139
143
|
});
|
@@ -144,11 +148,12 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
144
148
|
var propsImageLength = images.length;
|
145
149
|
files.forEach(function (_file, index) {
|
146
150
|
upload(cacheRes[propsImageLength + index]).then(function (data) {
|
147
|
-
cacheRes[propsImageLength + index] = (0, _extends2.default)({}, cacheRes[propsImageLength + index], data
|
151
|
+
cacheRes[propsImageLength + index] = (0, _extends2.default)({}, cacheRes[propsImageLength + index], data, {
|
152
|
+
status: undefined
|
153
|
+
});
|
148
154
|
}).catch(function () {
|
149
155
|
cacheRes[propsImageLength + index].status = 'error';
|
150
156
|
}).finally(function () {
|
151
|
-
cacheRes[propsImageLength + index].status = 'loaded';
|
152
157
|
onChange([].concat(cacheRes));
|
153
158
|
});
|
154
159
|
});
|
@@ -169,15 +174,15 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
169
174
|
e.preventDefault();
|
170
175
|
timeOutEvent = setTimeout(function () {
|
171
176
|
timeOutEvent = 0;
|
172
|
-
|
177
|
+
onLongPress == null ? void 0 : onLongPress(e, image, index);
|
173
178
|
}, 750);
|
174
179
|
};
|
175
180
|
|
176
|
-
var
|
181
|
+
var handleClick = function handleClick(e, image, index) {
|
177
182
|
clearTimeout(timeOutEvent);
|
178
183
|
|
179
184
|
if (timeOutEvent !== 0) {
|
180
|
-
|
185
|
+
onClick == null ? void 0 : onClick(e, image, index);
|
181
186
|
}
|
182
187
|
};
|
183
188
|
|
@@ -190,7 +195,7 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
190
195
|
target: {
|
191
196
|
files: files
|
192
197
|
}
|
193
|
-
});
|
198
|
+
}, true);
|
194
199
|
}) : (_fileRef$current = fileRef.current) == null ? void 0 : _fileRef$current.click();
|
195
200
|
};
|
196
201
|
|
@@ -224,8 +229,8 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
224
229
|
onTouchStart: function onTouchStart(e) {
|
225
230
|
return handleTouchStart(e, image, index);
|
226
231
|
},
|
227
|
-
|
228
|
-
return
|
232
|
+
onClick: function onClick(e) {
|
233
|
+
return handleClick(e, image, index);
|
229
234
|
},
|
230
235
|
className: prefixCls + "-image-picker-image-container"
|
231
236
|
}, /*#__PURE__*/_react.default.createElement(_image.default, (0, _extends2.default)({
|
@@ -268,7 +273,9 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
268
273
|
accept: accept,
|
269
274
|
multiple: multiple,
|
270
275
|
type: "file",
|
271
|
-
onChange:
|
276
|
+
onChange: function onChange(e) {
|
277
|
+
return handleChange(e);
|
278
|
+
},
|
272
279
|
ref: fileRef
|
273
280
|
}) : null)),
|
274
281
|
title: ''
|
package/cjs/nav-bar/index.js
CHANGED
@@ -15,6 +15,8 @@ var _contextProvider = require("../context-provider");
|
|
15
15
|
|
16
16
|
var _backIcon = _interopRequireDefault(require("./back-icon"));
|
17
17
|
|
18
|
+
var _helpers = require("../_helpers");
|
19
|
+
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
21
|
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -66,8 +68,10 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
66
68
|
customStyle = _useState2[0],
|
67
69
|
setCustomStyle = _useState2[1];
|
68
70
|
|
71
|
+
var system = (0, _helpers.useSystem)();
|
72
|
+
|
69
73
|
var onElementScroll = function onElementScroll(curOffset) {
|
70
|
-
setScrollToggleHide(curOffset
|
74
|
+
setScrollToggleHide(curOffset < showOffset);
|
71
75
|
|
72
76
|
if (getComputedStyleByScroll) {
|
73
77
|
var cstyle = getComputedStyleByScroll(curOffset);
|
@@ -93,6 +97,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
93
97
|
(0, _react.useEffect)(function () {
|
94
98
|
var needBind = showOffset || getComputedStyleByScroll;
|
95
99
|
var container = (0, _mobileUtils.getValidScrollContainer)(getScrollContainer);
|
100
|
+
handleEleScroll();
|
96
101
|
|
97
102
|
if (needBind && container) {
|
98
103
|
container.addEventListener('scroll', handleEleScroll, false);
|
@@ -140,7 +145,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
140
145
|
background: relBackground
|
141
146
|
} : {})
|
142
147
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
143
|
-
className: (0, _mobileUtils.cls)(className, prefixCls + "-nav-bar-wrapper", (_cls2 = {}, _cls2[prefixCls + "-nav-bar-wrapper-fixed"] = fixed, _cls2[prefixCls + "-nav-bar-wrapper-border"] = hasBottomLine, _cls2)),
|
148
|
+
className: (0, _mobileUtils.cls)(className, system, prefixCls + "-nav-bar-wrapper", (_cls2 = {}, _cls2[prefixCls + "-nav-bar-wrapper-fixed"] = fixed, _cls2[prefixCls + "-nav-bar-wrapper-border"] = hasBottomLine, _cls2)),
|
144
149
|
style: (0, _extends2.default)({
|
145
150
|
paddingTop: statusBarHeight ? statusBarHeight + "px" : ''
|
146
151
|
}, customStyle)
|
package/cjs/notify/index.d.ts
CHANGED
package/cjs/notify/index.js
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
+
var _exportNames = {
|
7
|
+
methodsGenerator: true
|
8
|
+
};
|
6
9
|
exports.default = void 0;
|
7
10
|
exports.methodsGenerator = methodsGenerator;
|
8
11
|
|
@@ -20,6 +23,15 @@ var _helpers = require("../_helpers");
|
|
20
23
|
|
21
24
|
var _methods = require("./methods");
|
22
25
|
|
26
|
+
var _type = require("./type");
|
27
|
+
|
28
|
+
Object.keys(_type).forEach(function (key) {
|
29
|
+
if (key === "default" || key === "__esModule") return;
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
31
|
+
if (key in exports && exports[key] === _type[key]) return;
|
32
|
+
exports[key] = _type[key];
|
33
|
+
});
|
34
|
+
|
23
35
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
24
36
|
|
25
37
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/cjs/notify/type.d.ts
CHANGED
@@ -123,6 +123,34 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
123
123
|
offset: offset,
|
124
124
|
threshold: threshold
|
125
125
|
}, true);
|
126
|
+
},
|
127
|
+
|
128
|
+
/**
|
129
|
+
* 重置元素初始可见态为false,并重新对元素可见度发起检测,优先级低于disabled(通常用在对ShowMonitor内部元素变化时发起的重新监听)
|
130
|
+
* @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
|
131
|
+
*/
|
132
|
+
flushVisibleStatus: function flushVisibleStatus() {
|
133
|
+
isVisible.current = false;
|
134
|
+
|
135
|
+
if (isSupportNativeApi && io.current && domRef.current) {
|
136
|
+
disabled ? io.current.unobserve(domRef.current) : io.current.observe(domRef.current);
|
137
|
+
} else if (listener.current) {
|
138
|
+
var _key = wrapperKey.current;
|
139
|
+
|
140
|
+
if (once && onOnceEmittedListeners != null && onOnceEmittedListeners[_key]) {
|
141
|
+
onOnceEmittedListeners[_key] = onOnceEmittedListeners[_key].filter(function (emitListener) {
|
142
|
+
return emitListener !== listener.current;
|
143
|
+
});
|
144
|
+
}
|
145
|
+
|
146
|
+
if (!disabled && !listeners[_key].find(function (_listener) {
|
147
|
+
return _listener === listener.current;
|
148
|
+
})) {
|
149
|
+
listeners[_key].push(listener.current);
|
150
|
+
}
|
151
|
+
|
152
|
+
!disabled && _checkVisible(listener.current);
|
153
|
+
}
|
126
154
|
}
|
127
155
|
};
|
128
156
|
});
|
@@ -390,8 +418,8 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
390
418
|
}
|
391
419
|
}
|
392
420
|
|
393
|
-
var
|
394
|
-
var curListeners = listeners[
|
421
|
+
var _key2 = wrapperKey.current;
|
422
|
+
var curListeners = listeners[_key2];
|
395
423
|
|
396
424
|
if (curListeners) {
|
397
425
|
// 不在监听队列中,移除
|
@@ -401,7 +429,7 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
401
429
|
// @en When the listening queue is empty, unbind scroll and resize events
|
402
430
|
|
403
431
|
if (curListeners.length === 0) {
|
404
|
-
delete listeners[
|
432
|
+
delete listeners[_key2];
|
405
433
|
|
406
434
|
if (scrollPort.current) {
|
407
435
|
scrollPort.current.removeEventListener('scroll', throttlingVisibleChange);
|
package/cjs/transition/index.js
CHANGED
@@ -26,10 +26,12 @@ var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOn
|
|
26
26
|
* @name_en Transition
|
27
27
|
*/
|
28
28
|
function Transition(props) {
|
29
|
-
var children = props.children,
|
29
|
+
var _props$children = props.children,
|
30
|
+
children = _props$children === void 0 ? /*#__PURE__*/_react.default.createElement("div", null) : _props$children,
|
30
31
|
type = props.type,
|
31
32
|
transIn = props.in,
|
32
|
-
timeout = props.timeout,
|
33
|
+
_props$timeout = props.timeout,
|
34
|
+
timeout = _props$timeout === void 0 ? 300 : _props$timeout,
|
33
35
|
_props$mountOnEnter = props.mountOnEnter,
|
34
36
|
mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
|
35
37
|
_props$unmountOnExit = props.unmountOnExit,
|