@nutui/nutui-react-taro 2.0.2 → 2.0.3
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 +13 -0
- package/dist/esm/Avatar.js +3 -3
- package/dist/esm/Calendar.js +2 -2
- package/dist/esm/CalendarItem.js +1 -1
- package/dist/esm/Image.js +3 -2
- package/dist/esm/InputNumber/style/style.css +1 -1
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +3 -3
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/Skeleton.js +4 -4
- package/dist/esm/{avatar.taro-31362306.js → avatar.taro-a45e2e71.js} +2 -2
- package/dist/esm/{calendar.taro-1fbc673a.js → calendar.taro-ac2a1c47.js} +1 -1
- package/dist/esm/{calendaritem.taro-39463c08.js → calendaritem.taro-1af09287.js} +2 -2
- package/dist/esm/image.taro-c4be8323.js +81 -0
- package/dist/esm/{menu.taro-6450a3ae.js → menu.taro-f412b55d.js} +14 -3
- package/dist/esm/{menuitem.taro-11bd648e.js → menuitem.taro-f145c755.js} +41 -27
- package/dist/esm/nutui-react.es.js +8 -8
- package/dist/esm/{skeleton.taro-49046def.js → skeleton.taro-9ac4b4b8.js} +1 -1
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/image/image.taro.d.ts +9 -21
- package/dist/esm/types/src/packages/menu/menu.d.ts +2 -0
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +2 -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 +162 -156
- package/dist/nutui.react.umd.js +161 -155
- package/dist/packages/menuitem/menuitem.scss +2 -2
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +1 -0
- package/dist/styles/variables.scss +2 -1
- package/dist/types/index.d.ts +92 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/image/image.taro.d.ts +30 -22
- package/dist/types/packages/menu/menu.taro.d.ts +2 -0
- package/package.json +1 -1
- package/dist/esm/image.taro-567edf0f.js +0 -65
package/dist/nutui.react.es.js
CHANGED
|
@@ -5,13 +5,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v2.0.
|
|
8
|
+
* @nutui/nutui-react-taro v2.0.3 Wed Jul 12 2023 18:04:02 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
12
12
|
import React, { useCallback, createContext, useMemo, useContext, useState, useEffect, useRef, isValidElement, useImperativeHandle, forwardRef, Component, Children } from "react";
|
|
13
13
|
import Taro, { getEnv, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, createSelectorQuery, ENV_TYPE, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
|
|
14
|
-
import { View, ScrollView, PickerView, PickerViewColumn, Input as Input$1, Textarea,
|
|
14
|
+
import { Image as Image$2, View, ScrollView, PickerView, PickerViewColumn, Input as Input$1, Textarea, Swiper as Swiper$1, SwiperItem as SwiperItem$1, Video as Video$1 } from "@tarojs/components";
|
|
15
15
|
import ReactDOM, { createPortal } from "react-dom";
|
|
16
16
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
17
17
|
var classnamesExports = {};
|
|
@@ -2489,94 +2489,84 @@ const ConfigProvider = (props) => {
|
|
|
2489
2489
|
ConfigProvider.defaultProps = defaultProps$1p;
|
|
2490
2490
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2491
2491
|
const defaultProps$1o = {
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
width: "center",
|
|
2496
|
-
height: "",
|
|
2497
|
-
round: false,
|
|
2498
|
-
showError: true,
|
|
2499
|
-
showLoading: true
|
|
2492
|
+
src: "",
|
|
2493
|
+
error: true,
|
|
2494
|
+
loading: true
|
|
2500
2495
|
};
|
|
2501
2496
|
const Image$1 = (props) => {
|
|
2502
|
-
|
|
2497
|
+
const classPrefix2 = "nut-image";
|
|
2503
2498
|
const {
|
|
2504
|
-
children,
|
|
2505
2499
|
className,
|
|
2506
2500
|
style,
|
|
2507
2501
|
src,
|
|
2508
|
-
fit,
|
|
2509
|
-
position,
|
|
2510
|
-
alt,
|
|
2511
2502
|
width,
|
|
2512
2503
|
height,
|
|
2513
|
-
round,
|
|
2514
2504
|
radius,
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
slotError,
|
|
2518
|
-
slotLoding,
|
|
2519
|
-
onClick,
|
|
2505
|
+
error,
|
|
2506
|
+
loading,
|
|
2520
2507
|
onLoad,
|
|
2521
|
-
onError
|
|
2508
|
+
onError,
|
|
2509
|
+
...rest
|
|
2522
2510
|
} = { ...defaultProps$1o, ...props };
|
|
2523
|
-
const [
|
|
2511
|
+
const [innerLoading, setInnerLoading] = useState(true);
|
|
2524
2512
|
const [isError, setIsError] = useState(false);
|
|
2525
|
-
|
|
2513
|
+
const handleLoad = (e) => {
|
|
2514
|
+
setIsError(false);
|
|
2515
|
+
setInnerLoading(false);
|
|
2516
|
+
onLoad && onLoad(e);
|
|
2517
|
+
};
|
|
2518
|
+
const handleError = (e) => {
|
|
2526
2519
|
if (src) {
|
|
2527
|
-
setIsError(
|
|
2528
|
-
|
|
2520
|
+
setIsError(true);
|
|
2521
|
+
setInnerLoading(false);
|
|
2522
|
+
onError && onError(e);
|
|
2529
2523
|
}
|
|
2530
|
-
}, [src]);
|
|
2531
|
-
const load = () => {
|
|
2532
|
-
setLoading(false);
|
|
2533
|
-
onLoad && onLoad();
|
|
2534
|
-
};
|
|
2535
|
-
const error = () => {
|
|
2536
|
-
setIsError(true);
|
|
2537
|
-
setLoading(false);
|
|
2538
|
-
onError && onError();
|
|
2539
2524
|
};
|
|
2540
2525
|
const pxCheck2 = (value) => {
|
|
2541
2526
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2542
2527
|
};
|
|
2543
|
-
const
|
|
2528
|
+
const containerStyle = {
|
|
2544
2529
|
height: height ? pxCheck2(height) : "",
|
|
2545
2530
|
width: width ? pxCheck2(width) : "",
|
|
2546
2531
|
overflow: radius !== void 0 && radius !== null ? "hidden" : "",
|
|
2547
2532
|
borderRadius: radius !== void 0 && radius !== null ? pxCheck2(radius) : ""
|
|
2548
2533
|
};
|
|
2549
|
-
const
|
|
2550
|
-
objectFit: fit,
|
|
2551
|
-
objectPosition: position,
|
|
2534
|
+
const imgStyle = {
|
|
2552
2535
|
...style
|
|
2553
2536
|
};
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2537
|
+
const renderErrorImg = useCallback(() => {
|
|
2538
|
+
if (!isError)
|
|
2539
|
+
return null;
|
|
2540
|
+
if (typeof error === "boolean" && error === true && !innerLoading) {
|
|
2541
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-img-error" }, /* @__PURE__ */ React.createElement(a$l, null));
|
|
2542
|
+
}
|
|
2543
|
+
if (React.isValidElement(error) && !innerLoading) {
|
|
2544
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-img-error" }, error);
|
|
2545
|
+
}
|
|
2546
|
+
return null;
|
|
2547
|
+
}, [error, isError]);
|
|
2548
|
+
const renderLoading = useCallback(() => {
|
|
2549
|
+
if (!loading)
|
|
2550
|
+
return null;
|
|
2551
|
+
if (typeof loading === "boolean" && loading === true && innerLoading) {
|
|
2552
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-img-loading" }, /* @__PURE__ */ React.createElement(r$k, null));
|
|
2553
|
+
}
|
|
2554
|
+
if (React.isValidElement(loading) && innerLoading) {
|
|
2555
|
+
return /* @__PURE__ */ React.createElement("div", { className: "nut-img-loading" }, loading);
|
|
2556
|
+
}
|
|
2557
|
+
return null;
|
|
2558
|
+
}, [loading, innerLoading]);
|
|
2559
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix2, className), style: containerStyle }, /* @__PURE__ */ React.createElement(
|
|
2560
|
+
Image$2,
|
|
2559
2561
|
{
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
{
|
|
2569
|
-
className: "nut-img",
|
|
2570
|
-
style: styles,
|
|
2571
|
-
src,
|
|
2572
|
-
alt,
|
|
2573
|
-
onLoad: load,
|
|
2574
|
-
onError: error
|
|
2575
|
-
}
|
|
2576
|
-
),
|
|
2577
|
-
showLoading && loading ? /* @__PURE__ */ React.createElement("div", { className: "nut-img-loading" }, slotLoding || children || /* @__PURE__ */ React.createElement(r$k, null)) : null,
|
|
2578
|
-
showError && isError && !loading ? /* @__PURE__ */ React.createElement("div", { className: "nut-img-error" }, slotError || children || /* @__PURE__ */ React.createElement(a$l, null)) : null
|
|
2579
|
-
);
|
|
2562
|
+
...rest,
|
|
2563
|
+
className: "nut-img",
|
|
2564
|
+
style: imgStyle,
|
|
2565
|
+
src,
|
|
2566
|
+
onLoad: (e) => handleLoad(e),
|
|
2567
|
+
onError: (e) => handleError(e)
|
|
2568
|
+
}
|
|
2569
|
+
), renderLoading(), renderErrorImg());
|
|
2580
2570
|
};
|
|
2581
2571
|
Image$1.defaultProps = defaultProps$1o;
|
|
2582
2572
|
Image$1.displayName = "NutImage";
|
|
@@ -6965,9 +6955,9 @@ const getPreMonthDates = (type4, year, month, firstDayOfWeek) => {
|
|
|
6965
6955
|
});
|
|
6966
6956
|
return months.slice(preDates - days);
|
|
6967
6957
|
};
|
|
6968
|
-
const _window = window;
|
|
6969
6958
|
function requestAniFrame() {
|
|
6970
|
-
if (typeof
|
|
6959
|
+
if (typeof window !== "undefined") {
|
|
6960
|
+
const _window = window;
|
|
6971
6961
|
return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
|
|
6972
6962
|
_window.setTimeout(callback, 1e3 / 60);
|
|
6973
6963
|
};
|
|
@@ -10812,14 +10802,27 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
10812
10802
|
...defaultProps$S,
|
|
10813
10803
|
...props
|
|
10814
10804
|
};
|
|
10815
|
-
const [
|
|
10816
|
-
const [
|
|
10805
|
+
const [showPopup, setShowPopup] = useState(show);
|
|
10806
|
+
const [innerValue, setValue] = useState(value);
|
|
10817
10807
|
useEffect(() => {
|
|
10818
10808
|
setShowPopup(show);
|
|
10819
10809
|
}, [show]);
|
|
10820
10810
|
useEffect(() => {
|
|
10821
10811
|
getParentOffset();
|
|
10822
|
-
}, [
|
|
10812
|
+
}, [showPopup]);
|
|
10813
|
+
const windowHeight = useMemo(() => getSystemInfoSync().windowHeight, []);
|
|
10814
|
+
const updateItemOffset = useCallback(() => {
|
|
10815
|
+
const p = parent.menuRef.current;
|
|
10816
|
+
p.getBoundingClientRect().then((rect) => {
|
|
10817
|
+
if (rect) {
|
|
10818
|
+
setPosition({
|
|
10819
|
+
height: rect.height,
|
|
10820
|
+
top: rect.top
|
|
10821
|
+
});
|
|
10822
|
+
}
|
|
10823
|
+
});
|
|
10824
|
+
}, [direction, windowHeight]);
|
|
10825
|
+
usePageScroll(updateItemOffset);
|
|
10823
10826
|
useImperativeHandle(ref, () => ({
|
|
10824
10827
|
toggle: parent.toggleMenuItem
|
|
10825
10828
|
}));
|
|
@@ -10855,120 +10858,111 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
10855
10858
|
}, 100);
|
|
10856
10859
|
};
|
|
10857
10860
|
const isShow = () => {
|
|
10858
|
-
if (
|
|
10861
|
+
if (showPopup)
|
|
10859
10862
|
return {};
|
|
10860
10863
|
return { display: "none" };
|
|
10861
10864
|
};
|
|
10862
10865
|
const getPosition = () => {
|
|
10863
|
-
return direction === "down" ? {
|
|
10864
|
-
|
|
10865
|
-
bottom: "
|
|
10866
|
-
|
|
10867
|
-
|
|
10866
|
+
return direction === "down" ? {
|
|
10867
|
+
top: `${position.top + position.height}px`,
|
|
10868
|
+
bottom: "0",
|
|
10869
|
+
height: "initial"
|
|
10870
|
+
} : {
|
|
10871
|
+
bottom: `${getSystemInfoSync().windowHeight - position.top}px`,
|
|
10872
|
+
top: "0",
|
|
10873
|
+
height: "initial"
|
|
10868
10874
|
};
|
|
10869
10875
|
};
|
|
10870
10876
|
const placeholderStyle = () => {
|
|
10871
10877
|
if (direction === "down") {
|
|
10872
10878
|
return {
|
|
10873
10879
|
height: `${position.top + position.height}px`,
|
|
10874
|
-
top: "auto",
|
|
10875
|
-
bottom: "-100%",
|
|
10876
10880
|
...isShow()
|
|
10877
10881
|
};
|
|
10878
10882
|
}
|
|
10879
10883
|
return {
|
|
10880
10884
|
height: `${getSystemInfoSync().windowHeight - position.top}px`,
|
|
10881
|
-
|
|
10882
|
-
top: "0",
|
|
10885
|
+
top: "auto",
|
|
10883
10886
|
...isShow()
|
|
10884
10887
|
};
|
|
10885
10888
|
};
|
|
10886
|
-
return /* @__PURE__ */ React.createElement(
|
|
10887
|
-
|
|
10889
|
+
return /* @__PURE__ */ React.createElement(View, { className: "nut-menu-item-container" }, closeOnClickAway ? /* @__PURE__ */ React.createElement(
|
|
10890
|
+
View,
|
|
10888
10891
|
{
|
|
10889
|
-
className:
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10892
|
+
className: `placeholder-element ${classNames({
|
|
10893
|
+
up: direction === "up"
|
|
10894
|
+
})}`,
|
|
10895
|
+
style: placeholderStyle(),
|
|
10896
|
+
onClick: () => parent.toggleMenuItem(index)
|
|
10897
|
+
}
|
|
10898
|
+
) : null, /* @__PURE__ */ React.createElement(
|
|
10899
|
+
Overlay,
|
|
10900
|
+
{
|
|
10901
|
+
className: "nut-menu__overlay",
|
|
10902
|
+
style: getPosition(),
|
|
10903
|
+
lockScroll: parent.lockScroll,
|
|
10904
|
+
visible: showPopup,
|
|
10905
|
+
closeOnOverlayClick: parent.closeOnOverlayClick,
|
|
10906
|
+
onClick: () => {
|
|
10907
|
+
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
10900
10908
|
}
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
}
|
|
10909
|
+
}
|
|
10910
|
+
), /* @__PURE__ */ React.createElement(
|
|
10911
|
+
View,
|
|
10912
|
+
{
|
|
10913
|
+
className: classNames(className, {
|
|
10914
|
+
"nut-menu-item__wrap": direction === "down",
|
|
10915
|
+
"nut-menu-item__wrap-up": direction !== "down"
|
|
10916
|
+
}),
|
|
10917
|
+
style: {
|
|
10918
|
+
...style,
|
|
10919
|
+
...isShow()
|
|
10913
10920
|
}
|
|
10914
|
-
|
|
10921
|
+
},
|
|
10915
10922
|
/* @__PURE__ */ React.createElement(
|
|
10916
|
-
|
|
10923
|
+
CSSTransition$1,
|
|
10917
10924
|
{
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
}),
|
|
10922
|
-
style: {
|
|
10923
|
-
...style,
|
|
10924
|
-
...isShow()
|
|
10925
|
-
}
|
|
10925
|
+
in: showPopup,
|
|
10926
|
+
timeout: 100,
|
|
10927
|
+
classNames: direction === "down" ? "menu-item" : "menu-item-up"
|
|
10926
10928
|
},
|
|
10927
|
-
/* @__PURE__ */ React.createElement(
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10929
|
+
/* @__PURE__ */ React.createElement(View, { className: "nut-menu-item__content" }, options == null ? void 0 : options.map((item, index2) => {
|
|
10930
|
+
return /* @__PURE__ */ React.createElement(
|
|
10931
|
+
View,
|
|
10932
|
+
{
|
|
10933
|
+
className: `nut-menu-item__option ${classNames({
|
|
10934
|
+
active: item.value === innerValue
|
|
10935
|
+
})}`,
|
|
10936
|
+
key: item.text,
|
|
10937
|
+
style: {
|
|
10938
|
+
flexBasis: `${100 / columns}%`
|
|
10939
|
+
},
|
|
10940
|
+
onClick: () => {
|
|
10941
|
+
handleClick(item);
|
|
10942
|
+
}
|
|
10943
|
+
},
|
|
10944
|
+
item.value === innerValue ? /* @__PURE__ */ React.createElement(React.Fragment, null, icon || /* @__PURE__ */ React.createElement(
|
|
10945
|
+
a$t,
|
|
10946
|
+
{
|
|
10947
|
+
color: activeColor,
|
|
10948
|
+
size: 10,
|
|
10949
|
+
className: getIconCName(item.value, value)
|
|
10950
|
+
}
|
|
10951
|
+
)) : null,
|
|
10952
|
+
/* @__PURE__ */ React.createElement(
|
|
10953
|
+
View,
|
|
10937
10954
|
{
|
|
10938
|
-
className:
|
|
10939
|
-
active: item.value === _value
|
|
10940
|
-
})}`,
|
|
10941
|
-
key: item.text,
|
|
10955
|
+
className: getIconCName(item.value, value),
|
|
10942
10956
|
style: {
|
|
10943
|
-
|
|
10944
|
-
},
|
|
10945
|
-
onClick: () => {
|
|
10946
|
-
handleClick(item);
|
|
10957
|
+
color: `${item.value === innerValue ? activeColor : ""}`
|
|
10947
10958
|
}
|
|
10948
10959
|
},
|
|
10949
|
-
item.
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
size: 10,
|
|
10954
|
-
className: getIconCName(item.value, value)
|
|
10955
|
-
}
|
|
10956
|
-
)) : null,
|
|
10957
|
-
/* @__PURE__ */ React.createElement(
|
|
10958
|
-
"div",
|
|
10959
|
-
{
|
|
10960
|
-
className: getIconCName(item.value, value),
|
|
10961
|
-
style: {
|
|
10962
|
-
color: `${item.value === _value ? activeColor : ""}`
|
|
10963
|
-
}
|
|
10964
|
-
},
|
|
10965
|
-
item.text
|
|
10966
|
-
)
|
|
10967
|
-
);
|
|
10968
|
-
}), children)
|
|
10969
|
-
)
|
|
10960
|
+
item.text
|
|
10961
|
+
)
|
|
10962
|
+
);
|
|
10963
|
+
}), children)
|
|
10970
10964
|
)
|
|
10971
|
-
);
|
|
10965
|
+
));
|
|
10972
10966
|
});
|
|
10973
10967
|
MenuItem.defaultProps = defaultProps$S;
|
|
10974
10968
|
MenuItem.displayName = "NutMenuItem";
|
|
@@ -10978,7 +10972,11 @@ const defaultProps$R = {
|
|
|
10978
10972
|
closeOnOverlayClick: true,
|
|
10979
10973
|
scrollFixed: false,
|
|
10980
10974
|
lockScroll: true,
|
|
10981
|
-
icon: null
|
|
10975
|
+
icon: null,
|
|
10976
|
+
onOpen: () => {
|
|
10977
|
+
},
|
|
10978
|
+
onClose: () => {
|
|
10979
|
+
}
|
|
10982
10980
|
};
|
|
10983
10981
|
const Menu = (props) => {
|
|
10984
10982
|
const {
|
|
@@ -10989,6 +10987,8 @@ const Menu = (props) => {
|
|
|
10989
10987
|
closeOnOverlayClick,
|
|
10990
10988
|
children,
|
|
10991
10989
|
activeColor,
|
|
10990
|
+
onClose,
|
|
10991
|
+
onOpen,
|
|
10992
10992
|
...rest
|
|
10993
10993
|
} = {
|
|
10994
10994
|
...defaultProps$R,
|
|
@@ -11015,6 +11015,11 @@ const Menu = (props) => {
|
|
|
11015
11015
|
const [menuItemTitle, setMenuItemTitle] = useState([]);
|
|
11016
11016
|
const toggleMenuItem = (index) => {
|
|
11017
11017
|
showMenuItem[index] = !showMenuItem[index];
|
|
11018
|
+
if (showMenuItem[index]) {
|
|
11019
|
+
onOpen && onOpen();
|
|
11020
|
+
} else {
|
|
11021
|
+
onClose && onClose();
|
|
11022
|
+
}
|
|
11018
11023
|
const temp = showMenuItem.map(
|
|
11019
11024
|
(i, idx) => idx === index ? i : false
|
|
11020
11025
|
);
|
|
@@ -11023,6 +11028,7 @@ const Menu = (props) => {
|
|
|
11023
11028
|
const hideMenuItem = (index) => {
|
|
11024
11029
|
showMenuItem[index] = false;
|
|
11025
11030
|
setShowMenuItem([...showMenuItem]);
|
|
11031
|
+
onClose && onClose();
|
|
11026
11032
|
};
|
|
11027
11033
|
const updateTitle = (text, index) => {
|
|
11028
11034
|
menuItemTitle[index] = text;
|
|
@@ -11031,6 +11037,7 @@ const Menu = (props) => {
|
|
|
11031
11037
|
const cloneChildren = () => {
|
|
11032
11038
|
return React.Children.map(children, (child, index) => {
|
|
11033
11039
|
return React.cloneElement(child, {
|
|
11040
|
+
...child.props,
|
|
11034
11041
|
show: showMenuItem[index],
|
|
11035
11042
|
index,
|
|
11036
11043
|
activeColor,
|
|
@@ -14620,7 +14627,6 @@ const Avatar = (props) => {
|
|
|
14620
14627
|
className: "avatar-img",
|
|
14621
14628
|
src,
|
|
14622
14629
|
style: { objectFit: fit },
|
|
14623
|
-
alt,
|
|
14624
14630
|
onError: errorEvent
|
|
14625
14631
|
}
|
|
14626
14632
|
), React.isValidElement(icon) ? React.cloneElement(icon, {
|