@nutui/nutui-react-taro 2.3.9 → 2.3.11
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 +22 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Audio/style/style.css +1 -1
- package/dist/esm/BackTop.js +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +4 -2
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/Col/style/style.css +1 -1
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Divider/style/style.css +1 -1
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +1 -1
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/FormItem.js +1 -1
- package/dist/esm/Grid/style/style.css +1 -1
- package/dist/esm/GridItem/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Indicator/style/style.css +1 -1
- package/dist/esm/Input.js +1 -1
- package/dist/esm/InputNumber.js +1 -1
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Price/style/style.css +1 -1
- package/dist/esm/Radio/style/style.css +1 -1
- package/dist/esm/RadioGroup/style/style.css +1 -1
- package/dist/esm/Range/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +1 -1
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Skeleton.js +1 -1
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Switch/style/style.css +1 -1
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/{actionsheet.taro-6NiOrNyd.js → actionsheet.taro-kKhb0Vwt.js} +1 -1
- package/dist/esm/{address.taro-B54ZOtmo.js → address.taro-zQuxQEce.js} +1 -1
- package/dist/esm/{backtop.taro-Y3vOJiXq.js → backtop.taro-Cfld7ina.js} +1 -1
- package/dist/esm/barrage.taro-6nbq7wtt.js +118 -0
- package/dist/esm/{cascader.taro-BxyK5ybo.js → cascader.taro-M2nZWxiB.js} +1 -1
- package/dist/esm/{formitem.taro-atY4A0pS.js → formitem.taro-viaUkMmm.js} +42 -13
- package/dist/esm/{input.taro-YoPsV-op.js → input.taro-xCoGdppk.js} +4 -1
- package/dist/esm/inputnumber.taro-WPpS0Xl9.js +169 -0
- package/dist/esm/nutui-react.es.js +12 -12
- package/dist/esm/{shortpassword.taro-bZCwIpEn.js → shortpassword.taro-JBWXzk6I.js} +19 -6
- package/dist/esm/{skeleton.taro-Pg7WtP0e.js → skeleton.taro--AtiA7MK.js} +2 -2
- package/dist/esm/{sticky.taro-MmKUU2Wv.js → sticky.taro-p-evMNR-.js} +1 -1
- package/dist/esm/{tabs.taro-w8ra49Qb.js → tabs.taro-Yj7vgtSg.js} +1 -1
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +6 -2
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +15 -15
- package/dist/esm/types/src/packages/inputnumber/inputnumber.taro.d.ts +15 -17
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/types.d.ts +4 -0
- 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 +277 -247
- package/dist/nutui.react.umd.js +277 -247
- package/dist/packages/animate/animate.scss +0 -27
- package/dist/packages/audio/audio.scss +0 -5
- package/dist/packages/avatarcropper/avatarcropper.scss +0 -2
- package/dist/packages/badge/badge.scss +7 -0
- package/dist/packages/barrage/barrage.scss +23 -4
- package/dist/packages/button/button.scss +0 -1
- package/dist/packages/calendar/calendar.scss +4 -4
- package/dist/packages/calendarcard/calendarcard.scss +0 -1
- package/dist/packages/cascader/cascader.scss +0 -1
- package/dist/packages/checkbox/checkbox.scss +0 -2
- package/dist/packages/checkboxgroup/checkboxgroup.scss +1 -3
- package/dist/packages/col/col.scss +2 -2
- package/dist/packages/collapseitem/collapseitem.scss +2 -3
- package/dist/packages/dialog/dialog.scss +4 -0
- package/dist/packages/divider/divider.scss +1 -1
- package/dist/packages/fixednav/fixednav.scss +0 -2
- package/dist/packages/form/form.scss +24 -26
- package/dist/packages/formitem/formitem.scss +0 -1
- package/dist/packages/grid/grid.scss +1 -1
- package/dist/packages/griditem/griditem.scss +28 -26
- package/dist/packages/imagepreview/imagepreview.scss +0 -1
- package/dist/packages/indicator/indicator.scss +2 -3
- package/dist/packages/menu/menu.scss +0 -7
- package/dist/packages/menuitem/menuitem.scss +14 -10
- package/dist/packages/navbar/navbar.scss +3 -5
- package/dist/packages/noticebar/noticebar.scss +20 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +25 -18
- package/dist/packages/pagination/pagination.scss +0 -2
- package/dist/packages/picker/picker.scss +9 -0
- package/dist/packages/popover/popover.scss +0 -4
- package/dist/packages/popup/popup.scss +4 -19
- package/dist/packages/price/price.scss +1 -0
- package/dist/packages/radio/radio.scss +0 -1
- package/dist/packages/radiogroup/radiogroup.scss +10 -1
- package/dist/packages/range/range.scss +127 -127
- package/dist/packages/rate/rate.scss +0 -1
- package/dist/packages/searchbar/searchbar.scss +3 -2
- package/dist/packages/shortpassword/shortpassword.scss +4 -0
- package/dist/packages/skeleton/skeleton.scss +13 -3
- package/dist/packages/space/space.scss +0 -1
- package/dist/packages/step/step.scss +21 -25
- package/dist/packages/swipe/swipe.scss +0 -15
- package/dist/packages/swiper/swiper.scss +0 -1
- package/dist/packages/switch/switch.scss +11 -0
- package/dist/packages/table/table.scss +4 -5
- package/dist/packages/tabs/tabs.scss +16 -18
- package/dist/packages/tag/tag.scss +0 -1
- package/dist/packages/textarea/textarea.scss +1 -6
- package/dist/packages/timeselect/timeselect.scss +1 -6
- package/dist/packages/tour/tour.scss +1 -5
- package/dist/packages/trendarrow/trendarrow.scss +0 -1
- package/dist/packages/uploader/uploader.scss +0 -1
- package/dist/packages/virtuallist/virtuallist.scss +12 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables.scss +11 -7
- package/dist/types/packages/formitem/formitem.d.ts +6 -2
- package/dist/types/packages/formitem/formitem.taro.d.ts +14 -2
- package/dist/types/packages/inputnumber/inputnumber.d.ts +15 -15
- package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +28 -30
- package/dist/types/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/types/packages/shortpassword/types.d.ts +4 -0
- package/package.json +5 -5
- package/dist/esm/barrage.taro-HsivAhbE.js +0 -91
- package/dist/esm/inputnumber.taro-7QptygT3.js +0 -197
package/dist/style.mjs
CHANGED
|
@@ -1340,13 +1340,14 @@ $radio-button-disabled-active-color: var(
|
|
|
1340
1340
|
--nutui-radio-button-disabled-active-color,
|
|
1341
1341
|
$white
|
|
1342
1342
|
) !default;
|
|
1343
|
-
$radiogroup-radio-margin: var(
|
|
1343
|
+
$radiogroup-radio-margin: var(--nutui-radiogroup-radio-margin, 20px) !default;
|
|
1344
|
+
$radiogroup-radio-margin-bottom: var(
|
|
1344
1345
|
--nutui-radiogroup-radio-margin,
|
|
1345
|
-
|
|
1346
|
+
5px
|
|
1346
1347
|
) !default;
|
|
1347
1348
|
$radiogroup-radio-label-margin: var(
|
|
1348
1349
|
--nutui-radiogroup-radio-label-margin,
|
|
1349
|
-
0 5px
|
|
1350
|
+
0 5px
|
|
1350
1351
|
) !default;
|
|
1351
1352
|
|
|
1352
1353
|
// signature(✅)
|
|
@@ -1912,7 +1913,7 @@ $form-item-label-margin-right: var(
|
|
|
1912
1913
|
) !default;
|
|
1913
1914
|
$form-item-label-text-align: var(
|
|
1914
1915
|
--nutui-form-item-label-text-align,
|
|
1915
|
-
|
|
1916
|
+
start
|
|
1916
1917
|
) !default;
|
|
1917
1918
|
$form-item-required-margin-right: var(
|
|
1918
1919
|
--nutui-form-item-required-margin-right,
|
|
@@ -1924,17 +1925,20 @@ $form-item-body-font-size: var(
|
|
|
1924
1925
|
) !default;
|
|
1925
1926
|
$form-item-body-slots-text-align: var(
|
|
1926
1927
|
--nutui-form-item-body-slots-text-align,
|
|
1927
|
-
|
|
1928
|
+
start
|
|
1928
1929
|
) !default;
|
|
1929
1930
|
$form-item-body-input-text-align: var(
|
|
1930
1931
|
--nutui-form-item-body-input-text-align,
|
|
1931
|
-
|
|
1932
|
+
start
|
|
1932
1933
|
) !default;
|
|
1933
1934
|
$form-item-tip-font-size: var(
|
|
1934
1935
|
--nutui-form-item-tip-font-size,
|
|
1935
1936
|
$font-size-xs
|
|
1936
1937
|
) !default;
|
|
1937
|
-
$form-item-tip-text-align: var(
|
|
1938
|
+
$form-item-tip-text-align: var(
|
|
1939
|
+
--nutui-form-item-tip-text-align,
|
|
1940
|
+
start
|
|
1941
|
+
) !default;
|
|
1938
1942
|
|
|
1939
1943
|
// skeleton(✅)
|
|
1940
1944
|
$skeleton-background: var(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
required: boolean;
|
|
8
8
|
initialValue: any;
|
|
9
9
|
trigger: string;
|
|
@@ -12,6 +12,9 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
12
12
|
onClick: (event: React.MouseEvent, componentRef: React.MutableRefObject<any>) => void;
|
|
13
13
|
errorMessageAlign: TextAlign;
|
|
14
14
|
validateTrigger: string | string[];
|
|
15
|
+
shouldUpdate: boolean;
|
|
16
|
+
noStyle: boolean;
|
|
17
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
15
18
|
}
|
|
16
19
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
17
20
|
resetCount: number;
|
|
@@ -21,6 +24,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
21
24
|
context: React.ContextType<typeof Context>;
|
|
22
25
|
private cancelRegister;
|
|
23
26
|
private componentRef;
|
|
27
|
+
private eventOff;
|
|
24
28
|
constructor(props: FormItemProps);
|
|
25
29
|
componentDidMount(): void;
|
|
26
30
|
componentWillUnmount(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseFormField } from './types';
|
|
3
3
|
import { Context } from '../form/context';
|
|
4
4
|
import { BasicComponent } from '../../utils/typings';
|
|
5
5
|
type TextAlign = 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'match-parent';
|
|
6
|
-
export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
6
|
+
export interface FormItemProps extends Omit<BasicComponent, 'children'>, BaseFormField {
|
|
7
7
|
/**
|
|
8
8
|
* 必填表单项 label 的红色星标,仅用于控制样式
|
|
9
9
|
* @default false
|
|
@@ -44,6 +44,17 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
|
|
|
44
44
|
* @default onChange
|
|
45
45
|
*/
|
|
46
46
|
validateTrigger: string | string[]
|
|
47
|
+
/**
|
|
48
|
+
* 更新逻辑
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
shouldUpdate: boolean
|
|
52
|
+
/**
|
|
53
|
+
* 不使用样式,只使用字段管理
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
noStyle: boolean
|
|
57
|
+
children: ReactNode | ((obj: any) => React.ReactNode);
|
|
47
58
|
}
|
|
48
59
|
export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
49
60
|
resetCount: number;
|
|
@@ -53,6 +64,7 @@ export declare class FormItem extends React.Component<Partial<FormItemProps>, {
|
|
|
53
64
|
context: React.ContextType<typeof Context>;
|
|
54
65
|
private cancelRegister;
|
|
55
66
|
private componentRef;
|
|
67
|
+
private eventOff;
|
|
56
68
|
constructor(props: FormItemProps);
|
|
57
69
|
componentDidMount(): void;
|
|
58
70
|
componentWillUnmount(): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React, { FunctionComponent, ChangeEvent
|
|
1
|
+
import React, { FunctionComponent, ChangeEvent } from 'react';
|
|
2
2
|
import { BasicComponent } from '../../utils/typings';
|
|
3
3
|
export interface InputNumberProps extends BasicComponent {
|
|
4
|
+
value: number | string;
|
|
5
|
+
defaultValue: number | string;
|
|
6
|
+
allowEmpty: boolean;
|
|
7
|
+
min: number | string;
|
|
8
|
+
max: number | string;
|
|
4
9
|
disabled: boolean;
|
|
5
|
-
min: string | number;
|
|
6
|
-
max: string | number;
|
|
7
10
|
readOnly: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
allowEmpty: boolean;
|
|
11
|
-
step: string | number;
|
|
12
|
-
digits: string | number;
|
|
11
|
+
step: number;
|
|
12
|
+
digits: number;
|
|
13
13
|
async: boolean;
|
|
14
|
-
formatter?: (
|
|
15
|
-
onPlus: (e: MouseEvent) => void;
|
|
16
|
-
onMinus: (e: MouseEvent) => void;
|
|
17
|
-
onOverlimit: (e: MouseEvent) => void;
|
|
18
|
-
onBlur: (e:
|
|
19
|
-
onFocus: (e: FocusEvent<HTMLInputElement>) => void;
|
|
20
|
-
onChange: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
formatter?: (value?: string | number) => string;
|
|
15
|
+
onPlus: (e: React.MouseEvent) => void;
|
|
16
|
+
onMinus: (e: React.MouseEvent) => void;
|
|
17
|
+
onOverlimit: (e: React.MouseEvent) => void;
|
|
18
|
+
onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
19
|
+
onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
20
|
+
onChange: (param: string | number, e: React.MouseEvent | ChangeEvent<HTMLInputElement>) => void;
|
|
21
21
|
}
|
|
22
22
|
export declare const InputNumber: FunctionComponent<Partial<InputNumberProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'>>;
|
|
@@ -1,92 +1,90 @@
|
|
|
1
|
-
import React, { FunctionComponent, ChangeEvent
|
|
1
|
+
import React, { FunctionComponent, ChangeEvent } from 'react';
|
|
2
2
|
import { BasicComponent } from '../../utils/typings';
|
|
3
3
|
export interface InputNumberProps extends BasicComponent {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 当前值,受控值
|
|
6
|
+
* @default -
|
|
7
|
+
*/
|
|
8
|
+
value: number | string
|
|
9
|
+
/**
|
|
10
|
+
* 默认值
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
defaultValue: number | string
|
|
14
|
+
/**
|
|
15
|
+
* 是否允许内容为空
|
|
6
16
|
* @default false
|
|
7
17
|
*/
|
|
8
|
-
|
|
18
|
+
allowEmpty: boolean
|
|
9
19
|
/**
|
|
10
20
|
* 最小值限制
|
|
11
21
|
* @default 1
|
|
12
22
|
*/
|
|
13
|
-
min:
|
|
23
|
+
min: number | string
|
|
14
24
|
/**
|
|
15
25
|
* 最大值限制
|
|
16
26
|
* @default 9999
|
|
17
27
|
*/
|
|
18
|
-
max:
|
|
28
|
+
max: number | string
|
|
19
29
|
/**
|
|
20
|
-
*
|
|
30
|
+
* 禁用所有功能
|
|
21
31
|
* @default false
|
|
22
32
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 当前值,受控值
|
|
26
|
-
* @default -
|
|
27
|
-
*/
|
|
28
|
-
value: string | number
|
|
29
|
-
/**
|
|
30
|
-
* 默认值
|
|
31
|
-
* @default 0
|
|
32
|
-
*/
|
|
33
|
-
defaultValue: string | number
|
|
33
|
+
disabled: boolean
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* 只读状态禁用输入框操作行为
|
|
36
36
|
* @default false
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
readOnly: boolean
|
|
39
39
|
/**
|
|
40
40
|
* 步长
|
|
41
41
|
* @default 1
|
|
42
42
|
*/
|
|
43
|
-
step:
|
|
43
|
+
step: number
|
|
44
44
|
/**
|
|
45
45
|
* 设置保留的小数位
|
|
46
46
|
* @default 0
|
|
47
47
|
*/
|
|
48
|
-
digits:
|
|
48
|
+
digits: number
|
|
49
49
|
/**
|
|
50
50
|
* 支持异步修改
|
|
51
51
|
* @default false
|
|
52
52
|
*/
|
|
53
53
|
async: boolean
|
|
54
|
-
className: string;
|
|
55
|
-
style: React.CSSProperties;
|
|
56
54
|
/**
|
|
57
55
|
* 指定输入框展示值的格式
|
|
58
56
|
* @default -
|
|
59
57
|
*/
|
|
60
|
-
formatter?: (
|
|
58
|
+
formatter?: (value?: string | number) => string
|
|
61
59
|
/**
|
|
62
60
|
* 点击增加按钮时触发
|
|
63
61
|
* @default -
|
|
64
62
|
*/
|
|
65
|
-
onPlus: (e: MouseEvent) => void
|
|
63
|
+
onPlus: (e: React.MouseEvent) => void
|
|
66
64
|
/**
|
|
67
65
|
* 点击减少按钮时触发
|
|
68
66
|
* @default -
|
|
69
67
|
*/
|
|
70
|
-
onMinus: (e: MouseEvent) => void
|
|
68
|
+
onMinus: (e: React.MouseEvent) => void
|
|
71
69
|
/**
|
|
72
70
|
* 点击不可用的按钮时触发
|
|
73
71
|
* @default -
|
|
74
72
|
*/
|
|
75
|
-
onOverlimit: (e: MouseEvent) => void
|
|
73
|
+
onOverlimit: (e: React.MouseEvent) => void
|
|
76
74
|
/**
|
|
77
75
|
* 输入框失去焦点时触发
|
|
78
76
|
* @default -
|
|
79
77
|
*/
|
|
80
|
-
onBlur: (e:
|
|
78
|
+
onBlur: (e: React.FocusEvent<HTMLInputElement>) => void
|
|
81
79
|
/**
|
|
82
80
|
* 输入框获得焦点时触发
|
|
83
81
|
* @default -
|
|
84
82
|
*/
|
|
85
|
-
onFocus: (e: FocusEvent<HTMLInputElement>) => void
|
|
83
|
+
onFocus: (e: React.FocusEvent<HTMLInputElement>) => void
|
|
86
84
|
/**
|
|
87
85
|
* 值改变时触发
|
|
88
86
|
* @default -
|
|
89
87
|
*/
|
|
90
|
-
onChange: (param: string | number, e: MouseEvent | ChangeEvent<HTMLInputElement>) => void
|
|
88
|
+
onChange: (param: string | number, e: React.MouseEvent | ChangeEvent<HTMLInputElement>) => void
|
|
91
89
|
}
|
|
92
90
|
export declare const InputNumber: FunctionComponent<Partial<InputNumberProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/index';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
value: string;
|
|
@@ -19,4 +19,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
19
19
|
onTips: () => void;
|
|
20
20
|
onComplete: (value: string) => void;
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
23
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ForwardRefRenderFunction, ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../../packages/popup/popup.taro';
|
|
3
3
|
export interface ShortPasswordProps extends PopupProps {
|
|
4
4
|
/**
|
|
@@ -87,4 +87,5 @@ export interface ShortPasswordProps extends PopupProps {
|
|
|
87
87
|
*/
|
|
88
88
|
onComplete: (value: string) => void
|
|
89
89
|
}
|
|
90
|
-
export declare const
|
|
90
|
+
export declare const InternalShortPassword: ForwardRefRenderFunction<unknown, Partial<ShortPasswordProps>>;
|
|
91
|
+
export declare const ShortPassword: React.ForwardRefExoticComponent<Partial<ShortPasswordProps> & React.RefAttributes<unknown>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutui/nutui-react-taro",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"style": "dist/style.css",
|
|
5
5
|
"main": "dist/nutui.react.umd.js",
|
|
6
6
|
"module": "dist/esm/nutui-react.es.js",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"*.{ts,tsx,js,md}": "eslint"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@babel/runtime": "^7.
|
|
54
|
+
"@babel/runtime": "^7.23.9",
|
|
55
55
|
"@nutui/icons-react-taro": "^1.0.2",
|
|
56
56
|
"@nutui/touch-emulator": "^1.0.0",
|
|
57
57
|
"@react-spring/web": "~9.6.1",
|
|
58
58
|
"@use-gesture/react": "10.2.20",
|
|
59
59
|
"async-validator": "^4.2.5",
|
|
60
|
-
"classnames": "^2.
|
|
60
|
+
"classnames": "^2.5.1",
|
|
61
61
|
"lodash.isequal": "^4.5.0",
|
|
62
62
|
"lodash.kebabcase": "^4.1.1",
|
|
63
63
|
"react-transition-group": "^4.4.5"
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
67
67
|
},
|
|
68
68
|
"resolutions": {
|
|
69
|
-
"@types/react": "18",
|
|
70
|
-
"@types/react-dom": "18"
|
|
69
|
+
"@types/react": "^18.2.57",
|
|
70
|
+
"@types/react-dom": "^18.2.19"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React__default, { useState, useRef, useImperativeHandle, useEffect } from "react";
|
|
2
|
-
import { createSelectorQuery } from "@tarojs/taro";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
5
|
-
const defaultProps = {
|
|
6
|
-
...ComponentDefaults,
|
|
7
|
-
list: [],
|
|
8
|
-
interval: 500,
|
|
9
|
-
loop: true,
|
|
10
|
-
duration: 3e3,
|
|
11
|
-
rows: 3,
|
|
12
|
-
gapY: 10
|
|
13
|
-
};
|
|
14
|
-
const classPrefix = `nut-barrage`;
|
|
15
|
-
const InternalBarrage = (props, ref) => {
|
|
16
|
-
const { className, interval, loop, list, duration, rows, gapY, ...restProps } = {
|
|
17
|
-
...defaultProps,
|
|
18
|
-
...props
|
|
19
|
-
};
|
|
20
|
-
const [styleList, setStyleList] = useState([]);
|
|
21
|
-
const [baItemList, setBaItemList] = useState(list);
|
|
22
|
-
const barrageListSet = useRef(list);
|
|
23
|
-
const barrageBody = useRef(null);
|
|
24
|
-
const barrageContainer = useRef(null);
|
|
25
|
-
const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
|
|
26
|
-
const timer = useRef(0);
|
|
27
|
-
const classes = classNames(classPrefix, {
|
|
28
|
-
[`${classPrefix}-body${timeId.current}`]: true
|
|
29
|
-
}, className);
|
|
30
|
-
useImperativeHandle(ref, () => ({
|
|
31
|
-
add: (word) => {
|
|
32
|
-
barrageListSet.current = [...barrageListSet.current, word];
|
|
33
|
-
run();
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
barrageListSet.current = [...list];
|
|
38
|
-
run();
|
|
39
|
-
return () => {
|
|
40
|
-
clearInterval(timer.current);
|
|
41
|
-
};
|
|
42
|
-
}, [list]);
|
|
43
|
-
const run = () => {
|
|
44
|
-
setBaItemList(barrageListSet.current);
|
|
45
|
-
barrageListSet.current.forEach((item, index) => {
|
|
46
|
-
getNode(index);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const getNode = (index) => {
|
|
50
|
-
const query = createSelectorQuery();
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
let width = 100;
|
|
53
|
-
query.select(`.${classPrefix}-body${timeId.current}`).boundingClientRect((rec) => {
|
|
54
|
-
width = rec.width || 300;
|
|
55
|
-
});
|
|
56
|
-
query.select(`.${classPrefix}-item${index}`).boundingClientRect((recs) => {
|
|
57
|
-
const height = recs.height;
|
|
58
|
-
const nodeTop = `${index % rows * (height + gapY) + 20}px`;
|
|
59
|
-
styleInfo(index, nodeTop, width);
|
|
60
|
-
}).exec();
|
|
61
|
-
}, 500);
|
|
62
|
-
};
|
|
63
|
-
const styleInfo = (index, nodeTop, width) => {
|
|
64
|
-
const timeIndex = index - rows > 0 ? index - rows : 0;
|
|
65
|
-
const list2 = styleList;
|
|
66
|
-
const time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
|
|
67
|
-
const obj = {
|
|
68
|
-
top: nodeTop,
|
|
69
|
-
"--time": `${interval * index + time}`,
|
|
70
|
-
animationDuration: `${duration}ms`,
|
|
71
|
-
animationIterationCount: `${loop ? "infinite" : 1}`,
|
|
72
|
-
animationDelay: `${interval * index + time}ms`,
|
|
73
|
-
"--move-distance": `-${width}px`
|
|
74
|
-
};
|
|
75
|
-
list2.push(obj);
|
|
76
|
-
setStyleList([...list2]);
|
|
77
|
-
};
|
|
78
|
-
return React__default.createElement(
|
|
79
|
-
"div",
|
|
80
|
-
{ className: classes, ref: barrageBody, ...restProps },
|
|
81
|
-
React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
|
|
82
|
-
return React__default.createElement("div", { className: `barrage-item ${classPrefix}-item${index} move`, style: styleList[index], key: index }, item.length > 8 ? `${item.substr(0, 8)}...` : item);
|
|
83
|
-
}))
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
87
|
-
Barrage.defaultProps = defaultProps;
|
|
88
|
-
Barrage.displayName = "NutBarrage";
|
|
89
|
-
export {
|
|
90
|
-
Barrage as B
|
|
91
|
-
};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import React__default, { useRef, useEffect } from "react";
|
|
2
|
-
import { Minus, Plus } from "@nutui/icons-react-taro";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import { u as usePropsValue } from "./use-props-value-vKr0R0AX.js";
|
|
5
|
-
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
...ComponentDefaults,
|
|
8
|
-
disabled: false,
|
|
9
|
-
min: 1,
|
|
10
|
-
max: 9999,
|
|
11
|
-
readOnly: false,
|
|
12
|
-
allowEmpty: false,
|
|
13
|
-
defaultValue: 0,
|
|
14
|
-
step: 1,
|
|
15
|
-
digits: 0,
|
|
16
|
-
async: false
|
|
17
|
-
};
|
|
18
|
-
const classPrefix = `nut-inputnumber`;
|
|
19
|
-
const InputNumber = (props) => {
|
|
20
|
-
const { children, disabled, min, max, readOnly, value, defaultValue, allowEmpty, digits, step, async, className, style, formatter, onPlus, onMinus, onOverlimit, onBlur, onFocus, onChange, ...restProps } = {
|
|
21
|
-
...defaultProps,
|
|
22
|
-
...props
|
|
23
|
-
};
|
|
24
|
-
const inputRef = useRef("");
|
|
25
|
-
const [_checked, setChecked] = usePropsValue({
|
|
26
|
-
value,
|
|
27
|
-
defaultValue
|
|
28
|
-
});
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (formatter) {
|
|
31
|
-
if (_checked || _checked === 0) {
|
|
32
|
-
inputRef.current = formatter(_checked);
|
|
33
|
-
setChecked(formatter(_checked));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
const classes = classNames({
|
|
38
|
-
[`${classPrefix}`]: true,
|
|
39
|
-
[`${classPrefix}-disabled`]: disabled
|
|
40
|
-
}, className);
|
|
41
|
-
const styles = {
|
|
42
|
-
...style
|
|
43
|
-
};
|
|
44
|
-
const addAllow = (value2 = _checked) => {
|
|
45
|
-
if (formatter) {
|
|
46
|
-
const numValue = String(value2).replace(/[^0-9|.]/gi, "");
|
|
47
|
-
return Number(numValue) < Number(max) && !disabled;
|
|
48
|
-
}
|
|
49
|
-
return Number(value2) < Number(max) && !disabled;
|
|
50
|
-
};
|
|
51
|
-
const reduceAllow = (value2 = _checked) => {
|
|
52
|
-
if (formatter) {
|
|
53
|
-
const numValue = String(value2).replace(/[^0-9|.]/gi, "");
|
|
54
|
-
return Number(numValue) > Number(min) && !disabled;
|
|
55
|
-
}
|
|
56
|
-
return Number(value2) > Number(min) && !disabled;
|
|
57
|
-
};
|
|
58
|
-
const iconMinusClasses = classNames("nut-inputnumber-icon icon-minus", {
|
|
59
|
-
"nut-inputnumber-icon-disabled": !reduceAllow()
|
|
60
|
-
});
|
|
61
|
-
const iconAddClasses = classNames("nut-inputnumber-icon icon-plus", {
|
|
62
|
-
"nut-inputnumber-icon-disabled": !addAllow()
|
|
63
|
-
});
|
|
64
|
-
const fixedDecimalPlaces = (v) => {
|
|
65
|
-
return Number(v).toFixed(Number(digits));
|
|
66
|
-
};
|
|
67
|
-
const emitChange = (value2, e) => {
|
|
68
|
-
const outputValue = fixedDecimalPlaces(value2);
|
|
69
|
-
onChange && onChange(outputValue, e);
|
|
70
|
-
if (!async) {
|
|
71
|
-
if (Number(outputValue) < Number(min)) {
|
|
72
|
-
formatter ? setChecked(formatter(Number(min))) : setChecked(Number(min));
|
|
73
|
-
} else if (Number(outputValue) > Number(max)) {
|
|
74
|
-
formatter ? setChecked(formatter(Number(max))) : setChecked(Number(max));
|
|
75
|
-
} else {
|
|
76
|
-
formatter ? setChecked(formatter(outputValue)) : setChecked(outputValue);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const reduceNumber = (e) => {
|
|
81
|
-
onMinus && onMinus(e);
|
|
82
|
-
if (reduceAllow()) {
|
|
83
|
-
if (formatter) {
|
|
84
|
-
const numValue = String(_checked).replace(/[^0-9|.]/gi, "");
|
|
85
|
-
const outputValue = Number(numValue) - Number(step);
|
|
86
|
-
inputRef.current = formatter(outputValue);
|
|
87
|
-
emitChange(outputValue, e);
|
|
88
|
-
} else {
|
|
89
|
-
const outputValue = Number(_checked) - Number(step);
|
|
90
|
-
emitChange(outputValue, e);
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
onOverlimit && onOverlimit(e);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const addNumber = (e) => {
|
|
97
|
-
onPlus && onPlus(e);
|
|
98
|
-
if (addAllow()) {
|
|
99
|
-
if (formatter) {
|
|
100
|
-
const numValue = String(_checked).replace(/[^0-9|.]/gi, "");
|
|
101
|
-
const outputValue = Number(numValue) + Number(step);
|
|
102
|
-
inputRef.current = formatter(outputValue);
|
|
103
|
-
emitChange(outputValue, e);
|
|
104
|
-
} else {
|
|
105
|
-
const outputValue = Number(_checked) + Number(step);
|
|
106
|
-
emitChange(outputValue, e);
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
onOverlimit && onOverlimit(e);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const changeValue = (e) => {
|
|
113
|
-
const input = e.target;
|
|
114
|
-
onChange && onChange(input.value, e);
|
|
115
|
-
if (!async) {
|
|
116
|
-
setChecked(input.value);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const changeFormatValue = (e) => {
|
|
120
|
-
const input = e.target.value;
|
|
121
|
-
const numReg = /^[0-9]*$/;
|
|
122
|
-
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
123
|
-
if (formatter) {
|
|
124
|
-
if (!numReg.test(input[0]) && numValue) {
|
|
125
|
-
setChecked(formatter(numValue));
|
|
126
|
-
} else if (!numReg.test(input[0]) && !numValue) {
|
|
127
|
-
setChecked(input);
|
|
128
|
-
} else if (numReg.test(input[0])) {
|
|
129
|
-
if (formatter(numValue) === inputRef.current) {
|
|
130
|
-
setChecked(numValue);
|
|
131
|
-
} else {
|
|
132
|
-
setChecked(formatter(numValue));
|
|
133
|
-
inputRef.current = formatter(numValue);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
const burFormatValue = (e) => {
|
|
139
|
-
const input = e.target.value;
|
|
140
|
-
const numReg = /^[0-9]*$/;
|
|
141
|
-
const numValue = input.replace(/[^0-9|.]/gi, "");
|
|
142
|
-
if (formatter) {
|
|
143
|
-
if (formatter(numValue) === input) {
|
|
144
|
-
emitChange(numValue, e);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (!numReg.test(input) || !input) {
|
|
148
|
-
setChecked(formatter(""));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const focusValue = (e) => {
|
|
153
|
-
if (disabled)
|
|
154
|
-
return;
|
|
155
|
-
if (readOnly)
|
|
156
|
-
return;
|
|
157
|
-
onFocus && onFocus(e);
|
|
158
|
-
};
|
|
159
|
-
const burValue = (e) => {
|
|
160
|
-
if (disabled)
|
|
161
|
-
return;
|
|
162
|
-
if (readOnly)
|
|
163
|
-
return;
|
|
164
|
-
const input = e.target;
|
|
165
|
-
let value2 = +input.value;
|
|
166
|
-
if (value2 === 0 && !allowEmpty) {
|
|
167
|
-
value2 = Number(defaultValue);
|
|
168
|
-
}
|
|
169
|
-
if (value2 < Number(min)) {
|
|
170
|
-
value2 = Number(min);
|
|
171
|
-
} else if (value2 > Number(max)) {
|
|
172
|
-
value2 = Number(max);
|
|
173
|
-
}
|
|
174
|
-
emitChange(value2, e);
|
|
175
|
-
onBlur && onBlur(e);
|
|
176
|
-
};
|
|
177
|
-
return React__default.createElement(
|
|
178
|
-
"div",
|
|
179
|
-
{ className: classes, style: styles, ...restProps },
|
|
180
|
-
React__default.createElement(
|
|
181
|
-
"div",
|
|
182
|
-
{ className: "nut-input-minus" },
|
|
183
|
-
React__default.createElement(Minus, { className: iconMinusClasses, onClick: (e) => reduceNumber(e) })
|
|
184
|
-
),
|
|
185
|
-
React__default.createElement(React__default.Fragment, null, formatter ? React__default.createElement("input", { className: "nut-number-input", type: "text", min, max, disabled, readOnly, value: _checked, onInput: changeFormatValue, onBlur: burFormatValue, onFocus: focusValue }) : React__default.createElement("input", { className: "nut-number-input", type: "digit", min, max, disabled, readOnly, value: _checked, onInput: changeValue, onBlur: burValue, onFocus: focusValue })),
|
|
186
|
-
React__default.createElement(
|
|
187
|
-
"div",
|
|
188
|
-
{ className: "nut-input-add" },
|
|
189
|
-
React__default.createElement(Plus, { className: iconAddClasses, onClick: (e) => addNumber(e) })
|
|
190
|
-
)
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
|
-
InputNumber.defaultProps = defaultProps;
|
|
194
|
-
InputNumber.displayName = "NutInputNumber";
|
|
195
|
-
export {
|
|
196
|
-
InputNumber as I
|
|
197
|
-
};
|