@nutui/nutui-react-taro 1.4.5 → 1.4.6-beta.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 +8 -8
- package/dist/esm/ActionSheet.js +6 -5
- package/dist/esm/Address.js +8 -8
- package/dist/esm/Audio.js +8 -8
- package/dist/esm/Avatar.js +3 -3
- package/dist/esm/BackTop.js +3 -3
- package/dist/esm/Badge.js +3 -3
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Button.js +3 -3
- package/dist/esm/Calendar.js +8 -7
- package/dist/esm/CalendarItem.js +3 -3
- package/dist/esm/Card.js +4 -4
- package/dist/esm/Cascader.js +7 -6
- package/dist/esm/Cell.js +3 -3
- package/dist/esm/Checkbox.js +3 -3
- package/dist/esm/CheckboxGroup.js +3 -3
- package/dist/esm/CollapseItem.js +3 -3
- package/dist/esm/DatePicker.js +8 -7
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Drag.js +2 -2
- package/dist/esm/Elevator.js +2 -2
- package/dist/esm/Ellipsis.js +3 -3
- package/dist/esm/FixedNav.js +5 -4
- package/dist/esm/Form.js +5 -5
- package/dist/esm/FormItem.js +4 -4
- package/dist/esm/GridItem.js +3 -3
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Image.js +3 -3
- package/dist/esm/ImagePreview.js +6 -5
- package/dist/esm/Infiniteloading.js +3 -3
- package/dist/esm/Input.js +3 -3
- package/dist/esm/InputNumber.js +3 -3
- package/dist/esm/Menu.js +3 -3
- package/dist/esm/MenuItem.js +5 -4
- package/dist/esm/NavBar.js +3 -3
- package/dist/esm/NoticeBar.js +4 -4
- package/dist/esm/NumberKeyboard.js +6 -5
- package/dist/esm/Overlay.js +3 -2
- package/dist/esm/Picker.js +7 -6
- package/dist/esm/Popover.js +6 -5
- package/dist/esm/Popup.js +5 -4
- package/dist/esm/Progress.js +3 -3
- package/dist/esm/PullToRefresh.js +3 -2
- package/dist/esm/Radio.js +2 -2
- package/dist/esm/RadioGroup.js +3 -3
- package/dist/esm/Range.js +5 -5
- package/dist/esm/Rate.js +3 -3
- package/dist/esm/SearchBar.js +3 -3
- package/dist/esm/ShortPassword.js +6 -5
- package/dist/esm/SideNavBar.js +6 -5
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Skeleton.js +4 -4
- package/dist/esm/Step.js +3 -3
- package/dist/esm/Sticky.js +5 -5
- package/dist/esm/Swipe.js +3 -3
- package/dist/esm/TabbarItem.js +3 -3
- package/dist/esm/Table.js +3 -3
- package/dist/esm/Tabs.js +3 -3
- package/dist/esm/Tag.js +3 -3
- package/dist/esm/TimeSelect.js +6 -5
- package/dist/esm/Toast.js +3 -3
- package/dist/esm/TrendArrow.js +3 -3
- package/dist/esm/Uploader.js +7 -7
- package/dist/esm/VirtualList.js +2 -2
- package/dist/esm/{actionsheet.taro-a58d3d12.js → actionsheet.taro-27121a38.js} +1 -1
- package/dist/esm/{address.taro-79cc7c96.js → address.taro-dd602937.js} +12 -12
- package/dist/esm/{audio.taro-4fadc583.js → audio.taro-cf530b91.js} +5 -5
- package/dist/esm/{avatar.taro-85ced995.js → avatar.taro-1d2bf09a.js} +1 -2
- package/dist/esm/{backtop.taro-99107c30.js → backtop.taro-e53236c7.js} +3 -3
- package/dist/esm/{badge.taro-fe9171ec.js → badge.taro-11e2ec95.js} +1 -1
- package/dist/esm/{barrage.taro-0e157b5e.js → barrage.taro-e4fe81ae.js} +2 -2
- package/dist/esm/{button.taro-4ce133b9.js → button.taro-b7c5f5a7.js} +1 -1
- package/dist/esm/{calendar.taro-4ed72058.js → calendar.taro-05c40d76.js} +2 -2
- package/dist/esm/{calendaritem.taro-1ebe428d.js → calendaritem.taro-3cfd4186.js} +1 -1
- package/dist/esm/{card.taro-39055e82.js → card.taro-7e85c3da.js} +1 -1
- package/dist/esm/{cascader.taro-d8cb1c3e.js → cascader.taro-66462c03.js} +3 -3
- package/dist/esm/{cell.taro-9a04a92e.js → cell.taro-e877cf12.js} +3 -3
- package/dist/esm/{checkbox.taro-0bda9796.js → checkbox.taro-04da7151.js} +1 -1
- package/dist/esm/{collapseitem-ce1849d2.js → collapseitem-2e864527.js} +1 -1
- package/dist/esm/{datepicker.taro-7220e495.js → datepicker.taro-8507d826.js} +1 -1
- package/dist/esm/{dialog.taro-1c03960e.js → dialog.taro-0f64e21a.js} +1 -1
- package/dist/esm/{drag.taro-82b6b27a.js → drag.taro-703560c4.js} +3 -3
- package/dist/esm/{elevator.taro-d7d65470.js → elevator.taro-68cfaaee.js} +4 -4
- package/dist/esm/{ellipsis.taro-49b6db0c.js → ellipsis.taro-71021671.js} +1 -1
- package/dist/esm/{fixednav.taro-5ad15202.js → fixednav.taro-84930e08.js} +2 -2
- package/dist/esm/{form.taro-71d32671.js → form.taro-ce791a58.js} +1 -1
- package/dist/esm/{formitem.taro-3089489b.js → formitem.taro-f2ed02d4.js} +1 -1
- package/dist/esm/get-scroll-parent-3dcd3f53.js +28 -0
- package/dist/esm/{griditem.taro-4cade72e.js → griditem.taro-5406bd2c.js} +1 -1
- package/dist/esm/{icon-8dc4de10.js → icon-2242973e.js} +13 -4
- package/dist/esm/{icon.taro-1d0d4fb7.js → icon.taro-c9254a81.js} +13 -4
- package/dist/esm/{image.taro-e6dc5867.js → image.taro-1d867416.js} +1 -1
- package/dist/esm/{imagepreview.taro-3400ea03.js → imagepreview.taro-83481e13.js} +1 -1
- package/dist/esm/{index.taro-a36f96fb.js → index.taro-cd52b23f.js} +1 -1
- package/dist/esm/{infiniteloading.taro-6c2a2e95.js → infiniteloading.taro-e5be6795.js} +1 -1
- package/dist/esm/{input.taro-fd566407.js → input.taro-991945d1.js} +1 -1
- package/dist/esm/{inputnumber.taro-dc39b853.js → inputnumber.taro-e909d932.js} +1 -1
- package/dist/esm/{menu.taro-4abed328.js → menu.taro-e5b84501.js} +1 -1
- package/dist/esm/{menuitem.taro-6e8b27c3.js → menuitem.taro-f2129be6.js} +2 -2
- package/dist/esm/{navbar.taro-c931c078.js → navbar.taro-70514adf.js} +1 -1
- package/dist/esm/{noticebar.taro-69ea7673.js → noticebar.taro-22486646.js} +2 -4
- package/dist/esm/{numberkeyboard.taro-194519e4.js → numberkeyboard.taro-d2ccbce5.js} +1 -1
- package/dist/esm/nutui-react.es.js +66 -65
- package/dist/esm/{overlay.taro-98367bc1.js → overlay.taro-1e74a71d.js} +5 -4
- package/dist/esm/{picker.taro-2a8ded7c.js → picker.taro-6128297f.js} +2 -2
- package/dist/esm/{popover.taro-46d813e8.js → popover.taro-fc7b9a73.js} +3 -3
- package/dist/esm/{popup.taro-cb777e09.js → popup.taro-89809b25.js} +6 -7
- package/dist/esm/{progress.taro-623bc807.js → progress.taro-18e015e4.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-cab7b51c.js → pulltorefresh.taro-2b50fdf3.js} +1 -27
- package/dist/esm/{range.taro-5d6ff217.js → range.taro-b628f1ed.js} +2 -2
- package/dist/esm/{rate.taro-10197384.js → rate.taro-17b84a51.js} +1 -1
- package/dist/esm/{searchbar.taro-839dd622.js → searchbar.taro-141827e2.js} +5 -5
- package/dist/esm/{shortpassword.taro-182d46f7.js → shortpassword.taro-e1f53ee7.js} +2 -2
- package/dist/esm/{sidenavbar.taro-006cf38b.js → sidenavbar.taro-f44d12ac.js} +1 -1
- package/dist/esm/{signature.taro-33632585.js → signature.taro-d3416fcd.js} +1 -1
- package/dist/esm/{skeleton.taro-853ce460.js → skeleton.taro-6821b2c6.js} +1 -1
- package/dist/esm/{step.taro-1c94e067.js → step.taro-891c020b.js} +1 -1
- package/dist/esm/sticky.taro-2d9b2804.js +133 -0
- package/dist/esm/{swipe.taro-83bc248f.js → swipe.taro-e6c2b808.js} +1 -1
- package/dist/esm/{tabbaritem.taro-8dfb8055.js → tabbaritem.taro-f4a91070.js} +1 -1
- package/dist/esm/{table.taro-cb4dd2c3.js → table.taro-d9b2794b.js} +1 -1
- package/dist/esm/{tabs.taro-e71875fa.js → tabs.taro-5030ce68.js} +1 -1
- package/dist/esm/{tag.taro-00fe554d.js → tag.taro-213ec444.js} +1 -1
- package/dist/esm/{timeselect.taro-3ecce65d.js → timeselect.taro-b04b1538.js} +1 -1
- package/dist/esm/{toast.taro-0804b6b4.js → toast.taro-0f972a92.js} +1 -1
- package/dist/esm/{trendarrow.taro-5a7153e4.js → trendarrow.taro-d79fc8e2.js} +1 -1
- package/dist/esm/types/src/packages/audio/audio.taro.d.ts +6 -6
- package/dist/esm/types/src/packages/image/image.d.ts +3 -0
- package/dist/esm/types/src/packages/overlay/overlay.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/popup/popup.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +11 -2
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +1 -1
- package/dist/esm/{uploader.taro-f80d76d9.js → uploader.taro-1d745f4a.js} +17 -17
- package/dist/esm/{useClientRect-bf69d7b3.js → useClientRect-4506e52f.js} +5 -2
- package/dist/esm/{virtuallist.taro-e3345ced.js → virtuallist.taro-1688484f.js} +7 -8
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +256 -111
- package/dist/nutui.react.umd.js +252 -107
- package/dist/packages/calendar/calendar.scss +19 -1
- package/dist/packages/image/image.scss +2 -0
- package/dist/packages/input/input.scss +3 -18
- package/dist/packages/notify/notify.scss +23 -19
- package/dist/packages/popup/popup.scss +130 -93
- package/dist/packages/searchbar/searchbar.scss +6 -20
- package/dist/packages/sticky/sticky.scss +3 -0
- package/dist/packages/tag/tag.scss +6 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +1 -3
- package/dist/types/index.d.ts +22 -15
- package/package.json +2 -2
- package/dist/esm/sticky.taro-d0553f48.js +0 -13
|
@@ -2,8 +2,8 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { CSSTransition } from 'react-transition-group';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { d as defaultOverlayProps, O as Overlay } from './overlay.taro-
|
|
6
|
-
import { I as Icon } from './icon.taro-
|
|
5
|
+
import { d as defaultOverlayProps, O as Overlay } from './overlay.taro-1e74a71d.js';
|
|
6
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
7
7
|
import { c as cn } from './bem-893ad28d.js';
|
|
8
8
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
9
9
|
|
|
@@ -22,7 +22,6 @@ const defaultProps = {
|
|
|
22
22
|
round: false,
|
|
23
23
|
onOpen: () => { },
|
|
24
24
|
onClose: () => { },
|
|
25
|
-
onClick: (e) => { },
|
|
26
25
|
onOpened: (e) => { },
|
|
27
26
|
onClosed: (e) => { },
|
|
28
27
|
onClickOverlay: (e) => { },
|
|
@@ -51,13 +50,13 @@ const Popup = (props) => {
|
|
|
51
50
|
};
|
|
52
51
|
const classes = classNames({
|
|
53
52
|
round,
|
|
54
|
-
[`popup-${position}`]: true,
|
|
53
|
+
[`nut-popup-${position}`]: true,
|
|
55
54
|
[`${popClass}`]: true,
|
|
56
55
|
[`${className}`]: true,
|
|
57
56
|
}, b(''));
|
|
58
57
|
const closeClasses = classNames({
|
|
59
|
-
'
|
|
60
|
-
[`
|
|
58
|
+
'nut-popup__close-icon': true,
|
|
59
|
+
[`nut-popup__close-icon--${closeIconPosition}`]: true,
|
|
61
60
|
});
|
|
62
61
|
const open = () => {
|
|
63
62
|
if (!innerVisible) {
|
|
@@ -127,7 +126,7 @@ const Popup = (props) => {
|
|
|
127
126
|
!visible && close();
|
|
128
127
|
}, [visible]);
|
|
129
128
|
useEffect(() => {
|
|
130
|
-
setTransitionName(transition || `popup-slide-${position}`);
|
|
129
|
+
setTransitionName(transition || `nut-popup-slide-${position}`);
|
|
131
130
|
}, [position]);
|
|
132
131
|
return React__default.createElement(React__default.Fragment, null, renderToContainer(teleport, renderNode()));
|
|
133
132
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { I as Icon } from './icon-
|
|
3
|
+
import { I as Icon } from './icon-2242973e.js';
|
|
4
4
|
import { c as cn } from './bem-893ad28d.js';
|
|
5
5
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
6
6
|
|
|
@@ -2,33 +2,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import { useDrag } from '@use-gesture/react';
|
|
3
3
|
import { useSpring, animated } from '@react-spring/web';
|
|
4
4
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
5
|
-
|
|
6
|
-
const canUseDom = !!(typeof window !== 'undefined' &&
|
|
7
|
-
typeof document !== 'undefined' &&
|
|
8
|
-
window.document &&
|
|
9
|
-
window.document.createElement);
|
|
10
|
-
|
|
11
|
-
const defaultRoot = canUseDom ? window : undefined;
|
|
12
|
-
const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
|
|
13
|
-
function isElement(node) {
|
|
14
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
15
|
-
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
16
|
-
}
|
|
17
|
-
function getScrollParent(el, root = defaultRoot) {
|
|
18
|
-
let node = el;
|
|
19
|
-
while (node && node !== root && isElement(node)) {
|
|
20
|
-
if (node === document.body) {
|
|
21
|
-
return root;
|
|
22
|
-
}
|
|
23
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
24
|
-
if (overflowStylePatterns.includes(overflowY) &&
|
|
25
|
-
node.scrollHeight > node.clientHeight) {
|
|
26
|
-
return node;
|
|
27
|
-
}
|
|
28
|
-
node = node.parentNode;
|
|
29
|
-
}
|
|
30
|
-
return root;
|
|
31
|
-
}
|
|
5
|
+
import { c as canUseDom, g as getScrollParent } from './get-scroll-parent-3dcd3f53.js';
|
|
32
6
|
|
|
33
7
|
function bound(position, min, max) {
|
|
34
8
|
let ret = position;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
3
|
-
import { g as getRectByTaro } from './useClientRect-
|
|
4
|
-
import { T as Toast } from './toast.taro-
|
|
3
|
+
import { g as getRectByTaro } from './useClientRect-4506e52f.js';
|
|
4
|
+
import { T as Toast } from './toast.taro-0f972a92.js';
|
|
5
5
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import { c as cn } from './bem-893ad28d.js';
|
|
3
|
-
import { I as Icon } from './icon-
|
|
3
|
+
import { I as Icon } from './icon-2242973e.js';
|
|
4
4
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { getEnv } from '@tarojs/taro';
|
|
3
3
|
import { c as cn } from './bem-893ad28d.js';
|
|
4
4
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
5
|
-
import { I as Icon } from './icon.taro-
|
|
5
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -53,7 +53,7 @@ const SearchBar = (props) => {
|
|
|
53
53
|
}
|
|
54
54
|
}, [autoFocus]);
|
|
55
55
|
const renderField = () => {
|
|
56
|
-
return (React__default.createElement("input", { className: `${searchbarBem('input')} ${searchbarBem(alignClass)} ${shape === 'round' ? searchbarBem('round') : ''} ${clearable ? searchbarBem('input-clear') : ''}`, ref: searchRef, style: { ...props.style
|
|
56
|
+
return (React__default.createElement("input", { className: `${searchbarBem('input')} ${searchbarBem(alignClass)} ${shape === 'round' ? searchbarBem('round') : ''} ${clearable ? searchbarBem('input-clear') : ''}`, ref: searchRef, style: { ...props.style }, value: value || '', placeholder: placeholder || locale.placeholder, disabled: disabled, readOnly: readOnly, maxLength: maxLength, onKeyPress: onKeypress, onChange: (e) => change(e), onFocus: (e) => focus(e), onBlur: (e) => blur(e), onClick: (e) => clickInput(e) }));
|
|
57
57
|
};
|
|
58
58
|
const clickInput = (e) => {
|
|
59
59
|
onClickInput && onClickInput(e);
|
|
@@ -129,12 +129,12 @@ const SearchBar = (props) => {
|
|
|
129
129
|
return null;
|
|
130
130
|
};
|
|
131
131
|
const envClass = () => {
|
|
132
|
-
return
|
|
132
|
+
return getEnv() === 'WEB' ? 'nut-searchbar-taro' : '';
|
|
133
133
|
};
|
|
134
134
|
return (React__default.createElement("div", { className: `${searchbarBem()} ${envClass()} ${disabled ? searchbarBem('disabled') : ''} ${className || ''}`, style: { ...props.style, background: props.background } },
|
|
135
135
|
renderLeftoutIcon(),
|
|
136
136
|
renderLabel(),
|
|
137
|
-
React__default.createElement("div", { className: `${searchbarBem('content')}
|
|
137
|
+
React__default.createElement("div", { className: `${searchbarBem('content')}`, style: { background: props.inputBackground } },
|
|
138
138
|
renderLeftinIcon(),
|
|
139
139
|
React__default.createElement("div", { className: "nut-searchbar__input-box" }, renderField()),
|
|
140
140
|
renderRightinIcon(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { c as cn } from './bem-893ad28d.js';
|
|
3
|
-
import { P as Popup } from './popup.taro-
|
|
4
|
-
import { I as Icon } from './icon.taro-
|
|
3
|
+
import { P as Popup } from './popup.taro-89809b25.js';
|
|
4
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
5
5
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState } from 'react';
|
|
2
2
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
3
|
-
import { P as Popup } from './popup.taro-
|
|
3
|
+
import { P as Popup } from './popup.taro-89809b25.js';
|
|
4
4
|
import { O as OffsetContext } from './offsetContext-bfb02c25.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
|
-
import { B as Button } from './button.taro-
|
|
3
|
+
import { B as Button } from './button.taro-b7c5f5a7.js';
|
|
4
4
|
import { c as cn } from './bem-893ad28d.js';
|
|
5
5
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
6
6
|
|
|
@@ -2,7 +2,7 @@ import React__default, { useContext } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { D as DataContext } from './UserContext-68f62e66.js';
|
|
4
4
|
import { c as cn } from './bem-893ad28d.js';
|
|
5
|
-
import { I as Icon } from './icon.taro-
|
|
5
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import React__default, { useRef, useEffect, useState, useMemo, useCallback } from 'react';
|
|
2
|
+
import { g as getRectByTaro } from './useClientRect-4506e52f.js';
|
|
3
|
+
import { getEnv, usePageScroll, getSystemInfoSync } from '@tarojs/taro';
|
|
4
|
+
import { g as getScrollParent } from './get-scroll-parent-3dcd3f53.js';
|
|
5
|
+
|
|
6
|
+
function useWatch(dep, callback, config = { immediate: false }) {
|
|
7
|
+
const { immediate } = config;
|
|
8
|
+
const prev = useRef();
|
|
9
|
+
const inited = useRef(false);
|
|
10
|
+
const stop = useRef(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const execute = () => callback(prev.current);
|
|
13
|
+
if (!stop.current) {
|
|
14
|
+
if (!inited.current) {
|
|
15
|
+
inited.current = true;
|
|
16
|
+
if (immediate) {
|
|
17
|
+
execute();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
execute();
|
|
22
|
+
}
|
|
23
|
+
prev.current = dep;
|
|
24
|
+
}
|
|
25
|
+
}, [dep]);
|
|
26
|
+
return () => {
|
|
27
|
+
stop.current = true;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const defaultProps = {
|
|
32
|
+
position: 'top',
|
|
33
|
+
top: 0,
|
|
34
|
+
bottom: 0,
|
|
35
|
+
zIndex: 2000,
|
|
36
|
+
};
|
|
37
|
+
const Sticky = (props) => {
|
|
38
|
+
const { position = 'top', top = 0, bottom = 0, zIndex = 2000, children, container, className, onChange, ...rest } = props;
|
|
39
|
+
const stickyRef = useRef(null);
|
|
40
|
+
const rootRef = useRef(null);
|
|
41
|
+
const offset = position === 'top' ? top : bottom;
|
|
42
|
+
const [rootRect, setRootRect] = useState({});
|
|
43
|
+
const [fixed, setFixed] = useState(false);
|
|
44
|
+
const [transform, setTransform] = useState(0); //相对容器偏移距离
|
|
45
|
+
useWatch(fixed, () => {
|
|
46
|
+
onChange && onChange(fixed);
|
|
47
|
+
});
|
|
48
|
+
const rootStyle = useMemo(() => {
|
|
49
|
+
if (!fixed) {
|
|
50
|
+
return {
|
|
51
|
+
height: '',
|
|
52
|
+
width: '',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const style = {};
|
|
56
|
+
if (rootRect.height) {
|
|
57
|
+
style.height = rootRect.height;
|
|
58
|
+
}
|
|
59
|
+
if (rootRect.width) {
|
|
60
|
+
style.width = rootRect.width;
|
|
61
|
+
}
|
|
62
|
+
return style;
|
|
63
|
+
}, [fixed, rootRect.height, rootRect.width]);
|
|
64
|
+
const stickyStyle = useMemo(() => {
|
|
65
|
+
if (!fixed) {
|
|
66
|
+
return {
|
|
67
|
+
height: '',
|
|
68
|
+
width: '',
|
|
69
|
+
[position]: '',
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
let style = {};
|
|
73
|
+
if (rootRect.height)
|
|
74
|
+
style.height = rootRect.height;
|
|
75
|
+
if (rootRect.width)
|
|
76
|
+
style.width = rootRect.width;
|
|
77
|
+
style.transform = `translate3d(0, ${transform}px, 0)`;
|
|
78
|
+
style[position] = offset;
|
|
79
|
+
style.zIndex = zIndex;
|
|
80
|
+
return style;
|
|
81
|
+
}, [fixed, rootRect.height, rootRect.width, transform, position]);
|
|
82
|
+
const handleScroll = async (scrollTop) => {
|
|
83
|
+
const curRootRect = await getRectByTaro(rootRef.current);
|
|
84
|
+
const stickyRect = await getRectByTaro(stickyRef.current);
|
|
85
|
+
if (curRootRect && stickyRect) {
|
|
86
|
+
setRootRect(curRootRect);
|
|
87
|
+
if (position === 'top') {
|
|
88
|
+
if (container) {
|
|
89
|
+
const containerRect = await getRectByTaro(container.current);
|
|
90
|
+
const difference = containerRect.bottom - top - curRootRect.height;
|
|
91
|
+
const curTransform = difference < 0 ? difference : 0;
|
|
92
|
+
setTransform(curTransform);
|
|
93
|
+
const curFixed = top > curRootRect.top && containerRect.bottom > 0;
|
|
94
|
+
setFixed(curFixed);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
setFixed(top > curRootRect.top);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const windowHeight = getSystemInfoSync().windowHeight;
|
|
102
|
+
setFixed(windowHeight - offset < curRootRect.bottom);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
console.log('getRectByTaro获取失败', { stickyRect, curRootRect });
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const getElement = useCallback(() => {
|
|
110
|
+
return getScrollParent(rootRef.current);
|
|
111
|
+
}, []);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (getEnv() === 'WEB' && getElement() !== window) {
|
|
114
|
+
window.addEventListener('touchmove', handleScroll, true);
|
|
115
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
116
|
+
return () => {
|
|
117
|
+
window.removeEventListener('touchmove', handleScroll);
|
|
118
|
+
window.removeEventListener('scroll', handleScroll);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}, []);
|
|
122
|
+
usePageScroll((res) => {
|
|
123
|
+
if (getEnv() === 'WEAPP') {
|
|
124
|
+
handleScroll(res.scrollTop);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return (React__default.createElement("div", { ref: rootRef, style: rootStyle, className: `nut-sticky ${className}`, ...rest },
|
|
128
|
+
React__default.createElement("div", { className: `nut-sticky-box ${fixed ? 'nut-sticky-fixed' : ''}`, ref: stickyRef, style: stickyStyle }, children)));
|
|
129
|
+
};
|
|
130
|
+
Sticky.defaultProps = defaultProps;
|
|
131
|
+
Sticky.displayName = 'NutSticky';
|
|
132
|
+
|
|
133
|
+
export { Sticky as S };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { forwardRef, useRef, useState, useMemo, useImperativeHandle, useEffect } from 'react';
|
|
2
2
|
import { c as cn } from './bem-893ad28d.js';
|
|
3
3
|
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
4
|
-
import { g as getRectByTaro } from './useClientRect-
|
|
4
|
+
import { g as getRectByTaro } from './useClientRect-4506e52f.js';
|
|
5
5
|
|
|
6
6
|
function preventDefault(event, isStopPropagation) {
|
|
7
7
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useEffect } from 'react';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { c as cn } from './bem-893ad28d.js';
|
|
4
|
-
import { I as Icon } from './icon.taro-
|
|
4
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
5
5
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { c as cn } from './bem-893ad28d.js';
|
|
4
|
-
import { I as Icon } from './icon.taro-
|
|
4
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
5
5
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { c as cn } from './bem-893ad28d.js';
|
|
4
|
-
import { I as Icon } from './icon.taro-
|
|
4
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
5
5
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
6
6
|
|
|
7
7
|
class Title {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import { I as Icon } from './icon.taro-
|
|
2
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
3
3
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import { P as Popup } from './popup.taro-
|
|
2
|
+
import { P as Popup } from './popup.taro-89809b25.js';
|
|
3
3
|
import { T as TimePannel } from './timepannel.taro-29f9dd86.js';
|
|
4
4
|
import { T as TimeDetail } from './timedetail.taro-c5f564fd.js';
|
|
5
5
|
import { c as cn } from './bem-893ad28d.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { c as cn } from './bem-893ad28d.js';
|
|
4
|
-
import { I as Icon } from './icon-
|
|
4
|
+
import { I as Icon } from './icon-2242973e.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
id: '',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties, FunctionComponent } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { InnerAudioContext } from '@tarojs/taro';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
4
|
export interface AudioProps extends BasicComponent {
|
|
5
5
|
className?: string;
|
|
@@ -8,11 +8,11 @@ export interface AudioProps extends BasicComponent {
|
|
|
8
8
|
autoplay?: boolean;
|
|
9
9
|
loop?: boolean;
|
|
10
10
|
type: string;
|
|
11
|
-
onFastBack?: (ctx:
|
|
12
|
-
onForward?: (ctx:
|
|
11
|
+
onFastBack?: (ctx: InnerAudioContext) => void;
|
|
12
|
+
onForward?: (ctx: InnerAudioContext) => void;
|
|
13
13
|
onPause?: any;
|
|
14
14
|
onPlay?: any;
|
|
15
|
-
onPlayEnd?: (ctx:
|
|
16
|
-
onCanPlay?: (ctx:
|
|
15
|
+
onPlayEnd?: (ctx: InnerAudioContext) => void;
|
|
16
|
+
onCanPlay?: (ctx: InnerAudioContext) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare const Audio: FunctionComponent<Partial<AudioProps> & (React.HTMLAttributes<HTMLDivElement> |
|
|
18
|
+
export declare const Audio: FunctionComponent<Partial<AudioProps> & (React.HTMLAttributes<HTMLDivElement> | InnerAudioContext)>;
|
|
@@ -14,6 +14,9 @@ export interface ImageProps {
|
|
|
14
14
|
showLoading: boolean;
|
|
15
15
|
slotLoding: React.ReactNode;
|
|
16
16
|
slotError: React.ReactNode | string;
|
|
17
|
+
isLazy?: boolean;
|
|
18
|
+
loadingImg?: string;
|
|
19
|
+
errorImg?: string;
|
|
17
20
|
onClick?: (e: MouseEvent) => void;
|
|
18
21
|
onLoad?: () => void;
|
|
19
22
|
onError?: () => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
2
3
|
export interface OverlayProps {
|
|
3
4
|
zIndex: number;
|
|
4
5
|
duration: number;
|
|
@@ -7,6 +8,7 @@ export interface OverlayProps {
|
|
|
7
8
|
closeOnClickOverlay: boolean;
|
|
8
9
|
visible: boolean;
|
|
9
10
|
lockScroll: boolean;
|
|
11
|
+
onClick: (event: ITouchEvent) => void;
|
|
10
12
|
}
|
|
11
13
|
export declare const defaultOverlayProps: OverlayProps;
|
|
12
|
-
export declare const Overlay: FunctionComponent<Partial<OverlayProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const Overlay: FunctionComponent<Partial<OverlayProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
3
4
|
export type PopoverTheme = 'light' | 'dark';
|
|
4
5
|
export type PopoverLocation = 'bottom' | 'top' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
|
|
5
6
|
export interface List {
|
|
@@ -16,7 +17,7 @@ export interface PopoverProps extends BasicComponent {
|
|
|
16
17
|
className: string;
|
|
17
18
|
style?: CSSProperties;
|
|
18
19
|
children?: React.ReactNode;
|
|
19
|
-
onClick: (e: React.MouseEvent) => void;
|
|
20
|
+
onClick: (e: React.MouseEvent | ITouchEvent) => void;
|
|
20
21
|
onChoose: (item: List, index: number) => void;
|
|
21
22
|
}
|
|
22
23
|
export declare const Popover: FunctionComponent<Partial<PopoverProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent, MouseEvent } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
2
3
|
import { OverlayProps } from '@/packages/overlay/overlay.taro';
|
|
3
4
|
import { BasicComponent } from '@/utils/typings';
|
|
4
5
|
type Teleport = HTMLElement | (() => HTMLElement) | null;
|
|
@@ -16,11 +17,10 @@ export interface PopupProps extends OverlayProps, BasicComponent {
|
|
|
16
17
|
round: boolean;
|
|
17
18
|
onOpen: () => void;
|
|
18
19
|
onClose: () => void;
|
|
19
|
-
onClick: (e: MouseEvent) => void;
|
|
20
20
|
onOpened: (e: HTMLElement) => void;
|
|
21
21
|
onClosed: (e: HTMLElement) => void;
|
|
22
|
-
onClickOverlay: (e:
|
|
22
|
+
onClickOverlay: (e: ITouchEvent) => void;
|
|
23
23
|
onClickCloseIcon: (e: MouseEvent) => void;
|
|
24
24
|
}
|
|
25
|
-
export declare const Popup: FunctionComponent<Partial<PopupProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare const Popup: FunctionComponent<Partial<PopupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
|
|
26
26
|
export {};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
|
|
2
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
export interface StickyProps extends BasicComponent {
|
|
4
|
+
container?: React.RefObject<HTMLElement>;
|
|
5
|
+
position?: 'top' | 'bottom';
|
|
6
|
+
className?: string;
|
|
7
|
+
top?: number;
|
|
8
|
+
bottom?: number;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
onChange?: (val: boolean) => void;
|
|
3
12
|
}
|
|
4
|
-
export declare const Sticky: FunctionComponent<
|
|
13
|
+
export declare const Sticky: FunctionComponent<StickyProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { UploadOptions } from './upload';
|
|
4
|
+
import { BasicComponent } from '@/utils/typings';
|
|
4
5
|
export type FileType<T> = {
|
|
5
6
|
[key: string]: T;
|
|
6
7
|
};
|
|
@@ -23,7 +24,6 @@ interface sourceType {
|
|
|
23
24
|
/** 使用后置摄像头(仅H5纯浏览器) */
|
|
24
25
|
environment: string;
|
|
25
26
|
}
|
|
26
|
-
import { BasicComponent } from '@/utils/typings';
|
|
27
27
|
export interface UploaderProps extends BasicComponent {
|
|
28
28
|
url: string;
|
|
29
29
|
maximum: string | number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default, { useState, useEffect, useImperativeHandle } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import { uploadFile, getEnv, chooseImage } from '@tarojs/taro';
|
|
4
|
+
import { I as Icon } from './icon.taro-c9254a81.js';
|
|
5
|
+
import { B as Button } from './button.taro-b7c5f5a7.js';
|
|
6
|
+
import { P as Progress } from './progress.taro-18e015e4.js';
|
|
7
7
|
import { c as cn } from './bem-893ad28d.js';
|
|
8
8
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
9
9
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
@@ -161,7 +161,7 @@ const InternalUploader = (props, ref) => {
|
|
|
161
161
|
useImperativeHandle(ref, () => ({
|
|
162
162
|
submit: () => {
|
|
163
163
|
Promise.all(uploadQueue).then((res) => {
|
|
164
|
-
res.forEach((i) => i.uploadTaro(
|
|
164
|
+
res.forEach((i) => i.uploadTaro(uploadFile, getEnv()));
|
|
165
165
|
});
|
|
166
166
|
},
|
|
167
167
|
}));
|
|
@@ -174,16 +174,16 @@ const InternalUploader = (props, ref) => {
|
|
|
174
174
|
setUploadQueue([]);
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
-
const
|
|
177
|
+
const _chooseImage = () => {
|
|
178
178
|
if (disabled) {
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
chooseImage({
|
|
182
182
|
// 选择数量
|
|
183
183
|
count: maximum * 1 - fileList.length,
|
|
184
184
|
// 可以指定是原图还是压缩图,默认二者都有
|
|
185
|
-
sizeType
|
|
186
|
-
sourceType
|
|
185
|
+
sizeType,
|
|
186
|
+
sourceType,
|
|
187
187
|
success: onChangeFn,
|
|
188
188
|
});
|
|
189
189
|
};
|
|
@@ -260,7 +260,7 @@ const InternalUploader = (props, ref) => {
|
|
|
260
260
|
};
|
|
261
261
|
const task = new Upload(uploadOption);
|
|
262
262
|
if (props.autoUpload) {
|
|
263
|
-
task.uploadTaro(
|
|
263
|
+
task.uploadTaro(uploadFile, getEnv());
|
|
264
264
|
}
|
|
265
265
|
else {
|
|
266
266
|
uploadQueue.push(new Promise((resolve, reject) => {
|
|
@@ -283,7 +283,7 @@ const InternalUploader = (props, ref) => {
|
|
|
283
283
|
fileItem.status = 'ready';
|
|
284
284
|
fileItem.message = locale.uploader.readyUpload;
|
|
285
285
|
fileItem.type = fileType;
|
|
286
|
-
if (
|
|
286
|
+
if (getEnv() === 'WEB') {
|
|
287
287
|
const formData = new FormData();
|
|
288
288
|
for (const [key, value] of Object.entries(data)) {
|
|
289
289
|
formData.append(key, value);
|
|
@@ -318,7 +318,7 @@ const InternalUploader = (props, ref) => {
|
|
|
318
318
|
if (oversizes.length) {
|
|
319
319
|
onOversize && onOversize(files);
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
const currentFileLength = filterFile.length + fileList.length;
|
|
322
322
|
if (currentFileLength > maximum) {
|
|
323
323
|
filterFile.splice(filterFile.length - (currentFileLength - maximum));
|
|
324
324
|
}
|
|
@@ -357,17 +357,17 @@ const InternalUploader = (props, ref) => {
|
|
|
357
357
|
children && (React__default.createElement("div", { className: "nut-uploader__slot" },
|
|
358
358
|
React__default.createElement(React__default.Fragment, null,
|
|
359
359
|
children,
|
|
360
|
-
maximum > fileList.length && (React__default.createElement(Button, { className: "nut-uploader__input", onClick:
|
|
360
|
+
maximum > fileList.length && (React__default.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage }))))),
|
|
361
361
|
fileList.length !== 0 &&
|
|
362
362
|
fileList.map((item, index) => {
|
|
363
363
|
return (React__default.createElement("div", { className: `nut-uploader__preview ${listType}`, key: item.uid },
|
|
364
|
-
listType
|
|
364
|
+
listType === 'picture' && !children && (React__default.createElement("div", { className: "nut-uploader__preview-img" },
|
|
365
365
|
item.status === 'ready' ? (React__default.createElement("div", { className: "nut-uploader__preview__progress" },
|
|
366
366
|
React__default.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message))) : (item.status !== 'success' && (React__default.createElement("div", { className: "nut-uploader__preview__progress" },
|
|
367
|
-
React__default.createElement(Icon, { classPrefix: props.iconClassPrefix, fontClassName: props.iconFontClassName, color: "#fff", name: `${item.status
|
|
367
|
+
React__default.createElement(Icon, { classPrefix: props.iconClassPrefix, fontClassName: props.iconFontClassName, color: "#fff", name: `${item.status === 'error' ? 'failure' : 'loading'}` }),
|
|
368
368
|
React__default.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message)))),
|
|
369
369
|
isDeletable && (React__default.createElement(Icon, { classPrefix: props.iconClassPrefix, fontClassName: props.iconFontClassName, color: "rgba(0,0,0,0.6)", className: "close", name: "failure", onClick: () => onDelete(item, index) })),
|
|
370
|
-
item.type.includes('image') ? (React__default.createElement(React__default.Fragment, null, item.url && (React__default.createElement("img", { className: "nut-uploader__preview-img__c", src: item.url, onClick: () => handleItemClick(item) })))) : (React__default.createElement(React__default.Fragment, null, defaultImg ? (React__default.createElement("img", { className: "nut-uploader__preview-img__c", src: defaultImg, onClick: () => handleItemClick(item) })) : (React__default.createElement("div", { className: "nut-uploader__preview-img__file" },
|
|
370
|
+
item.type.includes('image') ? (React__default.createElement(React__default.Fragment, null, item.url && (React__default.createElement("img", { className: "nut-uploader__preview-img__c", src: item.url, alt: "", onClick: () => handleItemClick(item) })))) : (React__default.createElement(React__default.Fragment, null, defaultImg ? (React__default.createElement("img", { className: "nut-uploader__preview-img__c", src: defaultImg, alt: "", onClick: () => handleItemClick(item) })) : (React__default.createElement("div", { className: "nut-uploader__preview-img__file" },
|
|
371
371
|
React__default.createElement("div", { onClick: () => handleItemClick(item), className: "nut-uploader__preview-img__file__name" },
|
|
372
372
|
React__default.createElement(Icon, { classPrefix: props.iconClassPrefix, fontClassName: props.iconFontClassName, color: "#808080", name: "link" }),
|
|
373
373
|
"\u00A0",
|
|
@@ -383,7 +383,7 @@ const InternalUploader = (props, ref) => {
|
|
|
383
383
|
}),
|
|
384
384
|
maximum > fileList.length && listType === 'picture' && !children && (React__default.createElement("div", { className: `nut-uploader__upload ${listType}` },
|
|
385
385
|
React__default.createElement(Icon, { classPrefix: props.iconClassPrefix, fontClassName: props.iconFontClassName, size: uploadIconSize, color: "#808080", name: uploadIcon }),
|
|
386
|
-
React__default.createElement(Button, { className: "nut-uploader__input", onClick:
|
|
386
|
+
React__default.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage })))));
|
|
387
387
|
};
|
|
388
388
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
389
389
|
Uploader.defaultProps = defaultProps;
|