@nutui/nutui-react 2.5.2 → 2.6.1
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 +29 -5
- package/dist/esm/CellGroup.js +1 -1
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Image.js +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +16 -20
- package/dist/esm/Indicator.js +25 -1
- package/dist/esm/SideNavBar.js +1 -1
- package/dist/esm/SubSideNavBar.js +1 -1
- package/dist/esm/Swiper/style/index.js +0 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Swiper.js +273 -306
- package/dist/esm/SwiperItem.js +6 -18
- package/dist/esm/context4.js +16 -2
- package/dist/esm/use-touch.js +13 -3
- 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 +405 -397
- package/dist/nutui.react.umd.js +405 -397
- package/dist/packages/form/form.scss +0 -3
- package/dist/packages/swiper/swiper.scss +30 -16
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/packages/input/input.taro.d.ts +1 -1
- package/dist/types/packages/swiper/effects/default.d.ts +11 -0
- package/dist/types/packages/swiper/effects/focus.d.ts +21 -0
- package/dist/types/packages/swiper/index.d.ts +4 -2
- package/dist/types/packages/swiper/swiper.d.ts +24 -43
- package/dist/types/packages/swiper/types.d.ts +6 -0
- package/dist/types/packages/swiperitem/swiperitem.d.ts +8 -4
- package/dist/types/utils/use-lock-fn.d.ts +2 -0
- package/dist/types/utils/use-ref-state.d.ts +3 -0
- package/dist/types/utils/use-touch.d.ts +3 -1
- package/package.json +1 -1
- package/dist/esm/context5.js +0 -19
- package/dist/esm/indicator2.js +0 -28
- package/dist/types/packages/picker/doc.en.d.ts +0 -145
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v2.
|
|
2
|
+
* @nutui/nutui-react v2.6.1 Fri Apr 19 2024 14:49:31 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2023 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1230,7 +1230,7 @@ const defaultProps$1t = {
|
|
|
1230
1230
|
};
|
|
1231
1231
|
const classPrefix$r = "nut-cell-group";
|
|
1232
1232
|
const CellGroup = (props) => {
|
|
1233
|
-
const { children, className,
|
|
1233
|
+
const { children, className, title, description, divider, ...rest } = {
|
|
1234
1234
|
...defaultProps$1t,
|
|
1235
1235
|
...props
|
|
1236
1236
|
};
|
|
@@ -2617,7 +2617,8 @@ const Image$1 = (props) => {
|
|
|
2617
2617
|
alt,
|
|
2618
2618
|
loading: "lazy",
|
|
2619
2619
|
onLoad: handleLoad,
|
|
2620
|
-
onError: handleError
|
|
2620
|
+
onError: handleError,
|
|
2621
|
+
draggable: props.draggable
|
|
2621
2622
|
}
|
|
2622
2623
|
) : /* @__PURE__ */ React__default.createElement(
|
|
2623
2624
|
"img",
|
|
@@ -2628,7 +2629,8 @@ const Image$1 = (props) => {
|
|
|
2628
2629
|
src,
|
|
2629
2630
|
alt,
|
|
2630
2631
|
onLoad: handleLoad,
|
|
2631
|
-
onError: handleError
|
|
2632
|
+
onError: handleError,
|
|
2633
|
+
draggable: props.draggable
|
|
2632
2634
|
}
|
|
2633
2635
|
),
|
|
2634
2636
|
renderLoading(),
|
|
@@ -4381,16 +4383,20 @@ function useTouch() {
|
|
|
4381
4383
|
const offsetX = useRef(0);
|
|
4382
4384
|
const offsetY = useRef(0);
|
|
4383
4385
|
const direction = useRef("");
|
|
4384
|
-
const
|
|
4386
|
+
const last = useRef(false);
|
|
4387
|
+
const velocity = useRef(0);
|
|
4388
|
+
const touchTime = useRef(Date.now());
|
|
4385
4389
|
const isVertical = () => direction.current === "vertical";
|
|
4386
4390
|
const isHorizontal = () => direction.current === "horizontal";
|
|
4387
4391
|
const reset = () => {
|
|
4388
|
-
touchTime.current =
|
|
4392
|
+
touchTime.current = Date.now();
|
|
4389
4393
|
deltaX.current = 0;
|
|
4390
4394
|
deltaY.current = 0;
|
|
4391
4395
|
offsetX.current = 0;
|
|
4392
4396
|
offsetY.current = 0;
|
|
4397
|
+
delta.current = 0;
|
|
4393
4398
|
direction.current = "";
|
|
4399
|
+
last.current = false;
|
|
4394
4400
|
};
|
|
4395
4401
|
const start2 = (event) => {
|
|
4396
4402
|
reset();
|
|
@@ -4409,7 +4415,12 @@ function useTouch() {
|
|
|
4409
4415
|
direction.current = getDirection(offsetX.current, offsetY.current);
|
|
4410
4416
|
}
|
|
4411
4417
|
};
|
|
4418
|
+
const end = (event) => {
|
|
4419
|
+
last.current = true;
|
|
4420
|
+
velocity.current = Math.sqrt(deltaX.current ** 2 + deltaY.current ** 2) / (Date.now() - touchTime.current);
|
|
4421
|
+
};
|
|
4412
4422
|
return {
|
|
4423
|
+
end,
|
|
4413
4424
|
move,
|
|
4414
4425
|
start: start2,
|
|
4415
4426
|
reset,
|
|
@@ -4423,7 +4434,8 @@ function useTouch() {
|
|
|
4423
4434
|
offsetY,
|
|
4424
4435
|
direction,
|
|
4425
4436
|
isVertical,
|
|
4426
|
-
isHorizontal
|
|
4437
|
+
isHorizontal,
|
|
4438
|
+
last
|
|
4427
4439
|
};
|
|
4428
4440
|
}
|
|
4429
4441
|
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
@@ -4628,7 +4640,7 @@ const Overlay = (props) => {
|
|
|
4628
4640
|
};
|
|
4629
4641
|
Overlay.defaultProps = defaultOverlayProps;
|
|
4630
4642
|
Overlay.displayName = "NutOverlay";
|
|
4631
|
-
const DataContext$
|
|
4643
|
+
const DataContext$1 = createContext({});
|
|
4632
4644
|
const defaultProps$1q = {
|
|
4633
4645
|
...ComponentDefaults,
|
|
4634
4646
|
span: "24",
|
|
@@ -4642,7 +4654,7 @@ const Col = (props) => {
|
|
|
4642
4654
|
};
|
|
4643
4655
|
const [colName, setColName] = useState("");
|
|
4644
4656
|
const [colStyle, setColStyle] = useState({});
|
|
4645
|
-
const { gutter } = useContext(DataContext$
|
|
4657
|
+
const { gutter } = useContext(DataContext$1);
|
|
4646
4658
|
const classs = () => {
|
|
4647
4659
|
const prefixCls2 = "nut-col";
|
|
4648
4660
|
return `${prefixCls2} ${prefixCls2}-${span} ${gutter ? `${prefixCls2}-gutter` : ""} ${prefixCls2}-offset-${offset}`;
|
|
@@ -4893,7 +4905,7 @@ const Row = (props) => {
|
|
|
4893
4905
|
const parentRow = {
|
|
4894
4906
|
gutter
|
|
4895
4907
|
};
|
|
4896
|
-
return /* @__PURE__ */ React__default.createElement(DataContext$
|
|
4908
|
+
return /* @__PURE__ */ React__default.createElement(DataContext$1.Provider, { value: parentRow }, React__default.createElement(
|
|
4897
4909
|
"div",
|
|
4898
4910
|
{
|
|
4899
4911
|
className: classNames(getClasses(), className),
|
|
@@ -22786,7 +22798,6 @@ const Video = (props) => {
|
|
|
22786
22798
|
};
|
|
22787
22799
|
Video.defaultProps = defaultProps$j;
|
|
22788
22800
|
Video.displayName = "NutVideo";
|
|
22789
|
-
const DataContext$1 = createContext({});
|
|
22790
22801
|
const defaultProps$i = {
|
|
22791
22802
|
total: 3,
|
|
22792
22803
|
current: 0,
|
|
@@ -22820,413 +22831,410 @@ const Indicator = (props) => {
|
|
|
22820
22831
|
};
|
|
22821
22832
|
Indicator.defaultProps = defaultProps$i;
|
|
22822
22833
|
Indicator.displayName = "NutIndicator";
|
|
22834
|
+
const getRefValue = (ref) => {
|
|
22835
|
+
return ref.current;
|
|
22836
|
+
};
|
|
22837
|
+
const useRefState = (param) => {
|
|
22838
|
+
const ref = useRef(param);
|
|
22839
|
+
const [, setState] = useState(param);
|
|
22840
|
+
const updateState = (p) => {
|
|
22841
|
+
ref.current = p;
|
|
22842
|
+
setState(p);
|
|
22843
|
+
};
|
|
22844
|
+
return [ref, updateState];
|
|
22845
|
+
};
|
|
22846
|
+
const getPerSlidePosition$1 = (index, position, loop2, count) => {
|
|
22847
|
+
const currentPosition = index * 100 + position;
|
|
22848
|
+
if (loop2) {
|
|
22849
|
+
const cycle = count * 100;
|
|
22850
|
+
const shift = cycle / 2;
|
|
22851
|
+
const nextPosition = (currentPosition + shift) % cycle;
|
|
22852
|
+
const shiftedPosition = (nextPosition < 0 ? nextPosition + cycle : nextPosition) - shift;
|
|
22853
|
+
return `${shiftedPosition}%`;
|
|
22854
|
+
}
|
|
22855
|
+
return `${currentPosition}%`;
|
|
22856
|
+
};
|
|
22857
|
+
const defaultEffect = (args) => {
|
|
22858
|
+
return React__default.Children.map(args.children, (child, index) => {
|
|
22859
|
+
const { isVertical, getSpringsAxis, loop: loop2, count } = args;
|
|
22860
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
22861
|
+
animated.div,
|
|
22862
|
+
{
|
|
22863
|
+
className: "nut-swiper-slide",
|
|
22864
|
+
style: {
|
|
22865
|
+
[isVertical ? "y" : "x"]: getSpringsAxis().to((position) => {
|
|
22866
|
+
return getPerSlidePosition$1(index, position, loop2, count);
|
|
22867
|
+
}),
|
|
22868
|
+
[isVertical ? "top" : "left"]: `-${index * 100}%`
|
|
22869
|
+
}
|
|
22870
|
+
},
|
|
22871
|
+
child
|
|
22872
|
+
);
|
|
22873
|
+
});
|
|
22874
|
+
};
|
|
22875
|
+
const getPerSlidePosition = (index, position, loop2, count) => {
|
|
22876
|
+
const currentPosition = index * 100 + position;
|
|
22877
|
+
if (loop2) {
|
|
22878
|
+
const cycle = count * 100;
|
|
22879
|
+
const shift = cycle / 2;
|
|
22880
|
+
const nextPosition = (currentPosition + shift) % cycle;
|
|
22881
|
+
const shiftedPosition = (nextPosition < 0 ? nextPosition + cycle : nextPosition) - shift;
|
|
22882
|
+
return `${shiftedPosition}%`;
|
|
22883
|
+
}
|
|
22884
|
+
return `${currentPosition}%`;
|
|
22885
|
+
};
|
|
22886
|
+
const focusEffect = (args) => {
|
|
22887
|
+
return React__default.Children.map(args.children, (child, index) => {
|
|
22888
|
+
const {
|
|
22889
|
+
isVertical,
|
|
22890
|
+
springs,
|
|
22891
|
+
transforms,
|
|
22892
|
+
loop: loop2,
|
|
22893
|
+
count,
|
|
22894
|
+
swiperDirection,
|
|
22895
|
+
dragging,
|
|
22896
|
+
current,
|
|
22897
|
+
effect
|
|
22898
|
+
} = args;
|
|
22899
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
22900
|
+
animated.div,
|
|
22901
|
+
{
|
|
22902
|
+
className: "nut-swiper-slide",
|
|
22903
|
+
style: {
|
|
22904
|
+
[isVertical ? "y" : "x"]: springs[isVertical ? "y" : "x"].to(
|
|
22905
|
+
(position) => {
|
|
22906
|
+
return getPerSlidePosition(index, position, loop2, count);
|
|
22907
|
+
}
|
|
22908
|
+
),
|
|
22909
|
+
[isVertical ? "top" : "left"]: `-${index * 100}%`,
|
|
22910
|
+
scale: springs.s.to((ss) => {
|
|
22911
|
+
const scales = getRefValue(transforms);
|
|
22912
|
+
if (!scales)
|
|
22913
|
+
return 1;
|
|
22914
|
+
const scale = scales[index];
|
|
22915
|
+
const currentRefValue = getRefValue(current);
|
|
22916
|
+
if (dragging === false)
|
|
22917
|
+
ss = 0;
|
|
22918
|
+
const ps = ss * scale;
|
|
22919
|
+
if (index === currentRefValue) {
|
|
22920
|
+
return Math.max(scale - ps, effect.scale);
|
|
22921
|
+
}
|
|
22922
|
+
if (index === currentRefValue + swiperDirection.current) {
|
|
22923
|
+
return Math.min(scale + ps, 1);
|
|
22924
|
+
}
|
|
22925
|
+
return scale;
|
|
22926
|
+
})
|
|
22927
|
+
}
|
|
22928
|
+
},
|
|
22929
|
+
child
|
|
22930
|
+
);
|
|
22931
|
+
});
|
|
22932
|
+
};
|
|
22933
|
+
const useList = (effect, count, current) => {
|
|
22934
|
+
const [transforms, setTransforms] = useRefState([]);
|
|
22935
|
+
useEffect(() => {
|
|
22936
|
+
setTransforms(
|
|
22937
|
+
Array.from({ length: count }).fill(1).map(
|
|
22938
|
+
(scale, index) => index !== getRefValue(current) ? scale * (effect ? effect.scale : 1) : scale
|
|
22939
|
+
)
|
|
22940
|
+
);
|
|
22941
|
+
}, [count]);
|
|
22942
|
+
return [transforms, setTransforms];
|
|
22943
|
+
};
|
|
22944
|
+
const updateTransform = (transforms, setTransforms, effect, page) => {
|
|
22945
|
+
setTransforms(
|
|
22946
|
+
getRefValue(transforms).map(
|
|
22947
|
+
(s, index) => (
|
|
22948
|
+
// eslint-disable-next-line no-nested-ternary
|
|
22949
|
+
page === index ? 1 : effect ? effect.scale : 1
|
|
22950
|
+
)
|
|
22951
|
+
)
|
|
22952
|
+
);
|
|
22953
|
+
};
|
|
22823
22954
|
const defaultProps$h = {
|
|
22824
|
-
duration: 500,
|
|
22825
|
-
defaultValue: 0,
|
|
22826
|
-
autoPlay: 0,
|
|
22827
22955
|
direction: "horizontal",
|
|
22828
22956
|
indicator: false,
|
|
22829
22957
|
loop: false,
|
|
22958
|
+
duration: 3e3,
|
|
22959
|
+
autoPlay: false,
|
|
22960
|
+
defaultValue: 0,
|
|
22830
22961
|
touchable: true,
|
|
22831
|
-
|
|
22832
|
-
stopPropagation: true,
|
|
22833
|
-
center: false,
|
|
22834
|
-
className: ""
|
|
22962
|
+
effect: void 0
|
|
22835
22963
|
};
|
|
22836
|
-
const Swiper = React__default.forwardRef(
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22851
|
-
...
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
autoplayTimer: null,
|
|
22858
|
-
width: 0,
|
|
22859
|
-
height: 0,
|
|
22860
|
-
offset: 0,
|
|
22861
|
-
size: 0
|
|
22862
|
-
});
|
|
22863
|
-
const touch = useTouch();
|
|
22864
|
-
const isVertical = direction === "vertical";
|
|
22865
|
-
const [rect, setRect] = useState(null);
|
|
22866
|
-
let [active, setActive] = useState(0);
|
|
22867
|
-
const [width, setWidth] = useState(0);
|
|
22868
|
-
const [height, setHeight] = useState(0);
|
|
22869
|
-
const [offset, setOffset] = useState(0);
|
|
22870
|
-
const [childOffset, setChildOffset] = useState([]);
|
|
22871
|
-
const [ready, setReady] = useState(false);
|
|
22872
|
-
let size = isVertical ? height : width;
|
|
22873
|
-
const { swiperItems, swiperItemCount } = useMemo$1(() => {
|
|
22874
|
-
let count = 0;
|
|
22875
|
-
const swiperItems2 = React__default.Children.map(props.children, (child) => {
|
|
22876
|
-
if (!React__default.isValidElement(child))
|
|
22877
|
-
return null;
|
|
22878
|
-
count++;
|
|
22879
|
-
return child;
|
|
22880
|
-
});
|
|
22881
|
-
return {
|
|
22882
|
-
swiperItems: swiperItems2,
|
|
22883
|
-
swiperItemCount: count
|
|
22884
|
-
};
|
|
22885
|
-
}, [props.children]);
|
|
22886
|
-
let trackSize = swiperItemCount * Number(size);
|
|
22887
|
-
const parent = {
|
|
22888
|
-
propSwiper: mergedProps,
|
|
22889
|
-
size
|
|
22890
|
-
};
|
|
22891
|
-
const minOffset = (() => {
|
|
22892
|
-
if (rect) {
|
|
22893
|
-
const base = isVertical ? rect.height : rect.width;
|
|
22894
|
-
return base - Number(size) * swiperItemCount;
|
|
22895
|
-
}
|
|
22896
|
-
return 0;
|
|
22897
|
-
})();
|
|
22898
|
-
const stopAutoPlay = () => {
|
|
22899
|
-
clearTimeout(swiperRef.current.autoplayTimer);
|
|
22900
|
-
swiperRef.current.autoplayTimer = null;
|
|
22901
|
-
};
|
|
22902
|
-
const startPlay = () => {
|
|
22903
|
-
if (Number(mergedProps.autoPlay) <= 0 || swiperItemCount <= 1)
|
|
22904
|
-
return;
|
|
22905
|
-
stopAutoPlay();
|
|
22906
|
-
swiperRef.current.autoplayTimer = setTimeout(() => {
|
|
22907
|
-
next();
|
|
22908
|
-
startPlay();
|
|
22909
|
-
}, Number(mergedProps.autoPlay));
|
|
22910
|
-
};
|
|
22911
|
-
const resetPosition = () => {
|
|
22912
|
-
swiperRef.current.moving = true;
|
|
22913
|
-
if (active <= -1) {
|
|
22914
|
-
move({ pace: swiperItemCount });
|
|
22915
|
-
}
|
|
22916
|
-
if (active >= swiperItemCount) {
|
|
22917
|
-
move({ pace: -swiperItemCount });
|
|
22918
|
-
}
|
|
22919
|
-
};
|
|
22920
|
-
const prev = () => {
|
|
22921
|
-
resetPosition();
|
|
22922
|
-
touch.reset();
|
|
22923
|
-
requestAniFrame$1(() => {
|
|
22924
|
-
requestAniFrame$1(() => {
|
|
22925
|
-
swiperRef.current.moving = false;
|
|
22926
|
-
move({
|
|
22927
|
-
pace: -1,
|
|
22928
|
-
isEmit: true
|
|
22929
|
-
});
|
|
22930
|
-
});
|
|
22931
|
-
});
|
|
22932
|
-
};
|
|
22933
|
-
const next = () => {
|
|
22934
|
-
resetPosition();
|
|
22935
|
-
touch.reset();
|
|
22936
|
-
requestAniFrame$1(() => {
|
|
22937
|
-
requestAniFrame$1(() => {
|
|
22938
|
-
swiperRef.current.moving = false;
|
|
22939
|
-
move({
|
|
22940
|
-
pace: 1,
|
|
22941
|
-
isEmit: true
|
|
22942
|
-
});
|
|
22943
|
-
});
|
|
22944
|
-
});
|
|
22945
|
-
};
|
|
22946
|
-
const to2 = (index) => {
|
|
22947
|
-
resetPosition();
|
|
22948
|
-
touch.reset();
|
|
22949
|
-
requestAniFrame$1(() => {
|
|
22950
|
-
requestAniFrame$1(() => {
|
|
22951
|
-
swiperRef.current.moving = false;
|
|
22952
|
-
let targetIndex;
|
|
22953
|
-
if (props.loop && swiperItemCount === index) {
|
|
22954
|
-
targetIndex = active === 0 ? 0 : index;
|
|
22955
|
-
} else {
|
|
22956
|
-
targetIndex = index % swiperItemCount;
|
|
22957
|
-
}
|
|
22958
|
-
move({
|
|
22959
|
-
pace: targetIndex - active,
|
|
22960
|
-
isEmit: true
|
|
22961
|
-
});
|
|
22964
|
+
const Swiper = React__default.forwardRef(
|
|
22965
|
+
(props, ref) => {
|
|
22966
|
+
const classPrefix2 = "nut-swiper";
|
|
22967
|
+
const {
|
|
22968
|
+
children,
|
|
22969
|
+
direction,
|
|
22970
|
+
indicator,
|
|
22971
|
+
loop: loop2,
|
|
22972
|
+
effect,
|
|
22973
|
+
autoPlay,
|
|
22974
|
+
touchable,
|
|
22975
|
+
defaultValue,
|
|
22976
|
+
duration,
|
|
22977
|
+
style,
|
|
22978
|
+
className
|
|
22979
|
+
} = { ...defaultProps$h, ...props };
|
|
22980
|
+
const isVertical = direction === "vertical";
|
|
22981
|
+
const count = useMemo$1(() => {
|
|
22982
|
+
let c6 = 0;
|
|
22983
|
+
React__default.Children.map(children, (child, index) => {
|
|
22984
|
+
c6 += 1;
|
|
22962
22985
|
});
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
movingStatus = false
|
|
22973
|
-
}) => {
|
|
22974
|
-
var _a;
|
|
22975
|
-
if (swiperItemCount <= 1)
|
|
22976
|
-
return;
|
|
22977
|
-
const targetActive = getActive(pace);
|
|
22978
|
-
const targetOffset = getOffset(targetActive, offset2);
|
|
22979
|
-
if (props.loop) {
|
|
22980
|
-
if (Array.isArray(children) && children[0] && targetOffset !== minOffset) {
|
|
22981
|
-
const rightBound = targetOffset < minOffset;
|
|
22982
|
-
childOffset[0] = rightBound ? trackSize : 0;
|
|
22986
|
+
return c6;
|
|
22987
|
+
}, [children]);
|
|
22988
|
+
const getSlideSize = () => {
|
|
22989
|
+
if (props.slideSize)
|
|
22990
|
+
return props.slideSize;
|
|
22991
|
+
if (stageRef.current) {
|
|
22992
|
+
if (isVertical)
|
|
22993
|
+
return stageRef.current.offsetHeight;
|
|
22994
|
+
return stageRef.current.offsetWidth;
|
|
22983
22995
|
}
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
(_a = props.onChange) == null ? void 0 : _a.call(props, (targetActive + swiperItemCount) % swiperItemCount);
|
|
22992
|
-
}
|
|
22993
|
-
active = targetActive;
|
|
22994
|
-
setActive(targetActive);
|
|
22995
|
-
setOffset(targetOffset);
|
|
22996
|
-
getStyle(targetOffset);
|
|
22997
|
-
};
|
|
22998
|
-
React__default.useImperativeHandle(ref, () => ({
|
|
22999
|
-
to: to2,
|
|
23000
|
-
next,
|
|
23001
|
-
prev,
|
|
23002
|
-
resize
|
|
23003
|
-
}));
|
|
23004
|
-
const getActive = (pace) => {
|
|
23005
|
-
if (pace) {
|
|
23006
|
-
const _active = active + pace;
|
|
23007
|
-
if (props.loop) {
|
|
23008
|
-
return range3(_active, -1, swiperItemCount);
|
|
22996
|
+
return 0;
|
|
22997
|
+
};
|
|
22998
|
+
const getSwiperSize = () => {
|
|
22999
|
+
if (swiperRef.current) {
|
|
23000
|
+
if (isVertical)
|
|
23001
|
+
return swiperRef.current.offsetHeight;
|
|
23002
|
+
return swiperRef.current.offsetWidth;
|
|
23009
23003
|
}
|
|
23010
|
-
return
|
|
23011
|
-
}
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
let currentPosition = active2 * Number(size);
|
|
23016
|
-
if (!props.loop) {
|
|
23017
|
-
currentPosition = Math.min(currentPosition, -minOffset);
|
|
23018
|
-
}
|
|
23019
|
-
let targetOffset = offset2 - currentPosition;
|
|
23020
|
-
if (!props.loop) {
|
|
23021
|
-
targetOffset = range3(targetOffset, minOffset, 0);
|
|
23022
|
-
}
|
|
23023
|
-
return targetOffset;
|
|
23024
|
-
};
|
|
23025
|
-
const range3 = (num, min, max) => {
|
|
23026
|
-
return Math.min(Math.max(num, min), max);
|
|
23027
|
-
};
|
|
23028
|
-
const classPrefix2 = "nut-swiper";
|
|
23029
|
-
const contentClass = classNames({
|
|
23030
|
-
[`${classPrefix2}-inner`]: true,
|
|
23031
|
-
[`${classPrefix2}-vertical`]: isVertical
|
|
23032
|
-
});
|
|
23033
|
-
const getStyle = (moveOffset = offset) => {
|
|
23034
|
-
const target = innerRef.current;
|
|
23035
|
-
if (!target)
|
|
23036
|
-
return;
|
|
23037
|
-
let _offset = 0;
|
|
23038
|
-
if (!center) {
|
|
23039
|
-
_offset = moveOffset;
|
|
23040
|
-
} else {
|
|
23041
|
-
const _size = isVertical ? height : width;
|
|
23042
|
-
const val = isVertical ? rect.height - _size : rect.width - _size;
|
|
23043
|
-
_offset = moveOffset + (active === swiperItemCount - 1 && !props.loop ? -val / 2 : val / 2);
|
|
23044
|
-
}
|
|
23045
|
-
target.style.transitionDuration = `${swiperRef.current.moving ? 0 : props.duration}ms`;
|
|
23046
|
-
target.style[isVertical ? "height" : "width"] = `${Number(size) * swiperItemCount}px`;
|
|
23047
|
-
target.style[isVertical ? "width" : "height"] = `${isVertical ? width : height}px`;
|
|
23048
|
-
target.style.transform = `translate3D${!isVertical ? `(${rtl ? -_offset : _offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
23049
|
-
};
|
|
23050
|
-
const onTouchStart = (e2) => {
|
|
23051
|
-
if (!props.touchable)
|
|
23052
|
-
return;
|
|
23053
|
-
touch.start(e2);
|
|
23054
|
-
stopAutoPlay();
|
|
23055
|
-
resetPosition();
|
|
23056
|
-
};
|
|
23057
|
-
const onTouchMove = (e2) => {
|
|
23058
|
-
if (props.preventDefault)
|
|
23059
|
-
e2.preventDefault();
|
|
23060
|
-
if (props.stopPropagation)
|
|
23061
|
-
e2.stopPropagation();
|
|
23062
|
-
if (props.touchable && swiperRef.current.moving) {
|
|
23063
|
-
touch.move(e2);
|
|
23064
|
-
if (touch.direction.current === props.direction) {
|
|
23065
|
-
move({
|
|
23066
|
-
offset: touch.delta.current
|
|
23067
|
-
});
|
|
23004
|
+
return 0;
|
|
23005
|
+
};
|
|
23006
|
+
const bound2 = (v, min, max) => {
|
|
23007
|
+
if (min !== void 0) {
|
|
23008
|
+
v = Math.max(v, min);
|
|
23068
23009
|
}
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
const onTouchEnd = (e2) => {
|
|
23072
|
-
if (!props.touchable || !swiperRef.current.moving)
|
|
23073
|
-
return;
|
|
23074
|
-
const speed = touch.delta.current / (Date.now() - touch.touchTime.current);
|
|
23075
|
-
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(touch.delta.current) > Number((size / 2).toFixed(2));
|
|
23076
|
-
swiperRef.current.moving = false;
|
|
23077
|
-
if (isShouldMove && touch.direction.current === props.direction) {
|
|
23078
|
-
let pace = 0;
|
|
23079
|
-
const offset2 = touch.isVertical() ? touch.offsetY : touch.offsetX;
|
|
23080
|
-
if (props.loop) {
|
|
23081
|
-
if (offset2.current > 0) {
|
|
23082
|
-
pace = touch.delta.current > 0 ? -1 : 1;
|
|
23083
|
-
}
|
|
23084
|
-
} else {
|
|
23085
|
-
pace = -Math[touch.delta.current > 0 ? "ceil" : "floor"](
|
|
23086
|
-
touch.delta.current / size
|
|
23087
|
-
);
|
|
23010
|
+
if (max !== void 0) {
|
|
23011
|
+
v = Math.min(v, max);
|
|
23088
23012
|
}
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23013
|
+
return v;
|
|
23014
|
+
};
|
|
23015
|
+
const timeoutRef = useRef(null);
|
|
23016
|
+
const [dragging, setDragging] = useState(false);
|
|
23017
|
+
const [current, setCurrent] = useRefState(defaultValue);
|
|
23018
|
+
const stageRef = useRef(null);
|
|
23019
|
+
const swiperRef = useRef(null);
|
|
23020
|
+
const [springs, api] = useSpring(() => ({
|
|
23021
|
+
x: !isVertical ? current.current * 100 * -1 : 0,
|
|
23022
|
+
y: isVertical ? current.current * 100 * -1 : 0,
|
|
23023
|
+
s: 0,
|
|
23024
|
+
reset: () => {
|
|
23025
|
+
},
|
|
23026
|
+
config: { tension: 200, friction: 30 }
|
|
23027
|
+
}));
|
|
23028
|
+
useEffect(() => {
|
|
23029
|
+
api.start({
|
|
23030
|
+
[isVertical ? "y" : "x"]: boundIndex(current.current) * -1 * 100,
|
|
23031
|
+
immediate: true
|
|
23092
23032
|
});
|
|
23093
|
-
}
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
}
|
|
23126
|
-
setRect(rect2);
|
|
23127
|
-
setActive(currentIndex);
|
|
23128
|
-
setWidth(width2);
|
|
23129
|
-
setHeight(height2);
|
|
23130
|
-
setOffset(targetOffset);
|
|
23131
|
-
setReady(true);
|
|
23132
|
-
};
|
|
23133
|
-
useEffect(() => {
|
|
23134
|
-
if (ready) {
|
|
23135
|
-
getStyle();
|
|
23136
|
-
}
|
|
23137
|
-
}, [isVertical, width, height, offset, ready]);
|
|
23138
|
-
useEffect(() => {
|
|
23139
|
-
if (ready) {
|
|
23140
|
-
stopAutoPlay();
|
|
23141
|
-
startPlay();
|
|
23142
|
-
}
|
|
23143
|
-
return () => setReady(false);
|
|
23144
|
-
}, [ready]);
|
|
23145
|
-
useEffect(() => {
|
|
23146
|
-
const events = [
|
|
23147
|
-
{ name: "touchstart", e: onTouchStart },
|
|
23148
|
-
{ name: "touchmove", e: onTouchMove },
|
|
23149
|
-
{ name: "touchend", e: onTouchEnd }
|
|
23150
|
-
];
|
|
23151
|
-
events.forEach((item) => {
|
|
23033
|
+
}, [swiperRef.current]);
|
|
23034
|
+
const swiperDirection = useRef(1);
|
|
23035
|
+
const [transforms, setTransforms] = useList(effect, count, current);
|
|
23036
|
+
const runTimeSwiper = () => {
|
|
23037
|
+
const durationNumber = typeof duration === "string" ? parseInt(duration) : duration;
|
|
23038
|
+
const d = typeof autoPlay === "number" ? autoPlay : durationNumber;
|
|
23039
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
23040
|
+
next();
|
|
23041
|
+
runTimeSwiper();
|
|
23042
|
+
}, d);
|
|
23043
|
+
};
|
|
23044
|
+
useEffect(() => {
|
|
23045
|
+
if (!autoPlay || dragging)
|
|
23046
|
+
return;
|
|
23047
|
+
runTimeSwiper();
|
|
23048
|
+
return () => {
|
|
23049
|
+
if (timeoutRef.current)
|
|
23050
|
+
window.clearTimeout(timeoutRef.current);
|
|
23051
|
+
};
|
|
23052
|
+
}, [autoPlay, duration, dragging, count]);
|
|
23053
|
+
function boundIndex(current2) {
|
|
23054
|
+
const min = 0;
|
|
23055
|
+
const max = count - 1;
|
|
23056
|
+
if (current2 === max && !loop2 && props.slideSize) {
|
|
23057
|
+
const slideSize = props.slideSize;
|
|
23058
|
+
const swiperSize = getSwiperSize();
|
|
23059
|
+
const ratio = (swiperSize - slideSize) / slideSize;
|
|
23060
|
+
return bound2(current2, min, max - ratio);
|
|
23061
|
+
}
|
|
23062
|
+
return current2;
|
|
23063
|
+
}
|
|
23064
|
+
const to2 = (index, immediate = false) => {
|
|
23152
23065
|
var _a;
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23066
|
+
let targetIndex = bound2(index, 0, count - 1);
|
|
23067
|
+
if (loop2) {
|
|
23068
|
+
const cycleIndex = index % count;
|
|
23069
|
+
targetIndex = cycleIndex < 0 ? cycleIndex + count : cycleIndex;
|
|
23070
|
+
}
|
|
23071
|
+
setCurrent(targetIndex);
|
|
23072
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, targetIndex);
|
|
23073
|
+
if (effect) {
|
|
23074
|
+
updateTransform(transforms, setTransforms, effect, targetIndex);
|
|
23075
|
+
}
|
|
23076
|
+
api.start({
|
|
23077
|
+
// 这里需要统一成百分比
|
|
23078
|
+
[isVertical ? "y" : "x"]: (loop2 ? -index : boundIndex(targetIndex) * -1) * 100,
|
|
23079
|
+
s: 0,
|
|
23080
|
+
immediate
|
|
23159
23081
|
});
|
|
23160
23082
|
};
|
|
23161
|
-
|
|
23162
|
-
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
|
|
23170
|
-
|
|
23171
|
-
|
|
23172
|
-
|
|
23173
|
-
|
|
23174
|
-
|
|
23175
|
-
|
|
23176
|
-
|
|
23177
|
-
|
|
23083
|
+
const getSpringsAxis = () => {
|
|
23084
|
+
return springs[isVertical ? "y" : "x"];
|
|
23085
|
+
};
|
|
23086
|
+
const next = () => {
|
|
23087
|
+
to2(Math.round(-getSpringsAxis().get() / 100) + 1);
|
|
23088
|
+
};
|
|
23089
|
+
const prev = () => {
|
|
23090
|
+
to2(Math.round(-getSpringsAxis().get() / 100) - 1);
|
|
23091
|
+
};
|
|
23092
|
+
React__default.useImperativeHandle(ref, () => ({
|
|
23093
|
+
to: to2,
|
|
23094
|
+
next,
|
|
23095
|
+
prev
|
|
23096
|
+
}));
|
|
23097
|
+
const bind = useDrag(
|
|
23098
|
+
(state) => {
|
|
23099
|
+
const axis = Number(isVertical);
|
|
23100
|
+
const slideSize = getSlideSize();
|
|
23101
|
+
const offset = state.offset[axis];
|
|
23102
|
+
setDragging(!!state.dragging);
|
|
23103
|
+
const distance = state.distance[axis];
|
|
23104
|
+
swiperDirection.current = state.direction[axis];
|
|
23105
|
+
if (state.last) {
|
|
23106
|
+
const swipeDirection = state.direction[axis];
|
|
23107
|
+
const velocity = state.velocity[axis];
|
|
23108
|
+
const minIndex = Math.floor(offset / slideSize);
|
|
23109
|
+
const maxIndex = minIndex + 1;
|
|
23110
|
+
const index = Math.round(
|
|
23111
|
+
(offset + velocity * 2e3 * swipeDirection) / slideSize
|
|
23112
|
+
);
|
|
23113
|
+
to2(bound2(index, minIndex, maxIndex));
|
|
23114
|
+
} else {
|
|
23115
|
+
api.start({
|
|
23116
|
+
[isVertical ? "y" : "x"]: -(offset / slideSize * 100),
|
|
23117
|
+
s: distance / slideSize,
|
|
23118
|
+
immediate: true
|
|
23119
|
+
});
|
|
23120
|
+
}
|
|
23178
23121
|
},
|
|
23179
|
-
|
|
23180
|
-
|
|
23181
|
-
|
|
23182
|
-
|
|
23183
|
-
|
|
23184
|
-
|
|
23122
|
+
{
|
|
23123
|
+
enabled: touchable,
|
|
23124
|
+
transform: ([x, y]) => [-x, -y],
|
|
23125
|
+
from: () => {
|
|
23126
|
+
const slideSize = getSlideSize();
|
|
23127
|
+
const x = springs.x.get() / 100 * slideSize;
|
|
23128
|
+
const y = springs.y.get() / 100 * slideSize;
|
|
23129
|
+
return [-x, -y];
|
|
23130
|
+
},
|
|
23131
|
+
triggerAllEvents: true,
|
|
23132
|
+
bounds: () => {
|
|
23133
|
+
if (loop2)
|
|
23134
|
+
return {};
|
|
23135
|
+
const slideSize = getSlideSize();
|
|
23136
|
+
getSwiperSize();
|
|
23137
|
+
if (isVertical) {
|
|
23138
|
+
return { top: 0, bottom: (count - 1) * slideSize };
|
|
23139
|
+
}
|
|
23140
|
+
return { left: 0, right: (count - 1) * slideSize };
|
|
23141
|
+
},
|
|
23142
|
+
preventDefault: true,
|
|
23143
|
+
rubberband: true,
|
|
23144
|
+
axis: isVertical ? "y" : "x",
|
|
23145
|
+
pointer: {
|
|
23146
|
+
touch: true
|
|
23185
23147
|
}
|
|
23186
|
-
|
|
23148
|
+
}
|
|
23187
23149
|
);
|
|
23188
|
-
|
|
23189
|
-
|
|
23190
|
-
|
|
23191
|
-
|
|
23192
|
-
|
|
23193
|
-
|
|
23194
|
-
|
|
23195
|
-
|
|
23196
|
-
|
|
23150
|
+
const renderIndicator = () => {
|
|
23151
|
+
if (React__default.isValidElement(indicator))
|
|
23152
|
+
return indicator;
|
|
23153
|
+
if (!indicator)
|
|
23154
|
+
return null;
|
|
23155
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
23156
|
+
"div",
|
|
23157
|
+
{
|
|
23158
|
+
className: classNames({
|
|
23159
|
+
[`${classPrefix2}-indicator`]: true,
|
|
23160
|
+
[`${classPrefix2}-indicator-vertical`]: isVertical,
|
|
23161
|
+
[`${classPrefix2}-indicator-horizontal`]: !isVertical
|
|
23162
|
+
})
|
|
23163
|
+
},
|
|
23164
|
+
/* @__PURE__ */ React__default.createElement(
|
|
23165
|
+
Indicator,
|
|
23166
|
+
{
|
|
23167
|
+
current: getRefValue(current),
|
|
23168
|
+
total: count,
|
|
23169
|
+
direction
|
|
23170
|
+
}
|
|
23171
|
+
)
|
|
23172
|
+
);
|
|
23173
|
+
};
|
|
23174
|
+
const renderEffect = () => {
|
|
23175
|
+
if (!effect)
|
|
23176
|
+
return defaultEffect({
|
|
23177
|
+
children,
|
|
23178
|
+
getSpringsAxis,
|
|
23179
|
+
loop: loop2,
|
|
23180
|
+
count,
|
|
23181
|
+
isVertical
|
|
23182
|
+
});
|
|
23183
|
+
if (effect && effect.name === "focus") {
|
|
23184
|
+
return focusEffect({
|
|
23185
|
+
children,
|
|
23186
|
+
springs,
|
|
23187
|
+
loop: loop2,
|
|
23188
|
+
count,
|
|
23189
|
+
isVertical,
|
|
23190
|
+
effect,
|
|
23191
|
+
current,
|
|
23192
|
+
swiperDirection,
|
|
23193
|
+
dragging,
|
|
23194
|
+
transforms
|
|
23195
|
+
});
|
|
23196
|
+
}
|
|
23197
|
+
};
|
|
23198
|
+
const renderSlides = () => {
|
|
23199
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
23200
|
+
"div",
|
|
23201
|
+
{
|
|
23202
|
+
ref: stageRef,
|
|
23203
|
+
className: classNames("nut-swiper-inner", {
|
|
23204
|
+
"nut-swiper-inner-vertical": isVertical,
|
|
23205
|
+
"nut-swiper-inner-horizontal": !isVertical
|
|
23206
|
+
}),
|
|
23207
|
+
style: {
|
|
23208
|
+
...props.slideSize ? { [isVertical ? "height" : "width"]: `${props.slideSize}px` } : {}
|
|
23209
|
+
}
|
|
23210
|
+
},
|
|
23211
|
+
renderEffect()
|
|
23212
|
+
);
|
|
23213
|
+
};
|
|
23214
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
23197
23215
|
"div",
|
|
23198
23216
|
{
|
|
23199
|
-
className:
|
|
23200
|
-
style
|
|
23201
|
-
|
|
23217
|
+
className: classNames("nut-swiper", className),
|
|
23218
|
+
style,
|
|
23219
|
+
ref: swiperRef,
|
|
23220
|
+
...bind()
|
|
23202
23221
|
},
|
|
23203
|
-
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23222
|
+
renderSlides(),
|
|
23223
|
+
renderIndicator()
|
|
23224
|
+
);
|
|
23225
|
+
}
|
|
23226
|
+
);
|
|
23208
23227
|
Swiper.defaultProps = defaultProps$h;
|
|
23209
23228
|
Swiper.displayName = "NutSwiper";
|
|
23210
23229
|
const defaultProps$g = {
|
|
23211
|
-
|
|
23230
|
+
onClick: (e2) => void 0
|
|
23212
23231
|
};
|
|
23213
|
-
const SwiperItem =
|
|
23232
|
+
const SwiperItem = (props) => {
|
|
23214
23233
|
const classPrefix2 = "nut-swiper-item";
|
|
23215
|
-
const
|
|
23216
|
-
const { className, style, children, direction, size } = _props;
|
|
23217
|
-
const parent = useContext(DataContext$1);
|
|
23234
|
+
const { className, style, children } = { ...defaultProps$g, ...props };
|
|
23218
23235
|
const classes = classNames(classPrefix2, className);
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
const _direction = (parent == null ? void 0 : parent.propSwiper.direction) || direction;
|
|
23222
|
-
const _size = (parent == null ? void 0 : parent.size) || size;
|
|
23223
|
-
if (_size) {
|
|
23224
|
-
style2[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
23225
|
-
}
|
|
23226
|
-
return style2;
|
|
23227
|
-
};
|
|
23228
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classes, style: { ...style, ...getStyle() } }, children);
|
|
23229
|
-
});
|
|
23236
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classes, onClick: props.onClick, style }, children);
|
|
23237
|
+
};
|
|
23230
23238
|
SwiperItem.defaultProps = defaultProps$g;
|
|
23231
23239
|
SwiperItem.displayName = "NutSwiperItem";
|
|
23232
23240
|
const InnerSwiper = Swiper;
|
|
@@ -23402,6 +23410,7 @@ const ImagePreview = (props) => {
|
|
|
23402
23410
|
onCloseInner();
|
|
23403
23411
|
}
|
|
23404
23412
|
};
|
|
23413
|
+
const duration = typeof autoPlay === "string" ? parseInt(autoPlay) : autoPlay;
|
|
23405
23414
|
return /* @__PURE__ */ React__default.createElement(
|
|
23406
23415
|
Popup,
|
|
23407
23416
|
{
|
|
@@ -23419,15 +23428,14 @@ const ImagePreview = (props) => {
|
|
|
23419
23428
|
onClick: closeOnImg,
|
|
23420
23429
|
onTouchStart
|
|
23421
23430
|
},
|
|
23422
|
-
/* @__PURE__ */ React__default.createElement(
|
|
23431
|
+
showPop ? /* @__PURE__ */ React__default.createElement(
|
|
23423
23432
|
InnerSwiper,
|
|
23424
23433
|
{
|
|
23425
|
-
autoPlay,
|
|
23434
|
+
autoPlay: !!duration,
|
|
23435
|
+
duration,
|
|
23426
23436
|
className: `${classPrefix2}-swiper`,
|
|
23427
23437
|
loop: true,
|
|
23428
|
-
preventDefault: false,
|
|
23429
23438
|
style: {
|
|
23430
|
-
display: showPop ? "block" : "none",
|
|
23431
23439
|
"--nutui-indicator-color": indicatorColor
|
|
23432
23440
|
},
|
|
23433
23441
|
direction: "horizontal",
|
|
@@ -23439,10 +23447,10 @@ const ImagePreview = (props) => {
|
|
|
23439
23447
|
return /* @__PURE__ */ React__default.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React__default.createElement(Video, { source: item.source, options: item.options }));
|
|
23440
23448
|
}) : []).concat(
|
|
23441
23449
|
images && images.length > 0 ? images.map((item, index) => {
|
|
23442
|
-
return /* @__PURE__ */ React__default.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React__default.createElement(Image$1, { src: item.src }));
|
|
23450
|
+
return /* @__PURE__ */ React__default.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React__default.createElement(Image$1, { src: item.src, draggable: false }));
|
|
23443
23451
|
}) : []
|
|
23444
23452
|
)
|
|
23445
|
-
)
|
|
23453
|
+
) : null
|
|
23446
23454
|
),
|
|
23447
23455
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
|
|
23448
23456
|
closeIcon !== false ? /* @__PURE__ */ React__default.createElement(
|