@nutui/nutui-react 1.1.3 → 1.1.4-beta.2
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/dist/esm/Address.js +22 -28
- package/dist/esm/Avatar/style/index.js +1 -1
- package/dist/esm/Avatar.js +97 -20
- package/dist/esm/Badge.js +0 -2
- package/dist/esm/Barrage.js +0 -1
- package/dist/esm/Calendar.js +6 -2
- package/dist/esm/CalendarItem.js +14 -13
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/CircleProgress.js +93 -56
- package/dist/esm/Collapse.js +2 -2
- package/dist/esm/ConfigProvider/style/index.js +2 -0
- package/dist/esm/ConfigProvider.js +146 -0
- package/dist/esm/CountDown.js +8 -4
- package/dist/esm/Dialog.js +7 -3
- package/dist/esm/FixedNav.js +5 -1
- package/dist/esm/Infiniteloading.js +7 -3
- package/dist/esm/Input.js +5 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/Pagination.js +6 -2
- package/dist/esm/Picker.js +6 -2
- package/dist/esm/Range.js +5 -1
- package/dist/esm/ShortPassword.js +9 -5
- package/dist/esm/Signature.js +7 -3
- package/dist/esm/Skeleton.js +20 -12
- package/dist/esm/Step.js +14 -3
- package/dist/esm/Steps.js +4 -1
- package/dist/esm/Swiper.js +2 -1
- package/dist/esm/TabbarItem.js +9 -0
- package/dist/esm/TextArea.js +5 -1
- package/dist/esm/Toast.js +4 -10
- package/dist/esm/Uploader/style/index.js +2 -1
- package/dist/esm/Uploader.js +84 -18
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/locales/base.d.ts +91 -0
- package/dist/locales/base.js +5 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +95 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +97 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +95 -0
- package/dist/nutui.react.es.js +519 -213
- package/dist/nutui.react.umd.js +26 -26
- package/dist/packages/avatar/avatar.scss +16 -6
- package/dist/packages/avatargroup/avatargroup.scss +14 -0
- package/dist/packages/circleprogress/circleprogress.scss +12 -53
- package/dist/packages/configprovider/configprovider.scss +0 -0
- package/dist/packages/skeleton/skeleton.scss +1 -3
- package/dist/packages/step/step.scss +29 -29
- package/dist/packages/uploader/uploader.scss +97 -14
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +2 -0
- package/dist/styles/variables.scss +36 -4
- package/dist/types/avatar/__tests__/avatar.spec.d.ts +1 -0
- package/dist/types/avatar/avatar.d.ts +6 -3
- package/dist/types/avatargroup/AvatarContext.d.ts +2 -0
- package/dist/types/avatargroup/__tests__/avatargroup.spec.d.ts +1 -0
- package/dist/types/avatargroup/avatargroup.d.ts +14 -0
- package/dist/types/avatargroup/index.d.ts +2 -0
- package/dist/types/barrage/__tests__/barrage.spec.d.ts +1 -0
- package/dist/types/button/button.d.ts +2 -2
- package/dist/types/checkbox/__test__/checkbox.spec.d.ts +1 -0
- package/dist/types/circleprogress/__tests__/circleprogress.spec.d.ts +1 -0
- package/dist/types/circleprogress/circleprogress.d.ts +11 -5
- package/dist/types/configprovider/configprovider.d.ts +12 -0
- package/dist/types/configprovider/index.d.ts +3 -0
- package/dist/types/icon/__test__/icon.spec.d.ts +1 -0
- package/dist/types/infiniteloading/__tests__/infiniteloading.spec.d.ts +1 -0
- package/dist/types/inputnumber/__tests__/inputnumber.spec.d.ts +1 -0
- package/dist/types/nutui.react.d.ts +2 -1
- package/dist/types/overlay/__tests__/overlay.spec.d.ts +1 -0
- package/dist/types/skeleton/__test__/skeleton.spec.d.ts +1 -0
- package/dist/types/skeleton/skeleton.d.ts +2 -2
- package/dist/types/step/step.d.ts +1 -0
- package/dist/types/steps/__tests__/steps.spec.d.ts +1 -0
- package/dist/types/steps/steps.d.ts +1 -0
- package/dist/types/tabbaritem/tabbaritem.d.ts +1 -0
- package/dist/types/toast/Notification.d.ts +1 -7
- package/dist/types/uploader/__tests__/uploader.spec.d.ts +1 -0
- package/dist/types/uploader/uploader.d.ts +9 -1
- package/package.json +9 -4
package/dist/style.es.js
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
@import '../../packages/swiper/swiper.scss';
|
|
48
48
|
@import '../../packages/swiperitem/swiperitem.scss';
|
|
49
49
|
@import '../../packages/avatar/avatar.scss';
|
|
50
|
+
@import '../../packages/avatargroup/avatargroup.scss';
|
|
50
51
|
@import '../../packages/price/price.scss';
|
|
51
52
|
@import '../../packages/badge/badge.scss';
|
|
52
53
|
@import '../../packages/tag/tag.scss';
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
@import '../../packages/collapse/collapse.scss';
|
|
57
58
|
@import '../../packages/collapseitem/collapseitem.scss';
|
|
58
59
|
@import '../../packages/animatingnumbers/animatingnumbers.scss';
|
|
60
|
+
@import '../../packages/configprovider/configprovider.scss';
|
|
59
61
|
@import '../../packages/address/address.scss';
|
|
60
62
|
@import '../../packages/barrage/barrage.scss';
|
|
61
63
|
@import '../../packages/signature/signature.scss';
|
|
@@ -117,9 +117,9 @@ $icon-line-height: 20px;
|
|
|
117
117
|
|
|
118
118
|
// uploader
|
|
119
119
|
|
|
120
|
-
$uploader-width: 100px;
|
|
121
|
-
$uploader-height: 100px;
|
|
122
|
-
$uploader-background: #f7f8fa;
|
|
120
|
+
$uploader-picture-width: 100px !default;
|
|
121
|
+
$uploader-picture-height: 100px !default;
|
|
122
|
+
$uploader-background: #f7f8fa !default;
|
|
123
123
|
|
|
124
124
|
//input
|
|
125
125
|
$input-border-bottom: #eaf0fb;
|
|
@@ -252,7 +252,33 @@ $rang-bar-bg-color: linear-gradient(135deg, $primary-color 0%, $primary-color-en
|
|
|
252
252
|
$address-region-tab-line: linear-gradient(90deg, $primary-color 0%, $primary-color-end 100%);
|
|
253
253
|
|
|
254
254
|
//steps
|
|
255
|
-
$
|
|
255
|
+
$steps-base-icon-width: 25px !default;
|
|
256
|
+
$steps-base-icon-height: 25px !default;
|
|
257
|
+
$steps-base-icon-line-height: 25px !default;
|
|
258
|
+
$steps-base-icon-font-size: 13px !default;
|
|
259
|
+
$steps-base-title-font-size: 14px !default;
|
|
260
|
+
$steps-base-line-color: #909ca4 !default;
|
|
261
|
+
$steps-base-title-color: #909ca4 !default;
|
|
262
|
+
$steps-base-title-margin-bottom: 10px !default;
|
|
263
|
+
$steps-base-content-font-size: 14px !default;
|
|
264
|
+
$steps-base-content-color: #666 !default;
|
|
265
|
+
|
|
266
|
+
$steps-wait-icon-bg-color: #959fb1 !default;
|
|
267
|
+
$steps-wait-icon-color: $white !default;
|
|
268
|
+
$steps-wait-head-color: #909ca4 !default;
|
|
269
|
+
$steps-wait-head-border-color: #909ca4 !default;
|
|
270
|
+
$steps-wait-content-color: #909ca4 !default;
|
|
271
|
+
|
|
272
|
+
$steps-finish-head-color: $primary-color !default;
|
|
273
|
+
$steps-finish-head-border-color: $primary-color !default;
|
|
274
|
+
$steps-finish-title-color: $primary-color !default;
|
|
275
|
+
$steps-finish-line-background: $primary-color !default;
|
|
276
|
+
$steps-finish-icon-text-color: $white !default;
|
|
277
|
+
|
|
278
|
+
$steps-process-head-color: $white !default;
|
|
279
|
+
$steps-process-head-border-color: $primary-color !default;
|
|
280
|
+
$steps-process-title-color: $primary-color !default;
|
|
281
|
+
$steps-process-icon-text-color: $primary-color !default;
|
|
256
282
|
|
|
257
283
|
// dialog
|
|
258
284
|
$dialog-width: 296px;
|
|
@@ -374,3 +400,9 @@ $tabs-vertical-tab-line-color: linear-gradient(
|
|
|
374
400
|
$tabs-vertical-titles-item-height: 40px !default;
|
|
375
401
|
$tabs-vertical-titles-item-active-line-height: 14px !default;
|
|
376
402
|
$tabs-vertical-titles-width: 100px !default;
|
|
403
|
+
|
|
404
|
+
// circleProgress
|
|
405
|
+
$circleprogress-primary-color: $primary-color !default;
|
|
406
|
+
$circleprogress-path-color: #e5e9f2 !default;
|
|
407
|
+
$circleprogress-text-color: #000000 !default;
|
|
408
|
+
$circleprogress-text-size: $font-size-3 !default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
export interface AvatarProps {
|
|
3
|
-
size:
|
|
3
|
+
size: string;
|
|
4
4
|
icon: string;
|
|
5
5
|
shape: AvatarShape;
|
|
6
6
|
bgColor: string;
|
|
7
|
+
color: string;
|
|
7
8
|
prefixCls: string;
|
|
8
|
-
|
|
9
|
+
url: string;
|
|
9
10
|
className: string;
|
|
11
|
+
alt: string;
|
|
10
12
|
style: React.CSSProperties;
|
|
13
|
+
activeAvatar: (e: MouseEvent) => void;
|
|
14
|
+
onError: (e: any) => void;
|
|
11
15
|
}
|
|
12
|
-
export declare type AvatarSize = 'large' | 'normal' | 'small';
|
|
13
16
|
export declare type AvatarShape = 'round' | 'square';
|
|
14
17
|
export declare const Avatar: FunctionComponent<Partial<AvatarProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export interface AvatarGroupProps {
|
|
3
|
+
maxContent: string;
|
|
4
|
+
maxCount: string | number;
|
|
5
|
+
maxBgColor: string;
|
|
6
|
+
maxColor: string;
|
|
7
|
+
size: string;
|
|
8
|
+
shape: string;
|
|
9
|
+
span: string;
|
|
10
|
+
zIndex: string;
|
|
11
|
+
className: string;
|
|
12
|
+
style: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
export declare const AvatarGroup: FunctionComponent<Partial<AvatarGroupProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
2
|
export interface ButtonProps {
|
|
3
3
|
className: string;
|
|
4
4
|
color: string;
|
|
@@ -6,7 +6,7 @@ export interface ButtonProps {
|
|
|
6
6
|
plain: boolean;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
disabled: boolean;
|
|
9
|
-
style:
|
|
9
|
+
style: React.CSSProperties;
|
|
10
10
|
type: ButtonType;
|
|
11
11
|
size: ButtonSize;
|
|
12
12
|
block: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export interface IColor {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
2
5
|
export interface CircleProgressProps {
|
|
3
|
-
strokeInnerWidth: string | number;
|
|
4
6
|
progress: string | number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
strokeWidth?: string | number;
|
|
8
|
+
radius?: number | string;
|
|
9
|
+
strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined;
|
|
10
|
+
circleColor?: object | string;
|
|
11
|
+
pathColor?: string;
|
|
12
|
+
clockwise?: boolean;
|
|
13
|
+
className?: string;
|
|
8
14
|
}
|
|
9
|
-
export declare const CircleProgress: FunctionComponent<
|
|
15
|
+
export declare const CircleProgress: FunctionComponent<CircleProgressProps & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseLang } from '@/locales/base';
|
|
3
|
+
export interface ConfigProviderProps {
|
|
4
|
+
locale: BaseLang;
|
|
5
|
+
}
|
|
6
|
+
export declare const defaultConfigRef: {
|
|
7
|
+
current: ConfigProviderProps;
|
|
8
|
+
};
|
|
9
|
+
export declare const setDefaultConfig: (config: ConfigProviderProps) => void;
|
|
10
|
+
export declare const getDefaultConfig: () => ConfigProviderProps;
|
|
11
|
+
export declare const useConfig: () => ConfigProviderProps;
|
|
12
|
+
export declare const ConfigProvider: FunctionComponent<Partial<ConfigProviderProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -55,8 +55,9 @@ import CountDown from './countdown';
|
|
|
55
55
|
import Collapse from './collapse';
|
|
56
56
|
import CollapseItem from './collapseitem';
|
|
57
57
|
import AnimatingNumbers from './animatingnumbers';
|
|
58
|
+
import ConfigProvider from './configprovider';
|
|
58
59
|
import Address from './address';
|
|
59
60
|
import Barrage from './barrage';
|
|
60
61
|
import Signature from './signature';
|
|
61
62
|
import Card from './card';
|
|
62
|
-
export { Button, Cell, CellGroup, Icon, Overlay, Popup, Layout, Col, Row, Divider, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Address, Barrage, Signature, Card };
|
|
63
|
+
export { Button, Cell, CellGroup, Icon, Overlay, Popup, Layout, Col, Row, Divider, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, ConfigProvider, Address, Barrage, Signature, Card };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -11,18 +11,13 @@ export interface NotificationProps {
|
|
|
11
11
|
customClass: string;
|
|
12
12
|
size: string | number;
|
|
13
13
|
textAlignCenter: boolean;
|
|
14
|
-
loadingRotate: boolean;
|
|
15
14
|
bgColor: string;
|
|
16
15
|
cover: boolean;
|
|
17
16
|
coverColor: string;
|
|
18
17
|
closeOnClickOverlay: boolean;
|
|
19
18
|
onClose: () => void;
|
|
20
|
-
className?: string;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
show: boolean;
|
|
24
|
-
}
|
|
25
|
-
export default class Notification extends React.PureComponent<NotificationProps, State> {
|
|
20
|
+
export default class Notification extends React.PureComponent<NotificationProps> {
|
|
26
21
|
private closeTimer;
|
|
27
22
|
static newInstance: (properties: NotificationProps, callback: any) => void;
|
|
28
23
|
constructor(props: NotificationProps);
|
|
@@ -34,4 +29,3 @@ export default class Notification extends React.PureComponent<NotificationProps,
|
|
|
34
29
|
componentWillUnmount(): void;
|
|
35
30
|
render(): JSX.Element;
|
|
36
31
|
}
|
|
37
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadOptions } from './upload';
|
|
3
|
+
export declare type FileType<T> = {
|
|
4
|
+
[key: string]: T;
|
|
5
|
+
};
|
|
6
|
+
export declare type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
3
7
|
export interface UploaderProps {
|
|
4
8
|
url: string;
|
|
5
9
|
maximum: string | number;
|
|
6
10
|
maximize: number;
|
|
11
|
+
defaultFileList: FileType<string>[];
|
|
12
|
+
listType: string;
|
|
7
13
|
uploadIcon: string;
|
|
14
|
+
uploadIconSize: string | number;
|
|
8
15
|
name: string;
|
|
9
16
|
accept: string;
|
|
10
17
|
disabled: boolean;
|
|
@@ -45,10 +52,11 @@ export interface UploaderProps {
|
|
|
45
52
|
}) => void;
|
|
46
53
|
beforeUpload?: (file: File[]) => Promise<File[]>;
|
|
47
54
|
beforeDelete?: (file: FileItem, files: FileItem[]) => boolean;
|
|
55
|
+
fileItemClick?: (file: FileItem) => void;
|
|
48
56
|
}
|
|
49
|
-
export declare type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
50
57
|
export declare class FileItem {
|
|
51
58
|
status: FileItemStatus;
|
|
59
|
+
message: string;
|
|
52
60
|
uid: string;
|
|
53
61
|
name?: string;
|
|
54
62
|
url?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutui/nutui-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4-beta.2",
|
|
4
4
|
"style": "dist/style.css",
|
|
5
5
|
"main": "dist/nutui.react.umd.js",
|
|
6
6
|
"module": "dist/esm/nutui-react.es.js",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"build:css": "npm run generate:themes && vite build --config vite.config.build.css.ts && npm run build:replace ",
|
|
50
50
|
"build:replace": "npm run replace:scss",
|
|
51
51
|
"build:es": "npx rollup -c rollup.config.es.js",
|
|
52
|
-
"build": "
|
|
52
|
+
"build:locales": "vite build --config vite.config.build.locales.ts",
|
|
53
|
+
"build": "npm run checked && npm run test && vite build --config vite.config.build.ts && npm run build:es && npm run build:css && npm run build:loader-style && npm run build:types && npm run build:locales",
|
|
53
54
|
"build:site": "npm run checked && vite build --config vite.config.build.site.ts",
|
|
54
55
|
"lint": "eslint .",
|
|
55
56
|
"lint:fix": "eslint --fix .",
|
|
@@ -57,6 +58,9 @@
|
|
|
57
58
|
"prepare": "husky install",
|
|
58
59
|
"test": "jest"
|
|
59
60
|
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": "^14.18.0 || >=15.0.0"
|
|
63
|
+
},
|
|
60
64
|
"lint-staged": {
|
|
61
65
|
"*.md": "prettier --write",
|
|
62
66
|
"*.{ts,tsx,js,vue,scss}": "prettier --write"
|
|
@@ -65,7 +69,7 @@
|
|
|
65
69
|
"@babel/runtime": "^7.16.5",
|
|
66
70
|
"@bem-react/classname": "^1.5.10",
|
|
67
71
|
"@react-spring/web": "^9.3.2",
|
|
68
|
-
"@use-gesture/react": "
|
|
72
|
+
"@use-gesture/react": "10.2.9",
|
|
69
73
|
"classnames": "^2.3.1",
|
|
70
74
|
"react-router-dom": "^5.2.0",
|
|
71
75
|
"react-transition-group": "^4.4.2"
|
|
@@ -139,6 +143,7 @@
|
|
|
139
143
|
"typescript": "^4.1.2",
|
|
140
144
|
"unist-util-visit": "^4.1.0",
|
|
141
145
|
"vinyl-fs": "^3.0.3",
|
|
142
|
-
"vite": "^2.1.5"
|
|
146
|
+
"vite": "^2.1.5",
|
|
147
|
+
"vite-plugin-dts": "^1.1.1"
|
|
143
148
|
}
|
|
144
149
|
}
|