@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
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React__default, { useState, 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
|
+
readOnly: false,
|
|
10
|
+
allowEmpty: false,
|
|
11
|
+
min: 1,
|
|
12
|
+
max: 9999,
|
|
13
|
+
step: 1,
|
|
14
|
+
digits: 0,
|
|
15
|
+
async: false
|
|
16
|
+
};
|
|
17
|
+
const classPrefix = `nut-inputnumber`;
|
|
18
|
+
const InputNumber = (props) => {
|
|
19
|
+
const { children, disabled, min, max, readOnly, value, defaultValue, allowEmpty, digits, step, async, className, style, formatter, onPlus, onMinus, onOverlimit, onBlur, onFocus, onChange, ...restProps } = {
|
|
20
|
+
...defaultProps,
|
|
21
|
+
...props
|
|
22
|
+
};
|
|
23
|
+
const classes = classNames(classPrefix, {
|
|
24
|
+
[`${classPrefix}-disabled`]: disabled
|
|
25
|
+
});
|
|
26
|
+
const [focused, setFocused] = useState(false);
|
|
27
|
+
const inputRef = useRef(null);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
if (focused) {
|
|
31
|
+
(_b = (_a = inputRef.current) == null ? void 0 : _a.select) == null ? void 0 : _b.call(_a);
|
|
32
|
+
}
|
|
33
|
+
}, [focused]);
|
|
34
|
+
const [shadowValue, setShadowValue] = usePropsValue({
|
|
35
|
+
value: typeof value === "string" ? parseFloat(value) : value,
|
|
36
|
+
defaultValue: typeof defaultValue === "string" ? parseFloat(defaultValue) : defaultValue,
|
|
37
|
+
onChange: (value2) => {
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const bound = (value2, min2, max2) => {
|
|
41
|
+
let res = value2;
|
|
42
|
+
if (min2 !== void 0) {
|
|
43
|
+
res = Math.max(Number(min2), res);
|
|
44
|
+
}
|
|
45
|
+
if (max2 !== void 0) {
|
|
46
|
+
res = Math.min(Number(max2), res);
|
|
47
|
+
}
|
|
48
|
+
return res;
|
|
49
|
+
};
|
|
50
|
+
const format = (value2) => {
|
|
51
|
+
if (value2 === null)
|
|
52
|
+
return "";
|
|
53
|
+
if (typeof value2 === "string")
|
|
54
|
+
value2 = parseFloat(value2);
|
|
55
|
+
const fixedValue = bound(value2, Number(min), Number(max));
|
|
56
|
+
if (formatter) {
|
|
57
|
+
return formatter(fixedValue);
|
|
58
|
+
}
|
|
59
|
+
if (digits) {
|
|
60
|
+
return fixedValue.toFixed(digits).toString();
|
|
61
|
+
}
|
|
62
|
+
return fixedValue.toString();
|
|
63
|
+
};
|
|
64
|
+
const [inputValue, setInputValue] = useState(format(shadowValue));
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!focused && !async) {
|
|
67
|
+
setShadowValue(bound(Number(shadowValue), Number(min), Number(max)));
|
|
68
|
+
setInputValue(format(shadowValue));
|
|
69
|
+
}
|
|
70
|
+
}, [focused, shadowValue]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (async) {
|
|
73
|
+
setShadowValue(bound(Number(value), Number(min), Number(max)));
|
|
74
|
+
setInputValue(format(value));
|
|
75
|
+
}
|
|
76
|
+
}, [value]);
|
|
77
|
+
const calcNextValue = (current, step2, symbol) => {
|
|
78
|
+
const dig = digits + 1;
|
|
79
|
+
return (parseFloat(current || "0") * dig + parseFloat(step2) * dig * symbol) / dig;
|
|
80
|
+
};
|
|
81
|
+
const update = (negative, e) => {
|
|
82
|
+
if (step !== void 0) {
|
|
83
|
+
const shouldOverBoundary = calcNextValue(shadowValue, step, negative ? -1 : 1);
|
|
84
|
+
const nextValue = bound(shouldOverBoundary, Number(min), Number(max));
|
|
85
|
+
setShadowValue(nextValue);
|
|
86
|
+
if (negative ? shouldOverBoundary < min : shouldOverBoundary > max) {
|
|
87
|
+
onOverlimit == null ? void 0 : onOverlimit(e);
|
|
88
|
+
} else {
|
|
89
|
+
onChange == null ? void 0 : onChange(nextValue, e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const handleReduce = (e) => {
|
|
94
|
+
if (disabled)
|
|
95
|
+
return;
|
|
96
|
+
onMinus == null ? void 0 : onMinus(e);
|
|
97
|
+
update(true, e);
|
|
98
|
+
};
|
|
99
|
+
const handlePlus = (e) => {
|
|
100
|
+
if (disabled)
|
|
101
|
+
return;
|
|
102
|
+
onPlus == null ? void 0 : onPlus(e);
|
|
103
|
+
update(false, e);
|
|
104
|
+
};
|
|
105
|
+
const parseValue = (text) => {
|
|
106
|
+
if (text === "")
|
|
107
|
+
return null;
|
|
108
|
+
if (text === "-")
|
|
109
|
+
return null;
|
|
110
|
+
return text;
|
|
111
|
+
};
|
|
112
|
+
const handleInputChange = (e) => {
|
|
113
|
+
setInputValue(e.target.value);
|
|
114
|
+
const valueStr = parseValue(e.target.value);
|
|
115
|
+
if (valueStr === null) {
|
|
116
|
+
if (allowEmpty) {
|
|
117
|
+
setShadowValue(null);
|
|
118
|
+
} else {
|
|
119
|
+
setShadowValue(defaultValue);
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
setShadowValue(valueStr);
|
|
123
|
+
}
|
|
124
|
+
if (!async) {
|
|
125
|
+
onChange == null ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const handleFocus = (e) => {
|
|
129
|
+
setFocused(true);
|
|
130
|
+
setInputValue(shadowValue !== void 0 && shadowValue !== null ? bound(Number(shadowValue), Number(min), Number(max)).toString() : "");
|
|
131
|
+
onFocus && onFocus(e);
|
|
132
|
+
};
|
|
133
|
+
const handleBlur = (e) => {
|
|
134
|
+
setFocused(false);
|
|
135
|
+
onBlur && onBlur(e);
|
|
136
|
+
if (async) {
|
|
137
|
+
const valueStr = parseValue(e.target.value);
|
|
138
|
+
onChange == null ? void 0 : onChange(parseFloat(valueStr || "0").toFixed(digits), e);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
return React__default.createElement(
|
|
142
|
+
"div",
|
|
143
|
+
{ className: classes, style, ...restProps },
|
|
144
|
+
React__default.createElement(
|
|
145
|
+
"div",
|
|
146
|
+
{ className: "nut-input-minus" },
|
|
147
|
+
React__default.createElement(Minus, { className: classNames("nut-inputnumber-icon icon-minus", {
|
|
148
|
+
[`${classPrefix}-icon-disabled`]: shadowValue === min || disabled
|
|
149
|
+
}), onClick: handleReduce })
|
|
150
|
+
),
|
|
151
|
+
React__default.createElement(
|
|
152
|
+
React__default.Fragment,
|
|
153
|
+
null,
|
|
154
|
+
React__default.createElement("input", { className: "nut-number-input", type: "digit", ref: inputRef, inputMode: "decimal", disabled, readOnly, value: inputValue, onInput: handleInputChange, onBlur: handleBlur, onFocus: handleFocus })
|
|
155
|
+
),
|
|
156
|
+
React__default.createElement(
|
|
157
|
+
"div",
|
|
158
|
+
{ className: "nut-input-add" },
|
|
159
|
+
React__default.createElement(Plus, { className: classNames("nut-inputnumber-icon icon-plus", {
|
|
160
|
+
[`${classPrefix}-icon-disabled`]: shadowValue === max || disabled
|
|
161
|
+
}), onClick: handlePlus })
|
|
162
|
+
)
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
InputNumber.defaultProps = defaultProps;
|
|
166
|
+
InputNumber.displayName = "NutInputNumber";
|
|
167
|
+
export {
|
|
168
|
+
InputNumber as I
|
|
169
|
+
};
|
|
@@ -11,9 +11,9 @@ import { G as G2 } from "./griditem.taro-TJDJVeQy.js";
|
|
|
11
11
|
import { L } from "./layout.taro-lnN-wB0Y.js";
|
|
12
12
|
import { R } from "./row.taro-IxNlKKQM.js";
|
|
13
13
|
import { S } from "./space.taro-q3R_yq79.js";
|
|
14
|
-
import { S as S2 } from "./sticky.taro-
|
|
14
|
+
import { S as S2 } from "./sticky.taro-p-evMNR-.js";
|
|
15
15
|
import { S as S3 } from "./safearea.taro-afu_mY7g.js";
|
|
16
|
-
import { B as B2 } from "./backtop.taro-
|
|
16
|
+
import { B as B2 } from "./backtop.taro-Cfld7ina.js";
|
|
17
17
|
import { E } from "./elevator.taro-2nbUM3vH.js";
|
|
18
18
|
import { F } from "./fixednav.taro-QVBXysDj.js";
|
|
19
19
|
import { N } from "./navbar.taro-AuKPDCaW.js";
|
|
@@ -23,18 +23,18 @@ import { S as S6 } from "./subsidenavbar.taro-Zy52MDDG.js";
|
|
|
23
23
|
import { T } from "./tabbar.taro-QE0rjSKE.js";
|
|
24
24
|
import { T as T2 } from "./tabbaritem.taro-t9C07OYX.js";
|
|
25
25
|
import { T as T3 } from "./tabpane.taro-5k7wWimS.js";
|
|
26
|
-
import { T as T4 } from "./tabs.taro-
|
|
27
|
-
import { A } from "./address.taro-
|
|
26
|
+
import { T as T4 } from "./tabs.taro-Yj7vgtSg.js";
|
|
27
|
+
import { A } from "./address.taro-zQuxQEce.js";
|
|
28
28
|
import { C as C5 } from "./calendar.taro-iNNHje7V.js";
|
|
29
29
|
import { C as C6 } from "./calendaritem.taro-o6Z8OOGY.js";
|
|
30
30
|
import { C as C7 } from "./calendarcard.taro-9s7naGmU.js";
|
|
31
|
-
import { C as C8 } from "./cascader.taro-
|
|
31
|
+
import { C as C8 } from "./cascader.taro-M2nZWxiB.js";
|
|
32
32
|
import { C as C9, a } from "./checkbox.taro-xMxWdpyI.js";
|
|
33
33
|
import { D as D2 } from "./datepicker.taro-DrXkqJkN.js";
|
|
34
34
|
import { default as default2 } from "./Form.js";
|
|
35
|
-
import { F as F2 } from "./formitem.taro-
|
|
36
|
-
import { I as I2 } from "./input.taro-
|
|
37
|
-
import { I as I3 } from "./inputnumber.taro-
|
|
35
|
+
import { F as F2 } from "./formitem.taro-viaUkMmm.js";
|
|
36
|
+
import { I as I2 } from "./input.taro-xCoGdppk.js";
|
|
37
|
+
import { I as I3 } from "./inputnumber.taro-WPpS0Xl9.js";
|
|
38
38
|
import { M } from "./menu.taro-ODwHYGFM.js";
|
|
39
39
|
import { M as M2 } from "./menuitem.taro-9nyTDLpt.js";
|
|
40
40
|
import { N as N2 } from "./numberkeyboard.taro-bF6VCXry.js";
|
|
@@ -43,12 +43,12 @@ import { R as R2, a as a2 } from "./radio.taro-EKJXMjnX.js";
|
|
|
43
43
|
import { R as R3 } from "./range.taro-mDYY3SXA.js";
|
|
44
44
|
import { R as R4 } from "./rate.taro-_5Mjd_EO.js";
|
|
45
45
|
import { S as S7 } from "./searchbar.taro-hVzdT6nI.js";
|
|
46
|
-
import { S as S8 } from "./shortpassword.taro-
|
|
46
|
+
import { S as S8 } from "./shortpassword.taro-JBWXzk6I.js";
|
|
47
47
|
import { S as S9 } from "./signature.taro-y3qxnKMv.js";
|
|
48
48
|
import { S as S10 } from "./switch.taro-L0BAbMeu.js";
|
|
49
49
|
import { T as T5 } from "./textarea.taro-9zQLTCwU.js";
|
|
50
50
|
import { U } from "./uploader.taro-bRF02TR9.js";
|
|
51
|
-
import { A as A2 } from "./actionsheet.taro-
|
|
51
|
+
import { A as A2 } from "./actionsheet.taro-kKhb0Vwt.js";
|
|
52
52
|
import { B as B3 } from "./badge.taro-993L861f.js";
|
|
53
53
|
import { B as B4 } from "./dialog.taro-dmQGDu3o.js";
|
|
54
54
|
import { D as D3 } from "./drag.taro-BwcleRuB.js";
|
|
@@ -60,7 +60,7 @@ import { N as N4 } from "./notify.taro-mA9KS8qh.js";
|
|
|
60
60
|
import { P as P2 } from "./popover.taro-qldQwLPC.js";
|
|
61
61
|
import { P as P3 } from "./popup.taro-ObEUml4r.js";
|
|
62
62
|
import { P as P4 } from "./pulltorefresh.taro-2jER8Mat.js";
|
|
63
|
-
import { S as S11 } from "./skeleton.taro
|
|
63
|
+
import { S as S11 } from "./skeleton.taro--AtiA7MK.js";
|
|
64
64
|
import { S as S12 } from "./swipe.taro-p2ONOq1o.js";
|
|
65
65
|
import { T as T6 } from "./toast.taro-xnEQSCDJ.js";
|
|
66
66
|
import { A as A3 } from "./animate.taro-m67VyUHP.js";
|
|
@@ -87,7 +87,7 @@ import { T as T8 } from "./tag.taro-5KC_wObY.js";
|
|
|
87
87
|
import { T as T9 } from "./tour.taro-CGEjzzN_.js";
|
|
88
88
|
import { V } from "./video.taro-csvHwS2v.js";
|
|
89
89
|
import { V as V2 } from "./virtuallist.taro-AeTVtFFa.js";
|
|
90
|
-
import { B as B5 } from "./barrage.taro-
|
|
90
|
+
import { B as B5 } from "./barrage.taro-6nbq7wtt.js";
|
|
91
91
|
import { C as C14 } from "./card.taro-p4PTy-IU.js";
|
|
92
92
|
import { T as T10 } from "./timedetail.taro-TF9Wcblh.js";
|
|
93
93
|
import { T as T11 } from "./timeselect.taro-j8LgSCe5.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { useMemo, useEffect } from "react";
|
|
1
|
+
import React__default, { useMemo, useImperativeHandle, useEffect } from "react";
|
|
2
2
|
import { Tips } from "@nutui/icons-react-taro";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { P as Popup } from "./popup.taro-ObEUml4r.js";
|
|
@@ -14,9 +14,9 @@ const defaultProps = {
|
|
|
14
14
|
length: 6,
|
|
15
15
|
autoFocus: false
|
|
16
16
|
};
|
|
17
|
-
const
|
|
17
|
+
const InternalShortPassword = (props, ref) => {
|
|
18
18
|
const { locale } = useConfig();
|
|
19
|
-
const { title, description, tips, visible, value, error, hideFooter, length, plain, style, className, closeable, autoFocus, onFocus, onChange, onConfirm, onTips, onCancel, onClose, onComplete, onOverlayClick, onCloseIconClick, ...rest } = {
|
|
19
|
+
const { title, description, tips, visible: deleteVisible, value, error, hideFooter, length, plain, style, className, closeable, autoFocus, onFocus, onChange, onConfirm, onTips, onCancel, onClose, onComplete, onOverlayClick, onCloseIconClick, ...rest } = {
|
|
20
20
|
...defaultProps,
|
|
21
21
|
...props
|
|
22
22
|
};
|
|
@@ -27,6 +27,20 @@ const ShortPassword = (props) => {
|
|
|
27
27
|
const format = (val) => {
|
|
28
28
|
return val.slice(0, comLen);
|
|
29
29
|
};
|
|
30
|
+
const [visible, setVisible] = usePropsValue({
|
|
31
|
+
value: props.visible,
|
|
32
|
+
defaultValue: false,
|
|
33
|
+
finalValue: false
|
|
34
|
+
});
|
|
35
|
+
const actions = {
|
|
36
|
+
open: () => {
|
|
37
|
+
setVisible(true);
|
|
38
|
+
},
|
|
39
|
+
close: () => {
|
|
40
|
+
setVisible(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
useImperativeHandle(ref, () => actions);
|
|
30
44
|
const [inputValue, setInputValue] = usePropsValue({ value, onChange });
|
|
31
45
|
useEffect(() => {
|
|
32
46
|
if (visible && autoFocus) {
|
|
@@ -70,7 +84,7 @@ const ShortPassword = (props) => {
|
|
|
70
84
|
React__default.createElement("div", { className: `${classPrefix}-message-forget`, onClick: onTips }, tips || React__default.createElement(
|
|
71
85
|
React__default.Fragment,
|
|
72
86
|
null,
|
|
73
|
-
React__default.createElement(Tips, { size: 11
|
|
87
|
+
React__default.createElement(Tips, { size: 11 }),
|
|
74
88
|
locale.shortpassword.tips
|
|
75
89
|
))
|
|
76
90
|
),
|
|
@@ -83,8 +97,7 @@ const ShortPassword = (props) => {
|
|
|
83
97
|
)
|
|
84
98
|
);
|
|
85
99
|
};
|
|
86
|
-
ShortPassword
|
|
87
|
-
ShortPassword.displayName = "NutShortPassword";
|
|
100
|
+
const ShortPassword = React__default.forwardRef(InternalShortPassword);
|
|
88
101
|
export {
|
|
89
102
|
ShortPassword as S
|
|
90
103
|
};
|
|
@@ -20,7 +20,7 @@ const Skeleton = (props) => {
|
|
|
20
20
|
const classPrefix = "nut-skeleton";
|
|
21
21
|
const classes = classNames(classPrefix, className);
|
|
22
22
|
const avatarClass = classNames({
|
|
23
|
-
avatar: true,
|
|
23
|
+
[`nut-avatar`]: true,
|
|
24
24
|
[`avatar-${avatarShape}`]: avatarShape
|
|
25
25
|
});
|
|
26
26
|
const repeatLines = (num) => {
|
|
@@ -38,7 +38,7 @@ const Skeleton = (props) => {
|
|
|
38
38
|
height: "50px"
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
return React__default.createElement(React__default.Fragment, null, visible ? React__default.createElement(
|
|
41
|
+
return React__default.createElement(React__default.Fragment, null, visible ? React__default.createElement(React__default.Fragment, null, children) : React__default.createElement(
|
|
42
42
|
"div",
|
|
43
43
|
{ className: classes, ...rest },
|
|
44
44
|
animated && React__default.createElement("div", { className: `${classPrefix}-animation` }),
|
|
@@ -178,7 +178,7 @@ const Tabs = (props) => {
|
|
|
178
178
|
View,
|
|
179
179
|
{ ref: (ref) => titleItemsRef.current.push(ref), id: `scrollIntoView${index}`, onClick: (e) => {
|
|
180
180
|
tabChange(item);
|
|
181
|
-
}, className: classNames(`${classPrefix}-titles-item
|
|
181
|
+
}, className: classNames(`${classPrefix}-titles-item`, {
|
|
182
182
|
[`nut-tabs-titles-item-active`]: !item.disabled && String(item.value) === String(value),
|
|
183
183
|
[`nut-tabs-titles-item-disabled`]: item.disabled,
|
|
184
184
|
[`nut-tabs-titles-item-${align}`]: align
|
|
@@ -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
|
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,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,24 +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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onFocus: (e: FocusEvent<HTMLInputElement>) => void;
|
|
22
|
-
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;
|
|
23
21
|
}
|
|
24
22
|
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
|
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>>;
|
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
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED