@nutui/nutui-react-taro 2.3.6 → 2.3.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Audio.js +2 -2
- package/dist/esm/AvatarCropper.js +2 -2
- package/dist/esm/Button.js +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/CircleProgress/style/style.css +1 -1
- package/dist/esm/Collapse.js +2 -2
- package/dist/esm/CollapseItem.js +1 -1
- package/dist/esm/DatePicker.js +3 -2
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Ellipsis.js +2 -1
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +2 -2
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NavBar.js +4 -1
- package/dist/esm/NumberKeyboard.js +1 -1
- package/dist/esm/Picker.js +2 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +1 -1
- package/dist/esm/Radio.js +1 -1
- package/dist/esm/RadioGroup.js +1 -1
- package/dist/esm/Rate/style/style.css +1 -1
- package/dist/esm/Rate.js +5 -1
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Step.js +2 -1
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Steps.js +1 -1
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Table.js +1 -1
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +2 -2
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/Uploader.js +2 -2
- package/dist/esm/Video.js +1 -2
- package/dist/esm/{address.taro-sTqrtuxC.js → address.taro-LCSSqsR-.js} +1 -1
- package/dist/esm/{audio.taro-ixcoTq7M.js → audio.taro-UpVxFvGk.js} +1 -1
- package/dist/esm/{avatarcropper.taro-OjudqSeT.js → avatarcropper.taro-GIZxzMJ_.js} +3 -3
- package/dist/esm/{button.taro-kZJrygfW.js → button.taro-3IIFy1M2.js} +7 -14
- package/dist/esm/{cascader.taro-DYMZD6ik.js → cascader.taro-x_X9F_pH.js} +1 -1
- package/dist/esm/{checkbox.taro-doAmyAh6.js → checkbox.taro-xMxWdpyI.js} +14 -7
- package/dist/esm/{collapse.taro-l21-Cvji.js → collapse.taro-sZibDygv.js} +1 -1
- package/dist/esm/{collapseitem.taro-9w-h_UP6.js → collapseitem.taro-AaQ_msgd.js} +2 -2
- package/dist/esm/{datepicker.taro-OrqtwJFM.js → datepicker.taro-S111IvJO.js} +1 -1
- package/dist/esm/{dialog.taro-UQN2mJZR.js → dialog.taro-z588FBZJ.js} +25 -4
- package/dist/esm/{ellipsis.taro-ov_C4kbs.js → ellipsis.taro-VApVqS_j.js} +39 -45
- package/dist/esm/{empty.taro-vxcxYcB5.js → empty.taro-98NzV-31.js} +1 -1
- package/dist/esm/{imagepreview.taro-_dileEvw.js → imagepreview.taro-qDST6Lh4.js} +6 -2
- package/dist/esm/navbar.taro-AuKPDCaW.js +105 -0
- package/dist/esm/{numberkeyboard.taro-gJhSoXsl.js → numberkeyboard.taro-CyW0s9bI.js} +3 -2
- package/dist/esm/nutui-react.es.js +27 -26
- package/dist/esm/{picker.taro-_bT5c-BS.js → picker.taro-RAYmFSC0.js} +1 -11
- package/dist/esm/{popover.taro-ScQymuJC.js → popover.taro-MUrnn7xY.js} +1 -1
- package/dist/esm/{radio.taro-mZvB2wwi.js → radio.taro-EKJXMjnX.js} +7 -6
- package/dist/esm/rate.taro-_5Mjd_EO.js +146 -0
- package/dist/esm/{step.taro-kCAQ4Q3-.js → step.taro-_DEZqFGb.js} +6 -5
- package/dist/esm/{steps.taro-n6BT6nWE.js → steps.taro-PH0qWPla.js} +5 -4
- package/dist/esm/{table.taro-Zyemar_o.js → table.taro-d172EUh9.js} +1 -1
- package/dist/esm/{tabs.taro-uXbRqGVo.js → tabs.taro-w8ra49Qb.js} +7 -7
- package/dist/esm/{tour.taro-GabSljal.js → tour.taro-HLsDVf9g.js} +3 -3
- package/dist/esm/types/src/packages/checkbox/checkbox.d.ts +7 -6
- package/dist/esm/types/src/packages/checkbox/checkbox.taro.d.ts +7 -6
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +3 -2
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +3 -1
- package/dist/esm/types/src/packages/checkboxgroup/types.d.ts +3 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/dialog/config.d.ts +9 -6
- package/dist/esm/types/src/packages/dialog/confirm.d.ts +3 -3
- package/dist/esm/types/src/packages/dialog/content.d.ts +1 -0
- package/dist/esm/types/src/packages/dialog/content.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/dialog/dialog.d.ts +2 -2
- package/dist/esm/types/src/packages/dialog/dialog.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/dialog/dialogwrap.d.ts +1 -0
- package/dist/esm/types/src/packages/dialog/index.d.ts +1 -0
- package/dist/esm/types/src/packages/imagepreview/imagepreview.d.ts +4 -1
- package/dist/esm/types/src/packages/imagepreview/imagepreview.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/imagepreview/index.d.ts +1 -1
- package/dist/esm/types/src/packages/imagepreview/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/navbar/navbar.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/numberkeyboard/numberkeyboard.d.ts +2 -1
- package/dist/esm/types/src/packages/numberkeyboard/numberkeyboard.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/radio/index.d.ts +2 -1
- package/dist/esm/types/src/packages/radio/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/radio/radio.d.ts +1 -2
- package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -2
- package/dist/esm/types/src/packages/radio/types.d.ts +2 -0
- package/dist/esm/types/src/packages/radiogroup/context.d.ts +2 -0
- package/dist/esm/types/src/packages/radiogroup/index.d.ts +1 -0
- package/dist/esm/types/src/packages/radiogroup/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/radiogroup/radiogroup.d.ts +4 -6
- package/dist/esm/types/src/packages/radiogroup/radiogroup.taro.d.ts +4 -6
- package/dist/esm/types/src/packages/radiogroup/types.d.ts +4 -0
- package/dist/esm/types/src/packages/rate/rate.d.ts +2 -0
- package/dist/esm/types/src/packages/rate/rate.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/video/video.taro.d.ts +4 -5
- package/dist/esm/types/src/utils/get-scroll-parent.d.ts +1 -0
- package/dist/esm/{uploader.taro-SAahCKRj.js → uploader.taro-a-U18v5C.js} +2 -2
- package/dist/esm/use-refs-IdrY0ww3.js +15 -0
- package/dist/esm/{video.taro-MDBF77xf.js → video.taro-csvHwS2v.js} +5 -7
- 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 +264 -93
- package/dist/nutui.react.umd.js +257 -86
- package/dist/packages/circleprogress/circleprogress.scss +3 -1
- package/dist/packages/dialog/dialog.scss +25 -0
- package/dist/packages/imagepreview/imagepreview.scss +24 -0
- package/dist/packages/navbar/navbar.scss +7 -0
- package/dist/packages/popover/popover.scss +1 -1
- package/dist/packages/rate/rate.scss +6 -0
- package/dist/packages/step/step.scss +5 -4
- package/dist/packages/table/table.scss +12 -1
- package/dist/packages/tabs/tabs.scss +17 -1
- package/dist/packages/uploader/uploader.scss +4 -6
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +6 -0
- package/dist/styles/variables.scss +6 -0
- package/dist/types/packages/button/button.taro.d.ts +6 -2
- package/dist/types/packages/checkbox/checkbox.d.ts +7 -6
- package/dist/types/packages/checkbox/checkbox.taro.d.ts +7 -6
- package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +3 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +8 -3
- package/dist/types/packages/checkboxgroup/context.d.ts +3 -1
- package/dist/types/packages/checkboxgroup/types.d.ts +3 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/dialog/config.d.ts +9 -6
- package/dist/types/packages/dialog/confirm.d.ts +3 -3
- package/dist/types/packages/dialog/content.d.ts +1 -0
- package/dist/types/packages/dialog/content.taro.d.ts +1 -0
- package/dist/types/packages/dialog/dialog.d.ts +2 -2
- package/dist/types/packages/dialog/dialog.taro.d.ts +2 -2
- package/dist/types/packages/dialog/dialogwrap.d.ts +1 -0
- package/dist/types/packages/dialog/index.d.ts +1 -0
- package/dist/types/packages/imagepreview/imagepreview.d.ts +4 -1
- package/dist/types/packages/imagepreview/imagepreview.taro.d.ts +12 -1
- package/dist/types/packages/imagepreview/index.d.ts +1 -1
- package/dist/types/packages/imagepreview/index.taro.d.ts +1 -1
- package/dist/types/packages/navbar/navbar.taro.d.ts +2 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +2 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +7 -2
- package/dist/types/packages/overlay/overlay.taro.d.ts +5 -1
- package/dist/types/packages/radio/index.d.ts +2 -1
- package/dist/types/packages/radio/index.taro.d.ts +2 -1
- package/dist/types/packages/radio/radio.d.ts +1 -2
- package/dist/types/packages/radio/radio.taro.d.ts +1 -2
- package/dist/types/packages/radio/types.d.ts +2 -0
- package/dist/types/packages/radiogroup/context.d.ts +2 -0
- package/dist/types/packages/radiogroup/index.d.ts +1 -0
- package/dist/types/packages/radiogroup/index.taro.d.ts +1 -0
- package/dist/types/packages/radiogroup/radiogroup.d.ts +4 -6
- package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +8 -6
- package/dist/types/packages/radiogroup/types.d.ts +4 -0
- package/dist/types/packages/rate/rate.d.ts +2 -0
- package/dist/types/packages/rate/rate.taro.d.ts +2 -0
- package/dist/types/packages/video/video.taro.d.ts +4 -5
- package/dist/types/utils/get-scroll-parent.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/navbar.taro-v0VHQWR4.js +0 -63
- package/dist/esm/rate.taro-ZkOVGSDs.js +0 -77
|
@@ -2,12 +2,13 @@ import React__default from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { CSSTransition } from "react-transition-group";
|
|
4
4
|
import { View } from "@tarojs/components";
|
|
5
|
-
import {
|
|
5
|
+
import { Close } from "@nutui/icons-react-taro";
|
|
6
|
+
import { B as Button } from "./button.taro-3IIFy1M2.js";
|
|
6
7
|
import { u as useConfig } from "./configprovider.taro-_wngOo0k.js";
|
|
7
8
|
import { u as useLockScrollTaro, O as Overlay } from "./overlay.taro-HsGeVyPh.js";
|
|
8
9
|
import { b as useParams, u as useCustomEvent, a as useCustomEventsPath, c as customEvents } from "./use-custom-event-XvsODK8c.js";
|
|
9
10
|
const Content = (props) => {
|
|
10
|
-
const { visible, title, header, footer, footerDirection, onClick, children } = props;
|
|
11
|
+
const { visible, title, header, footer, close: close2, footerDirection, onClick, children } = props;
|
|
11
12
|
const classPrefix = "nut-dialog";
|
|
12
13
|
const renderHeader = () => {
|
|
13
14
|
return title ? React__default.createElement("div", { className: `${classPrefix}-header` }, title) : null;
|
|
@@ -23,6 +24,7 @@ const Content = (props) => {
|
|
|
23
24
|
return React__default.createElement(
|
|
24
25
|
"div",
|
|
25
26
|
{ className: classNames(`${classPrefix}-outer`, props.className), style: props.style, onClick: (e) => handleClick(e) },
|
|
27
|
+
close2,
|
|
26
28
|
header,
|
|
27
29
|
React__default.createElement(
|
|
28
30
|
"div",
|
|
@@ -52,6 +54,8 @@ const defaultProps = {
|
|
|
52
54
|
disableConfirmButton: false,
|
|
53
55
|
footerDirection: "horizontal",
|
|
54
56
|
lockScroll: true,
|
|
57
|
+
closeIconPosition: "top-right",
|
|
58
|
+
closeIcon: false,
|
|
55
59
|
beforeCancel: () => true,
|
|
56
60
|
beforeClose: () => true,
|
|
57
61
|
onOverlayClick: () => true
|
|
@@ -59,7 +63,7 @@ const defaultProps = {
|
|
|
59
63
|
const BaseDialog = (props) => {
|
|
60
64
|
const classPrefix = "nut-dialog";
|
|
61
65
|
const { locale } = useConfig();
|
|
62
|
-
const { params: { id, className, style, visible, footer, title, header, content, children, footerDirection, hideConfirmButton, hideCancelButton, lockScroll, disableConfirmButton, closeOnOverlayClick, onOverlayClick, confirmText, cancelText, overlay, onClose, onCancel, onConfirm, beforeCancel, beforeClose }, setParams } = useParams({ ...defaultProps, ...props });
|
|
66
|
+
const { params: { id, className, style, visible, footer, title, header, content, children, footerDirection, hideConfirmButton, hideCancelButton, lockScroll, disableConfirmButton, closeOnOverlayClick, onOverlayClick, confirmText, cancelText, overlay, closeIconPosition, closeIcon, onClose, onCancel, onConfirm, beforeCancel, beforeClose }, setParams } = useParams({ ...defaultProps, ...props });
|
|
63
67
|
useCustomEvent(id, ({ status, options }) => {
|
|
64
68
|
if (status) {
|
|
65
69
|
setParams({ ...options, visible: true });
|
|
@@ -94,6 +98,23 @@ const BaseDialog = (props) => {
|
|
|
94
98
|
}), disabled: disableConfirmButton, onClick: (e) => handleOk(e) }, confirmText || locale.confirm)
|
|
95
99
|
);
|
|
96
100
|
};
|
|
101
|
+
const renderCloseIcon = () => {
|
|
102
|
+
if (!closeIcon)
|
|
103
|
+
return null;
|
|
104
|
+
const handleCancel = () => {
|
|
105
|
+
if (!(beforeCancel == null ? void 0 : beforeCancel()))
|
|
106
|
+
return;
|
|
107
|
+
if (!(beforeClose == null ? void 0 : beforeClose()))
|
|
108
|
+
return;
|
|
109
|
+
onClose == null ? void 0 : onClose();
|
|
110
|
+
onCancel == null ? void 0 : onCancel();
|
|
111
|
+
};
|
|
112
|
+
const closeClasses = classNames({
|
|
113
|
+
[`${classPrefix}-close`]: true,
|
|
114
|
+
[`${classPrefix}-close-${closeIconPosition}`]: true
|
|
115
|
+
});
|
|
116
|
+
return React__default.createElement(View, { className: closeClasses, onClick: handleCancel }, React__default.isValidElement(closeIcon) ? closeIcon : React__default.createElement(Close, null));
|
|
117
|
+
};
|
|
97
118
|
const onHandleClickOverlay = (e) => {
|
|
98
119
|
if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
|
|
99
120
|
const closed = onOverlayClick && onOverlayClick();
|
|
@@ -111,7 +132,7 @@ const BaseDialog = (props) => {
|
|
|
111
132
|
React__default.createElement(
|
|
112
133
|
CSSTransition,
|
|
113
134
|
{ in: visible, timeout: 300, classNames: "fadeDialog", unmountOnExit: true, appear: true },
|
|
114
|
-
React__default.createElement(Content, { className, style, title, header, footer: renderFooter(), footerDirection, visible }, content || children)
|
|
135
|
+
React__default.createElement(Content, { className, style, title, header, close: renderCloseIcon(), footer: renderFooter(), footerDirection, visible }, content || children)
|
|
115
136
|
)
|
|
116
137
|
)
|
|
117
138
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
4
5
|
import { g as getRectByTaro } from "./get-rect-by-taro-piSHvCGp.js";
|
|
5
6
|
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
6
7
|
const defaultProps = {
|
|
@@ -31,29 +32,25 @@ const Ellipsis = (props) => {
|
|
|
31
32
|
const [contentCopy, setContentCopy] = useState(content);
|
|
32
33
|
const lineH = useRef(0);
|
|
33
34
|
const originHeight = useRef(0);
|
|
34
|
-
const refRandomId = Math.random().toString(36).slice(-8);
|
|
35
|
+
const refRandomId = useRef(Math.random().toString(36).slice(-8));
|
|
35
36
|
const widthRef = useRef("auto");
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
const widthBase = useRef([14, 10, 7, 8.4, 10]);
|
|
38
|
+
const symbolTextWidth = useRef(widthBase.current[0] * 0.7921);
|
|
38
39
|
const chineseReg = /^[\u4e00-\u9fa5]+$/;
|
|
39
40
|
const digitReg = /^[0-9]+$/;
|
|
40
41
|
const letterUpperReg = /^[A-Z]+$/;
|
|
41
42
|
const letterLowerReg = /^[a-z]+$/;
|
|
42
43
|
const classes = classNames(classPrefix, width ? `${classPrefix}-width` : "", className);
|
|
43
|
-
|
|
44
|
-
setExceeded(false);
|
|
45
|
-
setExpanded(false);
|
|
44
|
+
useEffect(() => {
|
|
46
45
|
setContentCopy(content);
|
|
47
46
|
nextTick(() => {
|
|
48
47
|
getSymbolInfo();
|
|
49
48
|
getReference();
|
|
50
49
|
});
|
|
51
|
-
};
|
|
52
|
-
useReady(() => init());
|
|
53
|
-
useEffect(() => init(), [content, lineH.current, maxHeight.current, originHeight.current]);
|
|
50
|
+
}, [content]);
|
|
54
51
|
const getSymbolInfo = async () => {
|
|
55
52
|
const refe = await getRectByTaro(symbolContain == null ? void 0 : symbolContain.current);
|
|
56
|
-
symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
|
|
53
|
+
symbolTextWidth.current = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase.current[0] * 0.7921);
|
|
57
54
|
};
|
|
58
55
|
const symbolText = () => {
|
|
59
56
|
if (direction === "end" || direction === "middle") {
|
|
@@ -62,9 +59,8 @@ const Ellipsis = (props) => {
|
|
|
62
59
|
return `${symbol}${expandText}${symbol}`;
|
|
63
60
|
};
|
|
64
61
|
const getReference = async () => {
|
|
65
|
-
const element = root.current;
|
|
66
62
|
const query = createSelectorQuery();
|
|
67
|
-
query.select(
|
|
63
|
+
query.select(`#root${refRandomId.current}`) && query.select(`#root${refRandomId.current}`).fields({
|
|
68
64
|
computedStyle: [
|
|
69
65
|
"width",
|
|
70
66
|
"height",
|
|
@@ -81,7 +77,7 @@ const Ellipsis = (props) => {
|
|
|
81
77
|
originHeight.current = pxToNumber(res.height);
|
|
82
78
|
widthRef.current = res.width;
|
|
83
79
|
const bsize = pxToNumber(res.fontSize);
|
|
84
|
-
widthBase = [
|
|
80
|
+
widthBase.current = [
|
|
85
81
|
bsize,
|
|
86
82
|
bsize * 0.72,
|
|
87
83
|
bsize * 0.53,
|
|
@@ -135,7 +131,7 @@ const Ellipsis = (props) => {
|
|
|
135
131
|
setContentCopy(newContent);
|
|
136
132
|
};
|
|
137
133
|
const tailorContent = (left, right, type = "") => {
|
|
138
|
-
const threeDotWidth = symbolTextWidth;
|
|
134
|
+
const threeDotWidth = symbolTextWidth.current;
|
|
139
135
|
const direc = direction === "middle" && type ? type : direction;
|
|
140
136
|
setExceeded(true);
|
|
141
137
|
let widthPart = -1;
|
|
@@ -155,15 +151,15 @@ const Ellipsis = (props) => {
|
|
|
155
151
|
while (widthPart < contentPartWidth) {
|
|
156
152
|
const zi = content[marking];
|
|
157
153
|
if (chineseReg.test(zi)) {
|
|
158
|
-
widthPart = Number(widthPart + widthBase[0]);
|
|
154
|
+
widthPart = Number(widthPart + widthBase.current[0]);
|
|
159
155
|
} else if (letterUpperReg.test(zi)) {
|
|
160
|
-
widthPart = Number(widthPart + widthBase[1]);
|
|
156
|
+
widthPart = Number(widthPart + widthBase.current[1]);
|
|
161
157
|
} else if (letterLowerReg.test(zi)) {
|
|
162
|
-
widthPart = Number(widthPart + widthBase[2]);
|
|
158
|
+
widthPart = Number(widthPart + widthBase.current[2]);
|
|
163
159
|
} else if (digitReg.test(zi)) {
|
|
164
|
-
widthPart = Number(widthPart + widthBase[3]);
|
|
160
|
+
widthPart = Number(widthPart + widthBase.current[3]);
|
|
165
161
|
} else {
|
|
166
|
-
widthPart = Number(widthPart + widthBase[4]);
|
|
162
|
+
widthPart = Number(widthPart + widthBase.current[4]);
|
|
167
163
|
}
|
|
168
164
|
cutoff = marking;
|
|
169
165
|
direc === "end" ? marking++ : marking--;
|
|
@@ -196,35 +192,33 @@ const Ellipsis = (props) => {
|
|
|
196
192
|
null,
|
|
197
193
|
React__default.createElement(
|
|
198
194
|
"div",
|
|
199
|
-
{ className: classes, onClick: handleClick, ref: root, id: `root${refRandomId}`, ...rest },
|
|
195
|
+
{ className: classes, onClick: handleClick, ref: root, id: `root${refRandomId.current}`, ...rest },
|
|
200
196
|
React__default.createElement(
|
|
201
|
-
|
|
197
|
+
View,
|
|
202
198
|
null,
|
|
203
|
-
!exceeded ? React__default.createElement(
|
|
204
|
-
width: `${!Number.isNaN(Number(width)) ? `${width}px` : "auto"}
|
|
199
|
+
!exceeded ? React__default.createElement(View, { className: "nut-ellipsis-wordbreak", style: {
|
|
200
|
+
width: `${!Number.isNaN(Number(width)) ? `${width}px` : "auto"}`,
|
|
201
|
+
height: "20px",
|
|
202
|
+
overflow: "hidden"
|
|
205
203
|
} }, content) : null,
|
|
206
204
|
exceeded && !expanded ? React__default.createElement(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
(
|
|
215
|
-
(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
} }, expandText) : null,
|
|
220
|
-
((_c = ellipsis.current) == null ? void 0 : _c.tailing) && symbol,
|
|
221
|
-
(_d = ellipsis.current) == null ? void 0 : _d.tailing
|
|
222
|
-
)
|
|
205
|
+
View,
|
|
206
|
+
{ className: "nut-ellipsis-wordbreak", style: {
|
|
207
|
+
width: `${!Number.isNaN(Number(width)) ? `${width}px` : "auto"}`
|
|
208
|
+
} },
|
|
209
|
+
(_a = ellipsis.current) == null ? void 0 : _a.leading,
|
|
210
|
+
((_b = ellipsis.current) == null ? void 0 : _b.leading) && symbol,
|
|
211
|
+
expandText ? React__default.createElement("span", { className: "nut-ellipsis-text", onClick: (e) => {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
clickHandle(1);
|
|
214
|
+
} }, expandText) : null,
|
|
215
|
+
((_c = ellipsis.current) == null ? void 0 : _c.tailing) && symbol,
|
|
216
|
+
(_d = ellipsis.current) == null ? void 0 : _d.tailing
|
|
223
217
|
) : null,
|
|
224
218
|
exceeded && expanded ? React__default.createElement(
|
|
225
219
|
React__default.Fragment,
|
|
226
220
|
null,
|
|
227
|
-
React__default.createElement(
|
|
221
|
+
React__default.createElement(View, { style: {
|
|
228
222
|
width: `${!Number.isNaN(Number(width)) ? `${width}px` : "auto"}`
|
|
229
223
|
} }, content),
|
|
230
224
|
expandText ? React__default.createElement("span", { className: "nut-ellipsis-text", onClick: (e) => {
|
|
@@ -235,11 +229,11 @@ const Ellipsis = (props) => {
|
|
|
235
229
|
)
|
|
236
230
|
),
|
|
237
231
|
React__default.createElement(
|
|
238
|
-
|
|
239
|
-
{ className: "nut-ellipsis-copy", ref: rootContain, id: `rootContain${refRandomId}`, style: { width: `${widthRef}` } },
|
|
240
|
-
React__default.createElement(
|
|
232
|
+
View,
|
|
233
|
+
{ className: "nut-ellipsis-copy", ref: rootContain, id: `rootContain${refRandomId.current}`, style: { width: `${widthRef}` } },
|
|
234
|
+
React__default.createElement(View, null, contentCopy)
|
|
241
235
|
),
|
|
242
|
-
React__default.createElement(
|
|
236
|
+
React__default.createElement(View, { className: "nut-ellipsis-copy", ref: symbolContain, id: `symbolContain${refRandomId.current}`, style: { display: "inline" } }, symbolText())
|
|
243
237
|
);
|
|
244
238
|
};
|
|
245
239
|
Ellipsis.defaultProps = defaultProps;
|
|
@@ -2,7 +2,7 @@ import React__default, { useState, useEffect } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { u as useConfig } from "./configprovider.taro-_wngOo0k.js";
|
|
4
4
|
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
5
|
-
import { B as Button } from "./button.taro-
|
|
5
|
+
import { B as Button } from "./button.taro-3IIFy1M2.js";
|
|
6
6
|
const defaultStatus = {
|
|
7
7
|
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
8
8
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
@@ -2,6 +2,7 @@ import React__default, { useRef, useState, useEffect } from "react";
|
|
|
2
2
|
import Taro from "@tarojs/taro";
|
|
3
3
|
import { Video } from "@tarojs/components";
|
|
4
4
|
import classNames from "classnames";
|
|
5
|
+
import { Close } from "@nutui/icons-react-taro";
|
|
5
6
|
import { P as Popup } from "./popup.taro-2FdJu1kg.js";
|
|
6
7
|
import { I as Image } from "./image.taro-FfeikBlO.js";
|
|
7
8
|
import InnerSwiper from "./Swiper.js";
|
|
@@ -18,6 +19,8 @@ const defaultProps = {
|
|
|
18
19
|
closeOnContentClick: false,
|
|
19
20
|
indicator: false,
|
|
20
21
|
indicatorColor: "#fff",
|
|
22
|
+
closeIcon: false,
|
|
23
|
+
closeIconPosition: "top-right",
|
|
21
24
|
showMenuByLongpress: false,
|
|
22
25
|
onChange: (value) => {
|
|
23
26
|
},
|
|
@@ -25,7 +28,7 @@ const defaultProps = {
|
|
|
25
28
|
}
|
|
26
29
|
};
|
|
27
30
|
const ImagePreview = (props) => {
|
|
28
|
-
const { className, style, images, videos, visible, defaultValue, indicatorColor, indicator, autoPlay, closeOnContentClick, showMenuByLongpress, onClose } = props;
|
|
31
|
+
const { className, style, images, videos, visible, defaultValue, indicatorColor, indicator, autoPlay, closeOnContentClick, closeIcon, closeIconPosition, showMenuByLongpress, onClose } = props;
|
|
29
32
|
const classPrefix = "nut-imagepreview";
|
|
30
33
|
const ref = useRef(null);
|
|
31
34
|
const [innerNo, setInnerNo] = usePropsValue({
|
|
@@ -180,7 +183,8 @@ const ImagePreview = (props) => {
|
|
|
180
183
|
active,
|
|
181
184
|
"/",
|
|
182
185
|
(images ? images.length : 0) + (videos ? videos.length : 0)
|
|
183
|
-
)
|
|
186
|
+
),
|
|
187
|
+
closeIcon !== false ? React__default.createElement("div", { className: `${classPrefix}-close ${closeIconPosition}`, onClick: onCloseInner }, closeIcon === true ? React__default.createElement(Close, null) : closeIcon) : null
|
|
184
188
|
);
|
|
185
189
|
};
|
|
186
190
|
ImagePreview.defaultProps = defaultProps;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React__default, { useRef, useState, useEffect } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { View } from "@tarojs/components";
|
|
4
|
+
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
5
|
+
import { g as getRectByTaro } from "./get-rect-by-taro-piSHvCGp.js";
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
...ComponentDefaults,
|
|
8
|
+
left: "",
|
|
9
|
+
right: "",
|
|
10
|
+
titleAlign: "center",
|
|
11
|
+
back: "",
|
|
12
|
+
fixed: false,
|
|
13
|
+
safeAreaInsetTop: false,
|
|
14
|
+
placeholder: false,
|
|
15
|
+
zIndex: 10
|
|
16
|
+
};
|
|
17
|
+
const NavBar = (props) => {
|
|
18
|
+
const { right, left, titleAlign, className, style, back, fixed, safeAreaInsetTop, placeholder, zIndex, onBackClick } = {
|
|
19
|
+
...defaultProps,
|
|
20
|
+
...props
|
|
21
|
+
};
|
|
22
|
+
const classPrefix = "nut-navbar";
|
|
23
|
+
const children = Array.isArray(props.children) ? props.children : [props.children];
|
|
24
|
+
const styles = () => {
|
|
25
|
+
return {
|
|
26
|
+
...style,
|
|
27
|
+
zIndex
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const leftRef = useRef(null);
|
|
31
|
+
const rightRef = useRef(null);
|
|
32
|
+
const wrapperRef = useRef(null);
|
|
33
|
+
const [contentWidth, setContentWidth] = useState("50%");
|
|
34
|
+
const getNodeWidth = async (node) => {
|
|
35
|
+
if (node) {
|
|
36
|
+
const refe = await getRectByTaro(node);
|
|
37
|
+
return refe.width;
|
|
38
|
+
}
|
|
39
|
+
return 0;
|
|
40
|
+
};
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (titleAlign === "left") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!(back || left || right)) {
|
|
46
|
+
setContentWidth("100%");
|
|
47
|
+
}
|
|
48
|
+
const init = async () => {
|
|
49
|
+
const leftRectWidth = await getNodeWidth(leftRef == null ? void 0 : leftRef.current);
|
|
50
|
+
const rightRectWidth = await getNodeWidth(rightRef == null ? void 0 : rightRef.current);
|
|
51
|
+
const wrapperWidth = await getNodeWidth(wrapperRef == null ? void 0 : wrapperRef.current);
|
|
52
|
+
let centerWidth = wrapperWidth / 2;
|
|
53
|
+
if (leftRectWidth && rightRectWidth) {
|
|
54
|
+
centerWidth = wrapperWidth - (leftRectWidth > rightRectWidth ? leftRectWidth * 2 : rightRectWidth * 2);
|
|
55
|
+
} else {
|
|
56
|
+
centerWidth = wrapperWidth - leftRectWidth * 2 - rightRectWidth * 2;
|
|
57
|
+
}
|
|
58
|
+
setContentWidth(centerWidth.toFixed(2));
|
|
59
|
+
};
|
|
60
|
+
init();
|
|
61
|
+
}, [left, right, back]);
|
|
62
|
+
const renderLeft = () => {
|
|
63
|
+
return back || left ? React__default.createElement(
|
|
64
|
+
View,
|
|
65
|
+
{ className: `${classPrefix}-left`, ref: leftRef },
|
|
66
|
+
back && React__default.createElement(View, { className: `${classPrefix}-left-back`, onClick: (e) => onBackClick(e) }, back),
|
|
67
|
+
left
|
|
68
|
+
) : null;
|
|
69
|
+
};
|
|
70
|
+
const renderContent = () => {
|
|
71
|
+
let titleStyle = {};
|
|
72
|
+
if (titleAlign === "center") {
|
|
73
|
+
const contentRealWidth = `${contentWidth}${/%$/i.test(contentWidth) ? "" : "px"}`;
|
|
74
|
+
titleStyle = {
|
|
75
|
+
minWidth: contentRealWidth,
|
|
76
|
+
width: contentRealWidth
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return React__default.createElement(View, { className: `${classPrefix}-title`, style: titleStyle }, children);
|
|
80
|
+
};
|
|
81
|
+
const renderRight = () => {
|
|
82
|
+
return React__default.createElement(View, { className: `${classPrefix}-right`, ref: rightRef }, right);
|
|
83
|
+
};
|
|
84
|
+
const renderWrapper = () => {
|
|
85
|
+
return React__default.createElement(
|
|
86
|
+
View,
|
|
87
|
+
{ className: cls, style: styles(), ref: wrapperRef },
|
|
88
|
+
renderLeft(),
|
|
89
|
+
renderContent(),
|
|
90
|
+
renderRight()
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
const classes = classNames({
|
|
94
|
+
[`${classPrefix}-fixed`]: fixed,
|
|
95
|
+
[`${classPrefix}-safe-area-inset-top`]: safeAreaInsetTop,
|
|
96
|
+
[`${classPrefix}-title-align-${titleAlign}`]: true
|
|
97
|
+
});
|
|
98
|
+
const cls = classNames(classPrefix, classes, className);
|
|
99
|
+
return React__default.createElement(React__default.Fragment, null, fixed && placeholder ? React__default.createElement(View, { className: `${classPrefix}-placeholder` }, renderWrapper()) : renderWrapper());
|
|
100
|
+
};
|
|
101
|
+
NavBar.defaultProps = defaultProps;
|
|
102
|
+
NavBar.displayName = "NutNavBar";
|
|
103
|
+
export {
|
|
104
|
+
NavBar as N
|
|
105
|
+
};
|
|
@@ -8,6 +8,7 @@ import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
...ComponentDefaults,
|
|
10
10
|
visible: false,
|
|
11
|
+
rightActions: "",
|
|
11
12
|
type: "default",
|
|
12
13
|
custom: [],
|
|
13
14
|
random: false,
|
|
@@ -16,7 +17,7 @@ const defaultProps = {
|
|
|
16
17
|
};
|
|
17
18
|
const NumberKeyboard = (props) => {
|
|
18
19
|
const { locale } = useConfig();
|
|
19
|
-
const { title, confirmText, visible, type, custom, random, style, className, onChange, onDelete, onClose, onConfirm, ...rest } = props;
|
|
20
|
+
const { title, rightActions, confirmText, visible, type, custom, random, style, className, onChange, onDelete, onClose, onConfirm, ...rest } = props;
|
|
20
21
|
const classPrefix = "nut-numberkeyboard";
|
|
21
22
|
const getBasicKeys = () => {
|
|
22
23
|
const keys = new Array(9).fill(0).map((_, index) => {
|
|
@@ -105,7 +106,7 @@ const NumberKeyboard = (props) => {
|
|
|
105
106
|
"div",
|
|
106
107
|
{ className: `${classPrefix}-header` },
|
|
107
108
|
React__default.createElement("div", { className: `${classPrefix}-header-title` }, title),
|
|
108
|
-
type === "default" && React__default.createElement("span", { className: `${classPrefix}-header-close`, onClick: onConfirm }, locale.done)
|
|
109
|
+
type === "default" && React__default.createElement("span", { className: `${classPrefix}-header-close`, onClick: onConfirm }, rightActions || locale.done)
|
|
109
110
|
),
|
|
110
111
|
React__default.createElement(
|
|
111
112
|
"div",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B } from "./button.taro-
|
|
1
|
+
import { B } from "./button.taro-3IIFy1M2.js";
|
|
2
2
|
import { C } from "./cell.taro-jD6MoFTj.js";
|
|
3
3
|
import { C as C2 } from "./cellgroup.taro-08A3XAze.js";
|
|
4
4
|
import { C as C3 } from "./configprovider.taro-_wngOo0k.js";
|
|
@@ -16,48 +16,48 @@ import { S as S3 } from "./safearea.taro-afu_mY7g.js";
|
|
|
16
16
|
import { B as B2 } from "./backtop.taro-Y3vOJiXq.js";
|
|
17
17
|
import { E } from "./elevator.taro-2nbUM3vH.js";
|
|
18
18
|
import { F } from "./fixednav.taro-7OfzwFBE.js";
|
|
19
|
-
import { N } from "./navbar.taro-
|
|
19
|
+
import { N } from "./navbar.taro-AuKPDCaW.js";
|
|
20
20
|
import { S as S4 } from "./sidenavbar.taro-J5SEKQIh.js";
|
|
21
21
|
import { S as S5 } from "./sidenavbaritem.taro-AxJNRAdi.js";
|
|
22
22
|
import { S as S6 } from "./subsidenavbar.taro-Zy52MDDG.js";
|
|
23
23
|
import { T } from "./tabbar.taro-QE0rjSKE.js";
|
|
24
24
|
import { T as T2 } from "./tabbaritem.taro-t9C07OYX.js";
|
|
25
25
|
import { T as T3 } from "./tabpane.taro-5k7wWimS.js";
|
|
26
|
-
import { T as T4 } from "./tabs.taro-
|
|
27
|
-
import { A } from "./address.taro-
|
|
26
|
+
import { T as T4 } from "./tabs.taro-w8ra49Qb.js";
|
|
27
|
+
import { A } from "./address.taro-LCSSqsR-.js";
|
|
28
28
|
import { C as C5 } from "./calendar.taro-Kf91Qo5t.js";
|
|
29
29
|
import { C as C6 } from "./calendaritem.taro-G5BaVw8e.js";
|
|
30
30
|
import { C as C7 } from "./calendarcard.taro-tY-cyh-F.js";
|
|
31
|
-
import { C as C8 } from "./cascader.taro-
|
|
32
|
-
import { C as C9, a } from "./checkbox.taro-
|
|
33
|
-
import { D as D2 } from "./datepicker.taro-
|
|
31
|
+
import { C as C8 } from "./cascader.taro-x_X9F_pH.js";
|
|
32
|
+
import { C as C9, a } from "./checkbox.taro-xMxWdpyI.js";
|
|
33
|
+
import { D as D2 } from "./datepicker.taro-S111IvJO.js";
|
|
34
34
|
import { default as default2 } from "./Form.js";
|
|
35
35
|
import { F as F2 } from "./formitem.taro-atY4A0pS.js";
|
|
36
36
|
import { I as I2 } from "./input.taro-8gs046AH.js";
|
|
37
37
|
import { I as I3 } from "./inputnumber.taro-7QptygT3.js";
|
|
38
38
|
import { M } from "./menu.taro-ODwHYGFM.js";
|
|
39
39
|
import { M as M2 } from "./menuitem.taro-9nyTDLpt.js";
|
|
40
|
-
import { N as N2 } from "./numberkeyboard.taro-
|
|
41
|
-
import { P } from "./picker.taro-
|
|
42
|
-
import { R as R2, a as a2 } from "./radio.taro-
|
|
40
|
+
import { N as N2 } from "./numberkeyboard.taro-CyW0s9bI.js";
|
|
41
|
+
import { P } from "./picker.taro-RAYmFSC0.js";
|
|
42
|
+
import { R as R2, a as a2 } from "./radio.taro-EKJXMjnX.js";
|
|
43
43
|
import { R as R3 } from "./range.taro-mDYY3SXA.js";
|
|
44
|
-
import { R as R4 } from "./rate.taro-
|
|
44
|
+
import { R as R4 } from "./rate.taro-_5Mjd_EO.js";
|
|
45
45
|
import { S as S7 } from "./searchbar.taro-Hmwspp92.js";
|
|
46
46
|
import { S as S8 } from "./shortpassword.taro-uFeVULsY.js";
|
|
47
47
|
import { S as S9 } from "./signature.taro-y3qxnKMv.js";
|
|
48
48
|
import { S as S10 } from "./switch.taro-L0BAbMeu.js";
|
|
49
49
|
import { T as T5 } from "./textarea.taro-VYqlTewy.js";
|
|
50
|
-
import { U } from "./uploader.taro-
|
|
50
|
+
import { U } from "./uploader.taro-a-U18v5C.js";
|
|
51
51
|
import { A as A2 } from "./actionsheet.taro-gfhQciJ4.js";
|
|
52
52
|
import { B as B3 } from "./badge.taro-993L861f.js";
|
|
53
|
-
import { B as B4 } from "./dialog.taro-
|
|
53
|
+
import { B as B4 } from "./dialog.taro-z588FBZJ.js";
|
|
54
54
|
import { D as D3 } from "./drag.taro-BwcleRuB.js";
|
|
55
|
-
import { E as E2 } from "./empty.taro-
|
|
55
|
+
import { E as E2 } from "./empty.taro-98NzV-31.js";
|
|
56
56
|
import { I as I4 } from "./infiniteloading.taro-sl41Ddeh.js";
|
|
57
57
|
import { L as L2 } from "./loading.taro-aHN6xLIT.js";
|
|
58
58
|
import { N as N3 } from "./noticebar.taro-bHnEzTvL.js";
|
|
59
59
|
import { N as N4 } from "./notify.taro-mA9KS8qh.js";
|
|
60
|
-
import { P as P2 } from "./popover.taro-
|
|
60
|
+
import { P as P2 } from "./popover.taro-MUrnn7xY.js";
|
|
61
61
|
import { P as P3 } from "./popup.taro-2FdJu1kg.js";
|
|
62
62
|
import { P as P4 } from "./pulltorefresh.taro-VbzsD_HC.js";
|
|
63
63
|
import { S as S11 } from "./skeleton.taro-Pg7WtP0e.js";
|
|
@@ -65,27 +65,27 @@ import { S as S12 } from "./swipe.taro-p2ONOq1o.js";
|
|
|
65
65
|
import { T as T6 } from "./toast.taro-xnEQSCDJ.js";
|
|
66
66
|
import { A as A3 } from "./animate.taro-m67VyUHP.js";
|
|
67
67
|
import { default as default3 } from "./AnimatingNumbers.js";
|
|
68
|
-
import { A as A4 } from "./audio.taro-
|
|
68
|
+
import { A as A4 } from "./audio.taro-UpVxFvGk.js";
|
|
69
69
|
import { A as A5 } from "./avatar.taro-7ltbzIdY.js";
|
|
70
70
|
import { A as A6 } from "./avatargroup.taro-h6dpv6UX.js";
|
|
71
71
|
import { C as C10 } from "./circleprogress.taro-myZgamBw.js";
|
|
72
|
-
import { C as C11 } from "./collapse.taro-
|
|
73
|
-
import { C as C12 } from "./collapseitem.taro-
|
|
72
|
+
import { C as C11 } from "./collapse.taro-sZibDygv.js";
|
|
73
|
+
import { C as C12 } from "./collapseitem.taro-AaQ_msgd.js";
|
|
74
74
|
import { C as C13 } from "./countdown.taro-rJngrZUZ.js";
|
|
75
|
-
import { E as E3 } from "./ellipsis.taro-
|
|
76
|
-
import { I as I5 } from "./imagepreview.taro-
|
|
75
|
+
import { E as E3 } from "./ellipsis.taro-VApVqS_j.js";
|
|
76
|
+
import { I as I5 } from "./imagepreview.taro-qDST6Lh4.js";
|
|
77
77
|
import { I as I6 } from "./indicator.taro-ZH6MICsS.js";
|
|
78
78
|
import { P as P5 } from "./pagination.taro-RYmB2As4.js";
|
|
79
79
|
import { P as P6 } from "./price.taro-Z1zR8YWV.js";
|
|
80
80
|
import { P as P7 } from "./progress.taro-pStvlrbA.js";
|
|
81
|
-
import { S as S13 } from "./step.taro-
|
|
82
|
-
import { S as S14 } from "./steps.taro-
|
|
81
|
+
import { S as S13 } from "./step.taro-_DEZqFGb.js";
|
|
82
|
+
import { S as S14 } from "./steps.taro-PH0qWPla.js";
|
|
83
83
|
import { default as default4 } from "./Swiper.js";
|
|
84
84
|
import { S as S15 } from "./swiperitem.taro-BC1CE0T-.js";
|
|
85
|
-
import { T as T7 } from "./table.taro-
|
|
85
|
+
import { T as T7 } from "./table.taro-d172EUh9.js";
|
|
86
86
|
import { T as T8 } from "./tag.taro-5KC_wObY.js";
|
|
87
|
-
import { T as T9 } from "./tour.taro-
|
|
88
|
-
import { V } from "./video.taro-
|
|
87
|
+
import { T as T9 } from "./tour.taro-HLsDVf9g.js";
|
|
88
|
+
import { V } from "./video.taro-csvHwS2v.js";
|
|
89
89
|
import { V as V2 } from "./virtuallist.taro-AeTVtFFa.js";
|
|
90
90
|
import { B as B5 } from "./barrage.taro-HsivAhbE.js";
|
|
91
91
|
import { C as C14 } from "./card.taro-p4PTy-IU.js";
|
|
@@ -93,7 +93,7 @@ import { T as T10 } from "./timedetail.taro-TF9Wcblh.js";
|
|
|
93
93
|
import { T as T11 } from "./timeselect.taro-7FWR9oaJ.js";
|
|
94
94
|
import { T as T12 } from "./trendarrow.taro-hsM6-XsQ.js";
|
|
95
95
|
import { W } from "./watermark.taro-WDFdgWlJ.js";
|
|
96
|
-
import { A as A7 } from "./avatarcropper.taro-
|
|
96
|
+
import { A as A7 } from "./avatarcropper.taro-GIZxzMJ_.js";
|
|
97
97
|
import "react";
|
|
98
98
|
import "classnames";
|
|
99
99
|
import "@nutui/icons-react-taro";
|
|
@@ -113,6 +113,7 @@ import "./use-force-update-0oEVD8Nr.js";
|
|
|
113
113
|
import "./raf-UzmDvMUW.js";
|
|
114
114
|
import "./date-nxKOxj5-.js";
|
|
115
115
|
import "./pad-zero-iY-0-oys.js";
|
|
116
|
+
import "./use-refs-IdrY0ww3.js";
|
|
116
117
|
import "./index-YvHA__3D.js";
|
|
117
118
|
import "./use-custom-event-XvsODK8c.js";
|
|
118
119
|
import "react-dom";
|
|
@@ -6,6 +6,7 @@ import { P as Popup } from "./popup.taro-2FdJu1kg.js";
|
|
|
6
6
|
import { u as useTouch } from "./use-touch-BUFdkOSA.js";
|
|
7
7
|
import { g as getRectByTaro } from "./get-rect-by-taro-piSHvCGp.js";
|
|
8
8
|
import { p as passiveSupported } from "./overlay.taro-HsGeVyPh.js";
|
|
9
|
+
import { u as useRefs } from "./use-refs-IdrY0ww3.js";
|
|
9
10
|
import { u as useConfig } from "./configprovider.taro-_wngOo0k.js";
|
|
10
11
|
import { u as usePropsValue } from "./use-props-value-vKr0R0AX.js";
|
|
11
12
|
import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
|
|
@@ -224,17 +225,6 @@ const InternalPickerPanel = (props, ref) => {
|
|
|
224
225
|
};
|
|
225
226
|
const PickerPanel = React__default.forwardRef(InternalPickerPanel);
|
|
226
227
|
const PickerPanel$1 = PickerPanel;
|
|
227
|
-
function useRefs() {
|
|
228
|
-
const refs = React__default.useRef([]);
|
|
229
|
-
const setRefs = React__default.useCallback((index) => (el) => {
|
|
230
|
-
if (el)
|
|
231
|
-
refs.current[index] = el;
|
|
232
|
-
}, []);
|
|
233
|
-
const reset = React__default.useCallback(() => {
|
|
234
|
-
refs.current = [];
|
|
235
|
-
}, []);
|
|
236
|
-
return [refs.current, setRefs, reset];
|
|
237
|
-
}
|
|
238
228
|
const defaultProps = {
|
|
239
229
|
...ComponentDefaults,
|
|
240
230
|
visible: false,
|
|
@@ -71,7 +71,7 @@ const Popover = (props) => {
|
|
|
71
71
|
};
|
|
72
72
|
const getRectTaro = async (targetId2) => {
|
|
73
73
|
return new Promise((resolve) => {
|
|
74
|
-
const query =
|
|
74
|
+
const query = createSelectorQuery();
|
|
75
75
|
query.select(`#${targetId2}`) && query.select(`#${targetId2}`).boundingClientRect();
|
|
76
76
|
query.exec((res) => {
|
|
77
77
|
resolve(res[0]);
|
|
@@ -13,7 +13,7 @@ const defaultProps$1 = {
|
|
|
13
13
|
};
|
|
14
14
|
const classPrefix = "nut-radiogroup";
|
|
15
15
|
const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
16
|
-
const { children, className, value, defaultValue, onChange, labelPosition, direction, options, disabled, ...rest } = { ...defaultProps$1, ...props };
|
|
16
|
+
const { children, className, value, defaultValue, onChange, shape, labelPosition, direction, options, disabled, ...rest } = { ...defaultProps$1, ...props };
|
|
17
17
|
const [val2State, setVal2State] = usePropsValue({
|
|
18
18
|
defaultValue: props.defaultValue,
|
|
19
19
|
value: props.value,
|
|
@@ -30,6 +30,7 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
|
30
30
|
{ value: {
|
|
31
31
|
labelPosition: labelPosition || "right",
|
|
32
32
|
disabled,
|
|
33
|
+
shape,
|
|
33
34
|
value: val2State,
|
|
34
35
|
check: (value2) => {
|
|
35
36
|
setVal2State(value2);
|
|
@@ -120,17 +121,17 @@ const Radio = (props) => {
|
|
|
120
121
|
className: classNames(color())
|
|
121
122
|
}) : React__default.createElement(CheckNormal, { className: classNames(color()) });
|
|
122
123
|
};
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
return renderButton();
|
|
126
|
-
}
|
|
127
|
-
return React__default.createElement(
|
|
124
|
+
const renderByShape = (shape2) => {
|
|
125
|
+
return shape2 === "button" ? renderButton() : React__default.createElement(
|
|
128
126
|
React__default.Fragment,
|
|
129
127
|
null,
|
|
130
128
|
renderIcon(),
|
|
131
129
|
renderLabel()
|
|
132
130
|
);
|
|
133
131
|
};
|
|
132
|
+
const renderRadioItem = () => {
|
|
133
|
+
return renderByShape(context && context.shape ? context.shape : shape);
|
|
134
|
+
};
|
|
134
135
|
const handleClick = (e) => {
|
|
135
136
|
if (disabled || checkedStatement)
|
|
136
137
|
return;
|