@nutui/nutui-react 2.3.8 → 2.3.10
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 +37 -4
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Audio/style/style.css +1 -1
- package/dist/esm/Avatar/style/style.css +1 -1
- package/dist/esm/AvatarCropper/style/style.css +1 -1
- package/dist/esm/AvatarGroup/style/style.css +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +18 -3
- package/dist/esm/Button/style/style.css +1 -1
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/CalendarCard/style/style.css +1 -1
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cell/style/style.css +1 -1
- package/dist/esm/CellGroup/style/style.css +1 -1
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/CircleProgress/style/style.css +1 -1
- package/dist/esm/Col/style/style.css +1 -1
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Divider/style/style.css +1 -1
- package/dist/esm/Elevator/style/style.css +1 -1
- package/dist/esm/Empty/style/style.css +1 -1
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/Grid/style/style.css +1 -1
- package/dist/esm/GridItem/style/style.css +1 -1
- package/dist/esm/Image/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Indicator/style/style.css +1 -1
- package/dist/esm/InfiniteLoading/style/style.css +1 -1
- package/dist/esm/InfiniteLoading.js +7 -6
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/Notify/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Overlay/style/style.css +1 -1
- package/dist/esm/Pagination/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Price/style/style.css +1 -1
- package/dist/esm/Progress/style/style.css +1 -1
- package/dist/esm/PullToRefresh/style/style.css +1 -1
- package/dist/esm/Radio/style/style.css +1 -1
- package/dist/esm/Range/style/style.css +1 -1
- package/dist/esm/Rate/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +27 -8
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Space/style/style.css +1 -1
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Switch/style/style.css +1 -1
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tag/style/style.css +1 -1
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TextArea.js +1 -1
- package/dist/esm/TimeDetail/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/TrendArrow/style/style.css +1 -1
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/configprovider2.js +8 -4
- package/dist/esm/formitem2.js +39 -5
- package/dist/esm/popup2.js +2 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -1
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/formitem/formitem.d.ts +6 -2
- package/dist/esm/types/src/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +7 -0
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/shortpassword/types.d.ts +4 -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/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 +96 -24
- package/dist/nutui.react.umd.js +96 -24
- package/dist/packages/address/address.scss +12 -0
- package/dist/packages/animate/animate.scss +49 -0
- package/dist/packages/audio/audio.scss +14 -0
- package/dist/packages/avatar/avatar.scss +25 -0
- package/dist/packages/avatarcropper/avatarcropper.scss +52 -0
- package/dist/packages/avatargroup/avatargroup.scss +11 -0
- package/dist/packages/badge/badge.scss +8 -0
- package/dist/packages/barrage/barrage.scss +18 -1
- package/dist/packages/button/button.scss +18 -0
- package/dist/packages/calendar/calendar.scss +24 -0
- package/dist/packages/calendarcard/calendarcard.scss +41 -0
- package/dist/packages/card/card.scss +21 -0
- package/dist/packages/cascader/cascader.scss +8 -0
- package/dist/packages/cellgroup/cellgroup.scss +14 -0
- package/dist/packages/checkbox/checkbox.scss +38 -0
- package/dist/packages/checkboxgroup/checkboxgroup.scss +24 -8
- package/dist/packages/circleprogress/circleprogress.scss +8 -0
- package/dist/packages/col/col.scss +25 -0
- package/dist/packages/collapseitem/collapseitem.scss +15 -0
- package/dist/packages/dialog/dialog.scss +29 -0
- package/dist/packages/divider/divider.scss +22 -0
- package/dist/packages/elevator/elevator.scss +20 -0
- package/dist/packages/ellipsis/ellipsis.scss +1 -0
- package/dist/packages/empty/empty.scss +11 -0
- package/dist/packages/fixednav/fixednav.scss +75 -0
- package/dist/packages/form/form.scss +31 -0
- package/dist/packages/formitem/formitem.scss +15 -0
- package/dist/packages/grid/grid.scss +8 -0
- package/dist/packages/griditem/griditem.scss +37 -0
- package/dist/packages/image/image.scss +13 -0
- package/dist/packages/imagepreview/imagepreview.scss +26 -0
- package/dist/packages/indicator/indicator.scss +15 -0
- package/dist/packages/infiniteloading/infiniteloading.scss +13 -0
- package/dist/packages/loading/loading.scss +6 -0
- package/dist/packages/menu/menu.scss +9 -0
- package/dist/packages/menuitem/menuitem.scss +12 -0
- package/dist/packages/navbar/navbar.scss +61 -0
- package/dist/packages/noticebar/noticebar.scss +22 -0
- package/dist/packages/notify/notify.scss +10 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +27 -0
- package/dist/packages/overlay/overlay.scss +6 -0
- package/dist/packages/pagination/pagination.scss +24 -0
- package/dist/packages/popover/popover.scss +105 -0
- package/dist/packages/popup/popup.scss +77 -0
- package/dist/packages/price/price.scss +19 -0
- package/dist/packages/progress/progress.scss +7 -0
- package/dist/packages/pulltorefresh/pulltorefresh.scss +10 -0
- package/dist/packages/radio/radio.scss +21 -0
- package/dist/packages/range/range.scss +65 -0
- package/dist/packages/rate/rate.scss +30 -0
- package/dist/packages/safearea/safearea.scss +2 -0
- package/dist/packages/searchbar/searchbar.scss +65 -0
- package/dist/packages/shortpassword/shortpassword.scss +25 -0
- package/dist/packages/sidenavbar/sidenavbar.scss +15 -0
- package/dist/packages/skeleton/skeleton.scss +22 -1
- package/dist/packages/space/space.scss +30 -0
- package/dist/packages/step/step.scss +45 -0
- package/dist/packages/swipe/swipe.scss +15 -0
- package/dist/packages/swiper/swiper.scss +14 -0
- package/dist/packages/switch/switch.scss +13 -0
- package/dist/packages/tabbar/tabbar.scss +13 -0
- package/dist/packages/tabbaritem/tabbaritem.scss +2 -0
- package/dist/packages/table/table.scss +57 -0
- package/dist/packages/tabs/tabs.scss +85 -14
- package/dist/packages/tag/tag.scss +8 -0
- package/dist/packages/textarea/textarea.scss +17 -0
- package/dist/packages/timedetail/timedetail.scss +5 -0
- package/dist/packages/timeselect/timeselect.scss +5 -0
- package/dist/packages/toast/toast.scss +15 -0
- package/dist/packages/tour/tour.scss +23 -0
- package/dist/packages/trendarrow/trendarrow.scss +13 -0
- package/dist/packages/uploader/uploader.scss +36 -0
- package/dist/packages/video/video.scss +3 -0
- package/dist/packages/virtuallist/virtuallist.scss +11 -0
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/backtop/backtop.d.ts +1 -1
- package/dist/types/packages/configprovider/configprovider.d.ts +2 -0
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +2 -0
- package/dist/types/packages/configprovider/index.d.ts +1 -1
- package/dist/types/packages/configprovider/index.taro.d.ts +1 -1
- package/dist/types/packages/formitem/formitem.d.ts +14 -2
- package/dist/types/packages/formitem/formitem.taro.d.ts +6 -2
- package/dist/types/packages/popover/popover.taro.d.ts +7 -0
- package/dist/types/packages/shortpassword/shortpassword.d.ts +3 -2
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +3 -2
- package/dist/types/packages/shortpassword/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/nutui.react.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react v2.3.
|
|
11
|
+
* @nutui/nutui-react v2.3.10 Tue Feb 06 2024 16:12:46 GMT+0800 (China Standard Time)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -2397,7 +2397,8 @@ Check the top-level render call using <` + t2 + ">.");
|
|
|
2397
2397
|
const classPrefix$p = "nut-configprovider";
|
|
2398
2398
|
const defaultConfigRef = {
|
|
2399
2399
|
current: {
|
|
2400
|
-
locale: zhCN
|
|
2400
|
+
locale: zhCN,
|
|
2401
|
+
direction: "ltr"
|
|
2401
2402
|
}
|
|
2402
2403
|
};
|
|
2403
2404
|
const getDefaultConfig = () => {
|
|
@@ -2415,7 +2416,7 @@ Check the top-level render call using <` + t2 + ">.");
|
|
|
2415
2416
|
return cssVars;
|
|
2416
2417
|
}
|
|
2417
2418
|
const ConfigProvider = (props) => {
|
|
2418
|
-
const { style, className, children, ...config2 } = props;
|
|
2419
|
+
const { style, className, children, direction, ...config2 } = props;
|
|
2419
2420
|
const mergedConfig = useMemo(
|
|
2420
2421
|
() => {
|
|
2421
2422
|
return {
|
|
@@ -2438,8 +2439,10 @@ Check the top-level render call using <` + t2 + ">.");
|
|
|
2438
2439
|
className: classNames(classPrefix$p, className),
|
|
2439
2440
|
style: {
|
|
2440
2441
|
...cssVarStyle,
|
|
2441
|
-
...style
|
|
2442
|
-
|
|
2442
|
+
...style,
|
|
2443
|
+
direction
|
|
2444
|
+
},
|
|
2445
|
+
dir: direction
|
|
2443
2446
|
},
|
|
2444
2447
|
children
|
|
2445
2448
|
));
|
|
@@ -10899,7 +10902,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
10899
10902
|
{
|
|
10900
10903
|
nodeRef,
|
|
10901
10904
|
classNames: transitionName,
|
|
10902
|
-
|
|
10905
|
+
mountOnEnter: true,
|
|
10906
|
+
unmountOnExit: destroyOnClose,
|
|
10903
10907
|
timeout: duration,
|
|
10904
10908
|
in: innerVisible,
|
|
10905
10909
|
onEntered: onHandleOpened,
|
|
@@ -15800,6 +15804,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15800
15804
|
constructor() {
|
|
15801
15805
|
// 初始化数据
|
|
15802
15806
|
__publicField(this, "initialValues", {});
|
|
15807
|
+
__publicField(this, "updateList", []);
|
|
15803
15808
|
// 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
|
|
15804
15809
|
__publicField(this, "store", {});
|
|
15805
15810
|
// 所有的组件实例
|
|
@@ -15869,6 +15874,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15869
15874
|
}
|
|
15870
15875
|
});
|
|
15871
15876
|
});
|
|
15877
|
+
this.updateList.forEach((item) => {
|
|
15878
|
+
let shouldUpdate = item.condition;
|
|
15879
|
+
if (typeof item.condition === "function") {
|
|
15880
|
+
shouldUpdate = item.condition();
|
|
15881
|
+
}
|
|
15882
|
+
if (shouldUpdate) {
|
|
15883
|
+
item.entity.onStoreChange("update");
|
|
15884
|
+
}
|
|
15885
|
+
});
|
|
15872
15886
|
});
|
|
15873
15887
|
__publicField(this, "setCallback", (callback) => {
|
|
15874
15888
|
this.callbacks = {
|
|
@@ -15934,6 +15948,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15934
15948
|
entity.onStoreChange("reset");
|
|
15935
15949
|
});
|
|
15936
15950
|
});
|
|
15951
|
+
// 监听事件
|
|
15952
|
+
__publicField(this, "registerUpdate", (field, shouldUpdate) => {
|
|
15953
|
+
this.updateList.push({
|
|
15954
|
+
entity: field,
|
|
15955
|
+
condition: shouldUpdate
|
|
15956
|
+
});
|
|
15957
|
+
return () => {
|
|
15958
|
+
this.updateList = this.updateList.filter((i) => i.entity !== field);
|
|
15959
|
+
};
|
|
15960
|
+
});
|
|
15937
15961
|
__publicField(this, "dispatch", ({ name }) => {
|
|
15938
15962
|
this.validateFields([name]);
|
|
15939
15963
|
});
|
|
@@ -15945,7 +15969,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15945
15969
|
setInitialValues: this.setInitialValues,
|
|
15946
15970
|
dispatch: this.dispatch,
|
|
15947
15971
|
store: this.store,
|
|
15948
|
-
fieldEntities: this.fieldEntities
|
|
15972
|
+
fieldEntities: this.fieldEntities,
|
|
15973
|
+
registerUpdate: this.registerUpdate
|
|
15949
15974
|
};
|
|
15950
15975
|
}
|
|
15951
15976
|
});
|
|
@@ -16076,13 +16101,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16076
16101
|
label: "",
|
|
16077
16102
|
rules: [{ required: false, message: "" }],
|
|
16078
16103
|
errorMessageAlign: "left",
|
|
16079
|
-
validateTrigger: "onChange"
|
|
16104
|
+
validateTrigger: "onChange",
|
|
16105
|
+
shouldUpdate: false,
|
|
16106
|
+
noStyle: false
|
|
16080
16107
|
};
|
|
16081
16108
|
class FormItem extends React.Component {
|
|
16082
16109
|
constructor(props) {
|
|
16083
16110
|
super(props);
|
|
16084
16111
|
__publicField(this, "cancelRegister");
|
|
16085
16112
|
__publicField(this, "componentRef");
|
|
16113
|
+
__publicField(this, "eventOff");
|
|
16086
16114
|
// children添加value属性和onChange事件
|
|
16087
16115
|
__publicField(this, "getControlled", (children) => {
|
|
16088
16116
|
var _a2;
|
|
@@ -16197,22 +16225,31 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16197
16225
|
};
|
|
16198
16226
|
}
|
|
16199
16227
|
componentDidMount() {
|
|
16200
|
-
const { registerField } = this.context.getInternal(SECRET);
|
|
16228
|
+
const { registerField, registerUpdate } = this.context.getInternal(SECRET);
|
|
16201
16229
|
this.cancelRegister = registerField(this);
|
|
16230
|
+
this.eventOff = registerUpdate(this, this.props.shouldUpdate);
|
|
16202
16231
|
}
|
|
16203
16232
|
componentWillUnmount() {
|
|
16204
16233
|
if (this.cancelRegister) {
|
|
16205
16234
|
this.cancelRegister();
|
|
16206
16235
|
}
|
|
16236
|
+
if (this.eventOff) {
|
|
16237
|
+
this.eventOff();
|
|
16238
|
+
}
|
|
16207
16239
|
}
|
|
16208
16240
|
render() {
|
|
16209
16241
|
const { children } = this.props;
|
|
16210
16242
|
const child = Array.isArray(children) ? children[0] : children;
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16243
|
+
let returnChildNode;
|
|
16244
|
+
if (!this.props.shouldUpdate) {
|
|
16245
|
+
returnChildNode = React.cloneElement(
|
|
16246
|
+
child,
|
|
16247
|
+
this.getControlled(child)
|
|
16248
|
+
);
|
|
16249
|
+
} else {
|
|
16250
|
+
returnChildNode = child(this.context);
|
|
16251
|
+
}
|
|
16252
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, { key: this.state.resetCount }, this.props.noStyle ? returnChildNode : this.renderLayout(returnChildNode));
|
|
16216
16253
|
}
|
|
16217
16254
|
}
|
|
16218
16255
|
__publicField(FormItem, "defaultProps", defaultProps$W);
|
|
@@ -18123,13 +18160,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18123
18160
|
// 1~6
|
|
18124
18161
|
autoFocus: false
|
|
18125
18162
|
};
|
|
18126
|
-
const
|
|
18163
|
+
const InternalShortPassword = (props, ref) => {
|
|
18127
18164
|
const { locale } = useConfig();
|
|
18128
18165
|
const {
|
|
18129
18166
|
title,
|
|
18130
18167
|
description,
|
|
18131
18168
|
tips,
|
|
18132
|
-
visible,
|
|
18169
|
+
visible: deleteVisible,
|
|
18133
18170
|
value,
|
|
18134
18171
|
error,
|
|
18135
18172
|
hideFooter,
|
|
@@ -18160,6 +18197,24 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18160
18197
|
const format2 = (val) => {
|
|
18161
18198
|
return val.slice(0, comLen);
|
|
18162
18199
|
};
|
|
18200
|
+
const [visible, setVisible] = usePropsValue({
|
|
18201
|
+
value: props.visible,
|
|
18202
|
+
defaultValue: false,
|
|
18203
|
+
finalValue: false
|
|
18204
|
+
});
|
|
18205
|
+
const handleClose = () => {
|
|
18206
|
+
onClose == null ? void 0 : onClose();
|
|
18207
|
+
setVisible(false);
|
|
18208
|
+
};
|
|
18209
|
+
const actions = {
|
|
18210
|
+
open: () => {
|
|
18211
|
+
setVisible(true);
|
|
18212
|
+
},
|
|
18213
|
+
close: () => {
|
|
18214
|
+
setVisible(false);
|
|
18215
|
+
}
|
|
18216
|
+
};
|
|
18217
|
+
React.useImperativeHandle(ref, () => actions);
|
|
18163
18218
|
const [inputValue, setInputValue] = usePropsValue({ value, onChange });
|
|
18164
18219
|
React.useEffect(() => {
|
|
18165
18220
|
if (visible && autoFocus) {
|
|
@@ -18186,8 +18241,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18186
18241
|
},
|
|
18187
18242
|
visible,
|
|
18188
18243
|
closeable: true,
|
|
18189
|
-
onOverlayClick:
|
|
18190
|
-
onCloseIconClick:
|
|
18244
|
+
onOverlayClick: handleClose,
|
|
18245
|
+
onCloseIconClick: handleClose,
|
|
18191
18246
|
...rest
|
|
18192
18247
|
},
|
|
18193
18248
|
/* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix2, className), style }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-title` }, title || locale.shortpassword.title), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-description` }, description || locale.shortpassword.description), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-input`, onClick: onFocus }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-input-site` }), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-input-fake` }, [...new Array(comLen).keys()].map((item, index) => {
|
|
@@ -18195,8 +18250,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18195
18250
|
}))), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-message` }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-message-error` }, error), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-message-forget`, onClick: onTips }, tips || /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(s, { width: 11, height: 11, style: { marginRight: "3px" } }), locale.shortpassword.tips))), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-footer` }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-footer-cancel`, onClick: onCancel }, locale.cancel), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-footer-sure`, onClick: sure }, locale.confirm)))
|
|
18196
18251
|
);
|
|
18197
18252
|
};
|
|
18198
|
-
ShortPassword
|
|
18199
|
-
ShortPassword.displayName = "NutShortPassword";
|
|
18253
|
+
const ShortPassword = React.forwardRef(InternalShortPassword);
|
|
18200
18254
|
const defaultProps$K = {
|
|
18201
18255
|
...ComponentDefaults,
|
|
18202
18256
|
type: "png",
|
|
@@ -18405,7 +18459,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
18405
18459
|
const textareaRef = React.useRef(null);
|
|
18406
18460
|
const compositionRef = React.useRef(false);
|
|
18407
18461
|
const format2 = (value2) => {
|
|
18408
|
-
if (maxLength !==
|
|
18462
|
+
if (maxLength !== -1 && value2.length > maxLength) {
|
|
18409
18463
|
return value2.substring(0, maxLength);
|
|
18410
18464
|
}
|
|
18411
18465
|
return value2;
|
|
@@ -19844,6 +19898,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19844
19898
|
if (distance.current < refreshMaxH.current) {
|
|
19845
19899
|
distance.current = 0;
|
|
19846
19900
|
getRefreshTop().style.height = `${distance.current}px`;
|
|
19901
|
+
isTouching.current = false;
|
|
19847
19902
|
} else {
|
|
19848
19903
|
await (onRefresh == null ? void 0 : onRefresh());
|
|
19849
19904
|
refreshDone();
|
|
@@ -24500,6 +24555,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24500
24555
|
const barrageCWidth = React.useRef(0);
|
|
24501
24556
|
const timer = React.useRef(0);
|
|
24502
24557
|
const index = React.useRef(0);
|
|
24558
|
+
const times = React.useRef([]);
|
|
24559
|
+
const historyIndex = React.useRef(-1);
|
|
24503
24560
|
const classes = classNames(classPrefix$1, className);
|
|
24504
24561
|
React.useImperativeHandle(ref, () => ({
|
|
24505
24562
|
add: (word) => {
|
|
@@ -24530,9 +24587,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24530
24587
|
}, [list]);
|
|
24531
24588
|
const run = () => {
|
|
24532
24589
|
clearInterval(timer.current);
|
|
24590
|
+
let intervalCache = interval;
|
|
24591
|
+
const _index = (loop2 ? index.current % list.length : index.current) % rows;
|
|
24592
|
+
const result = times.current[_index] - rows * interval;
|
|
24593
|
+
if (result > 0) {
|
|
24594
|
+
intervalCache += result;
|
|
24595
|
+
}
|
|
24533
24596
|
timer.current = window.setTimeout(() => {
|
|
24534
24597
|
play();
|
|
24535
|
-
},
|
|
24598
|
+
}, intervalCache);
|
|
24536
24599
|
};
|
|
24537
24600
|
const play = () => {
|
|
24538
24601
|
if (!loop2 && index.current >= list.length) {
|
|
@@ -24540,14 +24603,23 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24540
24603
|
}
|
|
24541
24604
|
const _index = loop2 ? index.current % list.length : index.current;
|
|
24542
24605
|
const el = document.createElement(`div`);
|
|
24606
|
+
let currentIndex = _index % rows;
|
|
24607
|
+
if (currentIndex <= historyIndex.current || historyIndex.current === 3 && currentIndex !== 0 || Math.abs(currentIndex - historyIndex.current) !== 1) {
|
|
24608
|
+
currentIndex = historyIndex.current + 1 >= rows ? 0 : historyIndex.current + 1;
|
|
24609
|
+
}
|
|
24610
|
+
historyIndex.current = currentIndex;
|
|
24543
24611
|
el.innerHTML = list[_index];
|
|
24544
24612
|
el.classList.add("barrage-item");
|
|
24545
24613
|
barrageContainer.current.appendChild(el);
|
|
24546
24614
|
const width = el.offsetWidth;
|
|
24547
24615
|
const height = el.offsetHeight;
|
|
24548
24616
|
el.classList.add("move");
|
|
24549
|
-
|
|
24550
|
-
|
|
24617
|
+
const elScrollDuration = Math.ceil(
|
|
24618
|
+
width / barrageCWidth.current * duration
|
|
24619
|
+
);
|
|
24620
|
+
times.current[currentIndex] = elScrollDuration;
|
|
24621
|
+
el.style.animationDuration = `${duration + elScrollDuration}ms`;
|
|
24622
|
+
el.style.top = `${currentIndex * (height + gapY) + 20}px`;
|
|
24551
24623
|
el.style.width = `${width}px`;
|
|
24552
24624
|
el.addEventListener("animationend", () => {
|
|
24553
24625
|
barrageContainer.current.removeChild(el);
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
.nut-animate-slide-right {
|
|
14
14
|
animation-name: slide-right;
|
|
15
15
|
}
|
|
16
|
+
|
|
16
17
|
@keyframes slide-right {
|
|
17
18
|
0% {
|
|
18
19
|
opacity: 0;
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
.nut-animate-slide-left {
|
|
30
31
|
animation-name: slide-left;
|
|
31
32
|
}
|
|
33
|
+
|
|
32
34
|
@keyframes slide-left {
|
|
33
35
|
0% {
|
|
34
36
|
opacity: 0;
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
.nut-animate-slide-top {
|
|
46
48
|
animation-name: slide-top;
|
|
47
49
|
}
|
|
50
|
+
|
|
48
51
|
@keyframes slide-top {
|
|
49
52
|
0% {
|
|
50
53
|
opacity: 0;
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
.nut-animate-slide-bottom {
|
|
62
65
|
animation-name: slide-bottom;
|
|
63
66
|
}
|
|
67
|
+
|
|
64
68
|
@keyframes slide-bottom {
|
|
65
69
|
0% {
|
|
66
70
|
opacity: 0;
|
|
@@ -77,6 +81,7 @@
|
|
|
77
81
|
.nut-animate-shake {
|
|
78
82
|
animation-name: shake;
|
|
79
83
|
}
|
|
84
|
+
|
|
80
85
|
@keyframes shake {
|
|
81
86
|
0%,
|
|
82
87
|
100% {
|
|
@@ -124,10 +129,12 @@
|
|
|
124
129
|
.nut-animate-ripple {
|
|
125
130
|
animation-name: ripple;
|
|
126
131
|
}
|
|
132
|
+
|
|
127
133
|
@keyframes ripple {
|
|
128
134
|
0% {
|
|
129
135
|
transform: scale(1);
|
|
130
136
|
}
|
|
137
|
+
|
|
131
138
|
50% {
|
|
132
139
|
transform: scale(1.1);
|
|
133
140
|
}
|
|
@@ -140,13 +147,16 @@
|
|
|
140
147
|
animation-timing-function: ease-in-out;
|
|
141
148
|
animation-direction: alternate;
|
|
142
149
|
}
|
|
150
|
+
|
|
143
151
|
@keyframes breath {
|
|
144
152
|
0% {
|
|
145
153
|
transform: scale(1);
|
|
146
154
|
}
|
|
155
|
+
|
|
147
156
|
50% {
|
|
148
157
|
transform: scale(1.1);
|
|
149
158
|
}
|
|
159
|
+
|
|
150
160
|
100% {
|
|
151
161
|
transform: scale(1);
|
|
152
162
|
}
|
|
@@ -155,6 +165,7 @@
|
|
|
155
165
|
// 水波
|
|
156
166
|
.nut-animate-twinkle {
|
|
157
167
|
position: relative;
|
|
168
|
+
|
|
158
169
|
&::after,
|
|
159
170
|
&::before {
|
|
160
171
|
width: 60 * 1px;
|
|
@@ -176,13 +187,16 @@
|
|
|
176
187
|
animation-delay: 0.4s;
|
|
177
188
|
}
|
|
178
189
|
}
|
|
190
|
+
|
|
179
191
|
@keyframes twinkle {
|
|
180
192
|
0% {
|
|
181
193
|
transform: scale(0);
|
|
182
194
|
}
|
|
195
|
+
|
|
183
196
|
20% {
|
|
184
197
|
opacity: 1;
|
|
185
198
|
}
|
|
199
|
+
|
|
186
200
|
50%,
|
|
187
201
|
100% {
|
|
188
202
|
transform: scale(1.4);
|
|
@@ -212,10 +226,12 @@
|
|
|
212
226
|
filter: blur(3 * 1px);
|
|
213
227
|
}
|
|
214
228
|
}
|
|
229
|
+
|
|
215
230
|
@keyframes flicker {
|
|
216
231
|
0% {
|
|
217
232
|
transform: translateX(-100 * 1px) skewX(-20deg);
|
|
218
233
|
}
|
|
234
|
+
|
|
219
235
|
40%,
|
|
220
236
|
100% {
|
|
221
237
|
transform: translateX(150 * 1px) skewX(-20deg);
|
|
@@ -227,23 +243,28 @@
|
|
|
227
243
|
transform-origin: center center;
|
|
228
244
|
animation: jump 0.7s linear;
|
|
229
245
|
}
|
|
246
|
+
|
|
230
247
|
@keyframes jump {
|
|
231
248
|
0% {
|
|
232
249
|
animation-timing-function: ease-in;
|
|
233
250
|
transform: rotate(0deg) translateY(0);
|
|
234
251
|
}
|
|
252
|
+
|
|
235
253
|
25% {
|
|
236
254
|
animation-timing-function: ease-out;
|
|
237
255
|
transform: rotate(10deg) translateY(20 * 1px);
|
|
238
256
|
}
|
|
257
|
+
|
|
239
258
|
50% {
|
|
240
259
|
animation-timing-function: ease-in;
|
|
241
260
|
transform: rotate(0deg) translateY(-10 * 1px);
|
|
242
261
|
}
|
|
262
|
+
|
|
243
263
|
75% {
|
|
244
264
|
animation-timing-function: ease-out;
|
|
245
265
|
transform: rotate(-10deg) translateY(20 * 1px);
|
|
246
266
|
}
|
|
267
|
+
|
|
247
268
|
100% {
|
|
248
269
|
animation-timing-function: ease-in;
|
|
249
270
|
transform: rotate(0deg) translateY(0);
|
|
@@ -255,6 +276,7 @@
|
|
|
255
276
|
position: relative;
|
|
256
277
|
animation-name: float-pop;
|
|
257
278
|
}
|
|
279
|
+
|
|
258
280
|
@keyframes float-pop {
|
|
259
281
|
0% {
|
|
260
282
|
top: 0px;
|
|
@@ -282,3 +304,30 @@
|
|
|
282
304
|
animation-iteration-count: infinite;
|
|
283
305
|
}
|
|
284
306
|
}
|
|
307
|
+
|
|
308
|
+
[dir='rtl'] .nut-animate,
|
|
309
|
+
.nut-rtl .nut-animate {
|
|
310
|
+
.nut-animate-twinkle {
|
|
311
|
+
&::after,
|
|
312
|
+
&::before {
|
|
313
|
+
border-radius: calc(60 / 2) * 1px;
|
|
314
|
+
right: auto;
|
|
315
|
+
left: 50%;
|
|
316
|
+
margin-right: 0;
|
|
317
|
+
margin-left: calc(-60 / 2) * 1px;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.nut-animate-flicker {
|
|
322
|
+
&::after {
|
|
323
|
+
left: auto;
|
|
324
|
+
right: 0;
|
|
325
|
+
background-image: linear-gradient(
|
|
326
|
+
-106deg,
|
|
327
|
+
rgba(232, 224, 255, 0) 24%,
|
|
328
|
+
#e8e0ff 91%
|
|
329
|
+
);
|
|
330
|
+
transform: skewX(20deg);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
.nut-avatar {
|
|
2
3
|
background-size: 100% 100%;
|
|
3
4
|
background-repeat: no-repeat;
|
|
@@ -6,6 +7,7 @@
|
|
|
6
7
|
position: relative;
|
|
7
8
|
flex: 0 0 auto; // 防止被压缩
|
|
8
9
|
text-align: center;
|
|
10
|
+
|
|
9
11
|
.avatar-img {
|
|
10
12
|
position: absolute;
|
|
11
13
|
width: 100%;
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
transform: translate(-50%, -50%);
|
|
16
18
|
flex-shrink: 0;
|
|
17
19
|
}
|
|
20
|
+
|
|
18
21
|
.icon {
|
|
19
22
|
background-size: 100% 100%;
|
|
20
23
|
position: absolute;
|
|
@@ -22,10 +25,12 @@
|
|
|
22
25
|
left: 50%;
|
|
23
26
|
transform: translate(-50%, -50%);
|
|
24
27
|
}
|
|
28
|
+
|
|
25
29
|
.nut-icon-img {
|
|
26
30
|
width: 100%;
|
|
27
31
|
height: 100%;
|
|
28
32
|
}
|
|
33
|
+
|
|
29
34
|
.text {
|
|
30
35
|
display: inline-block;
|
|
31
36
|
width: 100%;
|
|
@@ -34,25 +39,45 @@
|
|
|
34
39
|
overflow: hidden;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
42
|
+
|
|
43
|
+
[dir='rtl'] .nut-avatar,
|
|
44
|
+
.nut-rtl .nut-avatar {
|
|
45
|
+
.avatar-img {
|
|
46
|
+
left: auto;
|
|
47
|
+
right: 50%;
|
|
48
|
+
transform: translate(50%, -50%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.icon {
|
|
52
|
+
left: auto;
|
|
53
|
+
right: 50%;
|
|
54
|
+
transform: translate(50%, -50%);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
37
58
|
.nut-avatar-large {
|
|
38
59
|
width: $avatar-large-width;
|
|
39
60
|
height: $avatar-large-height;
|
|
40
61
|
line-height: $avatar-large-height;
|
|
41
62
|
}
|
|
63
|
+
|
|
42
64
|
.nut-avatar-small {
|
|
43
65
|
width: $avatar-small-width;
|
|
44
66
|
height: $avatar-small-height;
|
|
45
67
|
line-height: $avatar-small-height;
|
|
46
68
|
}
|
|
69
|
+
|
|
47
70
|
.nut-avatar-normal {
|
|
48
71
|
width: $avatar-normal-width;
|
|
49
72
|
height: $avatar-normal-height;
|
|
50
73
|
line-height: $avatar-normal-height;
|
|
51
74
|
}
|
|
75
|
+
|
|
52
76
|
.nut-avatar-round {
|
|
53
77
|
border-radius: 50%;
|
|
54
78
|
overflow: hidden;
|
|
55
79
|
}
|
|
80
|
+
|
|
56
81
|
.nut-avatar-square {
|
|
57
82
|
border-radius: $avatar-square;
|
|
58
83
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.nut-avatar-cropper {
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
|
+
|
|
4
5
|
&-edit-text {
|
|
5
6
|
position: absolute;
|
|
6
7
|
top: 0;
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
justify-content: center;
|
|
15
16
|
align-items: center;
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
&-input {
|
|
18
20
|
position: absolute;
|
|
19
21
|
top: 0;
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
cursor: pointer;
|
|
25
27
|
z-index: 2;
|
|
26
28
|
}
|
|
29
|
+
|
|
27
30
|
&-popup {
|
|
28
31
|
position: fixed;
|
|
29
32
|
top: 0;
|
|
@@ -32,6 +35,7 @@
|
|
|
32
35
|
height: 100%;
|
|
33
36
|
background: var(--nut-overlay-bg-color, rgba(0, 0, 0, 0.7));
|
|
34
37
|
z-index: 1000;
|
|
38
|
+
|
|
35
39
|
&-canvas,
|
|
36
40
|
&-cut-canvas {
|
|
37
41
|
position: absolute;
|
|
@@ -41,24 +45,29 @@
|
|
|
41
45
|
height: 100%;
|
|
42
46
|
z-index: 1;
|
|
43
47
|
}
|
|
48
|
+
|
|
44
49
|
&-cut-canvas {
|
|
45
50
|
z-index: 0;
|
|
46
51
|
}
|
|
52
|
+
|
|
47
53
|
&-toolbar {
|
|
48
54
|
position: absolute;
|
|
49
55
|
bottom: 0;
|
|
50
56
|
left: 0;
|
|
51
57
|
width: 100%;
|
|
52
58
|
z-index: 2;
|
|
59
|
+
|
|
53
60
|
&.top {
|
|
54
61
|
top: 0;
|
|
55
62
|
bottom: inherit;
|
|
56
63
|
}
|
|
64
|
+
|
|
57
65
|
&-flex {
|
|
58
66
|
width: 100%;
|
|
59
67
|
display: flex;
|
|
60
68
|
justify-content: space-between;
|
|
61
69
|
}
|
|
70
|
+
|
|
62
71
|
&-item {
|
|
63
72
|
color: #fff;
|
|
64
73
|
padding: 15px;
|
|
@@ -71,6 +80,7 @@
|
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
}
|
|
83
|
+
|
|
74
84
|
&-highlight {
|
|
75
85
|
position: absolute;
|
|
76
86
|
left: 0;
|
|
@@ -79,6 +89,7 @@
|
|
|
79
89
|
height: 100%;
|
|
80
90
|
z-index: 1;
|
|
81
91
|
background-color: transparent;
|
|
92
|
+
|
|
82
93
|
.highlight {
|
|
83
94
|
position: absolute;
|
|
84
95
|
left: 50%;
|
|
@@ -89,9 +100,50 @@
|
|
|
89
100
|
}
|
|
90
101
|
}
|
|
91
102
|
}
|
|
103
|
+
|
|
92
104
|
&.round {
|
|
93
105
|
.nut-avatar-cropper-edit-text {
|
|
94
106
|
border-radius: 50%;
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
}
|
|
110
|
+
|
|
111
|
+
[dir='rtl'] .nut-avatar-cropper,
|
|
112
|
+
.nut-rtl .nut-avatar-cropper {
|
|
113
|
+
&-edit-text {
|
|
114
|
+
left: auto;
|
|
115
|
+
right: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-input {
|
|
119
|
+
left: auto;
|
|
120
|
+
right: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-popup {
|
|
124
|
+
left: auto;
|
|
125
|
+
right: 0;
|
|
126
|
+
|
|
127
|
+
&-canvas,
|
|
128
|
+
&-cut-canvas {
|
|
129
|
+
left: auto;
|
|
130
|
+
right: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&-toolbar {
|
|
134
|
+
left: auto;
|
|
135
|
+
right: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&-highlight {
|
|
139
|
+
left: auto;
|
|
140
|
+
right: 0;
|
|
141
|
+
|
|
142
|
+
.highlight {
|
|
143
|
+
left: auto;
|
|
144
|
+
right: 50%;
|
|
145
|
+
transform: translate(50%, -50%);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|