@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 | React.ReactFragment | JSX.Element | 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,22 +1,20 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
|
|
2
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
export type ToastPositionType = 'top' | 'bottom' | 'center';
|
|
4
|
+
export interface ToastProps extends BasicComponent {
|
|
3
5
|
id?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
maskClassName?: string;
|
|
7
|
+
contentClassName?: string;
|
|
8
|
+
contentStyle?: React.CSSProperties;
|
|
9
|
+
icon: string | React.ReactNode;
|
|
6
10
|
iconSize: string;
|
|
7
11
|
msg: string | React.ReactNode;
|
|
8
|
-
bottom: number | string;
|
|
9
12
|
duration: number;
|
|
10
|
-
|
|
13
|
+
position?: ToastPositionType;
|
|
11
14
|
type: string;
|
|
12
15
|
title: string;
|
|
13
|
-
|
|
16
|
+
closeOnOverlayClick: boolean;
|
|
14
17
|
size: string | number;
|
|
15
|
-
textAlignCenter: boolean;
|
|
16
|
-
bgColor: string;
|
|
17
|
-
cover: boolean;
|
|
18
|
-
coverColor: string;
|
|
19
|
-
closeOnClickOverlay: boolean;
|
|
20
18
|
visible: boolean;
|
|
21
19
|
onClose: () => void;
|
|
22
20
|
}
|
|
@@ -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>>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ItemRender
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
overscan
|
|
11
|
-
onScroll
|
|
12
|
-
key
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare const VirtualList: FunctionComponent<VirtualListProps & React.HTMLAttributes<HTMLDivElement>>;
|
|
2
|
+
import { 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
|
+
overscan: number;
|
|
11
|
+
onScroll: () => void;
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const VirtualList: FunctionComponent<Partial<VirtualListProps>>;
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/tr-TR.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
2
|
+
* @nutui/nutui-react v2.0.0-alpha.12 Fri May 26 2023 15:24:48 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2023 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -30,7 +30,15 @@ const i = {
|
|
|
30
30
|
},
|
|
31
31
|
range: { rangeText: "Aralıkta görünmüyor" },
|
|
32
32
|
calendaritem: {
|
|
33
|
-
weekdays: [
|
|
33
|
+
weekdays: [
|
|
34
|
+
"Pazar",
|
|
35
|
+
"Pazartesi",
|
|
36
|
+
"Salı",
|
|
37
|
+
"Çarşamba",
|
|
38
|
+
"Perşembe",
|
|
39
|
+
"Cuma",
|
|
40
|
+
"Cumartesi"
|
|
41
|
+
],
|
|
34
42
|
end: "Son",
|
|
35
43
|
start: "Başlangıç",
|
|
36
44
|
confirm: "Onayla",
|
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED