@nutui/nutui-react 2.6.22 → 2.6.23
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 +24 -14
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/AvatarCropper.js +1 -1
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +3 -3
- package/dist/esm/CalendarCard.js +1 -1
- package/dist/esm/CalendarItem.js +3 -3
- package/dist/esm/Cascader/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/Dialog.js +2 -3
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Overlay/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/ShortPassword/style/style.css +1 -1
- package/dist/esm/SideNavBar/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/cascader2.js +1 -1
- package/dist/esm/configprovider2.js +138 -1
- 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 +44 -53
- package/dist/nutui.react.umd.js +44 -53
- package/dist/packages/overlay/overlay.scss +0 -4
- package/dist/style.css +1 -1
- package/dist/types/packages/calendar/calendar.d.ts +10 -0
- package/dist/types/packages/calendar/calendar.taro.d.ts +2 -0
- package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -0
- package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/configprovider.taro.js +0 -23
- package/dist/esm/zh-CN.js +0 -141
package/dist/nutui.react.umd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.nutui = {}, global2.React, global2.ReactDOM));
|
|
3
3
|
})(this, function(exports2, React, ReactDOM) {
|
|
4
4
|
"use strict";/*!
|
|
5
|
-
* @nutui/nutui-react v2.6.
|
|
5
|
+
* @nutui/nutui-react v2.6.23 Fri Oct 18 2024 14:16:05 GMT+0800 (China Standard Time)
|
|
6
6
|
* (c) 2023 @jdf2e.
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
@@ -1892,20 +1892,20 @@
|
|
|
1892
1892
|
}
|
|
1893
1893
|
const requestAniFrame$1 = requestAniFrame();
|
|
1894
1894
|
const classPrefix$p = "nut-configprovider";
|
|
1895
|
-
const defaultConfigRef
|
|
1895
|
+
const defaultConfigRef = {
|
|
1896
1896
|
current: {
|
|
1897
1897
|
locale: zhCN
|
|
1898
1898
|
}
|
|
1899
1899
|
};
|
|
1900
1900
|
const setDefaultConfig = (config2) => {
|
|
1901
|
-
defaultConfigRef
|
|
1901
|
+
defaultConfigRef.current = config2;
|
|
1902
1902
|
};
|
|
1903
|
-
const getDefaultConfig
|
|
1904
|
-
return defaultConfigRef
|
|
1903
|
+
const getDefaultConfig = () => {
|
|
1904
|
+
return defaultConfigRef.current;
|
|
1905
1905
|
};
|
|
1906
|
-
const ConfigContext
|
|
1907
|
-
const useConfig
|
|
1908
|
-
return React.useContext(ConfigContext
|
|
1906
|
+
const ConfigContext = React.createContext(null);
|
|
1907
|
+
const useConfig = () => {
|
|
1908
|
+
return React.useContext(ConfigContext) ?? getDefaultConfig();
|
|
1909
1909
|
};
|
|
1910
1910
|
function convertThemeVarsToCSSVars(themeVars) {
|
|
1911
1911
|
const cssVars = {};
|
|
@@ -1915,7 +1915,7 @@
|
|
|
1915
1915
|
return cssVars;
|
|
1916
1916
|
}
|
|
1917
1917
|
const useRtl = () => {
|
|
1918
|
-
const { direction } = useConfig
|
|
1918
|
+
const { direction } = useConfig();
|
|
1919
1919
|
if (direction) {
|
|
1920
1920
|
return direction === "rtl";
|
|
1921
1921
|
}
|
|
@@ -1926,7 +1926,7 @@
|
|
|
1926
1926
|
const mergedConfig = useMemo(
|
|
1927
1927
|
() => {
|
|
1928
1928
|
return {
|
|
1929
|
-
...getDefaultConfig
|
|
1929
|
+
...getDefaultConfig(),
|
|
1930
1930
|
...config2,
|
|
1931
1931
|
direction
|
|
1932
1932
|
};
|
|
@@ -1940,7 +1940,7 @@
|
|
|
1940
1940
|
const cssVarStyle = React.useMemo(() => {
|
|
1941
1941
|
return convertThemeVarsToCSSVars(mergedConfig.theme || {});
|
|
1942
1942
|
}, [mergedConfig.theme]);
|
|
1943
|
-
return /* @__PURE__ */ React.createElement(ConfigContext
|
|
1943
|
+
return /* @__PURE__ */ React.createElement(ConfigContext.Provider, { value: mergedConfig }, /* @__PURE__ */ React.createElement(
|
|
1944
1944
|
"div",
|
|
1945
1945
|
{
|
|
1946
1946
|
className: classNames(classPrefix$p, className),
|
|
@@ -8463,7 +8463,7 @@
|
|
|
8463
8463
|
}
|
|
8464
8464
|
};
|
|
8465
8465
|
const FixedNav = (props) => {
|
|
8466
|
-
const { locale } = useConfig
|
|
8466
|
+
const { locale } = useConfig();
|
|
8467
8467
|
const {
|
|
8468
8468
|
className,
|
|
8469
8469
|
overlay,
|
|
@@ -9561,19 +9561,6 @@
|
|
|
9561
9561
|
return pathNodes;
|
|
9562
9562
|
}
|
|
9563
9563
|
}
|
|
9564
|
-
const defaultConfigRef = {
|
|
9565
|
-
current: {
|
|
9566
|
-
locale: zhCN,
|
|
9567
|
-
direction: "ltr"
|
|
9568
|
-
}
|
|
9569
|
-
};
|
|
9570
|
-
const getDefaultConfig = () => {
|
|
9571
|
-
return defaultConfigRef.current;
|
|
9572
|
-
};
|
|
9573
|
-
const ConfigContext = React.createContext(null);
|
|
9574
|
-
const useConfig = () => {
|
|
9575
|
-
return React.useContext(ConfigContext) ?? getDefaultConfig();
|
|
9576
|
-
};
|
|
9577
9564
|
const defaultProps$16 = {
|
|
9578
9565
|
...ComponentDefaults,
|
|
9579
9566
|
activeColor: "",
|
|
@@ -9990,7 +9977,7 @@
|
|
|
9990
9977
|
custom: false
|
|
9991
9978
|
};
|
|
9992
9979
|
const ExistRender = (props) => {
|
|
9993
|
-
const { locale } = useConfig
|
|
9980
|
+
const { locale } = useConfig();
|
|
9994
9981
|
const {
|
|
9995
9982
|
children,
|
|
9996
9983
|
type,
|
|
@@ -10046,7 +10033,7 @@
|
|
|
10046
10033
|
backIcon: null
|
|
10047
10034
|
};
|
|
10048
10035
|
const InternalAddress = (props, ref) => {
|
|
10049
|
-
const { locale } = useConfig
|
|
10036
|
+
const { locale } = useConfig();
|
|
10050
10037
|
const {
|
|
10051
10038
|
style,
|
|
10052
10039
|
className,
|
|
@@ -10441,7 +10428,7 @@
|
|
|
10441
10428
|
}
|
|
10442
10429
|
};
|
|
10443
10430
|
const CalendarItem = React.forwardRef((props, ref) => {
|
|
10444
|
-
const { locale } = useConfig
|
|
10431
|
+
const { locale } = useConfig();
|
|
10445
10432
|
const {
|
|
10446
10433
|
style,
|
|
10447
10434
|
className,
|
|
@@ -10463,6 +10450,7 @@
|
|
|
10463
10450
|
firstDayOfWeek,
|
|
10464
10451
|
disableDate,
|
|
10465
10452
|
renderHeaderButtons,
|
|
10453
|
+
renderBottomButton,
|
|
10466
10454
|
renderDay,
|
|
10467
10455
|
renderDayTop,
|
|
10468
10456
|
renderDayBottom,
|
|
@@ -11005,7 +10993,7 @@
|
|
|
11005
10993
|
);
|
|
11006
10994
|
};
|
|
11007
10995
|
const renderFooter = () => {
|
|
11008
|
-
return /* @__PURE__ */ React.createElement("div", { className: "nut-calendar-footer" }, children, /* @__PURE__ */ React.createElement("div", { className: "calendar-confirm-btn"
|
|
10996
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-calendar-footer" }, children, /* @__PURE__ */ React.createElement("div", { onClick: confirm2 }, renderBottomButton ? renderBottomButton() : /* @__PURE__ */ React.createElement("div", { className: "calendar-confirm-btn" }, confirmText || locale.confirm)));
|
|
11009
10997
|
};
|
|
11010
10998
|
return /* @__PURE__ */ React.createElement("div", { className: classes, style }, renderHeader(), renderContent(), popup && !autoBackfill ? renderFooter() : "");
|
|
11011
10999
|
});
|
|
@@ -11043,7 +11031,7 @@
|
|
|
11043
11031
|
}
|
|
11044
11032
|
};
|
|
11045
11033
|
const Calendar = React.forwardRef((props, ref) => {
|
|
11046
|
-
const { locale } = useConfig
|
|
11034
|
+
const { locale } = useConfig();
|
|
11047
11035
|
const {
|
|
11048
11036
|
style,
|
|
11049
11037
|
className,
|
|
@@ -11064,8 +11052,10 @@
|
|
|
11064
11052
|
showSubTitle,
|
|
11065
11053
|
scrollAnimation,
|
|
11066
11054
|
firstDayOfWeek,
|
|
11055
|
+
closeIcon,
|
|
11067
11056
|
disableDate,
|
|
11068
11057
|
renderHeaderButtons,
|
|
11058
|
+
renderBottomButton,
|
|
11069
11059
|
renderDay,
|
|
11070
11060
|
renderDayTop,
|
|
11071
11061
|
renderDayBottom,
|
|
@@ -11108,6 +11098,7 @@
|
|
|
11108
11098
|
children,
|
|
11109
11099
|
type,
|
|
11110
11100
|
autoBackfill,
|
|
11101
|
+
renderBottomButton,
|
|
11111
11102
|
popup,
|
|
11112
11103
|
title: title || locale.calendaritem.title,
|
|
11113
11104
|
defaultValue,
|
|
@@ -11140,6 +11131,7 @@
|
|
|
11140
11131
|
position: "bottom",
|
|
11141
11132
|
round: true,
|
|
11142
11133
|
closeable: true,
|
|
11134
|
+
closeIcon,
|
|
11143
11135
|
destroyOnClose: true,
|
|
11144
11136
|
onOverlayClick: closePopup,
|
|
11145
11137
|
onCloseIconClick: closePopup,
|
|
@@ -11260,7 +11252,7 @@
|
|
|
11260
11252
|
};
|
|
11261
11253
|
const prefixCls = "nut-calendarcard";
|
|
11262
11254
|
const CalendarCard = React.forwardRef((props, ref) => {
|
|
11263
|
-
const { locale } = useConfig
|
|
11255
|
+
const { locale } = useConfig();
|
|
11264
11256
|
const {
|
|
11265
11257
|
style,
|
|
11266
11258
|
className,
|
|
@@ -12106,7 +12098,7 @@
|
|
|
12106
12098
|
duration: 1e3
|
|
12107
12099
|
};
|
|
12108
12100
|
const InternalPicker = (props, ref) => {
|
|
12109
|
-
const { locale } = useConfig
|
|
12101
|
+
const { locale } = useConfig();
|
|
12110
12102
|
const {
|
|
12111
12103
|
children,
|
|
12112
12104
|
visible,
|
|
@@ -12402,7 +12394,7 @@
|
|
|
12402
12394
|
...defaultProps$Y,
|
|
12403
12395
|
...props
|
|
12404
12396
|
};
|
|
12405
|
-
const { locale } = useConfig
|
|
12397
|
+
const { locale } = useConfig();
|
|
12406
12398
|
const lang = locale.datepicker;
|
|
12407
12399
|
const zhCNType = {
|
|
12408
12400
|
day: lang.day,
|
|
@@ -14209,7 +14201,7 @@
|
|
|
14209
14201
|
const Input = React.forwardRef(
|
|
14210
14202
|
(props, ref) => {
|
|
14211
14203
|
const rtl = useRtl();
|
|
14212
|
-
const { locale } = useConfig
|
|
14204
|
+
const { locale } = useConfig();
|
|
14213
14205
|
const {
|
|
14214
14206
|
type,
|
|
14215
14207
|
name,
|
|
@@ -15016,7 +15008,7 @@
|
|
|
15016
15008
|
}
|
|
15017
15009
|
};
|
|
15018
15010
|
const NumberKeyboard = (props) => {
|
|
15019
|
-
const { locale } = useConfig
|
|
15011
|
+
const { locale } = useConfig();
|
|
15020
15012
|
const {
|
|
15021
15013
|
title,
|
|
15022
15014
|
rightActions,
|
|
@@ -15882,7 +15874,7 @@
|
|
|
15882
15874
|
};
|
|
15883
15875
|
const SearchBar = (props) => {
|
|
15884
15876
|
const classPrefix2 = "nut-searchbar";
|
|
15885
|
-
const { locale } = useConfig
|
|
15877
|
+
const { locale } = useConfig();
|
|
15886
15878
|
const searchRef = React.useRef(null);
|
|
15887
15879
|
const {
|
|
15888
15880
|
value: outerValue,
|
|
@@ -16035,7 +16027,7 @@
|
|
|
16035
16027
|
autoFocus: false
|
|
16036
16028
|
};
|
|
16037
16029
|
const InternalShortPassword = (props, ref) => {
|
|
16038
|
-
const { locale } = useConfig
|
|
16030
|
+
const { locale } = useConfig();
|
|
16039
16031
|
const {
|
|
16040
16032
|
title,
|
|
16041
16033
|
description,
|
|
@@ -16133,7 +16125,7 @@
|
|
|
16133
16125
|
unsupported: ""
|
|
16134
16126
|
};
|
|
16135
16127
|
const InternalSignature = (props, ref) => {
|
|
16136
|
-
const { locale } = useConfig
|
|
16128
|
+
const { locale } = useConfig();
|
|
16137
16129
|
const {
|
|
16138
16130
|
type,
|
|
16139
16131
|
lineWidth,
|
|
@@ -16314,7 +16306,7 @@
|
|
|
16314
16306
|
autoSize: false
|
|
16315
16307
|
};
|
|
16316
16308
|
const TextArea = (props) => {
|
|
16317
|
-
const { locale } = useConfig
|
|
16309
|
+
const { locale } = useConfig();
|
|
16318
16310
|
const {
|
|
16319
16311
|
className,
|
|
16320
16312
|
value,
|
|
@@ -16738,7 +16730,7 @@
|
|
|
16738
16730
|
}
|
|
16739
16731
|
};
|
|
16740
16732
|
const InternalUploader = (props, ref) => {
|
|
16741
|
-
const { locale } = useConfig
|
|
16733
|
+
const { locale } = useConfig();
|
|
16742
16734
|
const fileListRef = React.useRef([]);
|
|
16743
16735
|
const {
|
|
16744
16736
|
children,
|
|
@@ -17342,7 +17334,7 @@
|
|
|
17342
17334
|
onClose,
|
|
17343
17335
|
onCancel,
|
|
17344
17336
|
onOverlayClick
|
|
17345
|
-
} = props;
|
|
17337
|
+
} = mergeProps(defaultDialogProps, props);
|
|
17346
17338
|
const onHandleClickOverlay = (e) => {
|
|
17347
17339
|
if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
|
|
17348
17340
|
const closed = onOverlayClick && onOverlayClick(e);
|
|
@@ -17372,7 +17364,6 @@
|
|
|
17372
17364
|
/* @__PURE__ */ React.createElement(Content, { ...props, visible })
|
|
17373
17365
|
));
|
|
17374
17366
|
};
|
|
17375
|
-
DialogWrap.defaultProps = defaultDialogProps;
|
|
17376
17367
|
DialogWrap.displayName = "NutDialogWrap";
|
|
17377
17368
|
const defaultProps$E = {
|
|
17378
17369
|
...ComponentDefaults,
|
|
@@ -17391,7 +17382,7 @@
|
|
|
17391
17382
|
beforeClose: () => true
|
|
17392
17383
|
};
|
|
17393
17384
|
const BaseDialog = (props, ref) => {
|
|
17394
|
-
const { locale } = useConfig
|
|
17385
|
+
const { locale } = useConfig();
|
|
17395
17386
|
const {
|
|
17396
17387
|
visible,
|
|
17397
17388
|
footer,
|
|
@@ -17688,7 +17679,7 @@
|
|
|
17688
17679
|
};
|
|
17689
17680
|
const classPrefix$d = `nut-infiniteloading`;
|
|
17690
17681
|
const InfiniteLoading = (props) => {
|
|
17691
|
-
const { locale } = useConfig
|
|
17682
|
+
const { locale } = useConfig();
|
|
17692
17683
|
const {
|
|
17693
17684
|
children,
|
|
17694
17685
|
type,
|
|
@@ -18758,7 +18749,7 @@
|
|
|
18758
18749
|
};
|
|
18759
18750
|
const PullToRefresh = (p2) => {
|
|
18760
18751
|
const classPrefix2 = "nut-pulltorefresh";
|
|
18761
|
-
const { locale } = useConfig
|
|
18752
|
+
const { locale } = useConfig();
|
|
18762
18753
|
const props = {
|
|
18763
18754
|
...defaultProps$x,
|
|
18764
18755
|
...p2,
|
|
@@ -19647,7 +19638,7 @@
|
|
|
19647
19638
|
}
|
|
19648
19639
|
};
|
|
19649
19640
|
const Audio = (props) => {
|
|
19650
|
-
const { locale } = useConfig
|
|
19641
|
+
const { locale } = useConfig();
|
|
19651
19642
|
const {
|
|
19652
19643
|
className,
|
|
19653
19644
|
src,
|
|
@@ -21336,7 +21327,7 @@
|
|
|
21336
21327
|
ellipse: false
|
|
21337
21328
|
};
|
|
21338
21329
|
const Pagination = (props) => {
|
|
21339
|
-
const { locale } = useConfig
|
|
21330
|
+
const { locale } = useConfig();
|
|
21340
21331
|
const {
|
|
21341
21332
|
value,
|
|
21342
21333
|
mode,
|
|
@@ -21683,7 +21674,7 @@
|
|
|
21683
21674
|
showHeader: true
|
|
21684
21675
|
};
|
|
21685
21676
|
const Table = (props) => {
|
|
21686
|
-
const { locale } = useConfig
|
|
21677
|
+
const { locale } = useConfig();
|
|
21687
21678
|
const rtl = useRtl();
|
|
21688
21679
|
defaultProps$a.noData = locale.noData;
|
|
21689
21680
|
const {
|
|
@@ -21953,7 +21944,7 @@
|
|
|
21953
21944
|
};
|
|
21954
21945
|
const classPrefix$2 = "nut-tour";
|
|
21955
21946
|
const Tour = (props) => {
|
|
21956
|
-
const { locale } = useConfig
|
|
21947
|
+
const { locale } = useConfig();
|
|
21957
21948
|
const {
|
|
21958
21949
|
children,
|
|
21959
21950
|
className,
|
|
@@ -22608,7 +22599,7 @@
|
|
|
22608
22599
|
}
|
|
22609
22600
|
};
|
|
22610
22601
|
const TimeSelect = (props) => {
|
|
22611
|
-
const { locale } = useConfig
|
|
22602
|
+
const { locale } = useConfig();
|
|
22612
22603
|
const {
|
|
22613
22604
|
visible,
|
|
22614
22605
|
className,
|
|
@@ -22833,7 +22824,7 @@
|
|
|
22833
22824
|
fontSize: 14
|
|
22834
22825
|
};
|
|
22835
22826
|
const WaterMark = (props) => {
|
|
22836
|
-
const { locale } = useConfig
|
|
22827
|
+
const { locale } = useConfig();
|
|
22837
22828
|
const {
|
|
22838
22829
|
content,
|
|
22839
22830
|
fullPage,
|
|
@@ -23391,9 +23382,9 @@
|
|
|
23391
23382
|
exports2.Video = Video;
|
|
23392
23383
|
exports2.VirtualList = VirtualList;
|
|
23393
23384
|
exports2.WaterMark = WaterMark;
|
|
23394
|
-
exports2.getDefaultConfig = getDefaultConfig
|
|
23385
|
+
exports2.getDefaultConfig = getDefaultConfig;
|
|
23395
23386
|
exports2.setDefaultConfig = setDefaultConfig;
|
|
23396
|
-
exports2.useConfig = useConfig
|
|
23387
|
+
exports2.useConfig = useConfig;
|
|
23397
23388
|
exports2.useRtl = useRtl;
|
|
23398
23389
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
23399
23390
|
});
|