@nutui/nutui-react-taro 2.3.8 → 2.3.10
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 +37 -4
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +2 -2
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +5 -5
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Audio/style/style.css +1 -1
- package/dist/esm/Audio.js +2 -2
- package/dist/esm/Avatar/style/style.css +1 -1
- package/dist/esm/AvatarCropper/style/style.css +1 -1
- package/dist/esm/AvatarGroup/style/style.css +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +4 -2
- package/dist/esm/Button/style/style.css +1 -1
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +4 -4
- package/dist/esm/CalendarCard/style/style.css +1 -1
- package/dist/esm/CalendarCard.js +2 -2
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +3 -3
- package/dist/esm/Cell/style/style.css +1 -1
- package/dist/esm/CellGroup/style/style.css +1 -1
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/CircleProgress/style/style.css +1 -1
- package/dist/esm/Col/style/style.css +1 -1
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/ConfigProvider.js +2 -2
- package/dist/esm/CountDown.js +2 -2
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/DatePicker.js +4 -4
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Divider/style/style.css +1 -1
- package/dist/esm/Elevator/style/style.css +1 -1
- package/dist/esm/Empty/style/style.css +1 -1
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +1 -1
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/FormItem.js +1 -1
- package/dist/esm/Grid/style/style.css +1 -1
- package/dist/esm/Grid.js +3 -3
- package/dist/esm/GridItem/style/style.css +1 -1
- package/dist/esm/GridItem.js +2 -2
- package/dist/esm/Image/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +2 -2
- package/dist/esm/Indicator/style/style.css +1 -1
- package/dist/esm/InfiniteLoading/style/style.css +1 -1
- package/dist/esm/InfiniteLoading.js +2 -2
- package/dist/esm/Input.js +2 -2
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/Notify/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Overlay/style/style.css +1 -1
- package/dist/esm/Pagination/style/style.css +1 -1
- package/dist/esm/Pagination.js +2 -2
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +3 -3
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Popup.js +1 -1
- package/dist/esm/Price/style/style.css +1 -1
- package/dist/esm/Progress/style/style.css +1 -1
- package/dist/esm/PullToRefresh/style/style.css +1 -1
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Radio/style/style.css +1 -1
- package/dist/esm/Range/style/style.css +1 -1
- package/dist/esm/Rate/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +2 -2
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Space/style/style.css +1 -1
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Switch/style/style.css +1 -1
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Table.js +2 -2
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/Tag/style/style.css +1 -1
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TextArea.js +2 -2
- package/dist/esm/TimeDetail/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TimeSelect.js +3 -3
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +3 -3
- package/dist/esm/TrendArrow/style/style.css +1 -1
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/Uploader.js +2 -2
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/WaterMark.js +2 -2
- package/dist/esm/{actionsheet.taro-gfhQciJ4.js → actionsheet.taro-6NiOrNyd.js} +1 -1
- package/dist/esm/{address.taro-LCSSqsR-.js → address.taro-zQuxQEce.js} +3 -3
- package/dist/esm/{audio.taro-UpVxFvGk.js → audio.taro-dJgj5qIu.js} +1 -1
- package/dist/esm/barrage.taro-6nbq7wtt.js +118 -0
- package/dist/esm/{calendar.taro-Kf91Qo5t.js → calendar.taro-iNNHje7V.js} +3 -3
- package/dist/esm/{calendarcard.taro-tY-cyh-F.js → calendarcard.taro-9s7naGmU.js} +1 -1
- package/dist/esm/{calendaritem.taro-G5BaVw8e.js → calendaritem.taro-o6Z8OOGY.js} +1 -1
- package/dist/esm/{cascader.taro-x_X9F_pH.js → cascader.taro-M2nZWxiB.js} +2 -2
- package/dist/esm/{configprovider.taro-_wngOo0k.js → configprovider.taro-q5J2gQbi.js} +6 -4
- package/dist/esm/{countdown.taro-rJngrZUZ.js → countdown.taro-XZlfWBrA.js} +1 -1
- package/dist/esm/{datepicker.taro-S111IvJO.js → datepicker.taro-DrXkqJkN.js} +2 -2
- package/dist/esm/{dialog.taro-z588FBZJ.js → dialog.taro-dmQGDu3o.js} +1 -1
- package/dist/esm/{empty.taro-98NzV-31.js → empty.taro-gwvOr1xf.js} +1 -1
- package/dist/esm/{fixednav.taro-7OfzwFBE.js → fixednav.taro-QVBXysDj.js} +1 -1
- package/dist/esm/{formitem.taro-atY4A0pS.js → formitem.taro-PPkTQGfW.js} +39 -10
- package/dist/esm/{grid.taro-Hc4q01A_.js → grid.taro-3X-_AhXw.js} +1 -1
- package/dist/esm/{griditem.taro-RdNA-Wqv.js → griditem.taro-TJDJVeQy.js} +1 -1
- package/dist/esm/{imagepreview.taro-qDST6Lh4.js → imagepreview.taro--fVrJUOE.js} +1 -1
- package/dist/esm/{infiniteloading.taro-sl41Ddeh.js → infiniteloading.taro-BO0_y46K.js} +2 -1
- package/dist/esm/{input.taro-8gs046AH.js → input.taro-YoPsV-op.js} +20 -17
- package/dist/esm/{numberkeyboard.taro-CyW0s9bI.js → numberkeyboard.taro-bF6VCXry.js} +2 -2
- package/dist/esm/nutui-react.es.js +37 -37
- package/dist/esm/{pagination.taro-RYmB2As4.js → pagination.taro-C4_Ey5KC.js} +1 -1
- package/dist/esm/{picker.taro-RAYmFSC0.js → picker.taro-csU3SZPF.js} +2 -2
- package/dist/esm/{popover.taro-MUrnn7xY.js → popover.taro-qldQwLPC.js} +1 -1
- package/dist/esm/{popup.taro-2FdJu1kg.js → popup.taro-ObEUml4r.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-VbzsD_HC.js → pulltorefresh.taro-2jER8Mat.js} +1 -1
- package/dist/esm/{searchbar.taro-Hmwspp92.js → searchbar.taro-hVzdT6nI.js} +1 -1
- package/dist/esm/{shortpassword.taro-uFeVULsY.js → shortpassword.taro-ECs_E1Xn.js} +20 -7
- package/dist/esm/{sidenavbar.taro-J5SEKQIh.js → sidenavbar.taro-8qoGZg5n.js} +1 -1
- package/dist/esm/{sticky.taro-MmKUU2Wv.js → sticky.taro-p-evMNR-.js} +1 -1
- package/dist/esm/{table.taro-d172EUh9.js → table.taro-0zRh2hq6.js} +1 -1
- package/dist/esm/{tabs.taro-w8ra49Qb.js → tabs.taro-Yj7vgtSg.js} +1 -1
- package/dist/esm/{textarea.taro-VYqlTewy.js → textarea.taro-9zQLTCwU.js} +2 -2
- package/dist/esm/{timeselect.taro-7FWR9oaJ.js → timeselect.taro-j8LgSCe5.js} +2 -2
- package/dist/esm/{tour.taro-HLsDVf9g.js → tour.taro-CGEjzzN_.js} +1 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -1
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +6 -2
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +7 -0
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/types.d.ts +4 -0
- package/dist/esm/{uploader.taro-a-U18v5C.js → uploader.taro-bRF02TR9.js} +1 -1
- package/dist/esm/{watermark.taro-WDFdgWlJ.js → watermark.taro-nvSmcwu-.js} +1 -1
- 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/tr-TR.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 +172 -103
- package/dist/nutui.react.umd.js +172 -103
- package/dist/packages/address/address.scss +12 -0
- package/dist/packages/animate/animate.scss +49 -0
- package/dist/packages/audio/audio.scss +14 -0
- package/dist/packages/avatar/avatar.scss +25 -0
- package/dist/packages/avatarcropper/avatarcropper.scss +52 -0
- package/dist/packages/avatargroup/avatargroup.scss +11 -0
- package/dist/packages/badge/badge.scss +8 -0
- package/dist/packages/barrage/barrage.scss +18 -1
- package/dist/packages/button/button.scss +18 -0
- package/dist/packages/calendar/calendar.scss +24 -0
- package/dist/packages/calendarcard/calendarcard.scss +41 -0
- package/dist/packages/card/card.scss +21 -0
- package/dist/packages/cascader/cascader.scss +8 -0
- package/dist/packages/cellgroup/cellgroup.scss +14 -0
- package/dist/packages/checkbox/checkbox.scss +38 -0
- package/dist/packages/checkboxgroup/checkboxgroup.scss +24 -8
- package/dist/packages/circleprogress/circleprogress.scss +8 -0
- package/dist/packages/col/col.scss +25 -0
- package/dist/packages/collapseitem/collapseitem.scss +15 -0
- package/dist/packages/dialog/dialog.scss +29 -0
- package/dist/packages/divider/divider.scss +22 -0
- package/dist/packages/elevator/elevator.scss +20 -0
- package/dist/packages/ellipsis/ellipsis.scss +1 -0
- package/dist/packages/empty/empty.scss +11 -0
- package/dist/packages/fixednav/fixednav.scss +75 -0
- package/dist/packages/form/form.scss +31 -0
- package/dist/packages/formitem/formitem.scss +15 -0
- package/dist/packages/grid/grid.scss +8 -0
- package/dist/packages/griditem/griditem.scss +37 -0
- package/dist/packages/image/image.scss +13 -0
- package/dist/packages/imagepreview/imagepreview.scss +26 -0
- package/dist/packages/indicator/indicator.scss +15 -0
- package/dist/packages/infiniteloading/infiniteloading.scss +13 -0
- package/dist/packages/loading/loading.scss +6 -0
- package/dist/packages/menu/menu.scss +9 -0
- package/dist/packages/menuitem/menuitem.scss +12 -0
- package/dist/packages/navbar/navbar.scss +61 -0
- package/dist/packages/noticebar/noticebar.scss +22 -0
- package/dist/packages/notify/notify.scss +10 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +27 -0
- package/dist/packages/overlay/overlay.scss +6 -0
- package/dist/packages/pagination/pagination.scss +24 -0
- package/dist/packages/popover/popover.scss +105 -0
- package/dist/packages/popup/popup.scss +77 -0
- package/dist/packages/price/price.scss +19 -0
- package/dist/packages/progress/progress.scss +7 -0
- package/dist/packages/pulltorefresh/pulltorefresh.scss +10 -0
- package/dist/packages/radio/radio.scss +21 -0
- package/dist/packages/range/range.scss +65 -0
- package/dist/packages/rate/rate.scss +30 -0
- package/dist/packages/safearea/safearea.scss +2 -0
- package/dist/packages/searchbar/searchbar.scss +65 -0
- package/dist/packages/shortpassword/shortpassword.scss +25 -0
- package/dist/packages/sidenavbar/sidenavbar.scss +15 -0
- package/dist/packages/skeleton/skeleton.scss +22 -1
- package/dist/packages/space/space.scss +30 -0
- package/dist/packages/step/step.scss +45 -0
- package/dist/packages/swipe/swipe.scss +15 -0
- package/dist/packages/swiper/swiper.scss +14 -0
- package/dist/packages/switch/switch.scss +13 -0
- package/dist/packages/tabbar/tabbar.scss +13 -0
- package/dist/packages/tabbaritem/tabbaritem.scss +2 -0
- package/dist/packages/table/table.scss +57 -0
- package/dist/packages/tabs/tabs.scss +85 -14
- package/dist/packages/tag/tag.scss +8 -0
- package/dist/packages/textarea/textarea.scss +17 -0
- package/dist/packages/timedetail/timedetail.scss +5 -0
- package/dist/packages/timeselect/timeselect.scss +5 -0
- package/dist/packages/toast/toast.scss +15 -0
- package/dist/packages/tour/tour.scss +23 -0
- package/dist/packages/trendarrow/trendarrow.scss +13 -0
- package/dist/packages/uploader/uploader.scss +36 -0
- package/dist/packages/video/video.scss +3 -0
- package/dist/packages/virtuallist/virtuallist.scss +11 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/backtop/backtop.taro.d.ts +1 -1
- package/dist/types/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/types/packages/configprovider/index.d.ts +1 -1
- package/dist/types/packages/configprovider/index.taro.d.ts +1 -1
- package/dist/types/packages/formitem/formitem.d.ts +6 -2
- package/dist/types/packages/formitem/formitem.taro.d.ts +14 -2
- package/dist/types/packages/popover/popover.taro.d.ts +7 -0
- package/dist/types/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/types/packages/shortpassword/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/esm/barrage.taro-HsivAhbE.js +0 -91
package/dist/style.mjs
CHANGED
|
@@ -4,8 +4,10 @@ import { BaseLang } from '../../locales/base';
|
|
|
4
4
|
import type { NutCSSVariables } from './types';
|
|
5
5
|
export interface ConfigProviderProps extends BasicComponent {
|
|
6
6
|
locale: BaseLang;
|
|
7
|
+
direction?: Direction;
|
|
7
8
|
theme?: Record<string | NutCSSVariables, string>;
|
|
8
9
|
}
|
|
10
|
+
export type Direction = 'ltr' | 'rtl' | undefined;
|
|
9
11
|
export declare const defaultConfigRef: {
|
|
10
12
|
current: ConfigProviderProps;
|
|
11
13
|
};
|
|
@@ -8,12 +8,14 @@ export interface ConfigProviderProps extends BasicComponent {
|
|
|
8
8
|
* @default zhCN
|
|
9
9
|
*/
|
|
10
10
|
locale: BaseLang
|
|
11
|
+
direction?: Direction;
|
|
11
12
|
/**
|
|
12
13
|
* 设置主题
|
|
13
14
|
* @default -
|
|
14
15
|
*/
|
|
15
16
|
theme?: Record<string | NutCSSVariables, string>
|
|
16
17
|
}
|
|
18
|
+
export type Direction = 'ltr' | 'rtl' | undefined;
|
|
17
19
|
export declare const defaultConfigRef: {
|
|
18
20
|
current: ConfigProviderProps;
|
|
19
21
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigProvider, useConfig, setDefaultConfig, getDefaultConfig } from './configprovider';
|
|
2
|
-
export type { ConfigProviderProps } from './configprovider';
|
|
2
|
+
export type { ConfigProviderProps, Direction } from './configprovider';
|
|
3
3
|
export type { NutCSSVariables } from './types';
|
|
4
4
|
export { useConfig, setDefaultConfig, getDefaultConfig };
|
|
5
5
|
export default ConfigProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigProvider, useConfig, setDefaultConfig, getDefaultConfig } from './configprovider.taro';
|
|
2
|
-
export type { ConfigProviderProps } from './configprovider.taro';
|
|
2
|
+
export type { ConfigProviderProps, Direction } from './configprovider.taro';
|
|
3
3
|
export type { NutCSSVariables } from './types';
|
|
4
4
|
export { useConfig, setDefaultConfig, getDefaultConfig };
|
|
5
5
|
export default ConfigProvider;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
required: boolean;
|
|
8
8
|
initialValue: any;
|
|
9
9
|
trigger: string;
|
|
@@ -12,6 +12,9 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
12
12
|
onClick: (event: React.MouseEvent, componentRef: React.MutableRefObject<any>) => void;
|
|
13
13
|
errorMessageAlign: TextAlign;
|
|
14
14
|
validateTrigger: string | string[];
|
|
15
|
+
shouldUpdate: boolean;
|
|
16
|
+
noStyle: boolean;
|
|
17
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
15
18
|
}
|
|
16
19
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
17
20
|
resetCount: number;
|
|
@@ -21,6 +24,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
21
24
|
context: React.ContextType<typeof Context>;
|
|
22
25
|
private cancelRegister;
|
|
23
26
|
private componentRef;
|
|
27
|
+
private eventOff;
|
|
24
28
|
constructor(props: FormItemProps);
|
|
25
29
|
componentDidMount(): void;
|
|
26
30
|
componentWillUnmount(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
/**
|
|
8
8
|
* 必填表单项 label 的红色星标,仅用于控制样式
|
|
9
9
|
* @default false
|
|
@@ -44,6 +44,17 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
44
44
|
* @default onChange
|
|
45
45
|
*/
|
|
46
46
|
validateTrigger: string | string[]
|
|
47
|
+
/**
|
|
48
|
+
* 更新逻辑
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
shouldUpdate: boolean
|
|
52
|
+
/**
|
|
53
|
+
* 不使用样式,只使用字段管理
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
noStyle: boolean
|
|
57
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
47
58
|
}
|
|
48
59
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
49
60
|
resetCount: number;
|
|
@@ -53,6 +64,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
53
64
|
context: React.ContextType<typeof Context>;
|
|
54
65
|
private cancelRegister;
|
|
55
66
|
private componentRef;
|
|
67
|
+
private eventOff;
|
|
56
68
|
constructor(props: FormItemProps);
|
|
57
69
|
componentDidMount(): void;
|
|
58
70
|
componentWillUnmount(): void;
|
|
@@ -76,4 +76,11 @@ export interface PopoverProps extends PopupProps {
|
|
|
76
76
|
*/
|
|
77
77
|
onSelect: (item: List, index: number) => void
|
|
78
78
|
}
|
|
79
|
+
export interface RootPosition {
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
left: number;
|
|
83
|
+
top: number;
|
|
84
|
+
right: number;
|
|
85
|
+
}
|
|
79
86
|
export declare const Popover: FunctionComponent<Partial<PopoverProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/index';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
value: string;
|
|
@@ -19,4 +19,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
19
19
|
onTips: () => void;
|
|
20
20
|
onComplete: (value: string) => void;
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
23
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/popup.taro';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
/**
|
|
@@ -87,4 +87,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
87
87
|
*/
|
|
88
88
|
onComplete: (value: string) => void
|
|
89
89
|
}
|
|
90
|
-
export declare const
|
|
90
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
91
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
package/package.json
CHANGED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React__default, { useState, useRef, useImperativeHandle, useEffect } from "react";
|
|
2
|
-
import { createSelectorQuery } from "@tarojs/taro";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
5
|
-
const defaultProps = {
|
|
6
|
-
...ComponentDefaults,
|
|
7
|
-
list: [],
|
|
8
|
-
interval: 500,
|
|
9
|
-
loop: true,
|
|
10
|
-
duration: 3e3,
|
|
11
|
-
rows: 3,
|
|
12
|
-
gapY: 10
|
|
13
|
-
};
|
|
14
|
-
const classPrefix = `nut-barrage`;
|
|
15
|
-
const InternalBarrage = (props, ref) => {
|
|
16
|
-
const { className, interval, loop, list, duration, rows, gapY, ...restProps } = {
|
|
17
|
-
...defaultProps,
|
|
18
|
-
...props
|
|
19
|
-
};
|
|
20
|
-
const [styleList, setStyleList] = useState([]);
|
|
21
|
-
const [baItemList, setBaItemList] = useState(list);
|
|
22
|
-
const barrageListSet = useRef(list);
|
|
23
|
-
const barrageBody = useRef(null);
|
|
24
|
-
const barrageContainer = useRef(null);
|
|
25
|
-
const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
|
|
26
|
-
const timer = useRef(0);
|
|
27
|
-
const classes = classNames(classPrefix, {
|
|
28
|
-
[`${classPrefix}-body${timeId.current}`]: true
|
|
29
|
-
}, className);
|
|
30
|
-
useImperativeHandle(ref, () => ({
|
|
31
|
-
add: (word) => {
|
|
32
|
-
barrageListSet.current = [...barrageListSet.current, word];
|
|
33
|
-
run();
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
barrageListSet.current = [...list];
|
|
38
|
-
run();
|
|
39
|
-
return () => {
|
|
40
|
-
clearInterval(timer.current);
|
|
41
|
-
};
|
|
42
|
-
}, [list]);
|
|
43
|
-
const run = () => {
|
|
44
|
-
setBaItemList(barrageListSet.current);
|
|
45
|
-
barrageListSet.current.forEach((item, index) => {
|
|
46
|
-
getNode(index);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const getNode = (index) => {
|
|
50
|
-
const query = createSelectorQuery();
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
let width = 100;
|
|
53
|
-
query.select(`.${classPrefix}-body${timeId.current}`).boundingClientRect((rec) => {
|
|
54
|
-
width = rec.width || 300;
|
|
55
|
-
});
|
|
56
|
-
query.select(`.${classPrefix}-item${index}`).boundingClientRect((recs) => {
|
|
57
|
-
const height = recs.height;
|
|
58
|
-
const nodeTop = `${index % rows * (height + gapY) + 20}px`;
|
|
59
|
-
styleInfo(index, nodeTop, width);
|
|
60
|
-
}).exec();
|
|
61
|
-
}, 500);
|
|
62
|
-
};
|
|
63
|
-
const styleInfo = (index, nodeTop, width) => {
|
|
64
|
-
const timeIndex = index - rows > 0 ? index - rows : 0;
|
|
65
|
-
const list2 = styleList;
|
|
66
|
-
const time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
|
|
67
|
-
const obj = {
|
|
68
|
-
top: nodeTop,
|
|
69
|
-
"--time": `${interval * index + time}`,
|
|
70
|
-
animationDuration: `${duration}ms`,
|
|
71
|
-
animationIterationCount: `${loop ? "infinite" : 1}`,
|
|
72
|
-
animationDelay: `${interval * index + time}ms`,
|
|
73
|
-
"--move-distance": `-${width}px`
|
|
74
|
-
};
|
|
75
|
-
list2.push(obj);
|
|
76
|
-
setStyleList([...list2]);
|
|
77
|
-
};
|
|
78
|
-
return React__default.createElement(
|
|
79
|
-
"div",
|
|
80
|
-
{ className: classes, ref: barrageBody, ...restProps },
|
|
81
|
-
React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
|
|
82
|
-
return React__default.createElement("div", { className: `barrage-item ${classPrefix}-item${index} move`, style: styleList[index], key: index }, item.length > 8 ? `${item.substr(0, 8)}...` : item);
|
|
83
|
-
}))
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
87
|
-
Barrage.defaultProps = defaultProps;
|
|
88
|
-
Barrage.displayName = "NutBarrage";
|
|
89
|
-
export {
|
|
90
|
-
Barrage as B
|
|
91
|
-
};
|