@nutui/nutui-react 3.0.12 → 3.0.13-beta.1
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 +8 -9
- package/dist/cjs/packages/address/style/address.scss +2 -2
- package/dist/cjs/packages/address/style/style.css +2 -2
- package/dist/cjs/packages/address/style-jmapp/address.scss +2 -2
- package/dist/cjs/packages/address/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/address/style-jrkf/address.scss +2 -2
- package/dist/cjs/packages/address/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/button/style/button.scss +3 -3
- package/dist/cjs/packages/button/style/style.css +3 -3
- package/dist/cjs/packages/button/style-jmapp/button.scss +3 -3
- package/dist/cjs/packages/button/style-jmapp/style.css +3 -3
- package/dist/cjs/packages/button/style-jrkf/button.scss +3 -3
- package/dist/cjs/packages/button/style-jrkf/style.css +3 -3
- package/dist/cjs/packages/collapseitem/style/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style/style.css +2 -2
- package/dist/cjs/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
- package/dist/cjs/packages/collapseitem/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/dialog/style/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style/style.css +1 -1
- package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/loading/loading.js +0 -4
- package/dist/cjs/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style/style.css +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
- package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/steps/style/steps.scss +1 -1
- package/dist/cjs/packages/steps/style/style.css +1 -1
- package/dist/cjs/packages/steps/style-jmapp/steps.scss +1 -1
- package/dist/cjs/packages/steps/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/steps/style-jrkf/steps.scss +1 -1
- package/dist/cjs/packages/steps/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/swiper/swiper.js +52 -43
- package/dist/cjs/packages/tabbaritem/style/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabbaritem/style-jmapp/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabbaritem/style-jrkf/style.css +4 -4
- package/dist/cjs/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
- package/dist/cjs/packages/tabs/style/style.css +2 -2
- package/dist/cjs/packages/tabs/style/tabs.scss +2 -2
- package/dist/cjs/packages/tabs/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/tabs/style-jmapp/tabs.scss +2 -2
- package/dist/cjs/packages/tabs/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/tabs/style-jrkf/tabs.scss +2 -2
- package/dist/cjs/packages/textarea/textarea.d.ts +2 -2
- package/dist/cjs/packages/textarea/textarea.js +25 -8
- package/dist/cjs/packages/toast/style/style.css +2 -2
- package/dist/cjs/packages/toast/style/toast.scss +2 -2
- package/dist/cjs/packages/toast/style-jmapp/style.css +2 -2
- package/dist/cjs/packages/toast/style-jmapp/toast.scss +2 -2
- package/dist/cjs/packages/toast/style-jrkf/style.css +2 -2
- package/dist/cjs/packages/toast/style-jrkf/toast.scss +2 -2
- package/dist/cjs/packages/uploader/style/style.css +1 -0
- package/dist/cjs/packages/uploader/style/uploader.scss +1 -0
- package/dist/cjs/packages/uploader/style-jmapp/style.css +1 -0
- package/dist/cjs/packages/uploader/style-jmapp/uploader.scss +1 -0
- package/dist/cjs/packages/uploader/style-jrkf/style.css +1 -0
- package/dist/cjs/packages/uploader/style-jrkf/uploader.scss +1 -0
- package/dist/cjs/types/spec/lottie/taro.d.ts +1 -0
- package/dist/cjs/types/spec/swiper/base.d.ts +4 -0
- package/dist/cjs/types/spec/swiper/taro.d.ts +4 -0
- package/dist/cjs/utils/index.d.ts +0 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/index.taro.js +0 -1
- package/dist/cjs/utils/taro/platform.d.ts +1 -0
- package/dist/cjs/utils/taro/platform.js +8 -0
- package/dist/cjs/utils/taro/px-transform.js +1 -1
- package/dist/es/packages/address/style/address.scss +2 -2
- package/dist/es/packages/address/style/style.css +2 -2
- package/dist/es/packages/address/style-jmapp/address.scss +2 -2
- package/dist/es/packages/address/style-jmapp/style.css +2 -2
- package/dist/es/packages/address/style-jrkf/address.scss +2 -2
- package/dist/es/packages/address/style-jrkf/style.css +2 -2
- package/dist/es/packages/button/style/button.scss +3 -3
- package/dist/es/packages/button/style/style.css +3 -3
- package/dist/es/packages/button/style-jmapp/button.scss +3 -3
- package/dist/es/packages/button/style-jmapp/style.css +3 -3
- package/dist/es/packages/button/style-jrkf/button.scss +3 -3
- package/dist/es/packages/button/style-jrkf/style.css +3 -3
- package/dist/es/packages/collapseitem/style/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style/style.css +2 -2
- package/dist/es/packages/collapseitem/style-jmapp/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style-jmapp/style.css +2 -2
- package/dist/es/packages/collapseitem/style-jrkf/collapseitem.scss +2 -2
- package/dist/es/packages/collapseitem/style-jrkf/style.css +2 -2
- package/dist/es/packages/dialog/style/dialog.scss +1 -1
- package/dist/es/packages/dialog/style/style.css +1 -1
- package/dist/es/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/es/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/es/packages/loading/loading.js +0 -4
- package/dist/es/packages/numberkeyboard/style/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style/style.css +2 -2
- package/dist/es/packages/numberkeyboard/style-jmapp/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style-jmapp/style.css +2 -2
- package/dist/es/packages/numberkeyboard/style-jrkf/numberkeyboard.scss +2 -2
- package/dist/es/packages/numberkeyboard/style-jrkf/style.css +2 -2
- package/dist/es/packages/steps/style/steps.scss +1 -1
- package/dist/es/packages/steps/style/style.css +1 -1
- package/dist/es/packages/steps/style-jmapp/steps.scss +1 -1
- package/dist/es/packages/steps/style-jmapp/style.css +1 -1
- package/dist/es/packages/steps/style-jrkf/steps.scss +1 -1
- package/dist/es/packages/steps/style-jrkf/style.css +1 -1
- package/dist/es/packages/swiper/swiper.js +53 -44
- package/dist/es/packages/tabbaritem/style/style.css +4 -4
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +4 -4
- package/dist/es/packages/tabbaritem/style-jmapp/style.css +4 -4
- package/dist/es/packages/tabbaritem/style-jmapp/tabbaritem.scss +4 -4
- package/dist/es/packages/tabbaritem/style-jrkf/style.css +4 -4
- package/dist/es/packages/tabbaritem/style-jrkf/tabbaritem.scss +4 -4
- package/dist/es/packages/tabs/style/style.css +2 -2
- package/dist/es/packages/tabs/style/tabs.scss +2 -2
- package/dist/es/packages/tabs/style-jmapp/style.css +2 -2
- package/dist/es/packages/tabs/style-jmapp/tabs.scss +2 -2
- package/dist/es/packages/tabs/style-jrkf/style.css +2 -2
- package/dist/es/packages/tabs/style-jrkf/tabs.scss +2 -2
- package/dist/es/packages/textarea/textarea.d.ts +2 -2
- package/dist/es/packages/textarea/textarea.js +26 -9
- package/dist/es/packages/toast/style/style.css +2 -2
- package/dist/es/packages/toast/style/toast.scss +2 -2
- package/dist/es/packages/toast/style-jmapp/style.css +2 -2
- package/dist/es/packages/toast/style-jmapp/toast.scss +2 -2
- package/dist/es/packages/toast/style-jrkf/style.css +2 -2
- package/dist/es/packages/toast/style-jrkf/toast.scss +2 -2
- package/dist/es/packages/uploader/style/style.css +1 -0
- package/dist/es/packages/uploader/style/uploader.scss +1 -0
- package/dist/es/packages/uploader/style-jmapp/style.css +1 -0
- package/dist/es/packages/uploader/style-jmapp/uploader.scss +1 -0
- package/dist/es/packages/uploader/style-jrkf/style.css +1 -0
- package/dist/es/packages/uploader/style-jrkf/uploader.scss +1 -0
- package/dist/es/types/spec/input/base.d.ts +4 -1
- package/dist/es/types/spec/lottie/taro.d.ts +1 -0
- package/dist/es/types/spec/swiper/base.d.ts +5 -1
- package/dist/es/types/spec/swiper/taro.d.ts +4 -0
- package/dist/es/utils/index.d.ts +0 -1
- package/dist/es/utils/index.js +0 -1
- package/dist/es/utils/index.taro.js +0 -1
- package/dist/es/utils/taro/platform.d.ts +1 -0
- package/dist/es/utils/taro/platform.js +5 -0
- package/dist/es/utils/taro/px-transform.js +3 -2
- package/dist/nutui.react.umd.js +79 -152
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +30 -30
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +39 -39
- package/dist/style.css +1 -1
- package/dist/style.scss +39 -39
- package/package.json +1 -1
- package/dist/cjs/utils/camel-case.d.ts +0 -1
- package/dist/cjs/utils/camel-case.js +0 -106
- package/dist/es/utils/camel-case.d.ts +0 -1
- package/dist/es/utils/camel-case.js +0 -96
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
height: 100%;
|
|
78
78
|
background: var(--nutui-uploader-preview-progress-background, var(--nutui-color-surface-overlay));
|
|
79
79
|
border-radius: var(--nutui-uploader-image-border-radius, var(--nutui-radius-xs));
|
|
80
|
+
z-index: 10;
|
|
80
81
|
}
|
|
81
82
|
.nut-uploader-preview-progress i {
|
|
82
83
|
margin-bottom: var(--nutui-uploader-image-icon-margin-bottom, 6px);
|
|
@@ -60,7 +60,10 @@ export interface BaseInput<INPUT_TYPE, CONFIRM_TYPE = InputConfirmType> extends
|
|
|
60
60
|
* 键盘右下角按钮的文字,仅在type='text'时生效,可选值 send:发送、search:搜索、next:下一个、go:前往、done:完成
|
|
61
61
|
*/
|
|
62
62
|
confirmType: CONFIRM_TYPE
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* 输入框是容器型还是文本型,容器型一般都是带外边框的
|
|
65
|
+
*/
|
|
66
|
+
plain: boolean
|
|
64
67
|
/**
|
|
65
68
|
* 输入内容格式化函数
|
|
66
69
|
*/
|
|
@@ -27,10 +27,14 @@ export interface BaseSwiper extends BaseProps {
|
|
|
27
27
|
* 动画时长(单位是ms)
|
|
28
28
|
*/
|
|
29
29
|
duration: SimpleValue
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Please use `autoplay` prop instead.
|
|
32
|
+
*/
|
|
33
|
+
autoPlay: boolean | number;
|
|
30
34
|
/**
|
|
31
35
|
* 自动轮播时长,0表示不会自动轮播
|
|
32
36
|
*/
|
|
33
|
-
|
|
37
|
+
autoplay: boolean | number
|
|
34
38
|
/**
|
|
35
39
|
* 初始化索引值
|
|
36
40
|
*/
|
|
@@ -9,7 +9,11 @@ export type TaroSwiperProps = Omit<BaseSwiper, OmittedKeys> & OmittedSwiperProps
|
|
|
9
9
|
height?: SimpleValue;
|
|
10
10
|
direction: Direction;
|
|
11
11
|
indicator: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Please use `autoplay` prop instead.
|
|
14
|
+
*/
|
|
12
15
|
autoPlay: boolean;
|
|
16
|
+
autoplay: boolean;
|
|
13
17
|
loop: boolean;
|
|
14
18
|
defaultValue: number;
|
|
15
19
|
};
|
package/dist/es/utils/index.d.ts
CHANGED
package/dist/es/utils/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { pxTransform as transform } from "@tarojs/taro";
|
|
2
|
-
import { harmony } from "./platform";
|
|
2
|
+
import { harmony, td } from "./platform";
|
|
3
|
+
// td todo
|
|
3
4
|
export function pxTransform(value, radix) {
|
|
4
5
|
// @ts-ignore
|
|
5
|
-
if (harmony()) return transform(value, radix || 375);
|
|
6
|
+
if (harmony() || td()) return transform(value, radix || 375);
|
|
6
7
|
return "".concat(value, "px");
|
|
7
8
|
}
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1824,101 +1824,6 @@ Check the top-level render call using <` + t + ">.");
|
|
|
1824
1824
|
}
|
|
1825
1825
|
return ret;
|
|
1826
1826
|
}
|
|
1827
|
-
var UPPERCASE = RegExp("[\\p{Lu}]", "u");
|
|
1828
|
-
var LOWERCASE = RegExp("[\\p{Ll}]", "u");
|
|
1829
|
-
var LEADING_CAPITAL = RegExp("^[\\p{Lu}](?![\\p{Lu}])", "gu");
|
|
1830
|
-
var IDENTIFIER = RegExp("([\\p{Alpha}\\p{N}_]|$)", "u");
|
|
1831
|
-
var SEPARATORS = /[_.\- ]+/;
|
|
1832
|
-
var LEADING_SEPARATORS = new RegExp("^".concat(SEPARATORS.source));
|
|
1833
|
-
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
1834
|
-
var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+".concat(IDENTIFIER.source), "gu");
|
|
1835
|
-
var preserveCamelCase = function(string2, toLowerCase, toUpperCase) {
|
|
1836
|
-
var isLastCharLower = false;
|
|
1837
|
-
var isLastCharUpper = false;
|
|
1838
|
-
var isLastLastCharUpper = false;
|
|
1839
|
-
for (var index2 = 0; index2 < string2.length; index2++) {
|
|
1840
|
-
var character = string2[index2];
|
|
1841
|
-
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
1842
|
-
string2 = "".concat(string2.slice(0, index2), "-").concat(string2.slice(index2));
|
|
1843
|
-
isLastCharLower = false;
|
|
1844
|
-
isLastLastCharUpper = isLastCharUpper;
|
|
1845
|
-
isLastCharUpper = true;
|
|
1846
|
-
index2++;
|
|
1847
|
-
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
|
1848
|
-
string2 = "".concat(string2.slice(0, index2 - 1), "-").concat(string2.slice(index2 - 1));
|
|
1849
|
-
isLastLastCharUpper = isLastCharUpper;
|
|
1850
|
-
isLastCharUpper = false;
|
|
1851
|
-
isLastCharLower = true;
|
|
1852
|
-
} else {
|
|
1853
|
-
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
1854
|
-
isLastLastCharUpper = isLastCharUpper;
|
|
1855
|
-
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
return string2;
|
|
1859
|
-
};
|
|
1860
|
-
var preserveConsecutiveUppercase = function(input, toLowerCase) {
|
|
1861
|
-
LEADING_CAPITAL.lastIndex = 0;
|
|
1862
|
-
return input.replace(LEADING_CAPITAL, function(m1) {
|
|
1863
|
-
return toLowerCase(m1);
|
|
1864
|
-
});
|
|
1865
|
-
};
|
|
1866
|
-
var postProcess = function(input, toUpperCase) {
|
|
1867
|
-
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
1868
|
-
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
1869
|
-
return input.replace(SEPARATORS_AND_IDENTIFIER, function(_, identifier) {
|
|
1870
|
-
return toUpperCase(identifier);
|
|
1871
|
-
}).replace(NUMBERS_AND_IDENTIFIER, function(m2) {
|
|
1872
|
-
return toUpperCase(m2);
|
|
1873
|
-
});
|
|
1874
|
-
};
|
|
1875
|
-
var camelCase = function(input, options2) {
|
|
1876
|
-
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
1877
|
-
throw new TypeError("Expected the input to be `string | string[]`");
|
|
1878
|
-
}
|
|
1879
|
-
options2 = _object_spread({
|
|
1880
|
-
pascalCase: false,
|
|
1881
|
-
preserveConsecutiveUppercase: false
|
|
1882
|
-
}, options2);
|
|
1883
|
-
if (Array.isArray(input)) {
|
|
1884
|
-
input = input.map(function(x) {
|
|
1885
|
-
return x.trim();
|
|
1886
|
-
}).filter(function(x) {
|
|
1887
|
-
return x.length;
|
|
1888
|
-
}).join("-");
|
|
1889
|
-
} else {
|
|
1890
|
-
input = input.trim();
|
|
1891
|
-
}
|
|
1892
|
-
if (input.length === 0) {
|
|
1893
|
-
return "";
|
|
1894
|
-
}
|
|
1895
|
-
var toLowerCase = options2.locale === false ? function(string2) {
|
|
1896
|
-
return string2.toLowerCase();
|
|
1897
|
-
} : function(string2) {
|
|
1898
|
-
return string2.toLocaleLowerCase(options2.locale);
|
|
1899
|
-
};
|
|
1900
|
-
var toUpperCase = options2.locale === false ? function(string2) {
|
|
1901
|
-
return string2.toUpperCase();
|
|
1902
|
-
} : function(string2) {
|
|
1903
|
-
return string2.toLocaleUpperCase(options2.locale);
|
|
1904
|
-
};
|
|
1905
|
-
if (input.length === 1) {
|
|
1906
|
-
if (SEPARATORS.test(input)) {
|
|
1907
|
-
return "";
|
|
1908
|
-
}
|
|
1909
|
-
return options2.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
1910
|
-
}
|
|
1911
|
-
var hasUpperCase = input !== toLowerCase(input);
|
|
1912
|
-
if (hasUpperCase) {
|
|
1913
|
-
input = preserveCamelCase(input, toLowerCase, toUpperCase);
|
|
1914
|
-
}
|
|
1915
|
-
input = input.replace(LEADING_SEPARATORS, "");
|
|
1916
|
-
input = options2.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
1917
|
-
if (options2.pascalCase) {
|
|
1918
|
-
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
1919
|
-
}
|
|
1920
|
-
return postProcess(input, toUpperCase);
|
|
1921
|
-
};
|
|
1922
1827
|
var canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
1923
1828
|
var clamp$2 = function(num, min, max) {
|
|
1924
1829
|
return Math.min(Math.max(num, min), max);
|
|
@@ -19271,14 +19176,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19271
19176
|
showCount: false,
|
|
19272
19177
|
rows: 2,
|
|
19273
19178
|
maxLength: 140,
|
|
19274
|
-
placeholder: "",
|
|
19275
19179
|
readOnly: false,
|
|
19276
19180
|
disabled: false,
|
|
19277
19181
|
autoSize: false,
|
|
19278
19182
|
plain: false,
|
|
19279
19183
|
status: "default"
|
|
19280
19184
|
});
|
|
19281
|
-
var TextArea = function(props) {
|
|
19185
|
+
var TextArea = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
19282
19186
|
var locale = useConfig().locale;
|
|
19283
19187
|
var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
|
|
19284
19188
|
"className",
|
|
@@ -19313,13 +19217,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19313
19217
|
defaultValue,
|
|
19314
19218
|
finalValue: format2(defaultValue),
|
|
19315
19219
|
onChange
|
|
19316
|
-
}), 2),
|
|
19220
|
+
}), 2), innerValue = _usePropsValue[0], setInnerValue = _usePropsValue[1];
|
|
19317
19221
|
React.useEffect(function() {
|
|
19318
19222
|
if (autoSize) setContentHeight();
|
|
19319
19223
|
}, [
|
|
19320
19224
|
autoSize,
|
|
19321
19225
|
defaultValue,
|
|
19322
|
-
|
|
19226
|
+
innerValue
|
|
19323
19227
|
]);
|
|
19324
19228
|
var setContentHeight = function() {
|
|
19325
19229
|
var textarea = textareaRef.current;
|
|
@@ -19334,7 +19238,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19334
19238
|
var handleChange = function(event) {
|
|
19335
19239
|
var text2 = event.target;
|
|
19336
19240
|
var value3 = compositionRef.current ? text2.value : format2(text2.value);
|
|
19337
|
-
|
|
19241
|
+
setInnerValue(value3);
|
|
19338
19242
|
};
|
|
19339
19243
|
var isDisabled = function() {
|
|
19340
19244
|
return disabled || readOnly;
|
|
@@ -19347,6 +19251,24 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19347
19251
|
if (isDisabled()) return;
|
|
19348
19252
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
19349
19253
|
};
|
|
19254
|
+
React.useImperativeHandle(ref, function() {
|
|
19255
|
+
return {
|
|
19256
|
+
clear: function() {
|
|
19257
|
+
return setInnerValue("");
|
|
19258
|
+
},
|
|
19259
|
+
focus: function() {
|
|
19260
|
+
var _textareaRef_current;
|
|
19261
|
+
return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.focus();
|
|
19262
|
+
},
|
|
19263
|
+
blur: function() {
|
|
19264
|
+
var _textareaRef_current;
|
|
19265
|
+
return (_textareaRef_current = textareaRef.current) === null || _textareaRef_current === void 0 ? void 0 : _textareaRef_current.blur();
|
|
19266
|
+
},
|
|
19267
|
+
get nativeElement() {
|
|
19268
|
+
return textareaRef.current;
|
|
19269
|
+
}
|
|
19270
|
+
};
|
|
19271
|
+
});
|
|
19350
19272
|
var _obj;
|
|
19351
19273
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
19352
19274
|
className: classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix2, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix2, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix2, "-plain"), plain), _define_property(_obj, "".concat(classPrefix2, "-container"), !plain), _define_property(_obj, "".concat(classPrefix2, "-").concat(status), status), _obj), className)
|
|
@@ -19356,7 +19278,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19356
19278
|
style,
|
|
19357
19279
|
disabled,
|
|
19358
19280
|
readOnly,
|
|
19359
|
-
value:
|
|
19281
|
+
value: innerValue,
|
|
19360
19282
|
onChange: handleChange,
|
|
19361
19283
|
onBlur: handleBlur,
|
|
19362
19284
|
onFocus: handleFocus,
|
|
@@ -19371,8 +19293,8 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
19371
19293
|
placeholder: placeholder !== void 0 ? placeholder : locale.placeholder
|
|
19372
19294
|
})), showCount && /* @__PURE__ */ React.createElement("div", {
|
|
19373
19295
|
className: classNames("".concat(classPrefix2, "-limit"), _define_property({}, "".concat(classPrefix2, "-limit-disabled"), disabled))
|
|
19374
|
-
},
|
|
19375
|
-
};
|
|
19296
|
+
}, innerValue.length, "/", maxLength < 0 ? 0 : maxLength)));
|
|
19297
|
+
});
|
|
19376
19298
|
TextArea.displayName = "NutTextArea";
|
|
19377
19299
|
var defaultProps$K = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
19378
19300
|
percent: 0,
|
|
@@ -24016,47 +23938,63 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24016
23938
|
indicator: false,
|
|
24017
23939
|
loop: false,
|
|
24018
23940
|
duration: 3e3,
|
|
24019
|
-
|
|
23941
|
+
autoplay: false,
|
|
24020
23942
|
defaultValue: 0,
|
|
24021
23943
|
touchable: true,
|
|
24022
23944
|
effect: void 0
|
|
24023
23945
|
};
|
|
24024
23946
|
var Swiper = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
24025
|
-
var boundIndex = function boundIndex2(
|
|
23947
|
+
var boundIndex = function boundIndex2(current) {
|
|
24026
23948
|
var min = 0;
|
|
24027
23949
|
var max = count - 1;
|
|
24028
|
-
if (
|
|
23950
|
+
if (current === max && !loop2 && props.slideSize) {
|
|
24029
23951
|
var slideSize = props.slideSize;
|
|
24030
23952
|
var swiperSize = getSwiperSize();
|
|
24031
23953
|
var ratio = (swiperSize - slideSize) / slideSize;
|
|
24032
|
-
return bound2(
|
|
23954
|
+
return bound2(current, min, max - ratio);
|
|
24033
23955
|
}
|
|
24034
|
-
return
|
|
23956
|
+
return current;
|
|
24035
23957
|
};
|
|
24036
23958
|
var classPrefix2 = "nut-swiper";
|
|
24037
|
-
var _$_object_spread = _object_spread({}, defaultProps$i, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop2 = _$_object_spread.loop, effect2 = _$_object_spread.effect,
|
|
23959
|
+
var _$_object_spread = _object_spread({}, defaultProps$i, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop2 = _$_object_spread.loop, effect2 = _$_object_spread.effect, autoplay = _$_object_spread.autoplay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
|
|
24038
23960
|
var isVertical = direction === "vertical";
|
|
24039
23961
|
var count = React.useMemo(function() {
|
|
24040
23962
|
var c6 = 0;
|
|
24041
|
-
React.Children.map(children, function(
|
|
23963
|
+
React.Children.map(children, function() {
|
|
24042
23964
|
c6 += 1;
|
|
24043
23965
|
});
|
|
24044
23966
|
return c6;
|
|
24045
23967
|
}, [
|
|
24046
23968
|
children
|
|
24047
23969
|
]);
|
|
23970
|
+
var timeoutRef = React.useRef(null);
|
|
23971
|
+
var _useState = _sliced_to_array(React.useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
|
|
23972
|
+
var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), innerValue = _useRefState[0], setInnerValue = _useRefState[1];
|
|
23973
|
+
var stageRef = React.useRef(null);
|
|
23974
|
+
var swiperRef = React.useRef(null);
|
|
23975
|
+
var _useSpring = _sliced_to_array(useSpring(function() {
|
|
23976
|
+
return {
|
|
23977
|
+
x: !isVertical ? innerValue.current * 100 * -1 : 0,
|
|
23978
|
+
y: isVertical ? innerValue.current * 100 * -1 : 0,
|
|
23979
|
+
s: 0,
|
|
23980
|
+
reset: function() {
|
|
23981
|
+
},
|
|
23982
|
+
config: {
|
|
23983
|
+
tension: 200,
|
|
23984
|
+
friction: 30
|
|
23985
|
+
}
|
|
23986
|
+
};
|
|
23987
|
+
}), 2), springs = _useSpring[0], api = _useSpring[1];
|
|
24048
23988
|
var getSlideSize = function() {
|
|
24049
23989
|
if (props.slideSize) return props.slideSize;
|
|
24050
23990
|
if (stageRef.current) {
|
|
24051
|
-
|
|
24052
|
-
return stageRef.current.offsetWidth;
|
|
23991
|
+
return isVertical ? stageRef.current.offsetHeight : stageRef.current.offsetWidth;
|
|
24053
23992
|
}
|
|
24054
23993
|
return 0;
|
|
24055
23994
|
};
|
|
24056
23995
|
var getSwiperSize = function() {
|
|
24057
23996
|
if (swiperRef.current) {
|
|
24058
|
-
|
|
24059
|
-
return swiperRef.current.offsetWidth;
|
|
23997
|
+
return isVertical ? swiperRef.current.offsetHeight : swiperRef.current.offsetWidth;
|
|
24060
23998
|
}
|
|
24061
23999
|
return 0;
|
|
24062
24000
|
};
|
|
@@ -24069,51 +24007,44 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24069
24007
|
}
|
|
24070
24008
|
return v;
|
|
24071
24009
|
};
|
|
24072
|
-
var timeoutRef = React.useRef(null);
|
|
24073
|
-
var _useState = _sliced_to_array(React.useState(false), 2), dragging = _useState[0], setDragging = _useState[1];
|
|
24074
|
-
var _useRefState = _sliced_to_array(useRefState(defaultValue), 2), current = _useRefState[0], setCurrent = _useRefState[1];
|
|
24075
|
-
var stageRef = React.useRef(null);
|
|
24076
|
-
var swiperRef = React.useRef(null);
|
|
24077
|
-
var _useSpring = _sliced_to_array(useSpring(function() {
|
|
24078
|
-
return {
|
|
24079
|
-
x: !isVertical ? current.current * 100 * -1 : 0,
|
|
24080
|
-
y: isVertical ? current.current * 100 * -1 : 0,
|
|
24081
|
-
s: 0,
|
|
24082
|
-
reset: function() {
|
|
24083
|
-
},
|
|
24084
|
-
config: {
|
|
24085
|
-
tension: 200,
|
|
24086
|
-
friction: 30
|
|
24087
|
-
}
|
|
24088
|
-
};
|
|
24089
|
-
}), 2), springs = _useSpring[0], api = _useSpring[1];
|
|
24090
24010
|
React.useEffect(function() {
|
|
24091
24011
|
var _obj;
|
|
24092
|
-
api.start((_obj = {}, _define_property(_obj, isVertical ? "y" : "x", boundIndex(
|
|
24012
|
+
api.start((_obj = {}, _define_property(_obj, isVertical ? "y" : "x", boundIndex(innerValue.current) * -1 * 100), _define_property(_obj, "immediate", true), _obj));
|
|
24093
24013
|
}, [
|
|
24094
24014
|
swiperRef.current
|
|
24095
24015
|
]);
|
|
24096
24016
|
var swiperDirection = React.useRef(1);
|
|
24097
|
-
var _useList = _sliced_to_array(useList(effect2, count,
|
|
24098
|
-
var runTimeSwiper = function() {
|
|
24017
|
+
var _useList = _sliced_to_array(useList(effect2, count, innerValue), 2), transforms = _useList[0], setTransforms = _useList[1];
|
|
24018
|
+
var runTimeSwiper = React.useCallback(function() {
|
|
24099
24019
|
var durationNumber = typeof duration === "string" ? parseInt(duration) : duration;
|
|
24100
|
-
var d2 =
|
|
24020
|
+
var d2 = durationNumber;
|
|
24021
|
+
if (typeof props.autoPlay === "number") {
|
|
24022
|
+
d2 = props.autoPlay;
|
|
24023
|
+
} else if (typeof autoplay === "number") {
|
|
24024
|
+
d2 = autoplay;
|
|
24025
|
+
}
|
|
24101
24026
|
timeoutRef.current = window.setTimeout(function() {
|
|
24102
24027
|
next();
|
|
24103
24028
|
runTimeSwiper();
|
|
24104
24029
|
}, d2);
|
|
24105
|
-
}
|
|
24030
|
+
}, [
|
|
24031
|
+
props.autoPlay,
|
|
24032
|
+
autoplay,
|
|
24033
|
+
duration
|
|
24034
|
+
]);
|
|
24106
24035
|
React.useEffect(function() {
|
|
24107
|
-
|
|
24036
|
+
var shouldAutoplay = props.autoPlay || autoplay;
|
|
24037
|
+
if (!shouldAutoplay || dragging) return;
|
|
24108
24038
|
runTimeSwiper();
|
|
24109
24039
|
return function() {
|
|
24110
24040
|
if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
|
|
24111
24041
|
};
|
|
24112
24042
|
}, [
|
|
24113
|
-
|
|
24043
|
+
autoplay,
|
|
24114
24044
|
duration,
|
|
24115
24045
|
dragging,
|
|
24116
|
-
count
|
|
24046
|
+
count,
|
|
24047
|
+
runTimeSwiper
|
|
24117
24048
|
]);
|
|
24118
24049
|
var to2 = function(index2) {
|
|
24119
24050
|
var immediate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
@@ -24123,7 +24054,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24123
24054
|
var cycleIndex = index2 % count;
|
|
24124
24055
|
targetIndex = cycleIndex < 0 ? cycleIndex + count : cycleIndex;
|
|
24125
24056
|
}
|
|
24126
|
-
|
|
24057
|
+
setInnerValue(targetIndex);
|
|
24127
24058
|
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, targetIndex);
|
|
24128
24059
|
if (effect2) {
|
|
24129
24060
|
updateTransform(transforms, setTransforms, effect2, targetIndex);
|
|
@@ -24187,13 +24118,10 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24187
24118
|
bounds: function() {
|
|
24188
24119
|
if (loop2) return {};
|
|
24189
24120
|
var slideSize = getSlideSize();
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
};
|
|
24195
|
-
}
|
|
24196
|
-
return {
|
|
24121
|
+
return isVertical ? {
|
|
24122
|
+
top: 0,
|
|
24123
|
+
bottom: (count - 1) * slideSize
|
|
24124
|
+
} : {
|
|
24197
24125
|
left: 0,
|
|
24198
24126
|
right: (count - 1) * slideSize
|
|
24199
24127
|
};
|
|
@@ -24207,13 +24135,13 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24207
24135
|
}
|
|
24208
24136
|
});
|
|
24209
24137
|
var renderIndicator = function() {
|
|
24210
|
-
if (/* @__PURE__ */ React.isValidElement(indicator)) return indicator;
|
|
24211
24138
|
if (!indicator) return null;
|
|
24139
|
+
if (/* @__PURE__ */ React.isValidElement(indicator)) return indicator;
|
|
24212
24140
|
var _obj;
|
|
24213
24141
|
return /* @__PURE__ */ React.createElement("div", {
|
|
24214
24142
|
className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-indicator"), true), _define_property(_obj, "".concat(classPrefix2, "-indicator-vertical"), isVertical), _define_property(_obj, "".concat(classPrefix2, "-indicator-horizontal"), !isVertical), _obj))
|
|
24215
24143
|
}, /* @__PURE__ */ React.createElement(Indicator, {
|
|
24216
|
-
current: getRefValue(
|
|
24144
|
+
current: getRefValue(innerValue),
|
|
24217
24145
|
total: count,
|
|
24218
24146
|
direction
|
|
24219
24147
|
}));
|
|
@@ -24234,7 +24162,7 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
24234
24162
|
count,
|
|
24235
24163
|
isVertical,
|
|
24236
24164
|
effect: effect2,
|
|
24237
|
-
current,
|
|
24165
|
+
current: innerValue,
|
|
24238
24166
|
swiperDirection,
|
|
24239
24167
|
dragging,
|
|
24240
24168
|
transforms
|
|
@@ -43557,7 +43485,6 @@ Please add \`${key2}Action\` when creating your handler.`);
|
|
|
43557
43485
|
exports.VirtualList = VirtualList;
|
|
43558
43486
|
exports.WaterMark = WaterMark;
|
|
43559
43487
|
exports.bound = bound;
|
|
43560
|
-
exports.camelCase = camelCase;
|
|
43561
43488
|
exports.canUseDom = canUseDom;
|
|
43562
43489
|
exports.cancelRaf = cancelRaf;
|
|
43563
43490
|
exports.clamp = clamp$2;
|