@nutui/nutui-react 2.0.15 → 2.0.17-beta.0
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 +28 -0
- package/dist/esm/Audio.js +1 -2
- package/dist/esm/Avatar.js +2 -2
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/Cell.js +5 -3
- package/dist/esm/CellGroup.js +6 -1
- package/dist/esm/Dialog.js +4 -3
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +65 -10
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/Picker.js +4 -6
- package/dist/esm/SideNavBar.js +1 -1
- package/dist/esm/Step.js +1 -1
- package/dist/esm/Steps.js +1 -1
- package/dist/esm/SubSideNavBar.js +1 -1
- package/dist/esm/Swiper.js +1 -1
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/Table.js +4 -4
- package/dist/esm/VirtualList.js +3 -4
- package/dist/esm/cascader2.js +3 -3
- package/dist/esm/context.js +2 -16
- package/dist/esm/context2.js +16 -2
- package/dist/esm/context3.js +2 -2
- package/dist/esm/context5.js +5 -0
- package/dist/esm/formitem2.js +29 -9
- package/dist/esm/overlay2.js +4 -1
- package/dist/esm/popup2.js +3 -0
- package/dist/esm/types/src/packages/cascader/cascader.d.ts +2 -1
- package/dist/esm/types/src/packages/cascader/cascader.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/cellgroup/context.d.ts +5 -0
- package/dist/esm/types/src/packages/dialog/config.d.ts +2 -1
- package/dist/esm/types/src/packages/dialog/content.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/form/form.d.ts +4 -8
- package/dist/esm/types/src/packages/form/form.taro.d.ts +4 -8
- package/dist/esm/types/src/packages/form/index.d.ts +11 -2
- package/dist/esm/types/src/packages/form/index.taro.d.ts +11 -2
- package/dist/esm/types/src/packages/form/types.d.ts +2 -0
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +1 -0
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/swipe/swipe.taro.d.ts +5 -4
- package/dist/esm/types/src/packages/table/types.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +3 -6
- package/dist/esm/types/src/packages/virtuallist/utils.d.ts +1 -1
- package/dist/esm/types/src/utils/get-rect-by-taro.d.ts +12 -0
- package/dist/esm/types/src/utils/use-client-rect.d.ts +3 -9
- package/dist/esm/types/src/utils/use-custom-event.d.ts +1 -1
- package/dist/esm/types/src/utils/use-uuid.d.ts +1 -0
- package/dist/locales/src/locales/base.js +5 -0
- package/dist/locales/{en-US.js → src/locales/en-US.js} +1 -1
- package/dist/locales/{id-ID.js → src/locales/id-ID.js} +1 -1
- package/dist/locales/{tr-TR.js → src/locales/tr-TR.js} +1 -1
- package/dist/locales/{zh-CN.js → src/locales/zh-CN.js} +1 -1
- package/dist/locales/{zh-TW.js → src/locales/zh-TW.js} +1 -1
- package/dist/locales/{zh-UG.js → src/locales/zh-UG.js} +1 -1
- package/dist/nutui.react.es.js +254 -127
- package/dist/nutui.react.umd.js +254 -127
- package/dist/packages/form/form.scss +9 -1
- package/dist/packages/formitem/formitem.scss +0 -11
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/cascader/cascader.d.ts +2 -1
- package/dist/types/packages/cellgroup/context.d.ts +5 -0
- package/dist/types/packages/dialog/config.d.ts +2 -1
- package/dist/types/packages/form/form.d.ts +4 -8
- package/dist/types/packages/form/index.d.ts +11 -2
- package/dist/types/packages/form/types.d.ts +2 -0
- package/dist/types/packages/formitem/formitem.d.ts +5 -0
- package/dist/types/packages/table/types.d.ts +1 -1
- package/dist/types/packages/virtuallist/utils.d.ts +1 -1
- package/dist/types/utils/use-client-rect.d.ts +3 -9
- package/package.json +1 -1
- package/dist/locales/base.js +0 -5
package/dist/style.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/popup';
|
|
3
3
|
import { CascaderOption, CascaderValue, CascaderOptionKey } from './types';
|
|
4
|
-
export interface CascaderProps extends PopupProps {
|
|
4
|
+
export interface CascaderProps extends Pick<PopupProps, 'className' | 'style' | 'closeIcon' | 'closeable' | 'title' | 'left' | 'closeIconPosition' | 'onClose'> {
|
|
5
5
|
/**
|
|
6
6
|
* 是否弹窗状态展示
|
|
7
7
|
* @default true
|
|
8
8
|
*/
|
|
9
9
|
popup: boolean
|
|
10
|
+
popupProps: Partial<Omit<PopupProps, 'closeIcon' | 'closeable' | 'title' | 'left' | 'closeIconPosition' | 'onClose'>>;
|
|
10
11
|
/**
|
|
11
12
|
* 级联显示隐藏状态
|
|
12
13
|
* @default false
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode, ForwardRefExoticComponent, PropsWithChildren } from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
+
import { BasicComponent } from '../../utils/typings';
|
|
3
4
|
export type DialogConfigType = {
|
|
4
5
|
prefixCls?: string;
|
|
5
6
|
simple?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export interface BasicDialogProps {
|
|
8
|
+
export interface BasicDialogProps extends BasicComponent {
|
|
8
9
|
visible?: boolean;
|
|
9
10
|
title?: ReactNode;
|
|
10
11
|
content?: ReactNode;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { useForm } from './useform';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
3
2
|
import { BasicComponent } from '../../utils/typings';
|
|
4
|
-
import {
|
|
3
|
+
import { FormInstance } from '../../packages/form/types';
|
|
5
4
|
export interface FormProps extends BasicComponent {
|
|
6
5
|
/**
|
|
7
6
|
* 表单底部区域,一般放置确认和重置按钮
|
|
@@ -23,6 +22,7 @@ export interface FormProps extends BasicComponent {
|
|
|
23
22
|
* @default -
|
|
24
23
|
*/
|
|
25
24
|
form: any
|
|
25
|
+
divider: boolean;
|
|
26
26
|
/**
|
|
27
27
|
* 表单项 label 的位置
|
|
28
28
|
* @default right
|
|
@@ -44,8 +44,4 @@ export interface FormProps extends BasicComponent {
|
|
|
44
44
|
*/
|
|
45
45
|
onFinishFailed: (values: any, errorFields: any) => void
|
|
46
46
|
}
|
|
47
|
-
export declare const Form:
|
|
48
|
-
Item: typeof FormItem;
|
|
49
|
-
} & {
|
|
50
|
-
useForm: typeof useForm;
|
|
51
|
-
};
|
|
47
|
+
export declare const Form: React.ForwardRefExoticComponent<Partial<FormProps> & React.RefAttributes<FormInstance<any>>>;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps } from './form';
|
|
3
|
+
import { FormItem } from '../formitem/formitem';
|
|
4
|
+
import { FormInstance } from './types';
|
|
5
|
+
import { useForm } from '../../packages/form/useform';
|
|
2
6
|
export type { FormItemRuleWithoutValidator, StoreValue, NamePath, FormInstance, FieldEntity, } from './types';
|
|
3
|
-
|
|
7
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<Partial<FormProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & React.RefAttributes<FormInstance>> & {
|
|
8
|
+
Item: typeof FormItem;
|
|
9
|
+
useForm: typeof useForm;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerForm: CompoundedComponent;
|
|
12
|
+
export default InnerForm;
|
|
@@ -17,6 +17,8 @@ export interface Store {
|
|
|
17
17
|
export interface FormInstance<Values = any> {
|
|
18
18
|
registerField: (entity: FieldEntity) => () => void;
|
|
19
19
|
getFieldValue: (name: NamePath) => StoreValue;
|
|
20
|
+
getFieldsValue: (name: NamePath) => StoreValue;
|
|
21
|
+
setInitialValues: (values: any, init: boolean) => void;
|
|
20
22
|
setFieldsValue: (value: any) => void;
|
|
21
23
|
resetFields: (fields?: NamePath[]) => void;
|
|
22
24
|
submit: () => void;
|
|
@@ -39,6 +39,11 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
39
39
|
* @default left
|
|
40
40
|
*/
|
|
41
41
|
errorMessageAlign: TextAlign
|
|
42
|
+
/**
|
|
43
|
+
* 统一设置字段触发验证的时机
|
|
44
|
+
* @default string[]
|
|
45
|
+
*/
|
|
46
|
+
validateTrigger: string | string[]
|
|
42
47
|
}
|
|
43
48
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
44
49
|
resetCount: number;
|
|
@@ -16,5 +16,5 @@ export interface TableColumnProps {
|
|
|
16
16
|
title?: string;
|
|
17
17
|
align?: string;
|
|
18
18
|
sorter?: ((a: any, b: any) => number) | boolean | string;
|
|
19
|
-
render?: (rowData
|
|
19
|
+
render?: (rowData: any, rowIndex: number) => string | React.ReactNode;
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
declare const binarySearch: (positionsList: Array<PositionType>,
|
|
4
|
+
declare const binarySearch: (positionsList: Array<PositionType>, horizontal: true | false, value?: number) => number;
|
|
5
5
|
declare const getEndIndex: ({ list, startIndex, visibleCount, itemEqual, positions, offSetSize, overscan, sizeKey, }: {
|
|
6
6
|
list: Array<Data>;
|
|
7
7
|
startIndex: number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const inBrowser: boolean;
|
|
2
|
+
export declare function isWindow(val: unknown): val is Window;
|
|
1
3
|
/**
|
|
2
4
|
获取元素的大小及其相对于视口的位置,等价于 Element.getBoundingClientRect。
|
|
3
5
|
width 宽度 number
|
|
@@ -7,12 +9,4 @@
|
|
|
7
9
|
right 右侧与视图窗口左上角的距离 number
|
|
8
10
|
bottom 底部与视图窗口左上角的距离 number
|
|
9
11
|
*/
|
|
10
|
-
export declare const getRect: (elementRef: Element | Window | undefined) =>
|
|
11
|
-
top: number;
|
|
12
|
-
left: number;
|
|
13
|
-
right: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
export declare const getRectByTaro: (element: any) => Promise<any>;
|
|
12
|
+
export declare const getRect: (elementRef: Element | Window | undefined) => any;
|
package/package.json
CHANGED