@nutui/nutui-react 1.4.7 → 1.4.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 +44 -0
- package/dist/esm/Badge.js +1 -0
- package/dist/esm/Barrage.js +17 -7
- package/dist/esm/Cascader.js +17 -21
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/CheckboxGroup.js +13 -7
- package/dist/esm/Col.js +2 -1
- package/dist/esm/Dialog.js +19 -7
- package/dist/esm/Ellipsis.js +4 -2
- package/dist/esm/Form.js +36 -17
- package/dist/esm/FormItem.js +2 -2
- package/dist/esm/InputNumber.js +10 -8
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Row.js +2 -1
- package/dist/esm/ShortPassword.js +4 -1
- package/dist/esm/Switch.js +3 -2
- package/dist/esm/TabPane.js +2 -2
- package/dist/esm/Tabbar.js +12 -7
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/{checkbox-255983fc.js → checkbox-b2f0756e.js} +0 -2
- package/dist/esm/{formitem-bab4c481.js → formitem-4b58943b.js} +6 -4
- package/dist/esm/{tabpane-9b8ca8a8.js → tabpane-15f62234.js} +4 -3
- package/dist/esm/{tabs-ee05fd2f.js → tabs-5fe5fd90.js} +13 -11
- package/dist/esm/types/src/packages/cascader/cascader.d.ts +1 -0
- package/dist/esm/types/src/packages/cascader/cascaderItem.d.ts +1 -0
- package/dist/esm/types/src/packages/checkbox/demo.d.ts +0 -1
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +5 -0
- package/dist/esm/types/src/packages/dialog/DialogWrap.d.ts +1 -1
- package/dist/esm/types/src/packages/dialog/index.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/form/form.d.ts +3 -0
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +2 -1
- package/dist/esm/types/src/packages/formitem/types.d.ts +1 -1
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +1 -0
- package/dist/esm/types/src/packages/switch/switch.d.ts +2 -1
- package/dist/esm/types/src/packages/tabbar/tabbar.d.ts +1 -1
- package/dist/esm/types/src/packages/tabbar/use-props-value.d.ts +7 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/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 +148 -70
- package/dist/nutui.react.umd.js +148 -70
- package/dist/packages/badge/badge.scss +11 -5
- package/dist/packages/barrage/barrage.scss +3 -3
- package/dist/packages/button/button.scss +1 -0
- package/dist/packages/cascader/cascader.scss +19 -5
- package/dist/packages/checkboxgroup/checkboxgroup.scss +33 -0
- package/dist/packages/collapseitem/collapseitem.scss +41 -17
- package/dist/packages/form/form.scss +3 -0
- package/dist/packages/inputnumber/inputnumber.scss +18 -1
- package/dist/packages/popover/popover.scss +71 -46
- package/dist/packages/radiogroup/radiogroup.scss +9 -8
- package/dist/packages/step/step.scss +135 -98
- package/dist/packages/switch/switch.scss +1 -1
- package/dist/packages/tabs/tabs.scss +24 -2
- package/dist/packages/textarea/textarea.scss +7 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +155 -33
- package/dist/types/index.d.ts +70 -33
- package/package.json +1 -1
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.4.
|
|
2
|
+
* @nutui/nutui-react v1.4.8 Wed Feb 22 2023 16:47:33 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2023 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1775,7 +1775,7 @@ const Col = (props) => {
|
|
|
1775
1775
|
setColStyle(getStyle);
|
|
1776
1776
|
}, [span, offset, gutter]);
|
|
1777
1777
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1778
|
-
className:
|
|
1778
|
+
className: classNames(colName, className),
|
|
1779
1779
|
style: { ...style, ...colStyle },
|
|
1780
1780
|
onClick: (e2) => {
|
|
1781
1781
|
onClick && onClick(e2, "col");
|
|
@@ -2070,7 +2070,7 @@ const Row = (props) => {
|
|
|
2070
2070
|
}, React__default.createElement(
|
|
2071
2071
|
"div",
|
|
2072
2072
|
{
|
|
2073
|
-
className:
|
|
2073
|
+
className: classNames(getClasses(), className),
|
|
2074
2074
|
style,
|
|
2075
2075
|
onClick: (e2) => {
|
|
2076
2076
|
onClick && onClick(e2, "row");
|
|
@@ -8368,15 +8368,14 @@ const defaultProps$15 = {
|
|
|
8368
8368
|
safeAreaInsetBottom: false,
|
|
8369
8369
|
className: "",
|
|
8370
8370
|
style: {},
|
|
8371
|
-
|
|
8372
|
-
},
|
|
8373
|
-
onSwitch: () => {
|
|
8371
|
+
onSwitch: (child, activeVisible) => {
|
|
8374
8372
|
}
|
|
8375
8373
|
};
|
|
8376
8374
|
const Tabbar = (props) => {
|
|
8377
8375
|
const {
|
|
8378
8376
|
children,
|
|
8379
8377
|
visible,
|
|
8378
|
+
activeVisible,
|
|
8380
8379
|
bottom,
|
|
8381
8380
|
size,
|
|
8382
8381
|
activeColor,
|
|
@@ -8384,17 +8383,23 @@ const Tabbar = (props) => {
|
|
|
8384
8383
|
safeAreaInsetBottom,
|
|
8385
8384
|
className,
|
|
8386
8385
|
style,
|
|
8387
|
-
tabSwitch,
|
|
8388
8386
|
onSwitch
|
|
8389
8387
|
} = {
|
|
8390
8388
|
...defaultProps$15,
|
|
8391
8389
|
...props
|
|
8392
8390
|
};
|
|
8393
8391
|
const b = cn("tabbar");
|
|
8394
|
-
const [selectIndex, setSelectIndex] = useState(visible);
|
|
8392
|
+
const [selectIndex, setSelectIndex] = useState(activeVisible || visible);
|
|
8395
8393
|
const handleClick2 = (idx) => {
|
|
8396
|
-
|
|
8394
|
+
if (!("activeVisible" in props)) {
|
|
8395
|
+
setSelectIndex(idx);
|
|
8396
|
+
}
|
|
8397
8397
|
};
|
|
8398
|
+
useEffect(() => {
|
|
8399
|
+
if (activeVisible !== void 0) {
|
|
8400
|
+
setSelectIndex(activeVisible);
|
|
8401
|
+
}
|
|
8402
|
+
}, [activeVisible]);
|
|
8398
8403
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8399
8404
|
className: [
|
|
8400
8405
|
`${b()}`,
|
|
@@ -8416,7 +8421,6 @@ const Tabbar = (props) => {
|
|
|
8416
8421
|
size,
|
|
8417
8422
|
handleClick: () => {
|
|
8418
8423
|
handleClick2(idx);
|
|
8419
|
-
tabSwitch(child, idx);
|
|
8420
8424
|
onSwitch(child, idx);
|
|
8421
8425
|
}
|
|
8422
8426
|
};
|
|
@@ -8506,14 +8510,21 @@ const defaultProps$13 = {
|
|
|
8506
8510
|
disabled: false
|
|
8507
8511
|
};
|
|
8508
8512
|
const TabPane = (props) => {
|
|
8509
|
-
const {
|
|
8513
|
+
const {
|
|
8514
|
+
children,
|
|
8515
|
+
paneKey,
|
|
8516
|
+
activeKey,
|
|
8517
|
+
autoHeightClassName,
|
|
8518
|
+
className,
|
|
8519
|
+
disabled
|
|
8520
|
+
} = {
|
|
8510
8521
|
...defaultProps$13,
|
|
8511
8522
|
...props
|
|
8512
8523
|
};
|
|
8513
8524
|
const b = cn("tabpane");
|
|
8514
8525
|
const classes = classNames(
|
|
8515
8526
|
{
|
|
8516
|
-
active: paneKey === activeKey
|
|
8527
|
+
active: !disabled && paneKey === activeKey
|
|
8517
8528
|
},
|
|
8518
8529
|
b(""),
|
|
8519
8530
|
autoHeightClassName,
|
|
@@ -8521,7 +8532,7 @@ const TabPane = (props) => {
|
|
|
8521
8532
|
);
|
|
8522
8533
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8523
8534
|
className: classes
|
|
8524
|
-
}, children);
|
|
8535
|
+
}, !disabled && children);
|
|
8525
8536
|
};
|
|
8526
8537
|
class Title {
|
|
8527
8538
|
constructor() {
|
|
@@ -8544,6 +8555,7 @@ const defaultProps$12 = {
|
|
|
8544
8555
|
animatedTime: 300,
|
|
8545
8556
|
titleGutter: 0,
|
|
8546
8557
|
size: "normal",
|
|
8558
|
+
leftAlign: false,
|
|
8547
8559
|
autoHeight: false
|
|
8548
8560
|
};
|
|
8549
8561
|
const pxCheck$1 = (value) => {
|
|
@@ -8562,6 +8574,7 @@ const Tabs = (props) => {
|
|
|
8562
8574
|
animatedTime,
|
|
8563
8575
|
titleGutter,
|
|
8564
8576
|
size,
|
|
8577
|
+
leftAlign,
|
|
8565
8578
|
titleNode,
|
|
8566
8579
|
children,
|
|
8567
8580
|
onClick,
|
|
@@ -8581,15 +8594,15 @@ const Tabs = (props) => {
|
|
|
8581
8594
|
let currentIndex = 0;
|
|
8582
8595
|
titles.current = [];
|
|
8583
8596
|
React__default.Children.forEach(children, (child, idx) => {
|
|
8584
|
-
var _a, _b, _c, _d, _e;
|
|
8585
8597
|
if (!React__default.isValidElement(child)) {
|
|
8586
8598
|
return null;
|
|
8587
8599
|
}
|
|
8588
8600
|
const title = new Title();
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
title.
|
|
8592
|
-
title.
|
|
8601
|
+
const childProps = child == null ? void 0 : child.props;
|
|
8602
|
+
if ((childProps == null ? void 0 : childProps.title) || (childProps == null ? void 0 : childProps.paneKey)) {
|
|
8603
|
+
title.title = childProps == null ? void 0 : childProps.title;
|
|
8604
|
+
title.paneKey = (childProps == null ? void 0 : childProps.paneKey) || idx;
|
|
8605
|
+
title.disabled = childProps == null ? void 0 : childProps.disabled;
|
|
8593
8606
|
title.index = idx;
|
|
8594
8607
|
if (title.paneKey === value) {
|
|
8595
8608
|
currentIndex = idx;
|
|
@@ -8642,8 +8655,9 @@ const Tabs = (props) => {
|
|
|
8642
8655
|
onClick: (e2) => tabChange(item),
|
|
8643
8656
|
className: classNames(
|
|
8644
8657
|
{
|
|
8645
|
-
active: String(item.paneKey) === String(value),
|
|
8646
|
-
disabled: item.disabled
|
|
8658
|
+
active: !item.disabled && String(item.paneKey) === String(value),
|
|
8659
|
+
disabled: item.disabled,
|
|
8660
|
+
"nut-tabs__titles-item-left-align": leftAlign
|
|
8647
8661
|
},
|
|
8648
8662
|
`${b("")}__titles-item`
|
|
8649
8663
|
),
|
|
@@ -9546,11 +9560,12 @@ const defaultProps$$ = {
|
|
|
9546
9560
|
},
|
|
9547
9561
|
activeColor: "#fa2c19",
|
|
9548
9562
|
checked: false,
|
|
9563
|
+
checkedIcon: "checklist",
|
|
9549
9564
|
chooseItem: () => {
|
|
9550
9565
|
}
|
|
9551
9566
|
};
|
|
9552
|
-
const InternalCascaderItem = (props) => {
|
|
9553
|
-
const { data, checked, chooseItem, activeColor } = {
|
|
9567
|
+
const InternalCascaderItem = (props, ref) => {
|
|
9568
|
+
const { data, checked, checkedIcon, chooseItem, activeColor } = {
|
|
9554
9569
|
...defaultProps$$,
|
|
9555
9570
|
...props
|
|
9556
9571
|
};
|
|
@@ -9565,11 +9580,6 @@ const InternalCascaderItem = (props) => {
|
|
|
9565
9580
|
const classesTitle = classNames({
|
|
9566
9581
|
[`${b("")}__title`]: true
|
|
9567
9582
|
});
|
|
9568
|
-
useEffect(() => {
|
|
9569
|
-
initData();
|
|
9570
|
-
}, [data]);
|
|
9571
|
-
const initData = () => {
|
|
9572
|
-
};
|
|
9573
9583
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9574
9584
|
style: { color: checked ? activeColor : "" },
|
|
9575
9585
|
className: classes,
|
|
@@ -9584,7 +9594,7 @@ const InternalCascaderItem = (props) => {
|
|
|
9584
9594
|
name: "loading"
|
|
9585
9595
|
}) : /* @__PURE__ */ React__default.createElement(Icon, {
|
|
9586
9596
|
className: `${checked ? b("icon-check") : ""}`,
|
|
9587
|
-
name: "
|
|
9597
|
+
name: checked ? checkedIcon : ""
|
|
9588
9598
|
}));
|
|
9589
9599
|
};
|
|
9590
9600
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
@@ -9726,6 +9736,7 @@ const defaultProps$_ = {
|
|
|
9726
9736
|
className: "",
|
|
9727
9737
|
style: {},
|
|
9728
9738
|
activeColor: "#fa2c19",
|
|
9739
|
+
checkedIcon: "checklist",
|
|
9729
9740
|
tabsColor: "",
|
|
9730
9741
|
poppable: true,
|
|
9731
9742
|
visible: false,
|
|
@@ -9750,7 +9761,7 @@ const defaultProps$_ = {
|
|
|
9750
9761
|
},
|
|
9751
9762
|
...Popup.defaultProps
|
|
9752
9763
|
};
|
|
9753
|
-
const InternalCascader = (props) => {
|
|
9764
|
+
const InternalCascader = (props, ref) => {
|
|
9754
9765
|
const {
|
|
9755
9766
|
className,
|
|
9756
9767
|
style,
|
|
@@ -9774,7 +9785,7 @@ const InternalCascader = (props) => {
|
|
|
9774
9785
|
onPathChange
|
|
9775
9786
|
} = { ...defaultProps$_, ...props };
|
|
9776
9787
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
9777
|
-
const [
|
|
9788
|
+
const [optionsData, setOptionsData] = useState([]);
|
|
9778
9789
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
9779
9790
|
const [state] = useState({
|
|
9780
9791
|
optionsData: [],
|
|
@@ -9847,7 +9858,7 @@ const InternalCascader = (props) => {
|
|
|
9847
9858
|
}
|
|
9848
9859
|
];
|
|
9849
9860
|
syncValue();
|
|
9850
|
-
|
|
9861
|
+
setOptionsData(state.panes);
|
|
9851
9862
|
};
|
|
9852
9863
|
const syncValue = async () => {
|
|
9853
9864
|
const currentValue2 = state.innerValue;
|
|
@@ -9941,7 +9952,7 @@ const InternalCascader = (props) => {
|
|
|
9941
9952
|
onChange(optionParams, pathNodes);
|
|
9942
9953
|
onPathChange(optionParams, pathNodes);
|
|
9943
9954
|
}
|
|
9944
|
-
|
|
9955
|
+
setOptionsData(state.panes);
|
|
9945
9956
|
close();
|
|
9946
9957
|
return;
|
|
9947
9958
|
}
|
|
@@ -9956,7 +9967,7 @@ const InternalCascader = (props) => {
|
|
|
9956
9967
|
paneKey: `c${state.tabsCursor + 1}`
|
|
9957
9968
|
});
|
|
9958
9969
|
setTabvalue(`c${state.tabsCursor + 1}`);
|
|
9959
|
-
|
|
9970
|
+
setOptionsData(state.panes);
|
|
9960
9971
|
if (!type4) {
|
|
9961
9972
|
const pathNodes = state.panes.map((item) => item.selectedNode);
|
|
9962
9973
|
const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
|
|
@@ -9973,7 +9984,7 @@ const InternalCascader = (props) => {
|
|
|
9973
9984
|
state.panes[state.tabsCursor].selectedNode = node;
|
|
9974
9985
|
chooseItem(node, type4);
|
|
9975
9986
|
}
|
|
9976
|
-
|
|
9987
|
+
setOptionsData(state.panes);
|
|
9977
9988
|
};
|
|
9978
9989
|
const renderItem = () => {
|
|
9979
9990
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -9984,7 +9995,7 @@ const InternalCascader = (props) => {
|
|
|
9984
9995
|
}, title), /* @__PURE__ */ React__default.createElement(Tabs, {
|
|
9985
9996
|
value: tabvalue,
|
|
9986
9997
|
titleNode: () => {
|
|
9987
|
-
return
|
|
9998
|
+
return optionsData.map((pane, index) => {
|
|
9988
9999
|
var _a, _b;
|
|
9989
10000
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9990
10001
|
onClick: () => {
|
|
@@ -10001,7 +10012,7 @@ const InternalCascader = (props) => {
|
|
|
10001
10012
|
}));
|
|
10002
10013
|
});
|
|
10003
10014
|
}
|
|
10004
|
-
}, !state.initLoading && state.panes.length ?
|
|
10015
|
+
}, !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ React__default.createElement(TabPane, {
|
|
10005
10016
|
key: pane.paneKey,
|
|
10006
10017
|
paneKey: pane.paneKey
|
|
10007
10018
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -10038,6 +10049,8 @@ const defaultProps$Z = {
|
|
|
10038
10049
|
disabled: false,
|
|
10039
10050
|
checkedValue: [],
|
|
10040
10051
|
max: void 0,
|
|
10052
|
+
textPosition: "right",
|
|
10053
|
+
direction: "vertical",
|
|
10041
10054
|
onChange: (value) => {
|
|
10042
10055
|
},
|
|
10043
10056
|
options: []
|
|
@@ -10052,6 +10065,8 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
10052
10065
|
onChange,
|
|
10053
10066
|
checkedValue,
|
|
10054
10067
|
max,
|
|
10068
|
+
textPosition,
|
|
10069
|
+
direction,
|
|
10055
10070
|
options: options2,
|
|
10056
10071
|
...rest
|
|
10057
10072
|
} = props;
|
|
@@ -10107,9 +10122,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
10107
10122
|
return (innerValue == null ? void 0 : innerValue.indexOf(child.props.label || child.children)) > -1;
|
|
10108
10123
|
}
|
|
10109
10124
|
function validateChecked(value) {
|
|
10110
|
-
if (innerValue
|
|
10125
|
+
if (!innerValue)
|
|
10111
10126
|
return false;
|
|
10112
|
-
return innerValue
|
|
10127
|
+
return (innerValue == null ? void 0 : innerValue.indexOf(value)) > -1;
|
|
10113
10128
|
}
|
|
10114
10129
|
function getParentVals() {
|
|
10115
10130
|
return innerValue;
|
|
@@ -10125,7 +10140,8 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
10125
10140
|
checked: childChecked,
|
|
10126
10141
|
onChange: handleChildChange,
|
|
10127
10142
|
getParentVals,
|
|
10128
|
-
max
|
|
10143
|
+
max,
|
|
10144
|
+
textPosition
|
|
10129
10145
|
});
|
|
10130
10146
|
});
|
|
10131
10147
|
}
|
|
@@ -10140,13 +10156,14 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
10140
10156
|
onChange: handleChildChange,
|
|
10141
10157
|
...rest2,
|
|
10142
10158
|
max,
|
|
10159
|
+
textPosition,
|
|
10143
10160
|
getParentVals,
|
|
10144
10161
|
checked: childChecked
|
|
10145
10162
|
});
|
|
10146
10163
|
});
|
|
10147
|
-
}, [innerValue, options2, innerDisabled]);
|
|
10164
|
+
}, [innerValue, options2, innerDisabled, max]);
|
|
10148
10165
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
10149
|
-
className: `${b()} ${className || ""}`,
|
|
10166
|
+
className: `${b()} nut-checkboxgroup--${props.direction} ${className || ""}`,
|
|
10150
10167
|
...rest
|
|
10151
10168
|
}, (options2 == null ? void 0 : options2.length) ? renderOptionsChildren() : cloneChildren());
|
|
10152
10169
|
}
|
|
@@ -12109,6 +12126,14 @@ class FormStore {
|
|
|
12109
12126
|
...this.store,
|
|
12110
12127
|
...newStore
|
|
12111
12128
|
};
|
|
12129
|
+
this.fieldEntities.forEach((enetity) => {
|
|
12130
|
+
const { name } = enetity.props;
|
|
12131
|
+
Object.keys(newStore).forEach((key) => {
|
|
12132
|
+
if (key === name) {
|
|
12133
|
+
enetity.onStoreChange();
|
|
12134
|
+
}
|
|
12135
|
+
});
|
|
12136
|
+
});
|
|
12112
12137
|
};
|
|
12113
12138
|
this.validate = () => {
|
|
12114
12139
|
const err = [];
|
|
@@ -12132,6 +12157,7 @@ class FormStore {
|
|
|
12132
12157
|
err.push(...errors);
|
|
12133
12158
|
this.errList.push(...errors);
|
|
12134
12159
|
}
|
|
12160
|
+
entity.onStoreChange();
|
|
12135
12161
|
});
|
|
12136
12162
|
});
|
|
12137
12163
|
return err;
|
|
@@ -12152,6 +12178,10 @@ class FormStore {
|
|
|
12152
12178
|
}
|
|
12153
12179
|
};
|
|
12154
12180
|
this.resetFields = () => {
|
|
12181
|
+
this.errList.length = 0;
|
|
12182
|
+
this.fieldEntities.forEach((enetity) => {
|
|
12183
|
+
enetity.onStoreChange();
|
|
12184
|
+
});
|
|
12155
12185
|
};
|
|
12156
12186
|
this.getForm = () => {
|
|
12157
12187
|
return {
|
|
@@ -12159,6 +12189,7 @@ class FormStore {
|
|
|
12159
12189
|
registerField: this.registerField,
|
|
12160
12190
|
getFieldValue: this.getFieldValue,
|
|
12161
12191
|
setFieldsValue: this.setFieldsValue,
|
|
12192
|
+
resetFields: this.resetFields,
|
|
12162
12193
|
submit: this.submit,
|
|
12163
12194
|
store: this.store,
|
|
12164
12195
|
errList: this.errList,
|
|
@@ -12201,17 +12232,19 @@ const defaultProps$W = {
|
|
|
12201
12232
|
class FormItem extends React__default.Component {
|
|
12202
12233
|
constructor() {
|
|
12203
12234
|
super(...arguments);
|
|
12235
|
+
this.isInitialValue = false;
|
|
12204
12236
|
this.getControlled = (children) => {
|
|
12205
12237
|
var _a;
|
|
12206
12238
|
const { getFieldValue, setFieldsValue } = this.context;
|
|
12207
12239
|
const { name } = this.props;
|
|
12208
12240
|
const type4 = children.type.NAME;
|
|
12209
12241
|
const defaultvalue = this.props.initialValue || ((_a = children.props) == null ? void 0 : _a.defaultValue);
|
|
12210
|
-
if (defaultvalue) {
|
|
12242
|
+
if (defaultvalue && !this.isInitialValue) {
|
|
12211
12243
|
setFieldsValue({ [name]: defaultvalue });
|
|
12244
|
+
this.isInitialValue = true;
|
|
12212
12245
|
}
|
|
12213
12246
|
return {
|
|
12214
|
-
|
|
12247
|
+
defaultValue: getFieldValue(name),
|
|
12215
12248
|
onChange: (event) => {
|
|
12216
12249
|
const originOnChange = children.props.onChange;
|
|
12217
12250
|
if (originOnChange) {
|
|
@@ -12228,6 +12261,7 @@ class FormItem extends React__default.Component {
|
|
|
12228
12261
|
};
|
|
12229
12262
|
};
|
|
12230
12263
|
this.onStoreChange = () => {
|
|
12264
|
+
this.forceUpdate();
|
|
12231
12265
|
};
|
|
12232
12266
|
this.renderLayout = (childNode) => {
|
|
12233
12267
|
var _a, _b;
|
|
@@ -12291,7 +12325,7 @@ class FormItem extends React__default.Component {
|
|
|
12291
12325
|
}
|
|
12292
12326
|
const returnChildNode = React__default.cloneElement(
|
|
12293
12327
|
restCNode,
|
|
12294
|
-
this.getControlled(
|
|
12328
|
+
this.getControlled(restCNode)
|
|
12295
12329
|
);
|
|
12296
12330
|
return this.renderLayout(returnChildNode);
|
|
12297
12331
|
}
|
|
@@ -12323,14 +12357,20 @@ const Form = (props) => {
|
|
|
12323
12357
|
onFinishFailed,
|
|
12324
12358
|
labelPosition,
|
|
12325
12359
|
starPositon,
|
|
12360
|
+
form,
|
|
12326
12361
|
...rest
|
|
12327
12362
|
} = {
|
|
12328
12363
|
...defaultProps$V,
|
|
12329
12364
|
...props
|
|
12330
12365
|
};
|
|
12331
|
-
|
|
12366
|
+
let formInstance = {};
|
|
12367
|
+
if (Object.keys(form).length !== 0) {
|
|
12368
|
+
formInstance = form;
|
|
12369
|
+
} else {
|
|
12370
|
+
[formInstance] = useForm();
|
|
12371
|
+
}
|
|
12332
12372
|
formInstance.starPositon = starPositon;
|
|
12333
|
-
const { setCallback, submit } = formInstance;
|
|
12373
|
+
const { setCallback, submit, resetFields } = formInstance;
|
|
12334
12374
|
setCallback({
|
|
12335
12375
|
onFinish,
|
|
12336
12376
|
onFinishFailed
|
|
@@ -12341,6 +12381,10 @@ const Form = (props) => {
|
|
|
12341
12381
|
onSubmit: (e2) => {
|
|
12342
12382
|
e2.preventDefault();
|
|
12343
12383
|
submit();
|
|
12384
|
+
},
|
|
12385
|
+
onReset: (e2) => {
|
|
12386
|
+
e2.preventDefault();
|
|
12387
|
+
resetFields();
|
|
12344
12388
|
}
|
|
12345
12389
|
}, /* @__PURE__ */ React__default.createElement(CellGroup, null, /* @__PURE__ */ React__default.createElement(FormItemContext.Provider, {
|
|
12346
12390
|
value: formInstance
|
|
@@ -12349,6 +12393,7 @@ const Form = (props) => {
|
|
|
12349
12393
|
Form.defaultProps = defaultProps$V;
|
|
12350
12394
|
Form.displayName = "NutForm";
|
|
12351
12395
|
Form.Item = FormItem;
|
|
12396
|
+
Form.useForm = useForm;
|
|
12352
12397
|
function trimExtraChar(value, char, regExp) {
|
|
12353
12398
|
const index = value.indexOf(char);
|
|
12354
12399
|
if (index === -1) {
|
|
@@ -12759,16 +12804,14 @@ const InputNumber = (props) => {
|
|
|
12759
12804
|
const addAllow = (value = inputValue) => {
|
|
12760
12805
|
if (value || typeof value === "number") {
|
|
12761
12806
|
return value < Number(max) && !disabled;
|
|
12762
|
-
} else {
|
|
12763
|
-
return false;
|
|
12764
12807
|
}
|
|
12808
|
+
return false;
|
|
12765
12809
|
};
|
|
12766
12810
|
const reduceAllow = (value = inputValue) => {
|
|
12767
12811
|
if (value || typeof value === "number") {
|
|
12768
12812
|
return value > Number(min) && !disabled;
|
|
12769
|
-
} else {
|
|
12770
|
-
return false;
|
|
12771
12813
|
}
|
|
12814
|
+
return false;
|
|
12772
12815
|
};
|
|
12773
12816
|
const iconMinusClasses = classNames("nut-inputnumber__icon", {
|
|
12774
12817
|
"nut-inputnumber__icon--disabled": !reduceAllow()
|
|
@@ -12855,6 +12898,8 @@ const InputNumber = (props) => {
|
|
|
12855
12898
|
className: classes,
|
|
12856
12899
|
style: styles,
|
|
12857
12900
|
...restProps
|
|
12901
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12902
|
+
className: "nut-input-minus"
|
|
12858
12903
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
12859
12904
|
classPrefix: iconClassPrefix,
|
|
12860
12905
|
fontClassName: iconFontClassName,
|
|
@@ -12862,7 +12907,7 @@ const InputNumber = (props) => {
|
|
|
12862
12907
|
size: buttonSize,
|
|
12863
12908
|
name: "minus",
|
|
12864
12909
|
onClick: reduceNumber
|
|
12865
|
-
}), /* @__PURE__ */ React__default.createElement("input", {
|
|
12910
|
+
})), /* @__PURE__ */ React__default.createElement("input", {
|
|
12866
12911
|
type: "number",
|
|
12867
12912
|
min,
|
|
12868
12913
|
max,
|
|
@@ -12873,14 +12918,16 @@ const InputNumber = (props) => {
|
|
|
12873
12918
|
onInput: changeValue,
|
|
12874
12919
|
onBlur: burValue,
|
|
12875
12920
|
onFocus: focusValue
|
|
12876
|
-
}), /* @__PURE__ */ React__default.createElement(
|
|
12921
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
12922
|
+
className: "nut-input-add"
|
|
12923
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
12877
12924
|
classPrefix: iconClassPrefix,
|
|
12878
12925
|
fontClassName: iconFontClassName,
|
|
12879
12926
|
className: iconAddClasses,
|
|
12880
12927
|
size: buttonSize,
|
|
12881
12928
|
name: "plus",
|
|
12882
12929
|
onClick: addNumber
|
|
12883
|
-
}));
|
|
12930
|
+
})));
|
|
12884
12931
|
};
|
|
12885
12932
|
InputNumber.defaultProps = defaultProps$T;
|
|
12886
12933
|
InputNumber.displayName = "NutInputNumber";
|
|
@@ -14226,6 +14273,7 @@ const defaultProps$M = {
|
|
|
14226
14273
|
closeOnClickOverlay: true,
|
|
14227
14274
|
length: 6,
|
|
14228
14275
|
className: "",
|
|
14276
|
+
autoFocus: false,
|
|
14229
14277
|
onChange: (value) => {
|
|
14230
14278
|
},
|
|
14231
14279
|
onOk: (value) => {
|
|
@@ -14261,6 +14309,7 @@ const ShortPassword = (props) => {
|
|
|
14261
14309
|
onComplete,
|
|
14262
14310
|
iconClassPrefix,
|
|
14263
14311
|
iconFontClassName,
|
|
14312
|
+
autoFocus,
|
|
14264
14313
|
...reset
|
|
14265
14314
|
} = props;
|
|
14266
14315
|
const b = cn("shortpassword");
|
|
@@ -14345,6 +14394,7 @@ const ShortPassword = (props) => {
|
|
|
14345
14394
|
style: systemStyle(),
|
|
14346
14395
|
maxLength: 6,
|
|
14347
14396
|
value: inputValue,
|
|
14397
|
+
autoFocus,
|
|
14348
14398
|
onChange: (e2) => changeValue(e2)
|
|
14349
14399
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
14350
14400
|
className: b("input-site")
|
|
@@ -15423,9 +15473,20 @@ const DialogWrap = (props) => {
|
|
|
15423
15473
|
DialogWrap.displayName = "NutDialogWrap";
|
|
15424
15474
|
const DialogWrapper = (props) => {
|
|
15425
15475
|
const { visible, lockScroll } = props;
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15476
|
+
useEffect(() => {
|
|
15477
|
+
if (lockScroll && visible) {
|
|
15478
|
+
document.body.classList.add("nut-overflow-hidden");
|
|
15479
|
+
} else {
|
|
15480
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
15481
|
+
}
|
|
15482
|
+
}, [visible]);
|
|
15483
|
+
useEffect(() => {
|
|
15484
|
+
return () => {
|
|
15485
|
+
if (document.body.classList.value.includes("nut-overflow-hidden")) {
|
|
15486
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
15487
|
+
}
|
|
15488
|
+
};
|
|
15489
|
+
}, []);
|
|
15429
15490
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15430
15491
|
style: { display: visible ? "block" : "none" }
|
|
15431
15492
|
}, /* @__PURE__ */ React__default.createElement(DialogWrap, {
|
|
@@ -15455,13 +15516,13 @@ const normalizeConfig = (_config) => {
|
|
|
15455
15516
|
function confirm(config2, renderFunc) {
|
|
15456
15517
|
const div = document.createElement("div");
|
|
15457
15518
|
document.body.appendChild(div);
|
|
15458
|
-
function
|
|
15459
|
-
|
|
15519
|
+
function render$1(props) {
|
|
15520
|
+
render(/* @__PURE__ */ React__default.createElement(ConfirmDialog, {
|
|
15460
15521
|
...props,
|
|
15461
15522
|
onCancel
|
|
15462
15523
|
}), div);
|
|
15463
15524
|
}
|
|
15464
|
-
const renderFunction = renderFunc ||
|
|
15525
|
+
const renderFunction = renderFunc || render$1;
|
|
15465
15526
|
let dialogConfig = {
|
|
15466
15527
|
...config2,
|
|
15467
15528
|
visible: false
|
|
@@ -16456,6 +16517,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
16456
16517
|
Swipe.defaultProps = defaultProps$C;
|
|
16457
16518
|
Swipe.displayName = "NutSwipe";
|
|
16458
16519
|
const defaultProps$B = {
|
|
16520
|
+
...ComponentDefaults,
|
|
16459
16521
|
isAsync: false,
|
|
16460
16522
|
checked: false,
|
|
16461
16523
|
disable: false,
|
|
@@ -17060,6 +17122,7 @@ AvatarGroup.defaultProps = defaultProps$v;
|
|
|
17060
17122
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
17061
17123
|
const defaultProps$u = {
|
|
17062
17124
|
...ComponentDefaults,
|
|
17125
|
+
className: "",
|
|
17063
17126
|
value: "",
|
|
17064
17127
|
dot: false,
|
|
17065
17128
|
max: 1e4,
|
|
@@ -17829,12 +17892,14 @@ const Ellipsis = (props) => {
|
|
|
17829
17892
|
ref: root2
|
|
17830
17893
|
}, /* @__PURE__ */ React__default.createElement("div", null, !exceeded ? content : null, exceeded && !expanded ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (_a = ellipsis.current) == null ? void 0 : _a.leading, expandText ? /* @__PURE__ */ React__default.createElement("span", {
|
|
17831
17894
|
className: "nut-ellipsis-text",
|
|
17832
|
-
onClick: () => {
|
|
17895
|
+
onClick: (e2) => {
|
|
17896
|
+
e2.stopPropagation();
|
|
17833
17897
|
clickHandle(1);
|
|
17834
17898
|
}
|
|
17835
17899
|
}, expandText) : null, (_b = ellipsis.current) == null ? void 0 : _b.tailing) : null, exceeded && expanded ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, content, expandText ? /* @__PURE__ */ React__default.createElement("span", {
|
|
17836
17900
|
className: "nut-ellipsis-text",
|
|
17837
|
-
onClick: () => {
|
|
17901
|
+
onClick: (e2) => {
|
|
17902
|
+
e2.stopPropagation();
|
|
17838
17903
|
clickHandle(2);
|
|
17839
17904
|
}
|
|
17840
17905
|
}, collapseText) : null) : null));
|
|
@@ -19258,7 +19323,7 @@ const Popover = (props) => {
|
|
|
19258
19323
|
style: getStyle()
|
|
19259
19324
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
19260
19325
|
className: `${popoverArrow}`
|
|
19261
|
-
}), Array.isArray(children) ? children[1] : "", list.map((item, i) => {
|
|
19326
|
+
}), Array.isArray(children) ? children[1] : "", /* @__PURE__ */ React__default.createElement("div", null, list.map((item, i) => {
|
|
19262
19327
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19263
19328
|
key: item.name,
|
|
19264
19329
|
className: `popover-menu-item ${item.disabled ? "disabled" : ""}`,
|
|
@@ -19273,7 +19338,7 @@ const Popover = (props) => {
|
|
|
19273
19338
|
}) : "", /* @__PURE__ */ React__default.createElement("div", {
|
|
19274
19339
|
className: "popover-menu-item-name"
|
|
19275
19340
|
}, item.name));
|
|
19276
|
-
})) : null))), visible ? /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
19341
|
+
}))) : null))), visible ? /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
19277
19342
|
visible,
|
|
19278
19343
|
onClick: (e2) => handleClick2(e2),
|
|
19279
19344
|
style: { background: "transparent" }
|
|
@@ -20871,7 +20936,7 @@ const defaultProps$5 = {
|
|
|
20871
20936
|
barrageList: [],
|
|
20872
20937
|
frequency: 500,
|
|
20873
20938
|
loop: true,
|
|
20874
|
-
speeds:
|
|
20939
|
+
speeds: 3e3,
|
|
20875
20940
|
rows: 3,
|
|
20876
20941
|
top: 10
|
|
20877
20942
|
};
|
|
@@ -20899,26 +20964,40 @@ const InternalBarrage = (props, ref) => {
|
|
|
20899
20964
|
useImperativeHandle(ref, () => ({
|
|
20900
20965
|
add: (word) => {
|
|
20901
20966
|
const _index = index.current % barrageList.length;
|
|
20902
|
-
|
|
20967
|
+
if (!loop2 && index.current === barrageList.length) {
|
|
20968
|
+
barrageList.splice(barrageList.length, 0, word);
|
|
20969
|
+
} else {
|
|
20970
|
+
barrageList.splice(_index, 0, word);
|
|
20971
|
+
}
|
|
20903
20972
|
}
|
|
20904
20973
|
}));
|
|
20905
20974
|
useEffect(() => {
|
|
20906
20975
|
if (barrageBody.current) {
|
|
20907
20976
|
barrageCWidth.current = barrageBody.current.offsetWidth;
|
|
20908
|
-
run();
|
|
20909
20977
|
}
|
|
20978
|
+
setTimeout(() => {
|
|
20979
|
+
var _a;
|
|
20980
|
+
(_a = barrageBody.current) == null ? void 0 : _a.style.setProperty(
|
|
20981
|
+
"--move-distance",
|
|
20982
|
+
`-${barrageCWidth.current}px`
|
|
20983
|
+
);
|
|
20984
|
+
index.current = 0;
|
|
20985
|
+
run();
|
|
20986
|
+
}, 300);
|
|
20910
20987
|
return () => {
|
|
20911
20988
|
clearInterval(timer.current);
|
|
20912
20989
|
};
|
|
20913
20990
|
}, [barrageList]);
|
|
20914
20991
|
const run = () => {
|
|
20915
20992
|
clearInterval(timer.current);
|
|
20916
|
-
timer.current = window.
|
|
20993
|
+
timer.current = window.setTimeout(() => {
|
|
20917
20994
|
play();
|
|
20918
|
-
run();
|
|
20919
20995
|
}, frequency);
|
|
20920
20996
|
};
|
|
20921
20997
|
const play = () => {
|
|
20998
|
+
if (!loop2 && index.current >= barrageList.length) {
|
|
20999
|
+
return;
|
|
21000
|
+
}
|
|
20922
21001
|
const _index = loop2 ? index.current % barrageList.length : index.current;
|
|
20923
21002
|
const el = document.createElement(`div`);
|
|
20924
21003
|
el.innerHTML = barrageList[_index];
|
|
@@ -20930,12 +21009,11 @@ const InternalBarrage = (props, ref) => {
|
|
|
20930
21009
|
el.style.animationDuration = `${speeds}ms`;
|
|
20931
21010
|
el.style.top = `${_index % rows * (height + top) + 20}px`;
|
|
20932
21011
|
el.style.width = `${width}px`;
|
|
20933
|
-
el.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
|
|
20934
|
-
el.dataset.index = `${_index}`;
|
|
20935
21012
|
el.addEventListener("animationend", () => {
|
|
20936
21013
|
barrageContainer.current.removeChild(el);
|
|
20937
21014
|
});
|
|
20938
21015
|
index.current++;
|
|
21016
|
+
run();
|
|
20939
21017
|
};
|
|
20940
21018
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
20941
21019
|
className: classes,
|