@nutui/nutui-react-taro 2.3.12 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/esm/Address.js +1 -1
- package/dist/esm/AnimatingNumbers/style/style.css +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Badge.js +1 -1
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/CountDown.js +1 -1
- package/dist/esm/DatePicker.js +1 -1
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/InputNumber/style/style.css +1 -1
- package/dist/esm/InputNumber.js +1 -1
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +1 -1
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/Tabbar.js +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Table.js +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/Toast.js +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +1 -1
- package/dist/esm/Uploader.js +1 -1
- package/dist/esm/VirtualList.js +1 -1
- package/dist/esm/{address.taro-DjlXNWie.js → address.taro-CgkCHDYZ.js} +1 -1
- package/dist/esm/{badge.taro-CyDqBb9Z.js → badge.taro-D7Yn5zJi.js} +4 -1
- package/dist/esm/{cascader.taro-CpofskUL.js → cascader.taro-BMp2mI0W.js} +1 -1
- package/dist/esm/{checkbox.taro-D9F_HM7f.js → checkbox.taro-CUpF7Afr.js} +23 -5
- package/dist/esm/{countdown.taro-Dfa9kpmZ.js → countdown.taro-D-H9erkV.js} +1 -1
- package/dist/esm/{datepicker.taro-DshCn7Rn.js → datepicker.taro-DqR52Ivo.js} +1 -1
- package/dist/esm/{dialog.taro-xsQhsC1V.js → dialog.taro-Dk0QQMn_.js} +14 -6
- package/dist/esm/{inputnumber.taro-F3jNGr_V.js → inputnumber.taro-CQiAPZgS.js} +1 -1
- package/dist/esm/{noticebar.taro-CMdfOp2g.js → noticebar.taro-CRPbZenq.js} +26 -21
- package/dist/esm/nutui-react.es.js +18 -18
- package/dist/esm/{popover.taro-CcKwnX27.js → popover.taro-BsOaXoWp.js} +8 -6
- package/dist/esm/{tabbar.taro-8_SmJofa.js → tabbar.taro-LAPQoOva.js} +1 -1
- package/dist/esm/{tabbaritem.taro-Cb-yfOln.js → tabbaritem.taro-C4AZbQMG.js} +1 -1
- package/dist/esm/{table.taro-0BcEBB0F.js → table.taro-ClLmfqz3.js} +8 -7
- package/dist/esm/{tabs.taro-HgAoKBAc.js → tabs.taro-DRmZR3Xu.js} +5 -5
- package/dist/esm/{toast.taro-BIR_7Wgb.js → toast.taro-BVXqvjNJ.js} +3 -3
- package/dist/esm/{tour.taro-CMagdKcp.js → tour.taro-wfXuUebD.js} +1 -1
- package/dist/esm/types/src/packages/cell/demo.d.ts +0 -1
- package/dist/esm/types/src/packages/cell/demo.taro.d.ts +0 -1
- package/dist/esm/types/src/packages/cell/demos/h5/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/h5/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/cell/demos/taro/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +1 -0
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/dialog/config.d.ts +3 -3
- package/dist/esm/types/src/packages/dialog/index.d.ts +1 -1
- package/dist/esm/types/src/packages/noticebar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +2 -0
- package/dist/esm/types/src/packages/noticebar/noticebar.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/noticebar/types.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/index.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/popover.d.ts +2 -12
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -12
- package/dist/esm/types/src/packages/popover/types.d.ts +14 -0
- package/dist/esm/types/src/packages/table/useTableSticky.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +7 -3
- package/dist/esm/types/src/packages/tour/tour.d.ts +1 -1
- package/dist/esm/types/src/packages/tour/tour.taro.d.ts +1 -1
- package/dist/esm/{uploader.taro-CuaIVvya.js → uploader.taro-DdJ-sOK4.js} +2 -2
- package/dist/esm/{virtuallist.taro-C5vZAyza.js → virtuallist.taro-Cl08vfdg.js} +5 -4
- 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 +99 -51
- package/dist/nutui.react.umd.js +99 -51
- package/dist/packages/animatingnumbers/countup.scss +1 -0
- package/dist/packages/badge/badge.scss +2 -0
- package/dist/packages/checkbox/checkbox.scss +19 -0
- package/dist/packages/checkboxgroup/checkboxgroup.scss +25 -0
- package/dist/packages/collapseitem/collapseitem.scss +1 -6
- package/dist/packages/dialog/dialog.scss +8 -1
- package/dist/packages/noticebar/noticebar.scss +19 -1
- package/dist/packages/popover/popover.scss +21 -0
- package/dist/packages/swipe/swipe.scss +2 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +13 -0
- package/dist/styles/variables.scss +19 -12
- package/dist/types/index.d.ts +98 -98
- package/dist/types/packages/actionsheet/actionsheet.d.ts +1 -1
- package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +1 -1
- package/dist/types/packages/address/address.d.ts +1 -1
- package/dist/types/packages/address/address.taro.d.ts +1 -1
- package/dist/types/packages/address/customRender.d.ts +1 -1
- package/dist/types/packages/address/customRender.taro.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.taro.d.ts +1 -1
- package/dist/types/packages/badge/badge.taro.d.ts +1 -1
- package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -1
- package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.taro.d.ts +1 -1
- package/dist/types/packages/cell/cell.d.ts +1 -1
- package/dist/types/packages/cell/cell.taro.d.ts +1 -1
- package/dist/types/packages/cell/demos/h5/demo1.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo2.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo3.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo4.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo5.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo6.d.ts +3 -0
- package/dist/types/packages/cell/demos/h5/demo7.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo1.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo2.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo3.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo4.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo5.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo6.d.ts +3 -0
- package/dist/types/packages/cell/demos/taro/demo7.d.ts +3 -0
- package/dist/types/packages/checkbox/checkbox.d.ts +2 -2
- package/dist/types/packages/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +3 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +3 -2
- package/dist/types/packages/checkboxgroup/context.d.ts +1 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/datepicker/datepicker.d.ts +1 -1
- package/dist/types/packages/datepicker/datepicker.taro.d.ts +1 -1
- package/dist/types/packages/dialog/config.d.ts +3 -3
- package/dist/types/packages/dialog/dialogwrap.d.ts +1 -1
- package/dist/types/packages/dialog/index.d.ts +1 -1
- package/dist/types/packages/empty/empty.d.ts +1 -1
- package/dist/types/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/types/packages/fixednav/fixednav.taro.d.ts +1 -1
- package/dist/types/packages/form/form.d.ts +1 -1
- package/dist/types/packages/form/form.taro.d.ts +1 -1
- package/dist/types/packages/form/index.d.ts +1 -1
- package/dist/types/packages/form/index.taro.d.ts +1 -1
- package/dist/types/packages/menu/menu.d.ts +1 -1
- package/dist/types/packages/menu/menu.taro.d.ts +1 -1
- package/dist/types/packages/noticebar/index.d.ts +1 -0
- package/dist/types/packages/noticebar/noticebar.d.ts +2 -0
- package/dist/types/packages/noticebar/noticebar.taro.d.ts +6 -0
- package/dist/types/packages/noticebar/types.d.ts +1 -0
- package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +1 -1
- package/dist/types/packages/nutui.react.build.d.ts +98 -98
- package/dist/types/packages/nutui.react.d.ts +98 -98
- package/dist/types/packages/nutui.react.taro.d.ts +98 -98
- package/dist/types/packages/picker/picker.d.ts +1 -1
- package/dist/types/packages/picker/picker.taro.d.ts +1 -1
- package/dist/types/packages/popover/index.d.ts +2 -1
- package/dist/types/packages/popover/index.taro.d.ts +2 -1
- package/dist/types/packages/popover/popover.d.ts +3 -13
- package/dist/types/packages/popover/popover.taro.d.ts +3 -13
- package/dist/types/packages/popover/types.d.ts +14 -0
- package/dist/types/packages/popup/popup.d.ts +1 -1
- package/dist/types/packages/popup/popup.taro.d.ts +1 -1
- package/dist/types/packages/radio/radio.d.ts +2 -2
- package/dist/types/packages/radio/radio.taro.d.ts +2 -2
- package/dist/types/packages/shortpassword/shortpassword.d.ts +1 -1
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +1 -1
- package/dist/types/packages/swiper/index.d.ts +1 -1
- package/dist/types/packages/swiper/index.taro.d.ts +1 -1
- package/dist/types/packages/table/useTableSticky.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.taro.d.ts +1 -1
- package/dist/types/packages/toast/toast.taro.d.ts +8 -4
- package/dist/types/packages/tour/tour.d.ts +1 -1
- package/dist/types/packages/tour/tour.taro.d.ts +1 -1
- package/package.json +1 -1
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v2.
|
|
2
|
+
* @nutui/nutui-react-taro v2.4.0 Fri Mar 08 2024 14:36:52 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2023 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -4934,6 +4934,7 @@ const defaultProps$1d = {
|
|
|
4934
4934
|
};
|
|
4935
4935
|
const Badge = (props) => {
|
|
4936
4936
|
var _a;
|
|
4937
|
+
const rtl = useRtl();
|
|
4937
4938
|
const { className, style, value, max, children, dot, top, right: right2, color } = {
|
|
4938
4939
|
...defaultProps$1d,
|
|
4939
4940
|
...props
|
|
@@ -4971,7 +4972,8 @@ const Badge = (props) => {
|
|
|
4971
4972
|
const getStyle = () => {
|
|
4972
4973
|
const style2 = {};
|
|
4973
4974
|
style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
|
|
4974
|
-
|
|
4975
|
+
const dir = rtl ? "left" : "right";
|
|
4976
|
+
style2[dir] = `${Number(right2) || parseFloat(String(right2)) || 0}px`;
|
|
4975
4977
|
style2.background = color;
|
|
4976
4978
|
return style2;
|
|
4977
4979
|
};
|
|
@@ -5279,7 +5281,7 @@ const Tabs = (props) => {
|
|
|
5279
5281
|
}
|
|
5280
5282
|
animate();
|
|
5281
5283
|
};
|
|
5282
|
-
const scrollIntoView = () => {
|
|
5284
|
+
const scrollIntoView = (index) => {
|
|
5283
5285
|
requestAniFrame$1(() => {
|
|
5284
5286
|
Promise.all([
|
|
5285
5287
|
getRect2(`#nut-tabs-titles-${name || uuid} .nut-tabs-list`),
|
|
@@ -5287,20 +5289,20 @@ const Tabs = (props) => {
|
|
|
5287
5289
|
]).then(([navRect, titleRects]) => {
|
|
5288
5290
|
navRectRef.current = navRect;
|
|
5289
5291
|
titleRectRef.current = titleRects;
|
|
5290
|
-
const titleRect = titleRectRef.current[
|
|
5292
|
+
const titleRect = titleRectRef.current[index];
|
|
5291
5293
|
if (!titleRect)
|
|
5292
5294
|
return;
|
|
5293
5295
|
let to = 0;
|
|
5294
5296
|
if (props.direction === "vertical") {
|
|
5295
5297
|
const DEFAULT_PADDING = 11;
|
|
5296
|
-
const top = titleRects.slice(0,
|
|
5298
|
+
const top = titleRects.slice(0, index).reduce(
|
|
5297
5299
|
(prev, curr) => prev + curr.height,
|
|
5298
5300
|
DEFAULT_PADDING
|
|
5299
5301
|
);
|
|
5300
5302
|
to = top - (navRectRef.current.height - titleRect.height) / 2;
|
|
5301
5303
|
} else {
|
|
5302
5304
|
const DEFAULT_PADDING = 20;
|
|
5303
|
-
const left2 = titleRects.slice(0,
|
|
5305
|
+
const left2 = titleRects.slice(0, index).reduce(
|
|
5304
5306
|
(prev, curr) => prev + curr.width,
|
|
5305
5307
|
DEFAULT_PADDING
|
|
5306
5308
|
);
|
|
@@ -5319,7 +5321,7 @@ const Tabs = (props) => {
|
|
|
5319
5321
|
transform: direction === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
|
|
5320
5322
|
transitionDuration: `${duration}ms`
|
|
5321
5323
|
});
|
|
5322
|
-
scrollIntoView();
|
|
5324
|
+
scrollIntoView(index);
|
|
5323
5325
|
}, [value]);
|
|
5324
5326
|
const tabChange = (item, index) => {
|
|
5325
5327
|
onClick && onClick(item.value);
|
|
@@ -7543,6 +7545,7 @@ const Context$1 = CheckboxGroupContext;
|
|
|
7543
7545
|
const defaultProps$11 = {
|
|
7544
7546
|
max: void 0,
|
|
7545
7547
|
min: void 0,
|
|
7548
|
+
list: false,
|
|
7546
7549
|
labelPosition: "right",
|
|
7547
7550
|
direction: "vertical",
|
|
7548
7551
|
onChange: (value) => {
|
|
@@ -7558,6 +7561,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
7558
7561
|
children,
|
|
7559
7562
|
className,
|
|
7560
7563
|
disabled,
|
|
7564
|
+
list,
|
|
7561
7565
|
onChange,
|
|
7562
7566
|
value,
|
|
7563
7567
|
defaultValue,
|
|
@@ -7621,6 +7625,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
7621
7625
|
labelPosition: labelPosition || "right",
|
|
7622
7626
|
disabled,
|
|
7623
7627
|
max,
|
|
7628
|
+
list,
|
|
7624
7629
|
onLimit,
|
|
7625
7630
|
value: _value,
|
|
7626
7631
|
check: (value2) => {
|
|
@@ -7647,7 +7652,8 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
7647
7652
|
className: classNames(
|
|
7648
7653
|
classPrefix$j,
|
|
7649
7654
|
{
|
|
7650
|
-
[`nut-checkboxgroup-${props.direction}`]: props.direction
|
|
7655
|
+
[`nut-checkboxgroup-${props.direction}`]: props.direction,
|
|
7656
|
+
[`nut-checkboxgroup-list`]: list
|
|
7651
7657
|
},
|
|
7652
7658
|
className
|
|
7653
7659
|
),
|
|
@@ -7747,6 +7753,9 @@ const Checkbox = (props) => {
|
|
|
7747
7753
|
if (innerChecked && !innerIndeterminate) {
|
|
7748
7754
|
return `${cls}${classPrefix$i}-icon-checked ${classPrefix$i}-icon-disabled`;
|
|
7749
7755
|
}
|
|
7756
|
+
if (innerChecked && innerIndeterminate) {
|
|
7757
|
+
return `${cls}${classPrefix$i}-icon-indeterminate ${classPrefix$i}-icon-disabled`;
|
|
7758
|
+
}
|
|
7750
7759
|
return `${cls}${classPrefix$i}-icon-disabled`;
|
|
7751
7760
|
}
|
|
7752
7761
|
if (innerChecked) {
|
|
@@ -7776,7 +7785,7 @@ const Checkbox = (props) => {
|
|
|
7776
7785
|
};
|
|
7777
7786
|
const renderButton = () => {
|
|
7778
7787
|
return /* @__PURE__ */ React__default.createElement(
|
|
7779
|
-
|
|
7788
|
+
View,
|
|
7780
7789
|
{
|
|
7781
7790
|
className: classNames(`${classPrefix$i}-button`, {
|
|
7782
7791
|
[`${classPrefix$i}-button-active`]: innerChecked,
|
|
@@ -7784,17 +7793,23 @@ const Checkbox = (props) => {
|
|
|
7784
7793
|
})
|
|
7785
7794
|
},
|
|
7786
7795
|
children || label,
|
|
7787
|
-
innerChecked && activeIcon ? /* @__PURE__ */ React__default.createElement(
|
|
7796
|
+
innerChecked && activeIcon ? /* @__PURE__ */ React__default.createElement(View, { className: classNames(`${classPrefix$i}-button-icon`) }, activeIcon) : null
|
|
7788
7797
|
);
|
|
7789
7798
|
};
|
|
7799
|
+
const renderListItem = () => {
|
|
7800
|
+
return /* @__PURE__ */ React__default.createElement(View, { className: "nut-checkbox-list-item" }, renderLabel(), renderIcon());
|
|
7801
|
+
};
|
|
7790
7802
|
const renderCheckboxItem = () => {
|
|
7803
|
+
if (ctx == null ? void 0 : ctx.list) {
|
|
7804
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderListItem());
|
|
7805
|
+
}
|
|
7791
7806
|
if (shape === "button") {
|
|
7792
7807
|
return renderButton();
|
|
7793
7808
|
}
|
|
7794
7809
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderIcon(), renderLabel());
|
|
7795
7810
|
};
|
|
7796
7811
|
return /* @__PURE__ */ React__default.createElement(
|
|
7797
|
-
|
|
7812
|
+
View,
|
|
7798
7813
|
{
|
|
7799
7814
|
className: classNames(
|
|
7800
7815
|
classPrefix$i,
|
|
@@ -8621,7 +8636,7 @@ const DatePicker = (props) => {
|
|
|
8621
8636
|
} else {
|
|
8622
8637
|
cmin++;
|
|
8623
8638
|
}
|
|
8624
|
-
if (cmin <= val) {
|
|
8639
|
+
if (cmin <= Number(val)) {
|
|
8625
8640
|
index++;
|
|
8626
8641
|
}
|
|
8627
8642
|
}
|
|
@@ -10517,7 +10532,7 @@ const InputNumber = (props) => {
|
|
|
10517
10532
|
);
|
|
10518
10533
|
const nextValue = bound2(shouldOverBoundary, Number(min), Number(max));
|
|
10519
10534
|
setShadowValue(nextValue);
|
|
10520
|
-
if (negative ? shouldOverBoundary < min : shouldOverBoundary > max) {
|
|
10535
|
+
if (negative ? shouldOverBoundary < Number(min) : shouldOverBoundary > Number(max)) {
|
|
10521
10536
|
onOverlimit == null ? void 0 : onOverlimit(e2);
|
|
10522
10537
|
} else {
|
|
10523
10538
|
onChange == null ? void 0 : onChange(nextValue, e2);
|
|
@@ -13063,7 +13078,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13063
13078
|
const handleItemClick = (file, index) => {
|
|
13064
13079
|
onFileItemClick == null ? void 0 : onFileItemClick(file, index);
|
|
13065
13080
|
};
|
|
13066
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader-slot" }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children || /* @__PURE__ */ React__default.createElement(Button, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React__default.createElement(Button, { className: "nut-uploader-input", onClick: _chooseImage }))), /* @__PURE__ */ React__default.createElement(
|
|
13081
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader-slot" }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children || /* @__PURE__ */ React__default.createElement(Button, { size: "small", type: "primary" }, "上传文件"), Number(maxCount) > fileList.length && /* @__PURE__ */ React__default.createElement(Button, { className: "nut-uploader-input", onClick: _chooseImage }))), /* @__PURE__ */ React__default.createElement(
|
|
13067
13082
|
Preview,
|
|
13068
13083
|
{
|
|
13069
13084
|
...{
|
|
@@ -13076,7 +13091,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13076
13091
|
children
|
|
13077
13092
|
}
|
|
13078
13093
|
}
|
|
13079
|
-
), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React__default.createElement(
|
|
13094
|
+
), Number(maxCount) > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React__default.createElement(
|
|
13080
13095
|
"div",
|
|
13081
13096
|
{
|
|
13082
13097
|
className: `nut-uploader-upload ${previewType} ${disabled ? "nut-uploader-upload-disabled" : ""}`
|
|
@@ -13275,6 +13290,7 @@ const defaultProps$G = {
|
|
|
13275
13290
|
const BaseDialog = (props) => {
|
|
13276
13291
|
const classPrefix2 = "nut-dialog";
|
|
13277
13292
|
const { locale } = useConfig$1();
|
|
13293
|
+
const [loading, setLoading] = useState(false);
|
|
13278
13294
|
const {
|
|
13279
13295
|
params: {
|
|
13280
13296
|
id,
|
|
@@ -13329,10 +13345,16 @@ const BaseDialog = (props) => {
|
|
|
13329
13345
|
onClose == null ? void 0 : onClose();
|
|
13330
13346
|
onCancel == null ? void 0 : onCancel();
|
|
13331
13347
|
};
|
|
13332
|
-
const handleOk = (e2) => {
|
|
13348
|
+
const handleOk = async (e2) => {
|
|
13333
13349
|
e2.stopPropagation();
|
|
13334
|
-
|
|
13335
|
-
|
|
13350
|
+
setLoading(true);
|
|
13351
|
+
try {
|
|
13352
|
+
await (onConfirm == null ? void 0 : onConfirm(e2));
|
|
13353
|
+
setLoading(false);
|
|
13354
|
+
onClose == null ? void 0 : onClose();
|
|
13355
|
+
} catch {
|
|
13356
|
+
setLoading(false);
|
|
13357
|
+
}
|
|
13336
13358
|
};
|
|
13337
13359
|
return footer || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !hideCancelButton && /* @__PURE__ */ React__default.createElement(
|
|
13338
13360
|
Button,
|
|
@@ -13350,7 +13372,8 @@ const BaseDialog = (props) => {
|
|
|
13350
13372
|
disabled: disableConfirmButton
|
|
13351
13373
|
}),
|
|
13352
13374
|
disabled: disableConfirmButton,
|
|
13353
|
-
onClick: (e2) => handleOk(e2)
|
|
13375
|
+
onClick: (e2) => handleOk(e2),
|
|
13376
|
+
loading
|
|
13354
13377
|
},
|
|
13355
13378
|
confirmText || locale.confirm
|
|
13356
13379
|
));
|
|
@@ -13790,6 +13813,7 @@ Loading.defaultProps = defaultProps$C;
|
|
|
13790
13813
|
Loading.displayName = "NutLoading";
|
|
13791
13814
|
const defaultProps$B = {
|
|
13792
13815
|
...ComponentDefaults,
|
|
13816
|
+
align: "left",
|
|
13793
13817
|
direction: "horizontal",
|
|
13794
13818
|
list: [],
|
|
13795
13819
|
duration: 1e3,
|
|
@@ -13804,10 +13828,12 @@ const defaultProps$B = {
|
|
|
13804
13828
|
speed: 50
|
|
13805
13829
|
};
|
|
13806
13830
|
const NoticeBar = (props) => {
|
|
13831
|
+
const rtl = useRtl();
|
|
13807
13832
|
const {
|
|
13808
13833
|
children,
|
|
13809
13834
|
className,
|
|
13810
13835
|
style,
|
|
13836
|
+
align,
|
|
13811
13837
|
direction,
|
|
13812
13838
|
list,
|
|
13813
13839
|
duration,
|
|
@@ -13914,7 +13940,7 @@ const NoticeBar = (props) => {
|
|
|
13914
13940
|
const contentRes = await getRectByTaro(contentRef.current);
|
|
13915
13941
|
const wrapW = warpRes.width;
|
|
13916
13942
|
const offsetW = contentRes.width;
|
|
13917
|
-
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
13943
|
+
const canScroll = align === "left" && scrollable == null ? offsetW > wrapW : scrollable;
|
|
13918
13944
|
SetIsCanScroll(canScroll);
|
|
13919
13945
|
if (canScroll) {
|
|
13920
13946
|
SetWrapWidth(wrapW);
|
|
@@ -13965,7 +13991,7 @@ const NoticeBar = (props) => {
|
|
|
13965
13991
|
onClose && onClose(event);
|
|
13966
13992
|
};
|
|
13967
13993
|
const isEllipsis = () => {
|
|
13968
|
-
if (isCanScroll == null) {
|
|
13994
|
+
if (isCanScroll == null && align === "left") {
|
|
13969
13995
|
return wrap;
|
|
13970
13996
|
}
|
|
13971
13997
|
return !isCanScroll && !wrap;
|
|
@@ -13973,7 +13999,7 @@ const NoticeBar = (props) => {
|
|
|
13973
13999
|
const contentStyle = {
|
|
13974
14000
|
animationDelay: `${firstRound ? delay : 0}s`,
|
|
13975
14001
|
animationDuration: `${animationDuration}s`,
|
|
13976
|
-
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`
|
|
14002
|
+
transform: `translateX(${firstRound ? 0 : `${rtl ? -wrapWidth : wrapWidth}px`})`
|
|
13977
14003
|
};
|
|
13978
14004
|
const barStyle = {
|
|
13979
14005
|
height: isVertical ? `${height}px` : ""
|
|
@@ -14119,16 +14145,18 @@ const NoticeBar = (props) => {
|
|
|
14119
14145
|
}
|
|
14120
14146
|
};
|
|
14121
14147
|
const noticebarClass = classNames({
|
|
14122
|
-
|
|
14123
|
-
[
|
|
14148
|
+
[`${classPrefix2}-box`]: true,
|
|
14149
|
+
[`${classPrefix2}-box-wrapable`]: wrap,
|
|
14150
|
+
[`${classPrefix2}-box-${align}`]: true
|
|
14124
14151
|
});
|
|
14152
|
+
const cls = classNames(classPrefix2, className);
|
|
14125
14153
|
useEffect(() => {
|
|
14126
14154
|
return () => {
|
|
14127
14155
|
stopAutoPlay();
|
|
14128
14156
|
};
|
|
14129
14157
|
}, []);
|
|
14130
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14131
|
-
|
|
14158
|
+
return /* @__PURE__ */ React__default.createElement(View, { className: cls, style }, showNoticeBar && direction === "horizontal" ? /* @__PURE__ */ React__default.createElement(View, { className: noticebarClass, style: barStyle, onClick: handleClick }, leftIcon ? /* @__PURE__ */ React__default.createElement(View, { className: "nut-noticebar-box-left-icon" }, leftIcon) : null, /* @__PURE__ */ React__default.createElement(View, { ref: wrapRef, className: "nut-noticebar-box-wrap" }, /* @__PURE__ */ React__default.createElement(
|
|
14159
|
+
View,
|
|
14132
14160
|
{
|
|
14133
14161
|
ref: contentRef,
|
|
14134
14162
|
className: `nut-noticebar-box-wrap-content ${animationClass} ${isEllipsis() ? "nut-ellipsis" : ""}`,
|
|
@@ -14137,18 +14165,25 @@ const NoticeBar = (props) => {
|
|
|
14137
14165
|
},
|
|
14138
14166
|
children,
|
|
14139
14167
|
content
|
|
14140
|
-
)), closeable || rightIcon ? /* @__PURE__ */ React__default.createElement(
|
|
14141
|
-
|
|
14168
|
+
)), closeable || rightIcon ? /* @__PURE__ */ React__default.createElement(
|
|
14169
|
+
View,
|
|
14170
|
+
{
|
|
14171
|
+
className: "nut-noticebar-box-right-icon",
|
|
14172
|
+
onClick: onClickIcon
|
|
14173
|
+
},
|
|
14174
|
+
rightIcon || /* @__PURE__ */ React__default.createElement(A$1, { size: 12 })
|
|
14175
|
+
) : null) : null, showNoticeBar && scrollList.current.length > 0 && isVertical ? /* @__PURE__ */ React__default.createElement(
|
|
14176
|
+
View,
|
|
14142
14177
|
{
|
|
14143
14178
|
className: "nut-noticebar-vertical",
|
|
14144
14179
|
style: barStyle,
|
|
14145
14180
|
ref: container,
|
|
14146
14181
|
onClick: handleClick
|
|
14147
14182
|
},
|
|
14148
|
-
leftIcon ? /* @__PURE__ */ React__default.createElement(
|
|
14149
|
-
children ? /* @__PURE__ */ React__default.createElement(
|
|
14183
|
+
leftIcon ? /* @__PURE__ */ React__default.createElement(View, { className: "nut-noticebar-box-left-icon" }, leftIcon) : null,
|
|
14184
|
+
children ? /* @__PURE__ */ React__default.createElement(View, { className: "nut-noticebar-box-wrap", ref: innerRef }, scrollList.current.map((item, index) => {
|
|
14150
14185
|
return /* @__PURE__ */ React__default.createElement(
|
|
14151
|
-
|
|
14186
|
+
View,
|
|
14152
14187
|
{
|
|
14153
14188
|
style: itemStyle(index),
|
|
14154
14189
|
key: index,
|
|
@@ -14159,7 +14194,7 @@ const NoticeBar = (props) => {
|
|
|
14159
14194
|
item
|
|
14160
14195
|
);
|
|
14161
14196
|
})) : /* @__PURE__ */ React__default.createElement(
|
|
14162
|
-
|
|
14197
|
+
View,
|
|
14163
14198
|
{
|
|
14164
14199
|
className: "nut-noticebar-box-horseLamp-list",
|
|
14165
14200
|
style: horseLampStyle
|
|
@@ -14168,7 +14203,7 @@ const NoticeBar = (props) => {
|
|
|
14168
14203
|
return (
|
|
14169
14204
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
14170
14205
|
/* @__PURE__ */ React__default.createElement(
|
|
14171
|
-
|
|
14206
|
+
View,
|
|
14172
14207
|
{
|
|
14173
14208
|
className: "nut-noticebar-box-horseLamp-list-item",
|
|
14174
14209
|
style: { height },
|
|
@@ -14183,7 +14218,7 @@ const NoticeBar = (props) => {
|
|
|
14183
14218
|
})
|
|
14184
14219
|
),
|
|
14185
14220
|
/* @__PURE__ */ React__default.createElement(
|
|
14186
|
-
|
|
14221
|
+
View,
|
|
14187
14222
|
{
|
|
14188
14223
|
className: "nut-noticebar-box-right-icon",
|
|
14189
14224
|
onClick: (e2) => {
|
|
@@ -14300,6 +14335,7 @@ Notify.close = close;
|
|
|
14300
14335
|
const defaultProps$z = {
|
|
14301
14336
|
...ComponentDefaults,
|
|
14302
14337
|
list: [],
|
|
14338
|
+
theme: "light",
|
|
14303
14339
|
location: "bottom",
|
|
14304
14340
|
visible: false,
|
|
14305
14341
|
offset: [0, 12],
|
|
@@ -14307,9 +14343,9 @@ const defaultProps$z = {
|
|
|
14307
14343
|
targetId: "",
|
|
14308
14344
|
className: "",
|
|
14309
14345
|
showArrow: true,
|
|
14310
|
-
overlay: false,
|
|
14311
14346
|
closeOnOutsideClick: true,
|
|
14312
14347
|
closeOnActionClick: true,
|
|
14348
|
+
overlay: false,
|
|
14313
14349
|
onClick: () => {
|
|
14314
14350
|
},
|
|
14315
14351
|
onOpen: () => {
|
|
@@ -14322,16 +14358,17 @@ const Popover = (props) => {
|
|
|
14322
14358
|
const {
|
|
14323
14359
|
children,
|
|
14324
14360
|
list,
|
|
14361
|
+
theme,
|
|
14325
14362
|
location,
|
|
14326
14363
|
visible,
|
|
14327
14364
|
offset,
|
|
14365
|
+
arrowOffset,
|
|
14328
14366
|
targetId,
|
|
14329
14367
|
overlay,
|
|
14330
14368
|
closeOnOutsideClick,
|
|
14331
14369
|
closeOnActionClick,
|
|
14332
14370
|
className,
|
|
14333
14371
|
showArrow,
|
|
14334
|
-
arrowOffset,
|
|
14335
14372
|
style,
|
|
14336
14373
|
onClick,
|
|
14337
14374
|
onOpen,
|
|
@@ -14403,7 +14440,8 @@ const Popover = (props) => {
|
|
|
14403
14440
|
};
|
|
14404
14441
|
const classes = classNames(
|
|
14405
14442
|
{
|
|
14406
|
-
[`${classPrefix$c}`]: true
|
|
14443
|
+
[`${classPrefix$c}`]: true,
|
|
14444
|
+
[`${classPrefix$c}-${theme}`]: theme === "dark"
|
|
14407
14445
|
},
|
|
14408
14446
|
className
|
|
14409
14447
|
);
|
|
@@ -14511,11 +14549,12 @@ const Popover = (props) => {
|
|
|
14511
14549
|
className: "nut-popover-wrapper",
|
|
14512
14550
|
ref: popoverRef,
|
|
14513
14551
|
onClick: () => {
|
|
14514
|
-
|
|
14552
|
+
var _a;
|
|
14553
|
+
(_a = props == null ? void 0 : props.onClick) == null ? void 0 : _a.call(props);
|
|
14515
14554
|
if (!visible) {
|
|
14516
|
-
onOpen
|
|
14555
|
+
onOpen == null ? void 0 : onOpen();
|
|
14517
14556
|
} else {
|
|
14518
|
-
onClose
|
|
14557
|
+
onClose == null ? void 0 : onClose();
|
|
14519
14558
|
}
|
|
14520
14559
|
},
|
|
14521
14560
|
style
|
|
@@ -15134,6 +15173,7 @@ const defaultProps$t = {
|
|
|
15134
15173
|
id: "",
|
|
15135
15174
|
icon: null,
|
|
15136
15175
|
iconSize: "20",
|
|
15176
|
+
content: "",
|
|
15137
15177
|
msg: "",
|
|
15138
15178
|
duration: 2,
|
|
15139
15179
|
// 时长,duration为0则一直展示
|
|
@@ -15161,6 +15201,7 @@ const Toast = (props) => {
|
|
|
15161
15201
|
contentStyle,
|
|
15162
15202
|
icon,
|
|
15163
15203
|
iconSize,
|
|
15204
|
+
content,
|
|
15164
15205
|
msg,
|
|
15165
15206
|
duration,
|
|
15166
15207
|
type: type4,
|
|
@@ -15272,7 +15313,7 @@ const Toast = (props) => {
|
|
|
15272
15313
|
},
|
|
15273
15314
|
hasIcon() ? /* @__PURE__ */ React__default.createElement("p", { className: `${classPrefix$9}-icon-wrapper` }, iconName()) : null,
|
|
15274
15315
|
title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$9}-title` }, title) : null,
|
|
15275
|
-
/* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix$9}-text` }, msg)
|
|
15316
|
+
/* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix$9}-text` }, content || msg)
|
|
15276
15317
|
))
|
|
15277
15318
|
) : null);
|
|
15278
15319
|
};
|
|
@@ -16036,7 +16077,7 @@ const InternalCountDown = (props, ref) => {
|
|
|
16036
16077
|
if (!timeStr)
|
|
16037
16078
|
return Date.now();
|
|
16038
16079
|
let t2 = timeStr;
|
|
16039
|
-
t2 = t2 > 0 ? +t2 : t2.toString().replace(/-/g, "/");
|
|
16080
|
+
t2 = Number(t2) > 0 ? +t2 : t2.toString().replace(/-/g, "/");
|
|
16040
16081
|
return new Date(t2).getTime();
|
|
16041
16082
|
};
|
|
16042
16083
|
const initTime = () => {
|
|
@@ -17258,7 +17299,7 @@ const Steps = (props) => {
|
|
|
17258
17299
|
};
|
|
17259
17300
|
Steps.defaultProps = defaultProps$c;
|
|
17260
17301
|
Steps.displayName = "NutSteps";
|
|
17261
|
-
function useTableSticky(columns) {
|
|
17302
|
+
function useTableSticky(columns, rtl = false) {
|
|
17262
17303
|
const [isSticky, setIsSticky] = useState(false);
|
|
17263
17304
|
const [stickyColumnStyleMap, setStickyColumnStyleMap] = useState({});
|
|
17264
17305
|
const [stickyColumnClassMap, setStickyColumnClassMap] = useState({});
|
|
@@ -17273,9 +17314,9 @@ function useTableSticky(columns) {
|
|
|
17273
17314
|
let _stickyLeftWidth = 0;
|
|
17274
17315
|
let _stickyRightWidth = 0;
|
|
17275
17316
|
leftColumns.forEach((curr, index) => {
|
|
17276
|
-
|
|
17317
|
+
const dir = rtl ? "right" : "left";
|
|
17277
17318
|
_columnStyleMap[curr.key] = {
|
|
17278
|
-
|
|
17319
|
+
[dir]: _stickyLeftWidth || 0,
|
|
17279
17320
|
width: curr.width || "auto"
|
|
17280
17321
|
};
|
|
17281
17322
|
_columnClassMap[curr.key] = {
|
|
@@ -17291,9 +17332,9 @@ function useTableSticky(columns) {
|
|
|
17291
17332
|
});
|
|
17292
17333
|
for (let i2 = rightColumns.length - 1; i2 >= 0; i2--) {
|
|
17293
17334
|
const curr = rightColumns[i2];
|
|
17294
|
-
|
|
17335
|
+
const dir = rtl ? "left" : "right";
|
|
17295
17336
|
_columnStyleMap[curr.key] = {
|
|
17296
|
-
|
|
17337
|
+
[dir]: _stickyRightWidth || 0,
|
|
17297
17338
|
width: curr.width || "auto"
|
|
17298
17339
|
};
|
|
17299
17340
|
_columnClassMap[curr.key] = {
|
|
@@ -17340,6 +17381,7 @@ const defaultProps$b = {
|
|
|
17340
17381
|
};
|
|
17341
17382
|
const Table = (props) => {
|
|
17342
17383
|
const { locale } = useConfig$1();
|
|
17384
|
+
const rtl = useRtl();
|
|
17343
17385
|
defaultProps$b.noData = locale.noData;
|
|
17344
17386
|
const {
|
|
17345
17387
|
children,
|
|
@@ -17370,7 +17412,7 @@ const Table = (props) => {
|
|
|
17370
17412
|
stickyRightWidth,
|
|
17371
17413
|
getStickyClass,
|
|
17372
17414
|
getStickyStyle
|
|
17373
|
-
} = useTableSticky(columns);
|
|
17415
|
+
} = useTableSticky(columns, rtl);
|
|
17374
17416
|
useEffect(() => {
|
|
17375
17417
|
setValue(data);
|
|
17376
17418
|
}, [data]);
|
|
@@ -17883,11 +17925,9 @@ const updateItemSize = (positions, items, sizeKey, margin) => {
|
|
|
17883
17925
|
}
|
|
17884
17926
|
});
|
|
17885
17927
|
};
|
|
17886
|
-
const clientHeight = getSystemInfoSync().windowHeight - 5 || 667;
|
|
17887
17928
|
const defaultProps$7 = {
|
|
17888
17929
|
...ComponentDefaults,
|
|
17889
17930
|
list: [],
|
|
17890
|
-
containerHeight: clientHeight,
|
|
17891
17931
|
itemHeight: 66,
|
|
17892
17932
|
margin: 10,
|
|
17893
17933
|
itemEqual: true,
|
|
@@ -17904,12 +17944,20 @@ const VirtualList = (props) => {
|
|
|
17904
17944
|
key,
|
|
17905
17945
|
onScroll,
|
|
17906
17946
|
className,
|
|
17907
|
-
containerHeight,
|
|
17947
|
+
containerHeight: origContainerHeight,
|
|
17908
17948
|
...rest
|
|
17909
17949
|
} = {
|
|
17910
17950
|
...defaultProps$7,
|
|
17911
17951
|
...props
|
|
17912
17952
|
};
|
|
17953
|
+
const clientHeight = useMemo$1(
|
|
17954
|
+
() => getSystemInfoSync().windowHeight - 5 || 667,
|
|
17955
|
+
[]
|
|
17956
|
+
);
|
|
17957
|
+
const containerHeight = useMemo$1(
|
|
17958
|
+
() => origContainerHeight ?? clientHeight,
|
|
17959
|
+
[origContainerHeight, clientHeight]
|
|
17960
|
+
);
|
|
17913
17961
|
const [startOffset, setStartOffset] = useState(0);
|
|
17914
17962
|
const start = useRef(0);
|
|
17915
17963
|
const scrollRef = useRef(null);
|