@nutui/nutui-react 1.3.7 → 1.3.8
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 +26 -0
- package/dist/esm/Avatar.js +4 -5
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/Cell.js +5 -2
- package/dist/esm/Collapse.js +7 -3
- package/dist/esm/Input.js +35 -19
- package/dist/esm/InputNumber.js +15 -1
- package/dist/esm/NoticeBar.js +6 -0
- package/dist/esm/Radio.js +2 -2
- package/dist/esm/Range.js +7 -1
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/SideNavBarItem.js +3 -3
- package/dist/esm/Signature.js +14 -8
- package/dist/esm/Step.js +3 -5
- package/dist/esm/Steps.js +2 -1
- package/dist/esm/SubSideNavBar.js +3 -3
- package/dist/esm/Switch.js +2 -2
- package/dist/esm/TabPane.js +2 -2
- package/dist/esm/Tabbar.js +5 -2
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/TimeSelect.js +20 -5
- package/dist/esm/Uploader.js +1 -1
- package/dist/esm/Video.js +7 -1
- package/dist/esm/VirtualList.js +11 -6
- package/dist/esm/{tabpane-c957ab14.js → tabpane-9b8ca8a8.js} +3 -2
- package/dist/esm/{tabs-0896a61b.js → tabs-ee05fd2f.js} +8 -4
- package/dist/esm/types/src/packages/avatar/avatar.d.ts +1 -0
- package/dist/esm/types/src/packages/cell/cell.d.ts +1 -0
- package/dist/esm/types/src/packages/collapse/collapse.d.ts +3 -1
- package/dist/esm/types/src/packages/input/input.d.ts +10 -2
- package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +6 -0
- package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +3 -1
- package/dist/esm/types/src/packages/range/range.d.ts +4 -1
- package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +1 -1
- package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +1 -1
- package/dist/esm/types/src/packages/signature/signature.d.ts +2 -0
- package/dist/esm/types/src/packages/steps/steps.d.ts +1 -0
- package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +1 -1
- package/dist/esm/types/src/packages/switch/switch.d.ts +1 -1
- package/dist/esm/types/src/packages/tabbar/tabbar.d.ts +1 -0
- package/dist/esm/types/src/packages/tabpane/tabpane.d.ts +6 -2
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -0
- package/dist/esm/types/src/packages/timeselect/timeselect.d.ts +5 -1
- package/dist/esm/types/src/packages/video/video.d.ts +3 -0
- package/dist/esm/types/src/packages/virtuallist/type.d.ts +3 -1
- package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +2 -2
- 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/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +162 -65
- package/dist/nutui.react.umd.js +162 -65
- package/dist/packages/divider/divider.scss +2 -1
- package/dist/packages/noticebar/noticebar.scss +4 -1
- package/dist/packages/tabs/tabs.scss +3 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/types/index.d.ts +54 -14
- package/package.json +3 -1
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.
|
|
2
|
+
* @nutui/nutui-react v1.3.8 Wed Oct 26 2022 17:29:09 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1469,12 +1469,15 @@ const defaultProps$1j = {
|
|
|
1469
1469
|
iconSlot: null,
|
|
1470
1470
|
linkSlot: null,
|
|
1471
1471
|
click: (event) => {
|
|
1472
|
+
},
|
|
1473
|
+
onClick: (event) => {
|
|
1472
1474
|
}
|
|
1473
1475
|
};
|
|
1474
1476
|
const Cell = (props) => {
|
|
1475
1477
|
const {
|
|
1476
1478
|
children,
|
|
1477
1479
|
click,
|
|
1480
|
+
onClick,
|
|
1478
1481
|
title,
|
|
1479
1482
|
subTitle,
|
|
1480
1483
|
desc,
|
|
@@ -1501,6 +1504,7 @@ const Cell = (props) => {
|
|
|
1501
1504
|
const history = useHistory();
|
|
1502
1505
|
const handleClick2 = (event) => {
|
|
1503
1506
|
click(event);
|
|
1507
|
+
onClick(event);
|
|
1504
1508
|
if (to2 && history) {
|
|
1505
1509
|
history[replace ? "replace" : "push"](to2);
|
|
1506
1510
|
} else if (url) {
|
|
@@ -3163,6 +3167,8 @@ const defaultProps$17 = {
|
|
|
3163
3167
|
className: "",
|
|
3164
3168
|
style: {},
|
|
3165
3169
|
tabSwitch: () => {
|
|
3170
|
+
},
|
|
3171
|
+
onSwitch: () => {
|
|
3166
3172
|
}
|
|
3167
3173
|
};
|
|
3168
3174
|
const Tabbar = (props) => {
|
|
@@ -3176,7 +3182,8 @@ const Tabbar = (props) => {
|
|
|
3176
3182
|
safeAreaInsetBottom,
|
|
3177
3183
|
className,
|
|
3178
3184
|
style,
|
|
3179
|
-
tabSwitch
|
|
3185
|
+
tabSwitch,
|
|
3186
|
+
onSwitch
|
|
3180
3187
|
} = {
|
|
3181
3188
|
...defaultProps$17,
|
|
3182
3189
|
...props
|
|
@@ -3208,6 +3215,7 @@ const Tabbar = (props) => {
|
|
|
3208
3215
|
handleClick: () => {
|
|
3209
3216
|
handleClick2(idx);
|
|
3210
3217
|
tabSwitch(child, idx);
|
|
3218
|
+
onSwitch(child, idx);
|
|
3211
3219
|
}
|
|
3212
3220
|
};
|
|
3213
3221
|
return React__default.cloneElement(child, childProps);
|
|
@@ -8648,6 +8656,7 @@ class Title {
|
|
|
8648
8656
|
}
|
|
8649
8657
|
const defaultProps$13 = {
|
|
8650
8658
|
...ComponentDefaults,
|
|
8659
|
+
tabStyle: {},
|
|
8651
8660
|
value: 0,
|
|
8652
8661
|
color: "",
|
|
8653
8662
|
background: "",
|
|
@@ -8667,6 +8676,7 @@ const Tabs = (props) => {
|
|
|
8667
8676
|
const {
|
|
8668
8677
|
value,
|
|
8669
8678
|
color,
|
|
8679
|
+
tabStyle,
|
|
8670
8680
|
background,
|
|
8671
8681
|
direction,
|
|
8672
8682
|
type,
|
|
@@ -8748,7 +8758,7 @@ const Tabs = (props) => {
|
|
|
8748
8758
|
...rest
|
|
8749
8759
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
8750
8760
|
className: classesTitle,
|
|
8751
|
-
style: { background }
|
|
8761
|
+
style: { ...tabStyle, background }
|
|
8752
8762
|
}, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item, index2) => {
|
|
8753
8763
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8754
8764
|
style: titleStyle,
|
|
@@ -8781,6 +8791,8 @@ const Tabs = (props) => {
|
|
|
8781
8791
|
)
|
|
8782
8792
|
}, item.title));
|
|
8783
8793
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
8794
|
+
className: `${b2("")}__content__wrap`
|
|
8795
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
8784
8796
|
className: `${b2("")}__content`,
|
|
8785
8797
|
style: contentStyle
|
|
8786
8798
|
}, React__default.Children.map(children, (child, idx) => {
|
|
@@ -8799,7 +8811,7 @@ const Tabs = (props) => {
|
|
|
8799
8811
|
};
|
|
8800
8812
|
}
|
|
8801
8813
|
return React__default.cloneElement(child, childProps);
|
|
8802
|
-
})));
|
|
8814
|
+
}))));
|
|
8803
8815
|
};
|
|
8804
8816
|
Tabs.defaultProps = defaultProps$13;
|
|
8805
8817
|
Tabs.displayName = "NutTabs";
|
|
@@ -8810,7 +8822,7 @@ const defaultProps$12 = {
|
|
|
8810
8822
|
disabled: false
|
|
8811
8823
|
};
|
|
8812
8824
|
const TabPane = (props) => {
|
|
8813
|
-
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
8825
|
+
const { children, paneKey, activeKey, autoHeightClassName, className } = {
|
|
8814
8826
|
...defaultProps$12,
|
|
8815
8827
|
...props
|
|
8816
8828
|
};
|
|
@@ -8820,7 +8832,8 @@ const TabPane = (props) => {
|
|
|
8820
8832
|
active: paneKey === activeKey
|
|
8821
8833
|
},
|
|
8822
8834
|
b2(""),
|
|
8823
|
-
autoHeightClassName
|
|
8835
|
+
autoHeightClassName,
|
|
8836
|
+
className
|
|
8824
8837
|
);
|
|
8825
8838
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8826
8839
|
className: classes
|
|
@@ -8911,7 +8924,7 @@ const SideNavBar = (props) => {
|
|
|
8911
8924
|
children,
|
|
8912
8925
|
className,
|
|
8913
8926
|
showhead,
|
|
8914
|
-
|
|
8927
|
+
onClose,
|
|
8915
8928
|
...rest
|
|
8916
8929
|
} = {
|
|
8917
8930
|
...defaultProps$10,
|
|
@@ -8922,7 +8935,7 @@ const SideNavBar = (props) => {
|
|
|
8922
8935
|
visible,
|
|
8923
8936
|
style: { width, height: "100%" },
|
|
8924
8937
|
position,
|
|
8925
|
-
onClose
|
|
8938
|
+
onClose
|
|
8926
8939
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
8927
8940
|
className: className ? `${className} nut-sidenavbar` : "nut-sidenavbar",
|
|
8928
8941
|
...rest
|
|
@@ -8948,7 +8961,7 @@ const defaultProps$$ = {
|
|
|
8948
8961
|
open: true
|
|
8949
8962
|
};
|
|
8950
8963
|
const SubSideNavBar = (props) => {
|
|
8951
|
-
const { title, ikey, children,
|
|
8964
|
+
const { title, ikey, children, onClick, open, ...rest } = {
|
|
8952
8965
|
...defaultProps$$,
|
|
8953
8966
|
...props
|
|
8954
8967
|
};
|
|
@@ -8985,7 +8998,7 @@ const SubSideNavBar = (props) => {
|
|
|
8985
8998
|
handleClick(e2);
|
|
8986
8999
|
const currentClass = e2.currentTarget.className;
|
|
8987
9000
|
const isShow = currentClass.includes("nutShow");
|
|
8988
|
-
|
|
9001
|
+
onClick && onClick({ title, ikey, isShow });
|
|
8989
9002
|
};
|
|
8990
9003
|
useEffect(() => {
|
|
8991
9004
|
var _a, _b;
|
|
@@ -9009,10 +9022,10 @@ const SubSideNavBar = (props) => {
|
|
|
9009
9022
|
}, children));
|
|
9010
9023
|
};
|
|
9011
9024
|
const SideNavBarItem = (props) => {
|
|
9012
|
-
const { title, ikey, children,
|
|
9025
|
+
const { title, ikey, children, onClick, ...rest } = props;
|
|
9013
9026
|
const clickFn = (e2) => {
|
|
9014
9027
|
e2.stopPropagation();
|
|
9015
|
-
|
|
9028
|
+
onClick && onClick({ title, ikey });
|
|
9016
9029
|
};
|
|
9017
9030
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9018
9031
|
className: "nut-subsidenavbar__item border-bt",
|
|
@@ -9628,7 +9641,10 @@ const Range = (props) => {
|
|
|
9628
9641
|
marks,
|
|
9629
9642
|
change,
|
|
9630
9643
|
dragStart,
|
|
9631
|
-
dragEnd
|
|
9644
|
+
dragEnd,
|
|
9645
|
+
onChange,
|
|
9646
|
+
onDragStart,
|
|
9647
|
+
onDragEnd
|
|
9632
9648
|
} = { ...defaultProps$Y, ...props };
|
|
9633
9649
|
let { min, max, step } = { ...defaultProps$Y, ...props };
|
|
9634
9650
|
min = Number(min);
|
|
@@ -9792,6 +9808,7 @@ const Range = (props) => {
|
|
|
9792
9808
|
}
|
|
9793
9809
|
if ((marks || end) && !isSameValue(value, startValue)) {
|
|
9794
9810
|
change && change(value);
|
|
9811
|
+
onChange && onChange(value);
|
|
9795
9812
|
}
|
|
9796
9813
|
};
|
|
9797
9814
|
const click = (event) => {
|
|
@@ -9839,6 +9856,7 @@ const Range = (props) => {
|
|
|
9839
9856
|
}
|
|
9840
9857
|
if (dragStatus === "start") {
|
|
9841
9858
|
dragStart && dragStart();
|
|
9859
|
+
onDragStart && onDragStart();
|
|
9842
9860
|
}
|
|
9843
9861
|
touch.move(event);
|
|
9844
9862
|
SetDragStatus("draging");
|
|
@@ -9865,6 +9883,7 @@ const Range = (props) => {
|
|
|
9865
9883
|
if (dragStatus === "draging") {
|
|
9866
9884
|
updateValue(currentValue, true);
|
|
9867
9885
|
dragEnd && dragEnd();
|
|
9886
|
+
onDragEnd && onDragEnd();
|
|
9868
9887
|
}
|
|
9869
9888
|
SetDragStatus("");
|
|
9870
9889
|
};
|
|
@@ -11758,6 +11777,12 @@ const InputNumber = (props) => {
|
|
|
11758
11777
|
overlimit,
|
|
11759
11778
|
blur,
|
|
11760
11779
|
focus,
|
|
11780
|
+
onAdd,
|
|
11781
|
+
onReduce,
|
|
11782
|
+
onOverlimit,
|
|
11783
|
+
onBlurFuc,
|
|
11784
|
+
onFocus,
|
|
11785
|
+
onChangeFuc,
|
|
11761
11786
|
iconClassPrefix,
|
|
11762
11787
|
iconFontClassName,
|
|
11763
11788
|
...restProps
|
|
@@ -11798,6 +11823,7 @@ const InputNumber = (props) => {
|
|
|
11798
11823
|
};
|
|
11799
11824
|
const emitChange = (value, e2) => {
|
|
11800
11825
|
const outputValue = fixedDecimalPlaces(value);
|
|
11826
|
+
onChangeFuc && onChangeFuc(outputValue, e2);
|
|
11801
11827
|
change && change(outputValue, e2);
|
|
11802
11828
|
if (!isAsync) {
|
|
11803
11829
|
if (Number(outputValue) < Number(min)) {
|
|
@@ -11810,26 +11836,31 @@ const InputNumber = (props) => {
|
|
|
11810
11836
|
}
|
|
11811
11837
|
};
|
|
11812
11838
|
const reduceNumber = (e2) => {
|
|
11839
|
+
onReduce && onReduce(e2);
|
|
11813
11840
|
reduce && reduce(e2);
|
|
11814
11841
|
if (reduceAllow()) {
|
|
11815
11842
|
const outputValue = Number(inputValue) - Number(step);
|
|
11816
11843
|
emitChange(outputValue, e2);
|
|
11817
11844
|
} else {
|
|
11845
|
+
onOverlimit && onOverlimit(e2);
|
|
11818
11846
|
overlimit && overlimit(e2);
|
|
11819
11847
|
}
|
|
11820
11848
|
};
|
|
11821
11849
|
const addNumber = (e2) => {
|
|
11850
|
+
onAdd && onAdd(e2);
|
|
11822
11851
|
add && add(e2);
|
|
11823
11852
|
if (addAllow()) {
|
|
11824
11853
|
const outputValue = Number(inputValue) + Number(step);
|
|
11825
11854
|
emitChange(outputValue, e2);
|
|
11826
11855
|
} else {
|
|
11856
|
+
onOverlimit && onOverlimit(e2);
|
|
11827
11857
|
overlimit && overlimit(e2);
|
|
11828
11858
|
}
|
|
11829
11859
|
};
|
|
11830
11860
|
const changeValue = (e2) => {
|
|
11831
11861
|
const input = e2.target;
|
|
11832
11862
|
change && change(input.valueAsNumber, e2);
|
|
11863
|
+
onChangeFuc && onChangeFuc(input.valueAsNumber, e2);
|
|
11833
11864
|
if (!isAsync) {
|
|
11834
11865
|
if (Number.isNaN(input.valueAsNumber)) {
|
|
11835
11866
|
setInputValue(inputValue);
|
|
@@ -11843,6 +11874,7 @@ const InputNumber = (props) => {
|
|
|
11843
11874
|
return;
|
|
11844
11875
|
if (readonly)
|
|
11845
11876
|
return;
|
|
11877
|
+
onFocus && onFocus(e2);
|
|
11846
11878
|
focus && focus(e2);
|
|
11847
11879
|
};
|
|
11848
11880
|
const burValue = (e2) => {
|
|
@@ -11858,6 +11890,7 @@ const InputNumber = (props) => {
|
|
|
11858
11890
|
value = Number(max);
|
|
11859
11891
|
}
|
|
11860
11892
|
emitChange(value, e2);
|
|
11893
|
+
onBlurFuc && onBlurFuc(e2);
|
|
11861
11894
|
blur && blur(e2);
|
|
11862
11895
|
};
|
|
11863
11896
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -11990,12 +12023,20 @@ const Input = (props) => {
|
|
|
11990
12023
|
rows,
|
|
11991
12024
|
slotButton,
|
|
11992
12025
|
slotInput,
|
|
12026
|
+
onChange,
|
|
12027
|
+
onBlur,
|
|
12028
|
+
onFocus,
|
|
12029
|
+
onClear,
|
|
12030
|
+
formatter,
|
|
12031
|
+
keypress,
|
|
12032
|
+
onClickInput,
|
|
12033
|
+
onClickLeftIcon,
|
|
12034
|
+
onClickRightIcon,
|
|
12035
|
+
onClick,
|
|
11993
12036
|
change,
|
|
11994
12037
|
blur,
|
|
11995
12038
|
focus,
|
|
11996
12039
|
clear,
|
|
11997
|
-
formatter,
|
|
11998
|
-
keypress,
|
|
11999
12040
|
clickInput,
|
|
12000
12041
|
clickLeftIcon,
|
|
12001
12042
|
clickRightIcon,
|
|
@@ -12061,20 +12102,22 @@ const Input = (props) => {
|
|
|
12061
12102
|
}
|
|
12062
12103
|
SetInputValue(val);
|
|
12063
12104
|
};
|
|
12064
|
-
const
|
|
12105
|
+
const handleFocus = (event) => {
|
|
12065
12106
|
const val = event.target.value;
|
|
12066
12107
|
SetActive(true);
|
|
12108
|
+
onFocus && onFocus(val, event);
|
|
12067
12109
|
focus && focus(val, event);
|
|
12068
12110
|
};
|
|
12069
|
-
const
|
|
12111
|
+
const handleInput = (event) => {
|
|
12070
12112
|
let val = event.target.value;
|
|
12071
12113
|
if (maxlength && val.length > Number(maxlength)) {
|
|
12072
12114
|
val = val.slice(0, Number(maxlength));
|
|
12073
12115
|
}
|
|
12074
12116
|
updateValue(val);
|
|
12117
|
+
onChange && onChange(val, event);
|
|
12075
12118
|
change && change(val, event);
|
|
12076
12119
|
};
|
|
12077
|
-
const
|
|
12120
|
+
const handleBlur = (event) => {
|
|
12078
12121
|
setTimeout(() => {
|
|
12079
12122
|
SetActive(false);
|
|
12080
12123
|
}, 200);
|
|
@@ -12083,15 +12126,19 @@ const Input = (props) => {
|
|
|
12083
12126
|
val = val.slice(0, Number(maxlength));
|
|
12084
12127
|
}
|
|
12085
12128
|
updateValue(getModelValue(), "onBlur");
|
|
12129
|
+
onBlur && onBlur(val, event);
|
|
12086
12130
|
blur && blur(val, event);
|
|
12087
12131
|
};
|
|
12088
|
-
const
|
|
12132
|
+
const handleClickInput = (event) => {
|
|
12133
|
+
onClickInput && onClickInput(event);
|
|
12089
12134
|
clickInput && clickInput(event);
|
|
12090
12135
|
};
|
|
12091
|
-
const
|
|
12136
|
+
const handleClickLeftIcon = (event) => {
|
|
12137
|
+
onClickLeftIcon && onClickLeftIcon(event);
|
|
12092
12138
|
clickLeftIcon && clickLeftIcon(event);
|
|
12093
12139
|
};
|
|
12094
|
-
const
|
|
12140
|
+
const handleClickRightIcon = (event) => {
|
|
12141
|
+
onClickRightIcon && onClickRightIcon(event);
|
|
12095
12142
|
clickRightIcon && clickRightIcon(event);
|
|
12096
12143
|
};
|
|
12097
12144
|
const resetValidation = () => {
|
|
@@ -12107,6 +12154,7 @@ const Input = (props) => {
|
|
|
12107
12154
|
};
|
|
12108
12155
|
const handleClear = (event) => {
|
|
12109
12156
|
updateValue("");
|
|
12157
|
+
onClear && onClear("", event);
|
|
12110
12158
|
clear && clear("", event);
|
|
12111
12159
|
};
|
|
12112
12160
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -12114,6 +12162,7 @@ const Input = (props) => {
|
|
|
12114
12162
|
style,
|
|
12115
12163
|
...rest,
|
|
12116
12164
|
onClick: (e2) => {
|
|
12165
|
+
onClick && onClick(e2);
|
|
12117
12166
|
click && click(e2);
|
|
12118
12167
|
}
|
|
12119
12168
|
}, slotInput ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -12126,12 +12175,12 @@ const Input = (props) => {
|
|
|
12126
12175
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12127
12176
|
className: "nut-input-inner",
|
|
12128
12177
|
onClick: (e2) => {
|
|
12129
|
-
|
|
12178
|
+
handleClickInput(e2);
|
|
12130
12179
|
}
|
|
12131
12180
|
}, slotInput))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, leftIcon && leftIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12132
12181
|
className: "nut-input-left-icon",
|
|
12133
12182
|
onClick: (e2) => {
|
|
12134
|
-
|
|
12183
|
+
handleClickLeftIcon(e2);
|
|
12135
12184
|
}
|
|
12136
12185
|
}, /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
12137
12186
|
classPrefix: iconClassPrefix,
|
|
@@ -12148,7 +12197,7 @@ const Input = (props) => {
|
|
|
12148
12197
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12149
12198
|
className: "nut-input-inner",
|
|
12150
12199
|
onClick: (e2) => {
|
|
12151
|
-
|
|
12200
|
+
handleClickInput(e2);
|
|
12152
12201
|
}
|
|
12153
12202
|
}, type === "textarea" ? /* @__PURE__ */ React__default.createElement("textarea", {
|
|
12154
12203
|
className: "input-text",
|
|
@@ -12164,13 +12213,13 @@ const Input = (props) => {
|
|
|
12164
12213
|
value: inputValue,
|
|
12165
12214
|
autoFocus: autofocus,
|
|
12166
12215
|
onBlur: (e2) => {
|
|
12167
|
-
|
|
12216
|
+
handleBlur(e2);
|
|
12168
12217
|
},
|
|
12169
12218
|
onFocus: (e2) => {
|
|
12170
|
-
|
|
12219
|
+
handleFocus(e2);
|
|
12171
12220
|
},
|
|
12172
12221
|
onInput: (e2) => {
|
|
12173
|
-
|
|
12222
|
+
handleInput(e2);
|
|
12174
12223
|
}
|
|
12175
12224
|
}) : /* @__PURE__ */ React__default.createElement("input", {
|
|
12176
12225
|
className: "input-text",
|
|
@@ -12184,13 +12233,13 @@ const Input = (props) => {
|
|
|
12184
12233
|
value: inputValue,
|
|
12185
12234
|
autoFocus: autofocus,
|
|
12186
12235
|
onBlur: (e2) => {
|
|
12187
|
-
|
|
12236
|
+
handleBlur(e2);
|
|
12188
12237
|
},
|
|
12189
12238
|
onFocus: (e2) => {
|
|
12190
|
-
|
|
12239
|
+
handleFocus(e2);
|
|
12191
12240
|
},
|
|
12192
12241
|
onInput: (e2) => {
|
|
12193
|
-
|
|
12242
|
+
handleInput(e2);
|
|
12194
12243
|
}
|
|
12195
12244
|
}), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
12196
12245
|
classPrefix: iconClassPrefix,
|
|
@@ -12204,7 +12253,7 @@ const Input = (props) => {
|
|
|
12204
12253
|
}) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12205
12254
|
className: "nut-input-right-icon",
|
|
12206
12255
|
onClick: (e2) => {
|
|
12207
|
-
|
|
12256
|
+
handleClickRightIcon(e2);
|
|
12208
12257
|
}
|
|
12209
12258
|
}, /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
12210
12259
|
classPrefix: iconClassPrefix,
|
|
@@ -12358,9 +12407,9 @@ const Radio = (props) => {
|
|
|
12358
12407
|
return renderButton();
|
|
12359
12408
|
}
|
|
12360
12409
|
if (reverseState) {
|
|
12361
|
-
return
|
|
12410
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderLabel(), renderIcon());
|
|
12362
12411
|
}
|
|
12363
|
-
return
|
|
12412
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderIcon(), renderLabel());
|
|
12364
12413
|
};
|
|
12365
12414
|
const handleClick2 = (e2) => {
|
|
12366
12415
|
if (disabledStatement || checkedStatement)
|
|
@@ -13433,7 +13482,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13433
13482
|
classPrefix: iconClassPrefix,
|
|
13434
13483
|
fontClassName: iconFontClassName,
|
|
13435
13484
|
name: "link"
|
|
13436
|
-
}), "\xA0", item.name), /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
13485
|
+
}), "\xA0", item.name), isDeletable && /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
13437
13486
|
classPrefix: iconClassPrefix,
|
|
13438
13487
|
fontClassName: iconFontClassName,
|
|
13439
13488
|
color: "#808080",
|
|
@@ -15328,7 +15377,7 @@ const Switch = (props) => {
|
|
|
15328
15377
|
inactiveColor,
|
|
15329
15378
|
activeText,
|
|
15330
15379
|
inactiveText,
|
|
15331
|
-
|
|
15380
|
+
onChange,
|
|
15332
15381
|
className,
|
|
15333
15382
|
style
|
|
15334
15383
|
} = {
|
|
@@ -15356,7 +15405,7 @@ const Switch = (props) => {
|
|
|
15356
15405
|
if (!isAsync) {
|
|
15357
15406
|
setValue(!value);
|
|
15358
15407
|
}
|
|
15359
|
-
|
|
15408
|
+
onChange && onChange(!value, event);
|
|
15360
15409
|
};
|
|
15361
15410
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15362
15411
|
className: classes(),
|
|
@@ -15903,6 +15952,8 @@ const NoticeBar = (props) => {
|
|
|
15903
15952
|
rightIcon,
|
|
15904
15953
|
close,
|
|
15905
15954
|
click,
|
|
15955
|
+
onClose,
|
|
15956
|
+
onClick,
|
|
15906
15957
|
iconClassPrefix,
|
|
15907
15958
|
iconFontClassName
|
|
15908
15959
|
} = {
|
|
@@ -15988,11 +16039,13 @@ const NoticeBar = (props) => {
|
|
|
15988
16039
|
};
|
|
15989
16040
|
const handleClick2 = (event) => {
|
|
15990
16041
|
click && click(event);
|
|
16042
|
+
onClick && onClick(event);
|
|
15991
16043
|
};
|
|
15992
16044
|
const onClickIcon = (event) => {
|
|
15993
16045
|
event.stopPropagation();
|
|
15994
16046
|
SetShowNoticeBar(!closeMode);
|
|
15995
16047
|
close && close(event);
|
|
16048
|
+
onClose && onClose(event);
|
|
15996
16049
|
};
|
|
15997
16050
|
const onAnimationEnd = () => {
|
|
15998
16051
|
SetFirstRound(false);
|
|
@@ -16042,9 +16095,11 @@ const NoticeBar = (props) => {
|
|
|
16042
16095
|
};
|
|
16043
16096
|
const go = (item) => {
|
|
16044
16097
|
click && click(item);
|
|
16098
|
+
onClick && onClick(item);
|
|
16045
16099
|
};
|
|
16046
16100
|
const handleClickIcon = () => {
|
|
16047
16101
|
close && close(scrollList[0]);
|
|
16102
|
+
onClose && onClose(scrollList[0]);
|
|
16048
16103
|
};
|
|
16049
16104
|
const iconShow = () => {
|
|
16050
16105
|
if (leftIcon === "close") {
|
|
@@ -16170,6 +16225,7 @@ const Steps = (props) => {
|
|
|
16170
16225
|
className,
|
|
16171
16226
|
progressDot,
|
|
16172
16227
|
clickStep,
|
|
16228
|
+
onClickStep,
|
|
16173
16229
|
...restProps
|
|
16174
16230
|
} = propSteps;
|
|
16175
16231
|
const parentSteps = {
|
|
@@ -16233,10 +16289,9 @@ const Step = (props) => {
|
|
|
16233
16289
|
return index === +parent.propSteps.current ? "process" : "wait";
|
|
16234
16290
|
};
|
|
16235
16291
|
const handleClickStep = () => {
|
|
16236
|
-
var _a, _b;
|
|
16237
|
-
|
|
16238
|
-
|
|
16239
|
-
}
|
|
16292
|
+
var _a, _b, _c, _d;
|
|
16293
|
+
((_a = parent.propSteps) == null ? void 0 : _a.onClickStep) && ((_b = parent.propSteps) == null ? void 0 : _b.onClickStep(activeIndex));
|
|
16294
|
+
((_c = parent.propSteps) == null ? void 0 : _c.clickStep) && ((_d = parent.propSteps) == null ? void 0 : _d.clickStep(activeIndex));
|
|
16240
16295
|
};
|
|
16241
16296
|
const b2 = cn("step");
|
|
16242
16297
|
const classes = classNames(
|
|
@@ -16768,6 +16823,7 @@ const Avatar = (props) => {
|
|
|
16768
16823
|
className,
|
|
16769
16824
|
style,
|
|
16770
16825
|
activeAvatar,
|
|
16826
|
+
onActiveAvatar,
|
|
16771
16827
|
onError,
|
|
16772
16828
|
iconClassPrefix,
|
|
16773
16829
|
iconFontClassName,
|
|
@@ -16812,7 +16868,6 @@ const Avatar = (props) => {
|
|
|
16812
16868
|
const avatarLength = (children2) => {
|
|
16813
16869
|
var _a2, _b2, _c2;
|
|
16814
16870
|
for (let i = 0; i < children2.length; i++) {
|
|
16815
|
-
console.log("child", children2[i], children2[i].classList);
|
|
16816
16871
|
if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
|
|
16817
16872
|
children2[i].setAttribute("data-index", i + 1);
|
|
16818
16873
|
}
|
|
@@ -16831,9 +16886,8 @@ const Avatar = (props) => {
|
|
|
16831
16886
|
}
|
|
16832
16887
|
};
|
|
16833
16888
|
const clickAvatar = (e2) => {
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
}
|
|
16889
|
+
activeAvatar && activeAvatar(e2);
|
|
16890
|
+
onActiveAvatar && onActiveAvatar(e2);
|
|
16837
16891
|
};
|
|
16838
16892
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount)) && /* @__PURE__ */ React__default.createElement("div", {
|
|
16839
16893
|
className: cls,
|
|
@@ -17619,6 +17673,7 @@ const CountDown = React__default.forwardRef(InternalCountDown);
|
|
|
17619
17673
|
CountDown.defaultProps = defaultProps$j;
|
|
17620
17674
|
CountDown.displayName = "NutCountDown";
|
|
17621
17675
|
const defaultProps$i = {
|
|
17676
|
+
style: {},
|
|
17622
17677
|
activeName: ["0"],
|
|
17623
17678
|
accordion: false,
|
|
17624
17679
|
icon: "",
|
|
@@ -17632,6 +17687,8 @@ function areEqual(prevProps, nextProps) {
|
|
|
17632
17687
|
const Collapse = memo(
|
|
17633
17688
|
(props) => {
|
|
17634
17689
|
const {
|
|
17690
|
+
className,
|
|
17691
|
+
style,
|
|
17635
17692
|
children,
|
|
17636
17693
|
activeName,
|
|
17637
17694
|
accordion,
|
|
@@ -17639,7 +17696,7 @@ const Collapse = memo(
|
|
|
17639
17696
|
rotate,
|
|
17640
17697
|
iconSize,
|
|
17641
17698
|
iconColor,
|
|
17642
|
-
|
|
17699
|
+
onChange
|
|
17643
17700
|
} = {
|
|
17644
17701
|
...defaultProps$i,
|
|
17645
17702
|
...props
|
|
@@ -17681,10 +17738,11 @@ const Collapse = memo(
|
|
|
17681
17738
|
}
|
|
17682
17739
|
}
|
|
17683
17740
|
setDefaultOpenIndex(newOpenIndex);
|
|
17684
|
-
|
|
17741
|
+
onChange && onChange(!isOpen, name);
|
|
17685
17742
|
};
|
|
17686
17743
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
17687
|
-
className: colBem()
|
|
17744
|
+
className: `${colBem()} ${className}`,
|
|
17745
|
+
style
|
|
17688
17746
|
}, childrenDom.map((item) => {
|
|
17689
17747
|
return React__default.cloneElement(item, {
|
|
17690
17748
|
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
@@ -18109,6 +18167,7 @@ const VirtualList = (props) => {
|
|
|
18109
18167
|
overscan = 2,
|
|
18110
18168
|
key,
|
|
18111
18169
|
handleScroll,
|
|
18170
|
+
onScroll,
|
|
18112
18171
|
className,
|
|
18113
18172
|
containerSize,
|
|
18114
18173
|
...rest
|
|
@@ -18175,7 +18234,7 @@ const VirtualList = (props) => {
|
|
|
18175
18234
|
const totalSize = getListTotalSize(positions, horizontal);
|
|
18176
18235
|
setListTotalSize(totalSize);
|
|
18177
18236
|
}, [positions, sizeKey, horizontal]);
|
|
18178
|
-
const
|
|
18237
|
+
const scroll = useCallback(() => {
|
|
18179
18238
|
requestAnimationFrame((e2) => {
|
|
18180
18239
|
const scrollSize = getElement()[scrollKey];
|
|
18181
18240
|
const startIndex = binarySearch(positions, scrollSize, horizontal);
|
|
@@ -18196,7 +18255,11 @@ const VirtualList = (props) => {
|
|
|
18196
18255
|
const startOffset = positions[startIndex][offsetKey];
|
|
18197
18256
|
setOptions({ startOffset, startIndex, overStart, endIndex });
|
|
18198
18257
|
if (endIndex > sourceData.length - 1) {
|
|
18199
|
-
|
|
18258
|
+
if (onScroll) {
|
|
18259
|
+
onScroll();
|
|
18260
|
+
} else if (handleScroll) {
|
|
18261
|
+
handleScroll();
|
|
18262
|
+
}
|
|
18200
18263
|
}
|
|
18201
18264
|
});
|
|
18202
18265
|
}, [
|
|
@@ -18216,11 +18279,11 @@ const VirtualList = (props) => {
|
|
|
18216
18279
|
]);
|
|
18217
18280
|
useEffect(() => {
|
|
18218
18281
|
const element = getElement();
|
|
18219
|
-
element.addEventListener("scroll",
|
|
18282
|
+
element.addEventListener("scroll", scroll, false);
|
|
18220
18283
|
return () => {
|
|
18221
|
-
element.removeEventListener("scroll",
|
|
18284
|
+
element.removeEventListener("scroll", scroll, false);
|
|
18222
18285
|
};
|
|
18223
|
-
}, [getElement,
|
|
18286
|
+
}, [getElement, scroll]);
|
|
18224
18287
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18225
18288
|
className: className ? `${className} nut-virtualList-box` : "nut-virtualList-box",
|
|
18226
18289
|
...rest,
|
|
@@ -18410,6 +18473,9 @@ const Video = (props) => {
|
|
|
18410
18473
|
play,
|
|
18411
18474
|
pause,
|
|
18412
18475
|
playend,
|
|
18476
|
+
onPlayFuc,
|
|
18477
|
+
onPauseFuc,
|
|
18478
|
+
onPlayend,
|
|
18413
18479
|
...restProps
|
|
18414
18480
|
} = {
|
|
18415
18481
|
...defaultProps$b,
|
|
@@ -18436,13 +18502,16 @@ const Video = (props) => {
|
|
|
18436
18502
|
videoRef.setAttribute("x5-video-player-fullscreen", "false");
|
|
18437
18503
|
}
|
|
18438
18504
|
videoRef.addEventListener("play", () => {
|
|
18505
|
+
onPlayFuc && onPlayFuc(videoRef);
|
|
18439
18506
|
play && play(videoRef);
|
|
18440
18507
|
});
|
|
18441
18508
|
videoRef.addEventListener("pause", () => {
|
|
18509
|
+
onPauseFuc && onPauseFuc(videoRef);
|
|
18442
18510
|
pause && pause(videoRef);
|
|
18443
18511
|
});
|
|
18444
18512
|
videoRef.addEventListener("ended", () => {
|
|
18445
18513
|
videoRef.currentTime = 0;
|
|
18514
|
+
onPlayend && onPlayend(videoRef);
|
|
18446
18515
|
playend && playend(videoRef);
|
|
18447
18516
|
});
|
|
18448
18517
|
}
|
|
@@ -19566,7 +19635,18 @@ const defaultProps$4 = {
|
|
|
19566
19635
|
};
|
|
19567
19636
|
const Signature = (props) => {
|
|
19568
19637
|
const { locale } = useConfig();
|
|
19569
|
-
const {
|
|
19638
|
+
const {
|
|
19639
|
+
type,
|
|
19640
|
+
lineWidth,
|
|
19641
|
+
strokeStyle,
|
|
19642
|
+
unSupportTpl,
|
|
19643
|
+
className,
|
|
19644
|
+
confirm: confirm2,
|
|
19645
|
+
clear,
|
|
19646
|
+
onConfirm,
|
|
19647
|
+
onClear,
|
|
19648
|
+
...rest
|
|
19649
|
+
} = {
|
|
19570
19650
|
...defaultProps$4,
|
|
19571
19651
|
...props
|
|
19572
19652
|
};
|
|
@@ -19631,15 +19711,16 @@ const Signature = (props) => {
|
|
|
19631
19711
|
canvasRef.current.removeEventListener(events[2], endEventHandler, false);
|
|
19632
19712
|
}
|
|
19633
19713
|
};
|
|
19634
|
-
const
|
|
19714
|
+
const handleClearBtn = () => {
|
|
19635
19715
|
if (canvasRef.current && ctx2.current) {
|
|
19636
19716
|
canvasRef.current.addEventListener(events[2], endEventHandler, false);
|
|
19637
19717
|
ctx2.current.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
19638
19718
|
ctx2.current.closePath();
|
|
19639
19719
|
}
|
|
19640
|
-
|
|
19720
|
+
clear && clear();
|
|
19721
|
+
onClear && onClear();
|
|
19641
19722
|
};
|
|
19642
|
-
const
|
|
19723
|
+
const handleConfirmBtn = () => {
|
|
19643
19724
|
onSave(canvasRef.current);
|
|
19644
19725
|
};
|
|
19645
19726
|
const onSave = (canvas) => {
|
|
@@ -19654,8 +19735,9 @@ const Signature = (props) => {
|
|
|
19654
19735
|
default:
|
|
19655
19736
|
dataurl = canvas.toDataURL("image/png");
|
|
19656
19737
|
}
|
|
19657
|
-
|
|
19658
|
-
|
|
19738
|
+
handleClearBtn();
|
|
19739
|
+
confirm2 && confirm2(canvas, dataurl);
|
|
19740
|
+
onConfirm && onConfirm(canvas, dataurl);
|
|
19659
19741
|
};
|
|
19660
19742
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19661
19743
|
className: `${b2()} ${className}`,
|
|
@@ -19672,11 +19754,11 @@ const Signature = (props) => {
|
|
|
19672
19754
|
}, locale.signature.unSupportTpl || unSupportTpl)), /* @__PURE__ */ React__default.createElement(Button, {
|
|
19673
19755
|
className: `${b2("btn")}`,
|
|
19674
19756
|
type: "default",
|
|
19675
|
-
onClick: () =>
|
|
19757
|
+
onClick: () => handleClearBtn()
|
|
19676
19758
|
}, locale.signature.reSign), /* @__PURE__ */ React__default.createElement(Button, {
|
|
19677
19759
|
className: `${b2("btn")}`,
|
|
19678
19760
|
type: "primary",
|
|
19679
|
-
onClick: () =>
|
|
19761
|
+
onClick: () => handleConfirmBtn()
|
|
19680
19762
|
}, locale.confirm));
|
|
19681
19763
|
};
|
|
19682
19764
|
Signature.defaultProps = defaultProps$4;
|
|
@@ -19803,6 +19885,7 @@ TimeDetail.defaultProps = defaultProps$1;
|
|
|
19803
19885
|
TimeDetail.displayName = "NutTimeDetail";
|
|
19804
19886
|
const defaultProps = {
|
|
19805
19887
|
className: "",
|
|
19888
|
+
style: {},
|
|
19806
19889
|
visible: false,
|
|
19807
19890
|
height: "20%",
|
|
19808
19891
|
multiple: false,
|
|
@@ -19815,7 +19898,6 @@ const defaultProps = {
|
|
|
19815
19898
|
const TimeSelect = (props) => {
|
|
19816
19899
|
useConfig();
|
|
19817
19900
|
const {
|
|
19818
|
-
children,
|
|
19819
19901
|
visible,
|
|
19820
19902
|
className,
|
|
19821
19903
|
height,
|
|
@@ -19827,7 +19909,10 @@ const TimeSelect = (props) => {
|
|
|
19827
19909
|
multiple,
|
|
19828
19910
|
select,
|
|
19829
19911
|
pannelChange,
|
|
19830
|
-
timeChange
|
|
19912
|
+
timeChange,
|
|
19913
|
+
onSelect,
|
|
19914
|
+
onPannelChange,
|
|
19915
|
+
onTimeChange
|
|
19831
19916
|
} = {
|
|
19832
19917
|
...defaultProps,
|
|
19833
19918
|
...props
|
|
@@ -19848,7 +19933,11 @@ const TimeSelect = (props) => {
|
|
|
19848
19933
|
};
|
|
19849
19934
|
const b2 = cn("timeselect");
|
|
19850
19935
|
const closeFun = () => {
|
|
19851
|
-
|
|
19936
|
+
if (onSelect) {
|
|
19937
|
+
onSelect(activeTime);
|
|
19938
|
+
} else if (select) {
|
|
19939
|
+
select(activeTime);
|
|
19940
|
+
}
|
|
19852
19941
|
};
|
|
19853
19942
|
const handleSelectTime = (time) => {
|
|
19854
19943
|
let curTimeData = {};
|
|
@@ -19871,7 +19960,11 @@ const TimeSelect = (props) => {
|
|
|
19871
19960
|
const resultTimeData = [...activeTime];
|
|
19872
19961
|
resultTimeData.splice(curIndex, 1, curTimeData);
|
|
19873
19962
|
setActiveTime(resultTimeData);
|
|
19874
|
-
|
|
19963
|
+
if (onTimeChange) {
|
|
19964
|
+
onTimeChange(time, resultTimeData);
|
|
19965
|
+
} else if (timeChange) {
|
|
19966
|
+
timeChange(time, resultTimeData);
|
|
19967
|
+
}
|
|
19875
19968
|
};
|
|
19876
19969
|
const handleChange = (pannelKey) => {
|
|
19877
19970
|
const resultTimeData = [...activeTime];
|
|
@@ -19897,7 +19990,11 @@ const TimeSelect = (props) => {
|
|
|
19897
19990
|
]);
|
|
19898
19991
|
}
|
|
19899
19992
|
}
|
|
19900
|
-
|
|
19993
|
+
if (onPannelChange) {
|
|
19994
|
+
onPannelChange(pannelKey, resultTimeData);
|
|
19995
|
+
} else if (pannelChange) {
|
|
19996
|
+
pannelChange(pannelKey, resultTimeData);
|
|
19997
|
+
}
|
|
19901
19998
|
};
|
|
19902
19999
|
const getTimePannelClass = (dataItem) => {
|
|
19903
20000
|
if (String(dataItem["pannel-key"]) === String(activeKey)) {
|