@nutui/nutui-react 1.3.13 → 1.3.14-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 +19 -2
- package/README.md +54 -43
- package/dist/esm/Collapse.js +1 -1
- package/dist/esm/CollapseItem.js +9 -5
- package/dist/esm/Grid.js +9 -3
- package/dist/esm/GridItem.js +19 -1
- package/dist/esm/ImagePreview.js +27 -23
- package/dist/esm/NoticeBar.js +8 -5
- package/dist/esm/Notify.js +1 -1
- package/dist/esm/Toast.js +3 -3
- package/dist/esm/TrendArrow/style/index.js +1 -1
- package/dist/esm/TrendArrow.js +1 -1
- package/dist/esm/grid.context-e2f1ee97.js +6 -0
- package/dist/esm/render-f8746530.js +81 -0
- package/dist/esm/types/src/packages/formitem/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/grid/grid.context.d.ts +6 -0
- package/dist/esm/types/src/packages/grid/grid.d.ts +3 -1
- package/dist/esm/types/src/packages/grid/grid.taro.context.d.ts +6 -0
- package/dist/esm/types/src/utils/render.d.ts +8 -1
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +91 -35
- package/dist/nutui.react.umd.js +91 -35
- package/dist/packages/noticebar/noticebar.scss +0 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/config.json +5 -1
- package/dist/styles/font/demo_index.html +118 -26
- package/dist/styles/font/iconfont.css +23 -7
- package/dist/styles/font/iconfont.js +6 -6
- package/dist/styles/font/iconfont.json +35 -7
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/types/index.d.ts +16 -15
- package/package.json +1 -1
- package/dist/esm/render-18227751.js +0 -32
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
declare const MARK = "__nutui_react_root__";
|
|
4
|
+
declare type ContainerType = (Element | DocumentFragment) & {
|
|
5
|
+
[MARK]?: Root;
|
|
6
|
+
};
|
|
7
|
+
export declare function render(node: ReactElement, container: ContainerType): void;
|
|
8
|
+
export declare function unmount(container: ContainerType): boolean | Promise<void>;
|
|
9
|
+
export {};
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.
|
|
2
|
+
* @nutui/nutui-react v1.3.14 Fri Dec 09 2022 12:26:29 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2712,6 +2712,11 @@ const Divider = (props) => {
|
|
|
2712
2712
|
};
|
|
2713
2713
|
Divider.defaultProps = defaultProps$1g;
|
|
2714
2714
|
Divider.displayName = "NutDivider";
|
|
2715
|
+
const gridContext = {
|
|
2716
|
+
onClick: (item, index) => {
|
|
2717
|
+
}
|
|
2718
|
+
};
|
|
2719
|
+
var GridContext = React__default.createContext(gridContext);
|
|
2715
2720
|
const defaultProps$1f = {
|
|
2716
2721
|
columnNum: 4,
|
|
2717
2722
|
border: true,
|
|
@@ -2738,6 +2743,7 @@ const Grid = (props) => {
|
|
|
2738
2743
|
iconSize,
|
|
2739
2744
|
iconColor,
|
|
2740
2745
|
className,
|
|
2746
|
+
onClick,
|
|
2741
2747
|
...rest
|
|
2742
2748
|
} = { ...defaultProps$1f, ...props };
|
|
2743
2749
|
const childrenDom = React__default.Children.toArray(children);
|
|
@@ -2763,6 +2769,8 @@ const Grid = (props) => {
|
|
|
2763
2769
|
className: rootClass(),
|
|
2764
2770
|
style: rootStyle(),
|
|
2765
2771
|
...rest
|
|
2772
|
+
}, /* @__PURE__ */ React__default.createElement(GridContext.Provider, {
|
|
2773
|
+
value: { onClick }
|
|
2766
2774
|
}, childrenDom.map((item, idex) => {
|
|
2767
2775
|
return React__default.cloneElement(item, {
|
|
2768
2776
|
index: idex,
|
|
@@ -2776,7 +2784,7 @@ const Grid = (props) => {
|
|
|
2776
2784
|
parentIconSize: iconSize,
|
|
2777
2785
|
parentIconColor: iconColor
|
|
2778
2786
|
});
|
|
2779
|
-
}));
|
|
2787
|
+
})));
|
|
2780
2788
|
};
|
|
2781
2789
|
Grid.defaultProps = defaultProps$1f;
|
|
2782
2790
|
Grid.displayName = "NutGrid";
|
|
@@ -2823,6 +2831,7 @@ const GridItem = (props) => {
|
|
|
2823
2831
|
...props
|
|
2824
2832
|
};
|
|
2825
2833
|
const b2 = cn("grid-item");
|
|
2834
|
+
const context2 = useContext$1(GridContext);
|
|
2826
2835
|
const pxCheck2 = (value) => {
|
|
2827
2836
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2828
2837
|
};
|
|
@@ -2849,6 +2858,25 @@ const GridItem = (props) => {
|
|
|
2849
2858
|
};
|
|
2850
2859
|
const handleClick2 = (e2) => {
|
|
2851
2860
|
onClick && onClick(e2);
|
|
2861
|
+
context2.onClick && context2.onClick(
|
|
2862
|
+
{
|
|
2863
|
+
text,
|
|
2864
|
+
icon,
|
|
2865
|
+
iconSize,
|
|
2866
|
+
iconColor,
|
|
2867
|
+
parentIconSize,
|
|
2868
|
+
parentIconColor,
|
|
2869
|
+
index,
|
|
2870
|
+
columnNum,
|
|
2871
|
+
border,
|
|
2872
|
+
gutter,
|
|
2873
|
+
center,
|
|
2874
|
+
square,
|
|
2875
|
+
reverse,
|
|
2876
|
+
direction
|
|
2877
|
+
},
|
|
2878
|
+
index
|
|
2879
|
+
);
|
|
2852
2880
|
};
|
|
2853
2881
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2854
2882
|
className: b2(),
|
|
@@ -9517,27 +9545,34 @@ function useTouch() {
|
|
|
9517
9545
|
isHorizontal
|
|
9518
9546
|
};
|
|
9519
9547
|
}
|
|
9520
|
-
|
|
9521
|
-
const { version } = ReactDOM;
|
|
9522
|
-
const reactDOMClone = {
|
|
9548
|
+
const fullClone = {
|
|
9523
9549
|
...ReactDOM
|
|
9524
9550
|
};
|
|
9551
|
+
const { version, render: reactRender, unmountComponentAtNode } = fullClone;
|
|
9552
|
+
let createRoot;
|
|
9525
9553
|
try {
|
|
9526
9554
|
const mainVersion = Number((version || "").split(".")[0]);
|
|
9527
|
-
if (mainVersion >= 18) {
|
|
9528
|
-
createRoot =
|
|
9555
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
9556
|
+
createRoot = fullClone.createRoot;
|
|
9529
9557
|
}
|
|
9530
9558
|
} catch (e2) {
|
|
9531
|
-
console.log(e2);
|
|
9532
9559
|
}
|
|
9560
|
+
function toggleWarning(skip) {
|
|
9561
|
+
const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
|
|
9562
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
|
|
9563
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
9564
|
+
}
|
|
9565
|
+
}
|
|
9566
|
+
const MARK = "__nutui_react_root__";
|
|
9533
9567
|
function legacyRender(node, container) {
|
|
9534
|
-
|
|
9568
|
+
reactRender(node, container);
|
|
9535
9569
|
}
|
|
9536
9570
|
function concurrentRender(node, container) {
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9571
|
+
toggleWarning(true);
|
|
9572
|
+
const root = container[MARK] || createRoot(container);
|
|
9573
|
+
toggleWarning(false);
|
|
9574
|
+
root.render(node);
|
|
9575
|
+
container[MARK] = root;
|
|
9541
9576
|
}
|
|
9542
9577
|
function render(node, container) {
|
|
9543
9578
|
if (createRoot) {
|
|
@@ -9546,6 +9581,22 @@ function render(node, container) {
|
|
|
9546
9581
|
}
|
|
9547
9582
|
legacyRender(node, container);
|
|
9548
9583
|
}
|
|
9584
|
+
function legacyUnmount(container) {
|
|
9585
|
+
return unmountComponentAtNode(container);
|
|
9586
|
+
}
|
|
9587
|
+
async function concurrentUnmount(container) {
|
|
9588
|
+
return Promise.resolve().then(() => {
|
|
9589
|
+
var _a;
|
|
9590
|
+
(_a = container[MARK]) == null ? void 0 : _a.unmount();
|
|
9591
|
+
delete container[MARK];
|
|
9592
|
+
});
|
|
9593
|
+
}
|
|
9594
|
+
function unmount(container) {
|
|
9595
|
+
if (createRoot) {
|
|
9596
|
+
return concurrentUnmount(container);
|
|
9597
|
+
}
|
|
9598
|
+
return legacyUnmount(container);
|
|
9599
|
+
}
|
|
9549
9600
|
class Notification$1 extends React.PureComponent {
|
|
9550
9601
|
constructor(props) {
|
|
9551
9602
|
super(props);
|
|
@@ -9657,7 +9708,7 @@ Notification$1.newInstance = (properties, callback) => {
|
|
|
9657
9708
|
callback({
|
|
9658
9709
|
component: instance,
|
|
9659
9710
|
destroy() {
|
|
9660
|
-
|
|
9711
|
+
unmount(element);
|
|
9661
9712
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
9662
9713
|
}
|
|
9663
9714
|
});
|
|
@@ -17571,19 +17622,18 @@ const NoticeBar = (props) => {
|
|
|
17571
17622
|
};
|
|
17572
17623
|
const startRollEasy = () => {
|
|
17573
17624
|
showhorseLamp();
|
|
17574
|
-
const
|
|
17575
|
-
|
|
17576
|
-
~~(height / speed / 4) * 1e3 + Number(standTime)
|
|
17577
|
-
);
|
|
17625
|
+
const time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1e3 : ~~(height / speed / 4) * 1e3;
|
|
17626
|
+
const timerCurr = setInterval(showhorseLamp, time + Number(standTime));
|
|
17578
17627
|
SetTimer(timerCurr);
|
|
17579
17628
|
};
|
|
17580
17629
|
const showhorseLamp = () => {
|
|
17581
17630
|
SetAnimate(true);
|
|
17631
|
+
const time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1e3 : ~~(height / speed / 4) * 1e3;
|
|
17582
17632
|
setTimeout(() => {
|
|
17583
17633
|
scrollList.current.push(scrollList.current[0]);
|
|
17584
17634
|
scrollList.current.shift();
|
|
17585
17635
|
SetAnimate(false);
|
|
17586
|
-
},
|
|
17636
|
+
}, time);
|
|
17587
17637
|
};
|
|
17588
17638
|
const startRoll = () => {
|
|
17589
17639
|
const timerCurr = setInterval(() => {
|
|
@@ -17643,10 +17693,11 @@ const NoticeBar = (props) => {
|
|
|
17643
17693
|
background,
|
|
17644
17694
|
height: direction === "vertical" ? `${height}px` : ""
|
|
17645
17695
|
};
|
|
17646
|
-
const duringTime = ~~(height / speed / 4);
|
|
17696
|
+
const duringTime = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) : ~~(height / speed / 4);
|
|
17697
|
+
const noDuring = height / speed < 1 ? (height / speed).toFixed(1) : ~~(height / speed);
|
|
17647
17698
|
const horseLampStyle = {
|
|
17648
17699
|
transform: complexAm ? `translateY(${distance}px)` : "",
|
|
17649
|
-
transition: animate ? `all ${duringTime === 0 ?
|
|
17700
|
+
transition: animate ? `all ${duringTime === 0 ? noDuring : duringTime}s` : "",
|
|
17650
17701
|
marginTop: animate ? `-${height}px` : ""
|
|
17651
17702
|
};
|
|
17652
17703
|
const b2 = cn("noticebar");
|
|
@@ -17688,7 +17739,7 @@ const NoticeBar = (props) => {
|
|
|
17688
17739
|
fontClassName: iconFontClassName,
|
|
17689
17740
|
name: rightIcon || "close",
|
|
17690
17741
|
color
|
|
17691
|
-
})) : null) : null, showNoticeBar &&
|
|
17742
|
+
})) : null) : null, showNoticeBar && direction === "vertical" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
17692
17743
|
className: "nut-noticebar-vertical",
|
|
17693
17744
|
style: barStyle,
|
|
17694
17745
|
onClick: handleClick2
|
|
@@ -19199,7 +19250,7 @@ const defaultProps$k = {
|
|
|
19199
19250
|
rotate: 180
|
|
19200
19251
|
};
|
|
19201
19252
|
function areEqual(prevProps, nextProps) {
|
|
19202
|
-
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
19253
|
+
return prevProps.children === nextProps.children && JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
19203
19254
|
}
|
|
19204
19255
|
const Collapse = memo(
|
|
19205
19256
|
(props) => {
|
|
@@ -19325,10 +19376,6 @@ const CollapseItem = (props) => {
|
|
|
19325
19376
|
transform: "translateY(-50%)"
|
|
19326
19377
|
});
|
|
19327
19378
|
const colBem = cn("collapse-item");
|
|
19328
|
-
useEffect(() => {
|
|
19329
|
-
setCurrHeight("auto");
|
|
19330
|
-
setUpdate(!update2);
|
|
19331
|
-
}, [children]);
|
|
19332
19379
|
const measuredRef = useCallback(
|
|
19333
19380
|
(node) => {
|
|
19334
19381
|
if (node !== null) {
|
|
@@ -19346,6 +19393,14 @@ const CollapseItem = (props) => {
|
|
|
19346
19393
|
setIconStyle(newIconStyle);
|
|
19347
19394
|
}, 10);
|
|
19348
19395
|
}, [isOpen, domHeight, rotate]);
|
|
19396
|
+
useEffect(() => {
|
|
19397
|
+
if (!isOpen) {
|
|
19398
|
+
setCurrHeight("0px");
|
|
19399
|
+
} else {
|
|
19400
|
+
setCurrHeight("auto");
|
|
19401
|
+
}
|
|
19402
|
+
setUpdate(!update2);
|
|
19403
|
+
}, [children, isOpen]);
|
|
19349
19404
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19350
19405
|
className: colBem(),
|
|
19351
19406
|
...rest
|
|
@@ -20322,6 +20377,7 @@ const ImagePreview = (props) => {
|
|
|
20322
20377
|
onClose
|
|
20323
20378
|
} = props;
|
|
20324
20379
|
const nutImagePreview = useRef(null);
|
|
20380
|
+
const [innerNo, setInnerNo] = useState(initNo);
|
|
20325
20381
|
const [showPop, setShowPop] = useState(false);
|
|
20326
20382
|
const [active, setActive] = useState(1);
|
|
20327
20383
|
const [maxNo, setMaxNo] = useState(1);
|
|
@@ -20402,14 +20458,14 @@ const ImagePreview = (props) => {
|
|
|
20402
20458
|
document.addEventListener("touchcancel", onTouchEnd);
|
|
20403
20459
|
};
|
|
20404
20460
|
useEffect(() => {
|
|
20405
|
-
|
|
20406
|
-
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
}, [show]);
|
|
20461
|
+
setShowPop(show);
|
|
20462
|
+
setInnerNo(initNo);
|
|
20463
|
+
setActive(initNo);
|
|
20464
|
+
init();
|
|
20465
|
+
}, [show, initNo]);
|
|
20410
20466
|
useEffect(() => {
|
|
20411
|
-
if (
|
|
20412
|
-
setActive(
|
|
20467
|
+
if (innerNo !== void 0) {
|
|
20468
|
+
setActive(innerNo);
|
|
20413
20469
|
}
|
|
20414
20470
|
if (show !== void 0) {
|
|
20415
20471
|
setShowPop(show);
|
|
@@ -20465,7 +20521,7 @@ const ImagePreview = (props) => {
|
|
|
20465
20521
|
style: { display: showPop ? "block" : "none" },
|
|
20466
20522
|
direction: "horizontal",
|
|
20467
20523
|
onChange: slideChangeEnd,
|
|
20468
|
-
initPage:
|
|
20524
|
+
initPage: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
|
|
20469
20525
|
paginationColor,
|
|
20470
20526
|
paginationVisible
|
|
20471
20527
|
}, (videos && videos.length > 0 ? videos.map((item, index) => {
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.
|
|
2
|
+
* @nutui/nutui-react v1.3.14 Fri Dec 09 2022 12:26:29 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2739,6 +2739,11 @@
|
|
|
2739
2739
|
};
|
|
2740
2740
|
Divider.defaultProps = defaultProps$1g;
|
|
2741
2741
|
Divider.displayName = "NutDivider";
|
|
2742
|
+
const gridContext = {
|
|
2743
|
+
onClick: (item, index) => {
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2746
|
+
var GridContext = React__default["default"].createContext(gridContext);
|
|
2742
2747
|
const defaultProps$1f = {
|
|
2743
2748
|
columnNum: 4,
|
|
2744
2749
|
border: true,
|
|
@@ -2765,6 +2770,7 @@
|
|
|
2765
2770
|
iconSize,
|
|
2766
2771
|
iconColor,
|
|
2767
2772
|
className,
|
|
2773
|
+
onClick,
|
|
2768
2774
|
...rest
|
|
2769
2775
|
} = { ...defaultProps$1f, ...props };
|
|
2770
2776
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
@@ -2790,6 +2796,8 @@
|
|
|
2790
2796
|
className: rootClass(),
|
|
2791
2797
|
style: rootStyle(),
|
|
2792
2798
|
...rest
|
|
2799
|
+
}, /* @__PURE__ */ React__default["default"].createElement(GridContext.Provider, {
|
|
2800
|
+
value: { onClick }
|
|
2793
2801
|
}, childrenDom.map((item, idex) => {
|
|
2794
2802
|
return React__default["default"].cloneElement(item, {
|
|
2795
2803
|
index: idex,
|
|
@@ -2803,7 +2811,7 @@
|
|
|
2803
2811
|
parentIconSize: iconSize,
|
|
2804
2812
|
parentIconColor: iconColor
|
|
2805
2813
|
});
|
|
2806
|
-
}));
|
|
2814
|
+
})));
|
|
2807
2815
|
};
|
|
2808
2816
|
Grid.defaultProps = defaultProps$1f;
|
|
2809
2817
|
Grid.displayName = "NutGrid";
|
|
@@ -2850,6 +2858,7 @@
|
|
|
2850
2858
|
...props
|
|
2851
2859
|
};
|
|
2852
2860
|
const b2 = cn("grid-item");
|
|
2861
|
+
const context2 = React.useContext(GridContext);
|
|
2853
2862
|
const pxCheck2 = (value) => {
|
|
2854
2863
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2855
2864
|
};
|
|
@@ -2876,6 +2885,25 @@
|
|
|
2876
2885
|
};
|
|
2877
2886
|
const handleClick2 = (e2) => {
|
|
2878
2887
|
onClick && onClick(e2);
|
|
2888
|
+
context2.onClick && context2.onClick(
|
|
2889
|
+
{
|
|
2890
|
+
text,
|
|
2891
|
+
icon,
|
|
2892
|
+
iconSize,
|
|
2893
|
+
iconColor,
|
|
2894
|
+
parentIconSize,
|
|
2895
|
+
parentIconColor,
|
|
2896
|
+
index,
|
|
2897
|
+
columnNum,
|
|
2898
|
+
border,
|
|
2899
|
+
gutter,
|
|
2900
|
+
center,
|
|
2901
|
+
square,
|
|
2902
|
+
reverse,
|
|
2903
|
+
direction
|
|
2904
|
+
},
|
|
2905
|
+
index
|
|
2906
|
+
);
|
|
2879
2907
|
};
|
|
2880
2908
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2881
2909
|
className: b2(),
|
|
@@ -9544,27 +9572,34 @@
|
|
|
9544
9572
|
isHorizontal
|
|
9545
9573
|
};
|
|
9546
9574
|
}
|
|
9547
|
-
|
|
9548
|
-
const { version } = ReactDOM__namespace;
|
|
9549
|
-
const reactDOMClone = {
|
|
9575
|
+
const fullClone = {
|
|
9550
9576
|
...ReactDOM__namespace
|
|
9551
9577
|
};
|
|
9578
|
+
const { version, render: reactRender, unmountComponentAtNode } = fullClone;
|
|
9579
|
+
let createRoot;
|
|
9552
9580
|
try {
|
|
9553
9581
|
const mainVersion = Number((version || "").split(".")[0]);
|
|
9554
|
-
if (mainVersion >= 18) {
|
|
9555
|
-
createRoot =
|
|
9582
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
9583
|
+
createRoot = fullClone.createRoot;
|
|
9556
9584
|
}
|
|
9557
9585
|
} catch (e2) {
|
|
9558
|
-
console.log(e2);
|
|
9559
9586
|
}
|
|
9587
|
+
function toggleWarning(skip) {
|
|
9588
|
+
const { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } = fullClone;
|
|
9589
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
|
|
9590
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
const MARK = "__nutui_react_root__";
|
|
9560
9594
|
function legacyRender(node, container) {
|
|
9561
|
-
|
|
9595
|
+
reactRender(node, container);
|
|
9562
9596
|
}
|
|
9563
9597
|
function concurrentRender(node, container) {
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9598
|
+
toggleWarning(true);
|
|
9599
|
+
const root = container[MARK] || createRoot(container);
|
|
9600
|
+
toggleWarning(false);
|
|
9601
|
+
root.render(node);
|
|
9602
|
+
container[MARK] = root;
|
|
9568
9603
|
}
|
|
9569
9604
|
function render(node, container) {
|
|
9570
9605
|
if (createRoot) {
|
|
@@ -9573,6 +9608,22 @@
|
|
|
9573
9608
|
}
|
|
9574
9609
|
legacyRender(node, container);
|
|
9575
9610
|
}
|
|
9611
|
+
function legacyUnmount(container) {
|
|
9612
|
+
return unmountComponentAtNode(container);
|
|
9613
|
+
}
|
|
9614
|
+
async function concurrentUnmount(container) {
|
|
9615
|
+
return Promise.resolve().then(() => {
|
|
9616
|
+
var _a;
|
|
9617
|
+
(_a = container[MARK]) == null ? void 0 : _a.unmount();
|
|
9618
|
+
delete container[MARK];
|
|
9619
|
+
});
|
|
9620
|
+
}
|
|
9621
|
+
function unmount(container) {
|
|
9622
|
+
if (createRoot) {
|
|
9623
|
+
return concurrentUnmount(container);
|
|
9624
|
+
}
|
|
9625
|
+
return legacyUnmount(container);
|
|
9626
|
+
}
|
|
9576
9627
|
class Notification$1 extends React__namespace.PureComponent {
|
|
9577
9628
|
constructor(props) {
|
|
9578
9629
|
super(props);
|
|
@@ -9684,7 +9735,7 @@
|
|
|
9684
9735
|
callback({
|
|
9685
9736
|
component: instance,
|
|
9686
9737
|
destroy() {
|
|
9687
|
-
|
|
9738
|
+
unmount(element);
|
|
9688
9739
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
9689
9740
|
}
|
|
9690
9741
|
});
|
|
@@ -17598,19 +17649,18 @@
|
|
|
17598
17649
|
};
|
|
17599
17650
|
const startRollEasy = () => {
|
|
17600
17651
|
showhorseLamp();
|
|
17601
|
-
const
|
|
17602
|
-
|
|
17603
|
-
~~(height / speed / 4) * 1e3 + Number(standTime)
|
|
17604
|
-
);
|
|
17652
|
+
const time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1e3 : ~~(height / speed / 4) * 1e3;
|
|
17653
|
+
const timerCurr = setInterval(showhorseLamp, time + Number(standTime));
|
|
17605
17654
|
SetTimer(timerCurr);
|
|
17606
17655
|
};
|
|
17607
17656
|
const showhorseLamp = () => {
|
|
17608
17657
|
SetAnimate(true);
|
|
17658
|
+
const time = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) * 1e3 : ~~(height / speed / 4) * 1e3;
|
|
17609
17659
|
setTimeout(() => {
|
|
17610
17660
|
scrollList.current.push(scrollList.current[0]);
|
|
17611
17661
|
scrollList.current.shift();
|
|
17612
17662
|
SetAnimate(false);
|
|
17613
|
-
},
|
|
17663
|
+
}, time);
|
|
17614
17664
|
};
|
|
17615
17665
|
const startRoll = () => {
|
|
17616
17666
|
const timerCurr = setInterval(() => {
|
|
@@ -17670,10 +17720,11 @@
|
|
|
17670
17720
|
background,
|
|
17671
17721
|
height: direction === "vertical" ? `${height}px` : ""
|
|
17672
17722
|
};
|
|
17673
|
-
const duringTime = ~~(height / speed / 4);
|
|
17723
|
+
const duringTime = height / speed / 4 < 1 ? Number((height / speed / 4).toFixed(1)) : ~~(height / speed / 4);
|
|
17724
|
+
const noDuring = height / speed < 1 ? (height / speed).toFixed(1) : ~~(height / speed);
|
|
17674
17725
|
const horseLampStyle = {
|
|
17675
17726
|
transform: complexAm ? `translateY(${distance}px)` : "",
|
|
17676
|
-
transition: animate ? `all ${duringTime === 0 ?
|
|
17727
|
+
transition: animate ? `all ${duringTime === 0 ? noDuring : duringTime}s` : "",
|
|
17677
17728
|
marginTop: animate ? `-${height}px` : ""
|
|
17678
17729
|
};
|
|
17679
17730
|
const b2 = cn("noticebar");
|
|
@@ -17715,7 +17766,7 @@
|
|
|
17715
17766
|
fontClassName: iconFontClassName,
|
|
17716
17767
|
name: rightIcon || "close",
|
|
17717
17768
|
color
|
|
17718
|
-
})) : null) : null, showNoticeBar &&
|
|
17769
|
+
})) : null) : null, showNoticeBar && direction === "vertical" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17719
17770
|
className: "nut-noticebar-vertical",
|
|
17720
17771
|
style: barStyle,
|
|
17721
17772
|
onClick: handleClick2
|
|
@@ -19226,7 +19277,7 @@
|
|
|
19226
19277
|
rotate: 180
|
|
19227
19278
|
};
|
|
19228
19279
|
function areEqual(prevProps, nextProps) {
|
|
19229
|
-
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
19280
|
+
return prevProps.children === nextProps.children && JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
19230
19281
|
}
|
|
19231
19282
|
const Collapse = React.memo(
|
|
19232
19283
|
(props) => {
|
|
@@ -19352,10 +19403,6 @@
|
|
|
19352
19403
|
transform: "translateY(-50%)"
|
|
19353
19404
|
});
|
|
19354
19405
|
const colBem = cn("collapse-item");
|
|
19355
|
-
React.useEffect(() => {
|
|
19356
|
-
setCurrHeight("auto");
|
|
19357
|
-
setUpdate(!update2);
|
|
19358
|
-
}, [children]);
|
|
19359
19406
|
const measuredRef = React.useCallback(
|
|
19360
19407
|
(node) => {
|
|
19361
19408
|
if (node !== null) {
|
|
@@ -19373,6 +19420,14 @@
|
|
|
19373
19420
|
setIconStyle(newIconStyle);
|
|
19374
19421
|
}, 10);
|
|
19375
19422
|
}, [isOpen, domHeight, rotate]);
|
|
19423
|
+
React.useEffect(() => {
|
|
19424
|
+
if (!isOpen) {
|
|
19425
|
+
setCurrHeight("0px");
|
|
19426
|
+
} else {
|
|
19427
|
+
setCurrHeight("auto");
|
|
19428
|
+
}
|
|
19429
|
+
setUpdate(!update2);
|
|
19430
|
+
}, [children, isOpen]);
|
|
19376
19431
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
19377
19432
|
className: colBem(),
|
|
19378
19433
|
...rest
|
|
@@ -20349,6 +20404,7 @@
|
|
|
20349
20404
|
onClose
|
|
20350
20405
|
} = props;
|
|
20351
20406
|
const nutImagePreview = React.useRef(null);
|
|
20407
|
+
const [innerNo, setInnerNo] = React.useState(initNo);
|
|
20352
20408
|
const [showPop, setShowPop] = React.useState(false);
|
|
20353
20409
|
const [active, setActive] = React.useState(1);
|
|
20354
20410
|
const [maxNo, setMaxNo] = React.useState(1);
|
|
@@ -20429,14 +20485,14 @@
|
|
|
20429
20485
|
document.addEventListener("touchcancel", onTouchEnd);
|
|
20430
20486
|
};
|
|
20431
20487
|
React.useEffect(() => {
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
}, [show]);
|
|
20488
|
+
setShowPop(show);
|
|
20489
|
+
setInnerNo(initNo);
|
|
20490
|
+
setActive(initNo);
|
|
20491
|
+
init();
|
|
20492
|
+
}, [show, initNo]);
|
|
20437
20493
|
React.useEffect(() => {
|
|
20438
|
-
if (
|
|
20439
|
-
setActive(
|
|
20494
|
+
if (innerNo !== void 0) {
|
|
20495
|
+
setActive(innerNo);
|
|
20440
20496
|
}
|
|
20441
20497
|
if (show !== void 0) {
|
|
20442
20498
|
setShowPop(show);
|
|
@@ -20492,7 +20548,7 @@
|
|
|
20492
20548
|
style: { display: showPop ? "block" : "none" },
|
|
20493
20549
|
direction: "horizontal",
|
|
20494
20550
|
onChange: slideChangeEnd,
|
|
20495
|
-
initPage:
|
|
20551
|
+
initPage: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
|
|
20496
20552
|
paginationColor,
|
|
20497
20553
|
paginationVisible
|
|
20498
20554
|
}, (videos && videos.length > 0 ? videos.map((item, index) => {
|