@nutui/nutui-react 2.0.0-alpha.11 → 2.0.0-alpha.12
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 +14 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +28 -37
- package/dist/esm/CountDown/style/style.css +1 -1
- package/dist/esm/CountDown.js +20 -15
- package/dist/esm/Ellipsis/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/SearchBar.js +33 -87
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +65 -133
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Toast.js +86 -102
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/VirtualList.js +29 -25
- package/dist/esm/types/src/packages/actionsheet/actionsheet.d.ts +11 -15
- package/dist/esm/types/src/packages/actionsheet/actionsheet.taro.d.ts +11 -15
- package/dist/esm/types/src/packages/actionsheet/index.d.ts +1 -0
- package/dist/esm/types/src/packages/actionsheet/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -0
- package/dist/esm/types/src/packages/countdown/countdown.d.ts +5 -4
- package/dist/esm/types/src/packages/countdown/countdown.taro.d.ts +5 -4
- package/dist/esm/types/src/packages/countdown/index.d.ts +1 -0
- package/dist/esm/types/src/packages/countdown/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/ellipsis/ellipsis.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +4 -31
- package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +4 -31
- package/dist/esm/types/src/packages/shortpassword/index.d.ts +1 -0
- package/dist/esm/types/src/packages/shortpassword/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +17 -20
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +17 -20
- package/dist/esm/types/src/packages/toast/Notification.d.ts +9 -13
- package/dist/esm/types/src/packages/toast/index.d.ts +1 -0
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/toast/toast.d.ts +19 -26
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +9 -11
- package/dist/esm/types/src/packages/virtuallist/index.d.ts +1 -0
- package/dist/esm/types/src/packages/virtuallist/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/virtuallist/type.d.ts +0 -18
- package/dist/esm/types/src/packages/virtuallist/utils.d.ts +3 -3
- package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +15 -4
- package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -14
- 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 +10 -2
- 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 +442 -512
- package/dist/nutui.react.umd.js +442 -512
- package/dist/packages/actionsheet/actionsheet.scss +26 -73
- package/dist/packages/countdown/countdown.scss +2 -0
- package/dist/packages/ellipsis/ellipsis.scss +4 -0
- package/dist/packages/searchbar/searchbar.scss +13 -71
- package/dist/packages/shortpassword/shortpassword.scss +1 -88
- package/dist/packages/toast/toast.scss +20 -7
- package/dist/packages/virtuallist/virtuallist.scss +0 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +56 -60
- package/dist/styles/variables.scss +30 -53
- package/dist/types/packages/actionsheet/actionsheet.d.ts +11 -15
- package/dist/types/packages/actionsheet/index.d.ts +1 -0
- package/dist/types/packages/configprovider/configprovider.d.ts +2 -1
- package/dist/types/packages/configprovider/index.d.ts +1 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -0
- package/dist/types/packages/countdown/countdown.d.ts +5 -4
- package/dist/types/packages/countdown/index.d.ts +1 -0
- package/dist/types/packages/searchbar/index.d.ts +1 -0
- package/dist/types/packages/searchbar/searchbar.d.ts +4 -31
- package/dist/types/packages/shortpassword/index.d.ts +1 -0
- package/dist/types/packages/shortpassword/shortpassword.d.ts +17 -20
- package/dist/types/packages/toast/Notification.d.ts +9 -13
- package/dist/types/packages/toast/index.d.ts +1 -0
- package/dist/types/packages/toast/toast.d.ts +19 -26
- package/dist/types/packages/virtuallist/index.d.ts +1 -0
- package/dist/types/packages/virtuallist/type.d.ts +0 -18
- package/dist/types/packages/virtuallist/utils.d.ts +3 -3
- package/dist/types/packages/virtuallist/virtuallist.d.ts +15 -4
- package/package.json +1 -1
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BasicComponent } from '../../utils/typings';
|
|
3
|
+
export interface NotificationProps extends BasicComponent {
|
|
3
4
|
id?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
msg: string | React.ReactNode;
|
|
7
|
-
bottom: string;
|
|
5
|
+
icon: 'success' | 'fail' | 'loading' | 'warn' | React.ReactNode;
|
|
6
|
+
content: string | React.ReactNode;
|
|
8
7
|
duration: number;
|
|
9
|
-
center
|
|
10
|
-
type: string;
|
|
8
|
+
position?: 'top' | 'center' | 'bottom';
|
|
11
9
|
title: string;
|
|
12
|
-
customClass: string;
|
|
13
10
|
size: string | number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
coverColor: string;
|
|
18
|
-
closeOnClickOverlay: boolean;
|
|
11
|
+
closeOnOverlayClick: boolean;
|
|
12
|
+
contentClassName?: string;
|
|
13
|
+
contentStyle?: React.CSSProperties;
|
|
19
14
|
onClose: () => void;
|
|
20
15
|
}
|
|
21
16
|
export default class Notification extends React.PureComponent<NotificationProps> {
|
|
@@ -26,6 +21,7 @@ export default class Notification extends React.PureComponent<NotificationProps>
|
|
|
26
21
|
startCloseTimer(): void;
|
|
27
22
|
clearCloseTimer(): void;
|
|
28
23
|
clickCover(): void;
|
|
24
|
+
renderIcon(): number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
29
25
|
componentDidMount(): void;
|
|
30
26
|
componentWillUnmount(): void;
|
|
31
27
|
render(): JSX.Element;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BasicComponent } from '../../utils/typings';
|
|
3
|
+
export type ToastPositionType = 'top' | 'bottom' | 'center';
|
|
4
|
+
export type ToastIconType = 'success' | 'fail' | 'loading' | 'warn' | React.ReactNode;
|
|
5
|
+
export interface ToastProps extends BasicComponent {
|
|
3
6
|
id?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
iconSize: string;
|
|
15
|
-
textAlignCenter: boolean;
|
|
16
|
-
loadingRotate: boolean;
|
|
17
|
-
bgColor: string;
|
|
18
|
-
onClose: () => void;
|
|
19
|
-
cover: boolean;
|
|
20
|
-
coverColor: string;
|
|
21
|
-
closeOnClickOverlay: boolean;
|
|
7
|
+
duration?: number;
|
|
8
|
+
position?: ToastPositionType;
|
|
9
|
+
title?: string;
|
|
10
|
+
closeOnOverlayClick?: boolean;
|
|
11
|
+
size?: string | number;
|
|
12
|
+
icon?: ToastIconType;
|
|
13
|
+
content?: React.ReactNode;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
contentClassName?: string;
|
|
16
|
+
contentStyle?: React.CSSProperties;
|
|
22
17
|
}
|
|
18
|
+
declare function show(option: ToastProps | string): void;
|
|
19
|
+
declare function config(config: Pick<ToastProps, 'duration' | 'position' | 'closeOnOverlayClick'>): void;
|
|
23
20
|
declare const _default: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
loading(msg: string | React.ReactNode, option?: {}): void;
|
|
28
|
-
warn(msg: string | React.ReactNode, option?: {}): void;
|
|
29
|
-
customIcon(msg: string | React.ReactNode, option?: {}): void;
|
|
30
|
-
hide(): void;
|
|
21
|
+
show: typeof show;
|
|
22
|
+
config: typeof config;
|
|
23
|
+
clear(): void;
|
|
31
24
|
};
|
|
32
25
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type Data = any;
|
|
3
2
|
export interface VirtualListState {
|
|
4
3
|
startOffset: number;
|
|
@@ -15,20 +14,3 @@ export interface PositionType {
|
|
|
15
14
|
left?: number;
|
|
16
15
|
right: number;
|
|
17
16
|
}
|
|
18
|
-
export interface BasicVirtualListProps {
|
|
19
|
-
className?: string;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
sourceData: Array<Data>;
|
|
22
|
-
containerSize?: number;
|
|
23
|
-
ItemRender?: React.FC<any>;
|
|
24
|
-
itemSize?: number;
|
|
25
|
-
itemEqualSize?: boolean;
|
|
26
|
-
horizontal?: boolean;
|
|
27
|
-
overscan?: number;
|
|
28
|
-
handleScroll?: (...args: any[]) => any;
|
|
29
|
-
onScroll?: (...args: any[]) => any;
|
|
30
|
-
key?: string;
|
|
31
|
-
locale?: {
|
|
32
|
-
[key in string]: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
@@ -2,11 +2,11 @@ import { PositionType, Data } from './type';
|
|
|
2
2
|
declare const initPositinoCache: (reaItemSize: number, length?: number) => PositionType[];
|
|
3
3
|
declare const getListTotalSize: (positions: Array<PositionType>, horizontal: true | false) => number;
|
|
4
4
|
declare const binarySearch: (positionsList: Array<PositionType>, value: number | undefined, horizontal: true | false) => number;
|
|
5
|
-
declare const getEndIndex: ({
|
|
6
|
-
|
|
5
|
+
declare const getEndIndex: ({ list, startIndex, visibleCount, itemEqual, positions, offSetSize, overscan, sizeKey, }: {
|
|
6
|
+
list: Array<Data>;
|
|
7
7
|
startIndex: number;
|
|
8
8
|
visibleCount: number;
|
|
9
|
-
|
|
9
|
+
itemEqual?: boolean | undefined;
|
|
10
10
|
positions: PositionType[];
|
|
11
11
|
offSetSize: number;
|
|
12
12
|
overscan: number;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import type { Data } from './type';
|
|
3
|
+
import { BasicComponent } from '../../utils/typings';
|
|
4
|
+
export interface VirtualListProps extends BasicComponent {
|
|
5
|
+
list: Array<Data>;
|
|
6
|
+
containerHeight: number;
|
|
7
|
+
ItemRender: React.FC<any>;
|
|
8
|
+
itemHeight: number;
|
|
9
|
+
itemEqual: boolean;
|
|
10
|
+
direction: 'vertical' | 'horizontal';
|
|
11
|
+
overscan: number;
|
|
12
|
+
onScroll: () => void;
|
|
13
|
+
key: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const VirtualList: FunctionComponent<Partial<VirtualListProps>>;
|