@nutui/nutui-react-taro 1.4.5 → 1.4.6-beta.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 +8 -8
- package/dist/esm/ActionSheet.js +6 -5
- package/dist/esm/Address.js +8 -8
- package/dist/esm/AnimatingNumbers.js +2 -2
- 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/WaterMark.js +4 -4
- package/dist/esm/{actionsheet.taro-a58d3d12.js → actionsheet.taro-27121a38.js} +1 -1
- package/dist/esm/{address.taro-79cc7c96.js → address.taro-1765a37c.js} +14 -14
- package/dist/esm/{animatingnumbers.taro-6f40a2e9.js → animatingnumbers.taro-6307a3a5.js} +2 -2
- 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-aa39faf7.js} +3 -3
- 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-8ead43b0.js} +3 -3
- 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 +68 -67
- 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-d7a70ce0.js} +10 -10
- 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/esm/{watermark.taro-cd9db98a.js → watermark.taro-a948c735.js} +4 -4
- 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 +270 -125
- package/dist/nutui.react.umd.js +266 -121
- 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
|
@@ -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;
|
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
bottom 底部与视图窗口左上角的距离 number
|
|
9
9
|
*/
|
|
10
10
|
const getRectByTaro = async (element) => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
if (element) {
|
|
12
|
+
const res = await element.getBoundingClientRect();
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
return Promise.resolve({});
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export { getRectByTaro as g };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { ScrollView } from '@tarojs/components';
|
|
3
|
-
import
|
|
3
|
+
import { getSystemInfoSync } from '@tarojs/taro';
|
|
4
4
|
import { u as useConfig } from './configprovider.taro-26882dd2.js';
|
|
5
5
|
|
|
6
6
|
// 缓存列表初始化信息
|
|
@@ -89,8 +89,8 @@ const defaultProps = {
|
|
|
89
89
|
itemEqualSize: true,
|
|
90
90
|
overscan: 2,
|
|
91
91
|
};
|
|
92
|
-
const clientHeight =
|
|
93
|
-
|
|
92
|
+
const clientHeight = getSystemInfoSync().windowHeight - 5 || 667;
|
|
93
|
+
getSystemInfoSync().windowWidth || 375;
|
|
94
94
|
const VirtualList = (props) => {
|
|
95
95
|
const { sourceData = [], ItemRender, itemSize = 66, itemEqualSize = true, overscan = 2, key, onScroll, className, containerSize = clientHeight, ...rest } = props;
|
|
96
96
|
// const sizeKey = horizontal ? 'width' : 'height'
|
|
@@ -146,13 +146,12 @@ const VirtualList = (props) => {
|
|
|
146
146
|
}, [itemSize, sourceData]);
|
|
147
147
|
// 可视区域总高度
|
|
148
148
|
const getContainerHeight = () => {
|
|
149
|
-
|
|
149
|
+
// 初始首页列表高度
|
|
150
150
|
const initH = itemSize * sourceData.length;
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
// 未设置containerSize高度,判断首页高度小于设备高度时,滚动容器高度为首页数据高度,减5为分页触发的偏移量
|
|
152
|
+
return initH < clientHeight
|
|
153
153
|
? initH + overscan * itemSize - 5
|
|
154
|
-
: Math.min(containerSize, clientHeight);
|
|
155
|
-
return containerH; // Math.min(containerSize, clientHeight)
|
|
154
|
+
: Math.min(containerSize, clientHeight); // Math.min(containerSize, clientHeight)
|
|
156
155
|
};
|
|
157
156
|
// 可视区域条数
|
|
158
157
|
const visibleCount = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import Taro from '@tarojs/taro';
|
|
2
|
+
import { getSystemInfo, createOffscreenCanvas } from '@tarojs/taro';
|
|
4
3
|
import classNames from 'classnames';
|
|
4
|
+
import { u as useConfig } from './configprovider-5eea4f5d.js';
|
|
5
5
|
import { c as cn } from './bem-893ad28d.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
@@ -40,7 +40,7 @@ const WaterMark = (props) => {
|
|
|
40
40
|
}, []);
|
|
41
41
|
const init = () => {
|
|
42
42
|
let ratio = 1;
|
|
43
|
-
|
|
43
|
+
getSystemInfo().then((res) => {
|
|
44
44
|
ratio = res.pixelRatio;
|
|
45
45
|
const canvasWidth = `${(gapX + width) * ratio}px`;
|
|
46
46
|
const canvasHeight = `${(gapY + height) * ratio}px`;
|
|
@@ -55,7 +55,7 @@ const WaterMark = (props) => {
|
|
|
55
55
|
canvas.setAttribute('height', canvasHeight);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
canvas =
|
|
58
|
+
canvas = createOffscreenCanvas({
|
|
59
59
|
type: '2d',
|
|
60
60
|
width: Number(canvasWidth),
|
|
61
61
|
height: Number(canvasHeight),
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED