@x-plat/design-system 0.3.5 → 0.3.7
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/dist/components/CardTab/index.css +0 -1
- package/dist/components/Swiper/index.cjs +23 -15
- package/dist/components/Swiper/index.js +23 -15
- package/dist/components/index.cjs +23 -15
- package/dist/components/index.css +0 -1
- package/dist/components/index.js +23 -15
- package/dist/index.cjs +23 -15
- package/dist/index.css +0 -1
- package/dist/index.js +23 -15
- package/package.json +1 -1
|
@@ -115,22 +115,29 @@ var Swiper = (props) => {
|
|
|
115
115
|
const realIndex = getRealIndex(innerIndex);
|
|
116
116
|
const moveToInner = import_react.default.useCallback(
|
|
117
117
|
(idx, withAnim = true) => {
|
|
118
|
-
if (useLoop) {
|
|
119
|
-
setInnerIndex((prev) => {
|
|
120
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
121
|
-
const canonical = cloneCount + real;
|
|
122
|
-
if (prev !== canonical) {
|
|
123
|
-
const delta = idx - prev;
|
|
124
|
-
setAnimated(withAnim);
|
|
125
|
-
return canonical + delta;
|
|
126
|
-
}
|
|
127
|
-
setAnimated(withAnim);
|
|
128
|
-
return idx;
|
|
129
|
-
});
|
|
130
|
-
} else {
|
|
118
|
+
if (!useLoop) {
|
|
131
119
|
setAnimated(withAnim);
|
|
132
120
|
setInnerIndex(idx);
|
|
121
|
+
return;
|
|
133
122
|
}
|
|
123
|
+
setInnerIndex((prev) => {
|
|
124
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
125
|
+
const canonical = cloneCount + real;
|
|
126
|
+
const delta = idx - prev;
|
|
127
|
+
const target = canonical + delta;
|
|
128
|
+
if (prev !== canonical) {
|
|
129
|
+
setAnimated(false);
|
|
130
|
+
requestAnimationFrame(() => {
|
|
131
|
+
requestAnimationFrame(() => {
|
|
132
|
+
setAnimated(withAnim);
|
|
133
|
+
setInnerIndex(target);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
return canonical;
|
|
137
|
+
}
|
|
138
|
+
setAnimated(withAnim);
|
|
139
|
+
return target;
|
|
140
|
+
});
|
|
134
141
|
},
|
|
135
142
|
[useLoop, cloneCount, totalSlides]
|
|
136
143
|
);
|
|
@@ -139,10 +146,11 @@ var Swiper = (props) => {
|
|
|
139
146
|
const real = getRealIndex(innerIndex);
|
|
140
147
|
const canonical = cloneCount + real;
|
|
141
148
|
if (innerIndex !== canonical) {
|
|
142
|
-
|
|
149
|
+
setAnimated(false);
|
|
150
|
+
setInnerIndex(canonical);
|
|
143
151
|
}
|
|
144
152
|
onChange?.(Math.min(real, maxIndex));
|
|
145
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
153
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
146
154
|
const slideTo = import_react.default.useCallback(
|
|
147
155
|
(logicalIndex) => {
|
|
148
156
|
if (!canSlide) return;
|
|
@@ -79,22 +79,29 @@ var Swiper = (props) => {
|
|
|
79
79
|
const realIndex = getRealIndex(innerIndex);
|
|
80
80
|
const moveToInner = React.useCallback(
|
|
81
81
|
(idx, withAnim = true) => {
|
|
82
|
-
if (useLoop) {
|
|
83
|
-
setInnerIndex((prev) => {
|
|
84
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
85
|
-
const canonical = cloneCount + real;
|
|
86
|
-
if (prev !== canonical) {
|
|
87
|
-
const delta = idx - prev;
|
|
88
|
-
setAnimated(withAnim);
|
|
89
|
-
return canonical + delta;
|
|
90
|
-
}
|
|
91
|
-
setAnimated(withAnim);
|
|
92
|
-
return idx;
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
82
|
+
if (!useLoop) {
|
|
95
83
|
setAnimated(withAnim);
|
|
96
84
|
setInnerIndex(idx);
|
|
85
|
+
return;
|
|
97
86
|
}
|
|
87
|
+
setInnerIndex((prev) => {
|
|
88
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
89
|
+
const canonical = cloneCount + real;
|
|
90
|
+
const delta = idx - prev;
|
|
91
|
+
const target = canonical + delta;
|
|
92
|
+
if (prev !== canonical) {
|
|
93
|
+
setAnimated(false);
|
|
94
|
+
requestAnimationFrame(() => {
|
|
95
|
+
requestAnimationFrame(() => {
|
|
96
|
+
setAnimated(withAnim);
|
|
97
|
+
setInnerIndex(target);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
return canonical;
|
|
101
|
+
}
|
|
102
|
+
setAnimated(withAnim);
|
|
103
|
+
return target;
|
|
104
|
+
});
|
|
98
105
|
},
|
|
99
106
|
[useLoop, cloneCount, totalSlides]
|
|
100
107
|
);
|
|
@@ -103,10 +110,11 @@ var Swiper = (props) => {
|
|
|
103
110
|
const real = getRealIndex(innerIndex);
|
|
104
111
|
const canonical = cloneCount + real;
|
|
105
112
|
if (innerIndex !== canonical) {
|
|
106
|
-
|
|
113
|
+
setAnimated(false);
|
|
114
|
+
setInnerIndex(canonical);
|
|
107
115
|
}
|
|
108
116
|
onChange?.(Math.min(real, maxIndex));
|
|
109
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
117
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
110
118
|
const slideTo = React.useCallback(
|
|
111
119
|
(logicalIndex) => {
|
|
112
120
|
if (!canSlide) return;
|
|
@@ -28400,22 +28400,29 @@ var Swiper = (props) => {
|
|
|
28400
28400
|
const realIndex = getRealIndex(innerIndex);
|
|
28401
28401
|
const moveToInner = import_react29.default.useCallback(
|
|
28402
28402
|
(idx, withAnim = true) => {
|
|
28403
|
-
if (useLoop) {
|
|
28404
|
-
setInnerIndex((prev) => {
|
|
28405
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28406
|
-
const canonical = cloneCount + real;
|
|
28407
|
-
if (prev !== canonical) {
|
|
28408
|
-
const delta = idx - prev;
|
|
28409
|
-
setAnimated(withAnim);
|
|
28410
|
-
return canonical + delta;
|
|
28411
|
-
}
|
|
28412
|
-
setAnimated(withAnim);
|
|
28413
|
-
return idx;
|
|
28414
|
-
});
|
|
28415
|
-
} else {
|
|
28403
|
+
if (!useLoop) {
|
|
28416
28404
|
setAnimated(withAnim);
|
|
28417
28405
|
setInnerIndex(idx);
|
|
28406
|
+
return;
|
|
28418
28407
|
}
|
|
28408
|
+
setInnerIndex((prev) => {
|
|
28409
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28410
|
+
const canonical = cloneCount + real;
|
|
28411
|
+
const delta = idx - prev;
|
|
28412
|
+
const target = canonical + delta;
|
|
28413
|
+
if (prev !== canonical) {
|
|
28414
|
+
setAnimated(false);
|
|
28415
|
+
requestAnimationFrame(() => {
|
|
28416
|
+
requestAnimationFrame(() => {
|
|
28417
|
+
setAnimated(withAnim);
|
|
28418
|
+
setInnerIndex(target);
|
|
28419
|
+
});
|
|
28420
|
+
});
|
|
28421
|
+
return canonical;
|
|
28422
|
+
}
|
|
28423
|
+
setAnimated(withAnim);
|
|
28424
|
+
return target;
|
|
28425
|
+
});
|
|
28419
28426
|
},
|
|
28420
28427
|
[useLoop, cloneCount, totalSlides]
|
|
28421
28428
|
);
|
|
@@ -28424,10 +28431,11 @@ var Swiper = (props) => {
|
|
|
28424
28431
|
const real = getRealIndex(innerIndex);
|
|
28425
28432
|
const canonical = cloneCount + real;
|
|
28426
28433
|
if (innerIndex !== canonical) {
|
|
28427
|
-
|
|
28434
|
+
setAnimated(false);
|
|
28435
|
+
setInnerIndex(canonical);
|
|
28428
28436
|
}
|
|
28429
28437
|
onChange?.(Math.min(real, maxIndex));
|
|
28430
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
28438
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
28431
28439
|
const slideTo = import_react29.default.useCallback(
|
|
28432
28440
|
(logicalIndex) => {
|
|
28433
28441
|
if (!canSlide) return;
|
package/dist/components/index.js
CHANGED
|
@@ -28324,22 +28324,29 @@ var Swiper = (props) => {
|
|
|
28324
28324
|
const realIndex = getRealIndex(innerIndex);
|
|
28325
28325
|
const moveToInner = React27.useCallback(
|
|
28326
28326
|
(idx, withAnim = true) => {
|
|
28327
|
-
if (useLoop) {
|
|
28328
|
-
setInnerIndex((prev) => {
|
|
28329
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28330
|
-
const canonical = cloneCount + real;
|
|
28331
|
-
if (prev !== canonical) {
|
|
28332
|
-
const delta = idx - prev;
|
|
28333
|
-
setAnimated(withAnim);
|
|
28334
|
-
return canonical + delta;
|
|
28335
|
-
}
|
|
28336
|
-
setAnimated(withAnim);
|
|
28337
|
-
return idx;
|
|
28338
|
-
});
|
|
28339
|
-
} else {
|
|
28327
|
+
if (!useLoop) {
|
|
28340
28328
|
setAnimated(withAnim);
|
|
28341
28329
|
setInnerIndex(idx);
|
|
28330
|
+
return;
|
|
28342
28331
|
}
|
|
28332
|
+
setInnerIndex((prev) => {
|
|
28333
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28334
|
+
const canonical = cloneCount + real;
|
|
28335
|
+
const delta = idx - prev;
|
|
28336
|
+
const target = canonical + delta;
|
|
28337
|
+
if (prev !== canonical) {
|
|
28338
|
+
setAnimated(false);
|
|
28339
|
+
requestAnimationFrame(() => {
|
|
28340
|
+
requestAnimationFrame(() => {
|
|
28341
|
+
setAnimated(withAnim);
|
|
28342
|
+
setInnerIndex(target);
|
|
28343
|
+
});
|
|
28344
|
+
});
|
|
28345
|
+
return canonical;
|
|
28346
|
+
}
|
|
28347
|
+
setAnimated(withAnim);
|
|
28348
|
+
return target;
|
|
28349
|
+
});
|
|
28343
28350
|
},
|
|
28344
28351
|
[useLoop, cloneCount, totalSlides]
|
|
28345
28352
|
);
|
|
@@ -28348,10 +28355,11 @@ var Swiper = (props) => {
|
|
|
28348
28355
|
const real = getRealIndex(innerIndex);
|
|
28349
28356
|
const canonical = cloneCount + real;
|
|
28350
28357
|
if (innerIndex !== canonical) {
|
|
28351
|
-
|
|
28358
|
+
setAnimated(false);
|
|
28359
|
+
setInnerIndex(canonical);
|
|
28352
28360
|
}
|
|
28353
28361
|
onChange?.(Math.min(real, maxIndex));
|
|
28354
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
28362
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
28355
28363
|
const slideTo = React27.useCallback(
|
|
28356
28364
|
(logicalIndex) => {
|
|
28357
28365
|
if (!canSlide) return;
|
package/dist/index.cjs
CHANGED
|
@@ -32938,22 +32938,29 @@ var Swiper = (props) => {
|
|
|
32938
32938
|
const realIndex = getRealIndex(innerIndex);
|
|
32939
32939
|
const moveToInner = import_react29.default.useCallback(
|
|
32940
32940
|
(idx, withAnim = true) => {
|
|
32941
|
-
if (useLoop) {
|
|
32942
|
-
setInnerIndex((prev) => {
|
|
32943
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32944
|
-
const canonical = cloneCount + real;
|
|
32945
|
-
if (prev !== canonical) {
|
|
32946
|
-
const delta = idx - prev;
|
|
32947
|
-
setAnimated(withAnim);
|
|
32948
|
-
return canonical + delta;
|
|
32949
|
-
}
|
|
32950
|
-
setAnimated(withAnim);
|
|
32951
|
-
return idx;
|
|
32952
|
-
});
|
|
32953
|
-
} else {
|
|
32941
|
+
if (!useLoop) {
|
|
32954
32942
|
setAnimated(withAnim);
|
|
32955
32943
|
setInnerIndex(idx);
|
|
32944
|
+
return;
|
|
32956
32945
|
}
|
|
32946
|
+
setInnerIndex((prev) => {
|
|
32947
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32948
|
+
const canonical = cloneCount + real;
|
|
32949
|
+
const delta = idx - prev;
|
|
32950
|
+
const target = canonical + delta;
|
|
32951
|
+
if (prev !== canonical) {
|
|
32952
|
+
setAnimated(false);
|
|
32953
|
+
requestAnimationFrame(() => {
|
|
32954
|
+
requestAnimationFrame(() => {
|
|
32955
|
+
setAnimated(withAnim);
|
|
32956
|
+
setInnerIndex(target);
|
|
32957
|
+
});
|
|
32958
|
+
});
|
|
32959
|
+
return canonical;
|
|
32960
|
+
}
|
|
32961
|
+
setAnimated(withAnim);
|
|
32962
|
+
return target;
|
|
32963
|
+
});
|
|
32957
32964
|
},
|
|
32958
32965
|
[useLoop, cloneCount, totalSlides]
|
|
32959
32966
|
);
|
|
@@ -32962,10 +32969,11 @@ var Swiper = (props) => {
|
|
|
32962
32969
|
const real = getRealIndex(innerIndex);
|
|
32963
32970
|
const canonical = cloneCount + real;
|
|
32964
32971
|
if (innerIndex !== canonical) {
|
|
32965
|
-
|
|
32972
|
+
setAnimated(false);
|
|
32973
|
+
setInnerIndex(canonical);
|
|
32966
32974
|
}
|
|
32967
32975
|
onChange?.(Math.min(real, maxIndex));
|
|
32968
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
32976
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
32969
32977
|
const slideTo = import_react29.default.useCallback(
|
|
32970
32978
|
(logicalIndex) => {
|
|
32971
32979
|
if (!canSlide) return;
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -32555,22 +32555,29 @@ var Swiper = (props) => {
|
|
|
32555
32555
|
const realIndex = getRealIndex(innerIndex);
|
|
32556
32556
|
const moveToInner = React27.useCallback(
|
|
32557
32557
|
(idx, withAnim = true) => {
|
|
32558
|
-
if (useLoop) {
|
|
32559
|
-
setInnerIndex((prev) => {
|
|
32560
|
-
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32561
|
-
const canonical = cloneCount + real;
|
|
32562
|
-
if (prev !== canonical) {
|
|
32563
|
-
const delta = idx - prev;
|
|
32564
|
-
setAnimated(withAnim);
|
|
32565
|
-
return canonical + delta;
|
|
32566
|
-
}
|
|
32567
|
-
setAnimated(withAnim);
|
|
32568
|
-
return idx;
|
|
32569
|
-
});
|
|
32570
|
-
} else {
|
|
32558
|
+
if (!useLoop) {
|
|
32571
32559
|
setAnimated(withAnim);
|
|
32572
32560
|
setInnerIndex(idx);
|
|
32561
|
+
return;
|
|
32573
32562
|
}
|
|
32563
|
+
setInnerIndex((prev) => {
|
|
32564
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32565
|
+
const canonical = cloneCount + real;
|
|
32566
|
+
const delta = idx - prev;
|
|
32567
|
+
const target = canonical + delta;
|
|
32568
|
+
if (prev !== canonical) {
|
|
32569
|
+
setAnimated(false);
|
|
32570
|
+
requestAnimationFrame(() => {
|
|
32571
|
+
requestAnimationFrame(() => {
|
|
32572
|
+
setAnimated(withAnim);
|
|
32573
|
+
setInnerIndex(target);
|
|
32574
|
+
});
|
|
32575
|
+
});
|
|
32576
|
+
return canonical;
|
|
32577
|
+
}
|
|
32578
|
+
setAnimated(withAnim);
|
|
32579
|
+
return target;
|
|
32580
|
+
});
|
|
32574
32581
|
},
|
|
32575
32582
|
[useLoop, cloneCount, totalSlides]
|
|
32576
32583
|
);
|
|
@@ -32579,10 +32586,11 @@ var Swiper = (props) => {
|
|
|
32579
32586
|
const real = getRealIndex(innerIndex);
|
|
32580
32587
|
const canonical = cloneCount + real;
|
|
32581
32588
|
if (innerIndex !== canonical) {
|
|
32582
|
-
|
|
32589
|
+
setAnimated(false);
|
|
32590
|
+
setInnerIndex(canonical);
|
|
32583
32591
|
}
|
|
32584
32592
|
onChange?.(Math.min(real, maxIndex));
|
|
32585
|
-
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange
|
|
32593
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
32586
32594
|
const slideTo = React27.useCallback(
|
|
32587
32595
|
(logicalIndex) => {
|
|
32588
32596
|
if (!canSlide) return;
|