@nutui/nutui-react 2.7.6 → 2.7.8
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 +29 -7
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Animate.js +6 -9
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +2 -2
- package/dist/esm/CalendarCard.js +4 -4
- package/dist/esm/CalendarItem.js +177 -180
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/DatePicker.js +8 -0
- package/dist/esm/Empty.js +1 -1
- package/dist/esm/Form.js +2 -1
- package/dist/esm/TabPane.js +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/date.js +109 -181
- package/dist/esm/formitem2.js +121 -31
- package/dist/esm/tabs2.js +26 -42
- 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 +477 -517
- package/dist/nutui.react.umd.js +477 -517
- package/dist/packages/animate/animate.scss +63 -105
- package/dist/packages/calendar/calendar.scss +9 -9
- package/dist/packages/tabs/tabs.scss +72 -115
- package/dist/style.css +1 -1
- package/dist/types/packages/animate/animate.taro.d.ts +2 -1
- package/dist/types/packages/form/__tests__/merge.spec.d.ts +1 -0
- package/dist/types/packages/form/index.d.ts +2 -1
- package/dist/types/packages/form/index.taro.d.ts +2 -1
- package/dist/types/packages/form/useform.d.ts +2 -1
- package/dist/types/packages/form/useform.taro.d.ts +2 -1
- package/dist/types/utils/date.d.ts +54 -52
- package/dist/types/utils/merge.d.ts +14 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { default as React, FunctionComponent } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
2
3
|
import { AnimateType, AnimateAction } from './types';
|
|
3
4
|
import { BasicComponent } from '../../utils/typings';
|
|
4
5
|
export interface AnimateProps extends BasicComponent {
|
|
5
6
|
type: AnimateType;
|
|
6
7
|
action: AnimateAction;
|
|
7
8
|
loop: boolean;
|
|
8
|
-
onClick: (event: React.MouseEvent<
|
|
9
|
+
onClick: (event: React.MouseEvent<Element, MouseEvent> | ITouchEvent) => void;
|
|
9
10
|
}
|
|
10
11
|
export declare const Animate: FunctionComponent<Partial<AnimateProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,11 +2,12 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { FormProps } from './form';
|
|
3
3
|
import { FormItem } from '../formitem/formitem';
|
|
4
4
|
import { FormInstance } from './types';
|
|
5
|
-
import { useForm } from './useform';
|
|
5
|
+
import { useForm, useWatch } from './useform';
|
|
6
6
|
export type { FormItemRuleWithoutValidator, FormInstance, FormFieldEntity, } from './types';
|
|
7
7
|
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<FormProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<FormInstance>> & {
|
|
8
8
|
Item: typeof FormItem;
|
|
9
9
|
useForm: typeof useForm;
|
|
10
|
+
useWatch: typeof useWatch;
|
|
10
11
|
};
|
|
11
12
|
declare const InnerForm: CompoundedComponent;
|
|
12
13
|
export default InnerForm;
|
|
@@ -2,11 +2,12 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { FormProps } from './form.taro';
|
|
3
3
|
import { FormItem } from '../formitem/formitem.taro';
|
|
4
4
|
import { FormInstance } from './types';
|
|
5
|
-
import { useForm } from './useform.taro';
|
|
5
|
+
import { useForm, useWatch } from './useform.taro';
|
|
6
6
|
export type { FormItemRuleWithoutValidator, FormInstance, FormFieldEntity, } from './types';
|
|
7
7
|
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<FormProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<FormInstance>> & {
|
|
8
8
|
Item: typeof FormItem;
|
|
9
9
|
useForm: typeof useForm;
|
|
10
|
+
useWatch: typeof useWatch;
|
|
10
11
|
};
|
|
11
12
|
declare const InnerForm: CompoundedComponent;
|
|
12
13
|
export default InnerForm;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { FormInstance } from './types';
|
|
1
|
+
import { FormInstance, NamePath } from './types';
|
|
2
2
|
export declare const SECRET = "NUT_FORM_INTERNAL";
|
|
3
3
|
export declare const useForm: (form?: FormInstance) => [FormInstance];
|
|
4
|
+
export declare const useWatch: (path: NamePath, form: FormInstance) => any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { FormInstance } from './types';
|
|
1
|
+
import { FormInstance, NamePath } from './types';
|
|
2
2
|
export declare const SECRET = "NUT_FORM_INTERNAL";
|
|
3
3
|
export declare const useForm: (form?: FormInstance) => [FormInstance];
|
|
4
|
+
export declare const useWatch: (path: NamePath, form: FormInstance) => any;
|
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 判断是否为闰年
|
|
3
|
+
* 规则:
|
|
4
|
+
* 1. 能被4整除但不能被100整除,或
|
|
5
|
+
* 2. 能被400整除
|
|
6
|
+
* @param {number} y - 年份
|
|
7
|
+
* @return {Boolse} true|false
|
|
8
|
+
*/
|
|
9
|
+
export declare const isLeapYear: (y: number) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 返回星期数
|
|
12
|
+
* @return {String}
|
|
13
|
+
*/
|
|
14
|
+
export declare const getWhatDay: (year: number, month: number, day: number) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 返回上一个月在当前面板中的天数
|
|
17
|
+
* @return {Number}
|
|
18
|
+
*/
|
|
19
|
+
export declare const getMonthPreDay: (year: number, month: number) => number;
|
|
20
|
+
/**
|
|
21
|
+
* 返回月份天数
|
|
22
|
+
* @return {Number}
|
|
23
|
+
*/
|
|
24
|
+
export declare const getMonthDays: (year: string, month: string) => number;
|
|
25
|
+
/**
|
|
26
|
+
* 补齐数字位数
|
|
27
|
+
* @return {string}
|
|
28
|
+
*/
|
|
29
|
+
export declare const getNumTwoBit: (n: number) => string;
|
|
30
|
+
/**
|
|
31
|
+
* 日期对象转成字符串
|
|
32
|
+
* @return {string}
|
|
33
|
+
*/
|
|
34
|
+
export declare const date2Str: (date: Date, split?: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* 返回日期格式字符串
|
|
37
|
+
* @param {Number} 0返回今天的日期、1返回明天的日期,2返回后天得日期,依次类推
|
|
38
|
+
* @return {string} '2014-12-31'
|
|
39
|
+
*/
|
|
40
|
+
export declare const getDateString: (offset?: number) => string;
|
|
41
|
+
/**
|
|
42
|
+
* 时间比较
|
|
43
|
+
* @return {Boolean}
|
|
44
|
+
*/
|
|
45
|
+
export declare const compareDate: (date1: string, date2: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 时间是否相等
|
|
48
|
+
* @return {Boolean}
|
|
49
|
+
*/
|
|
50
|
+
export declare const isEqual: (date1: string, date2: string) => boolean;
|
|
51
|
+
export declare const getMonthWeek: (year: number, month: number, date: number, firstDayOfWeek?: number) => number;
|
|
52
|
+
export declare const getYearWeek: (year: number, month: number, date: number, firstDayOfWeek?: number) => number;
|
|
53
|
+
export declare const getWeekDate: (year: string, month: string, date: string, firstDayOfWeek?: number) => string[];
|
|
54
|
+
export declare const formatResultDate: (date: string) => string[];
|
|
53
55
|
export declare const getCurrMonthData: (type: string, year: number, month: number) => (string | number)[];
|
|
54
56
|
export declare const getDaysStatus: (type: string, year: number, month: number) => {
|
|
55
57
|
day: number;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default main;
|
|
2
|
+
export declare function main(clone: boolean, ...items: any[]): any;
|
|
3
|
+
export declare function main(...items: any[]): any;
|
|
4
|
+
export declare namespace main {
|
|
5
|
+
var clone: typeof import("./merge").clone;
|
|
6
|
+
var isPlainObject: typeof import("./merge").isPlainObject;
|
|
7
|
+
var recursive: typeof import("./merge").recursive;
|
|
8
|
+
}
|
|
9
|
+
export declare function merge(clone: boolean, ...items: any[]): any;
|
|
10
|
+
export declare function merge(...items: any[]): any;
|
|
11
|
+
export declare function recursive(clone: boolean, ...items: any[]): any;
|
|
12
|
+
export declare function recursive(...items: any[]): any;
|
|
13
|
+
export declare function clone<T>(input: T): T;
|
|
14
|
+
export declare function isPlainObject(input: unknown): input is NonNullable<any>;
|