@plaidev/karte-action-sdk 1.1.268-29089806.0ded74d0 → 1.1.268-29090020.0f31d4b5
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/hydrate/index.es.js +88 -78
- package/dist/index.es.js +77 -65
- package/dist/svelte5/hydrate/index.es.js +39 -36
- package/dist/svelte5/index.es.js +39 -36
- package/dist/svelte5/index.front2.es.js +39 -36
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -16145,17 +16145,17 @@ const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
|
16145
16145
|
/* src/components-flex/slider/Slider.svelte generated by Svelte v3.53.1 */
|
16146
16146
|
|
16147
16147
|
function add_css$f(target) {
|
16148
|
-
append_styles(target, "svelte-
|
16148
|
+
append_styles(target, "svelte-wwv1o", ".slider.svelte-wwv1o{width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y}.slider-container.svelte-wwv1o{width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y}.slider-list.svelte-wwv1o{-webkit-user-drag:none;margin:0;padding:0;list-style:none;will-change:transform}");
|
16149
16149
|
}
|
16150
16150
|
|
16151
16151
|
function get_each_context$1(ctx, list, i) {
|
16152
16152
|
const child_ctx = ctx.slice();
|
16153
|
-
child_ctx[
|
16154
|
-
child_ctx[
|
16153
|
+
child_ctx[36] = list[i];
|
16154
|
+
child_ctx[38] = i;
|
16155
16155
|
return child_ctx;
|
16156
16156
|
}
|
16157
16157
|
|
16158
|
-
// (
|
16158
|
+
// (192:4) {#each indicators ?? [] as indicator, i}
|
16159
16159
|
function create_each_block$1(ctx) {
|
16160
16160
|
let button;
|
16161
16161
|
let i_1;
|
@@ -16165,7 +16165,7 @@ function create_each_block$1(ctx) {
|
|
16165
16165
|
let dispose;
|
16166
16166
|
|
16167
16167
|
function click_handler() {
|
16168
|
-
return /*click_handler*/ ctx[
|
16168
|
+
return /*click_handler*/ ctx[22](/*i*/ ctx[38]);
|
16169
16169
|
}
|
16170
16170
|
|
16171
16171
|
return {
|
@@ -16175,9 +16175,9 @@ function create_each_block$1(ctx) {
|
|
16175
16175
|
t = space();
|
16176
16176
|
|
16177
16177
|
attr(i_1, "style", i_1_style_value = objToStyle({
|
16178
|
-
.../*indicatorItemStyle*/ ctx[
|
16178
|
+
.../*indicatorItemStyle*/ ctx[4],
|
16179
16179
|
...{
|
16180
|
-
background: /*indicator*/ ctx[
|
16180
|
+
background: /*indicator*/ ctx[36].isActive ? '#555555' : '#AAAAAA'
|
16181
16181
|
}
|
16182
16182
|
}));
|
16183
16183
|
|
@@ -16200,10 +16200,10 @@ function create_each_block$1(ctx) {
|
|
16200
16200
|
p(new_ctx, dirty) {
|
16201
16201
|
ctx = new_ctx;
|
16202
16202
|
|
16203
|
-
if (dirty[0] & /*indicatorItemStyle, indicators*/
|
16204
|
-
.../*indicatorItemStyle*/ ctx[
|
16203
|
+
if (dirty[0] & /*indicatorItemStyle, indicators*/ 144 && i_1_style_value !== (i_1_style_value = objToStyle({
|
16204
|
+
.../*indicatorItemStyle*/ ctx[4],
|
16205
16205
|
...{
|
16206
|
-
background: /*indicator*/ ctx[
|
16206
|
+
background: /*indicator*/ ctx[36].isActive ? '#555555' : '#AAAAAA'
|
16207
16207
|
}
|
16208
16208
|
}))) {
|
16209
16209
|
attr(i_1, "style", i_1_style_value);
|
@@ -16218,11 +16218,12 @@ function create_each_block$1(ctx) {
|
|
16218
16218
|
}
|
16219
16219
|
|
16220
16220
|
function create_fragment$j(ctx) {
|
16221
|
-
let
|
16221
|
+
let div2;
|
16222
|
+
let div0;
|
16222
16223
|
let ul;
|
16223
16224
|
let ul_style_value;
|
16224
16225
|
let t;
|
16225
|
-
let
|
16226
|
+
let div1;
|
16226
16227
|
let current;
|
16227
16228
|
let mounted;
|
16228
16229
|
let dispose;
|
@@ -16237,45 +16238,48 @@ function create_fragment$j(ctx) {
|
|
16237
16238
|
|
16238
16239
|
return {
|
16239
16240
|
c() {
|
16240
|
-
|
16241
|
+
div2 = element("div");
|
16242
|
+
div0 = element("div");
|
16241
16243
|
ul = element("ul");
|
16242
16244
|
if (default_slot) default_slot.c();
|
16243
16245
|
t = space();
|
16244
|
-
|
16246
|
+
div1 = element("div");
|
16245
16247
|
|
16246
16248
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
16247
16249
|
each_blocks[i].c();
|
16248
16250
|
}
|
16249
16251
|
|
16250
|
-
attr(ul, "class", "slider-list svelte-
|
16251
|
-
attr(ul, "style", ul_style_value = [/*containerStyle*/ ctx[
|
16252
|
-
attr(div0, "
|
16253
|
-
attr(div1, "
|
16254
|
-
attr(
|
16255
|
-
attr(
|
16252
|
+
attr(ul, "class", "slider-list svelte-wwv1o");
|
16253
|
+
attr(ul, "style", ul_style_value = [/*containerStyle*/ ctx[6], /*overrideStyle*/ ctx[1]].join(' '));
|
16254
|
+
attr(div0, "class", "slider-container svelte-wwv1o");
|
16255
|
+
attr(div1, "style", /*indicatorListStyle*/ ctx[5]);
|
16256
|
+
attr(div2, "data-layer-id", /*layerId*/ ctx[0]);
|
16257
|
+
attr(div2, "class", "slider svelte-wwv1o");
|
16256
16258
|
},
|
16257
16259
|
m(target, anchor) {
|
16258
|
-
insert(target,
|
16259
|
-
append(
|
16260
|
+
insert(target, div2, anchor);
|
16261
|
+
append(div2, div0);
|
16262
|
+
append(div0, ul);
|
16260
16263
|
|
16261
16264
|
if (default_slot) {
|
16262
16265
|
default_slot.m(ul, null);
|
16263
16266
|
}
|
16264
16267
|
|
16265
16268
|
/*ul_binding*/ ctx[20](ul);
|
16266
|
-
|
16267
|
-
append(
|
16269
|
+
/*div0_binding*/ ctx[21](div0);
|
16270
|
+
append(div2, t);
|
16271
|
+
append(div2, div1);
|
16268
16272
|
|
16269
16273
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
16270
|
-
each_blocks[i].m(
|
16274
|
+
each_blocks[i].m(div1, null);
|
16271
16275
|
}
|
16272
16276
|
|
16273
16277
|
current = true;
|
16274
16278
|
|
16275
16279
|
if (!mounted) {
|
16276
16280
|
dispose = [
|
16277
|
-
listen(
|
16278
|
-
listen(
|
16281
|
+
listen(div0, "mousedown", /*handleMousedown*/ ctx[10]),
|
16282
|
+
listen(div0, "touchstart", /*handleTouchstart*/ ctx[9])
|
16279
16283
|
];
|
16280
16284
|
|
16281
16285
|
mounted = true;
|
@@ -16297,11 +16301,11 @@ function create_fragment$j(ctx) {
|
|
16297
16301
|
}
|
16298
16302
|
}
|
16299
16303
|
|
16300
|
-
if (!current || dirty[0] & /*containerStyle, overrideStyle*/
|
16304
|
+
if (!current || dirty[0] & /*containerStyle, overrideStyle*/ 66 && ul_style_value !== (ul_style_value = [/*containerStyle*/ ctx[6], /*overrideStyle*/ ctx[1]].join(' '))) {
|
16301
16305
|
attr(ul, "style", ul_style_value);
|
16302
16306
|
}
|
16303
16307
|
|
16304
|
-
if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/
|
16308
|
+
if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/ 400) {
|
16305
16309
|
each_value = /*indicators*/ ctx[7] ?? [];
|
16306
16310
|
let i;
|
16307
16311
|
|
@@ -16313,7 +16317,7 @@ function create_fragment$j(ctx) {
|
|
16313
16317
|
} else {
|
16314
16318
|
each_blocks[i] = create_each_block$1(child_ctx);
|
16315
16319
|
each_blocks[i].c();
|
16316
|
-
each_blocks[i].m(
|
16320
|
+
each_blocks[i].m(div1, null);
|
16317
16321
|
}
|
16318
16322
|
}
|
16319
16323
|
|
@@ -16324,16 +16328,12 @@ function create_fragment$j(ctx) {
|
|
16324
16328
|
each_blocks.length = each_value.length;
|
16325
16329
|
}
|
16326
16330
|
|
16327
|
-
if (!current || dirty[0] & /*indicatorListStyle*/
|
16328
|
-
attr(
|
16331
|
+
if (!current || dirty[0] & /*indicatorListStyle*/ 32) {
|
16332
|
+
attr(div1, "style", /*indicatorListStyle*/ ctx[5]);
|
16329
16333
|
}
|
16330
16334
|
|
16331
16335
|
if (!current || dirty[0] & /*layerId*/ 1) {
|
16332
|
-
attr(
|
16333
|
-
}
|
16334
|
-
|
16335
|
-
if (!current || dirty[0] & /*style*/ 64) {
|
16336
|
-
attr(div1, "style", /*style*/ ctx[6]);
|
16336
|
+
attr(div2, "data-layer-id", /*layerId*/ ctx[0]);
|
16337
16337
|
}
|
16338
16338
|
},
|
16339
16339
|
i(local) {
|
@@ -16346,9 +16346,10 @@ function create_fragment$j(ctx) {
|
|
16346
16346
|
current = false;
|
16347
16347
|
},
|
16348
16348
|
d(detaching) {
|
16349
|
-
if (detaching) detach(
|
16349
|
+
if (detaching) detach(div2);
|
16350
16350
|
if (default_slot) default_slot.d(detaching);
|
16351
16351
|
/*ul_binding*/ ctx[20](null);
|
16352
|
+
/*div0_binding*/ ctx[21](null);
|
16352
16353
|
destroy_each(each_blocks, detaching);
|
16353
16354
|
mounted = false;
|
16354
16355
|
run_all(dispose);
|
@@ -16356,10 +16357,11 @@ function create_fragment$j(ctx) {
|
|
16356
16357
|
};
|
16357
16358
|
}
|
16358
16359
|
|
16360
|
+
const THROTTLE = 16;
|
16361
|
+
|
16359
16362
|
function instance$j($$self, $$props, $$invalidate) {
|
16360
16363
|
let indicators;
|
16361
16364
|
let itemWidthPercentage;
|
16362
|
-
let style;
|
16363
16365
|
let baseContainerStyle;
|
16364
16366
|
let containerStyle;
|
16365
16367
|
let indicatorListStyle;
|
@@ -16369,6 +16371,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16369
16371
|
let { props } = $$props;
|
16370
16372
|
let { overrideStyle } = $$props;
|
16371
16373
|
useInjectCustomizeCss(props);
|
16374
|
+
let containerElement;
|
16372
16375
|
let slotElement;
|
16373
16376
|
let currentIndex = 0;
|
16374
16377
|
let isDragging = false;
|
@@ -16376,7 +16379,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16376
16379
|
let movedX = null;
|
16377
16380
|
let childCount = 0;
|
16378
16381
|
let transformX;
|
16379
|
-
|
16382
|
+
let lastFrame = 0;
|
16380
16383
|
|
16381
16384
|
const computeTransformX = (index, itemCount, movedX, itemWidthPercentage, gap) => {
|
16382
16385
|
if (index === 0) return;
|
@@ -16392,7 +16395,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16392
16395
|
}
|
16393
16396
|
|
16394
16397
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
16395
|
-
return `
|
16398
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
16396
16399
|
};
|
16397
16400
|
|
16398
16401
|
const handleClickIndicator = index => {
|
@@ -16408,8 +16411,6 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16408
16411
|
};
|
16409
16412
|
|
16410
16413
|
const toNext = () => {
|
16411
|
-
console.log('toNext');
|
16412
|
-
|
16413
16414
|
if (currentIndex < childCount - 1) {
|
16414
16415
|
$$invalidate(12, currentIndex = currentIndex + 1);
|
16415
16416
|
} else if (props.loop) {
|
@@ -16426,20 +16427,32 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16426
16427
|
};
|
16427
16428
|
|
16428
16429
|
const handleClick = e => {
|
16429
|
-
|
16430
|
+
const isParentContainer = el => {
|
16431
|
+
if (!el) return false;
|
16432
|
+
return el === containerElement || isParentContainer(el.parentElement);
|
16433
|
+
};
|
16434
|
+
|
16435
|
+
if (isParentContainer(e.target) && isDragging) {
|
16430
16436
|
e.preventDefault();
|
16431
16437
|
e.stopPropagation();
|
16432
16438
|
}
|
16433
16439
|
};
|
16434
16440
|
|
16435
|
-
const
|
16436
|
-
$$invalidate(13, movedX =
|
16441
|
+
const move = moved => {
|
16442
|
+
$$invalidate(13, movedX = moved);
|
16437
16443
|
|
16438
|
-
if (
|
16444
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
16439
16445
|
isDragging = true;
|
16440
16446
|
}
|
16441
16447
|
};
|
16442
16448
|
|
16449
|
+
const handleTouchmove = e => {
|
16450
|
+
const now = performance.now();
|
16451
|
+
if (now - lastFrame < THROTTLE) return;
|
16452
|
+
move(startX - e.touches[0].clientX);
|
16453
|
+
lastFrame = now;
|
16454
|
+
};
|
16455
|
+
|
16443
16456
|
const handleTouchend = () => {
|
16444
16457
|
if (movedX >= 32) {
|
16445
16458
|
toNext();
|
@@ -16457,16 +16470,12 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16457
16470
|
startX = e.touches[0].clientX;
|
16458
16471
|
isDragging = false;
|
16459
16472
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
16460
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
16461
|
-
document.addEventListener('click', handleClick
|
16473
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
16474
|
+
document.addEventListener('click', handleClick);
|
16462
16475
|
};
|
16463
16476
|
|
16464
16477
|
const handleMousemove = e => {
|
16465
|
-
|
16466
|
-
|
16467
|
-
if (movedX > 10 || movedX < -10) {
|
16468
|
-
isDragging = true;
|
16469
|
-
}
|
16478
|
+
move(startX - e.clientX);
|
16470
16479
|
};
|
16471
16480
|
|
16472
16481
|
const handleMouseup = e => {
|
@@ -16479,7 +16488,6 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16479
16488
|
$$invalidate(13, movedX = null);
|
16480
16489
|
|
16481
16490
|
if (isDragging) {
|
16482
|
-
e.preventDefault();
|
16483
16491
|
e.stopPropagation();
|
16484
16492
|
}
|
16485
16493
|
|
@@ -16498,8 +16506,6 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16498
16506
|
|
16499
16507
|
onMount$1(() => {
|
16500
16508
|
setChildCount();
|
16501
|
-
|
16502
|
-
// const childCountTimer = setInterval(setChildCount, 300);
|
16503
16509
|
let autoSlideTimer;
|
16504
16510
|
|
16505
16511
|
if (props.auto) {
|
@@ -16512,7 +16518,6 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16512
16518
|
}
|
16513
16519
|
|
16514
16520
|
return () => {
|
16515
|
-
// clearInterval(childCountTimer)
|
16516
16521
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
16517
16522
|
};
|
16518
16523
|
});
|
@@ -16524,6 +16529,13 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16524
16529
|
});
|
16525
16530
|
}
|
16526
16531
|
|
16532
|
+
function div0_binding($$value) {
|
16533
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
16534
|
+
containerElement = $$value;
|
16535
|
+
$$invalidate(3, containerElement);
|
16536
|
+
});
|
16537
|
+
}
|
16538
|
+
|
16527
16539
|
const click_handler = i => handleClickIndicator(i);
|
16528
16540
|
|
16529
16541
|
$$self.$$set = $$props => {
|
@@ -16567,39 +16579,38 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16567
16579
|
}
|
16568
16580
|
|
16569
16581
|
if ($$self.$$.dirty[0] & /*baseContainerStyle, transformX*/ 98304) {
|
16570
|
-
$$invalidate(
|
16582
|
+
$$invalidate(6, containerStyle = objToStyle({
|
16571
16583
|
...baseContainerStyle,
|
16572
16584
|
transform: transformX
|
16573
16585
|
}));
|
16574
16586
|
}
|
16575
16587
|
};
|
16576
16588
|
|
16577
|
-
$$invalidate(
|
16578
|
-
|
16579
|
-
$$invalidate(4, indicatorListStyle = objToStyle({
|
16589
|
+
$$invalidate(5, indicatorListStyle = objToStyle({
|
16580
16590
|
display: 'flex',
|
16581
16591
|
justifyContent: 'center',
|
16582
16592
|
gap: '4px',
|
16583
16593
|
marginTop: '12px'
|
16584
16594
|
}));
|
16585
16595
|
|
16586
|
-
$$invalidate(
|
16596
|
+
$$invalidate(4, indicatorItemStyle = {
|
16587
16597
|
width: '8px',
|
16588
16598
|
height: '8px',
|
16589
16599
|
borderRadius: '100%',
|
16590
16600
|
display: 'block',
|
16591
16601
|
background: '#AAAAAA',
|
16592
|
-
border: 0
|
16602
|
+
border: 0,
|
16603
|
+
cursor: 'pointer'
|
16593
16604
|
});
|
16594
16605
|
|
16595
16606
|
return [
|
16596
16607
|
layerId,
|
16597
16608
|
overrideStyle,
|
16598
16609
|
slotElement,
|
16610
|
+
containerElement,
|
16599
16611
|
indicatorItemStyle,
|
16600
16612
|
indicatorListStyle,
|
16601
16613
|
containerStyle,
|
16602
|
-
style,
|
16603
16614
|
indicators,
|
16604
16615
|
handleClickIndicator,
|
16605
16616
|
handleTouchstart,
|
@@ -16614,6 +16625,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16614
16625
|
$$scope,
|
16615
16626
|
slots,
|
16616
16627
|
ul_binding,
|
16628
|
+
div0_binding,
|
16617
16629
|
click_handler
|
16618
16630
|
];
|
16619
16631
|
}
|
@@ -5464,11 +5464,11 @@ const LAYOUT_ALIGN = ['flex-start', 'center', 'flex-end', 'stretch'];
|
|
5464
5464
|
const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
5465
5465
|
|
5466
5466
|
var root_1$2 = $.template(`<button><i></i></button>`);
|
5467
|
-
var root$d = $.template(`<div class="slider svelte-
|
5467
|
+
var root$d = $.template(`<div class="slider svelte-wwv1o"><div class="slider-container svelte-wwv1o"><ul class="slider-list svelte-wwv1o"><!></ul></div> <div></div></div>`);
|
5468
5468
|
|
5469
5469
|
const $$css$e = {
|
5470
|
-
hash: 'svelte-
|
5471
|
-
code: '.slider-list.svelte-
|
5470
|
+
hash: 'svelte-wwv1o',
|
5471
|
+
code: '.slider.svelte-wwv1o {width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y;}.slider-container.svelte-wwv1o {width:100%;overflow:hidden;overscroll-behavior:contain;touch-action:pan-y;}.slider-list.svelte-wwv1o {-webkit-user-drag:none;margin:0;padding:0;list-style:none;will-change:transform;}'
|
5472
5472
|
};
|
5473
5473
|
|
5474
5474
|
function Slider($$anchor, $$props) {
|
@@ -5477,7 +5477,6 @@ function Slider($$anchor, $$props) {
|
|
5477
5477
|
|
5478
5478
|
const indicators = $.mutable_state();
|
5479
5479
|
const itemWidthPercentage = $.mutable_state();
|
5480
|
-
const style = $.mutable_state();
|
5481
5480
|
const baseContainerStyle = $.mutable_state();
|
5482
5481
|
const containerStyle = $.mutable_state();
|
5483
5482
|
const indicatorListStyle = $.mutable_state();
|
@@ -5488,6 +5487,7 @@ function Slider($$anchor, $$props) {
|
|
5488
5487
|
|
5489
5488
|
useInjectCustomizeCss(props());
|
5490
5489
|
|
5490
|
+
let containerElement = $.mutable_state();
|
5491
5491
|
let slotElement = $.mutable_state();
|
5492
5492
|
let currentIndex = $.mutable_state(0);
|
5493
5493
|
let isDragging = false;
|
@@ -5495,8 +5495,8 @@ function Slider($$anchor, $$props) {
|
|
5495
5495
|
let movedX = $.mutable_state(null);
|
5496
5496
|
let childCount = $.mutable_state(0);
|
5497
5497
|
let transformX = $.mutable_state();
|
5498
|
-
|
5499
|
-
|
5498
|
+
let lastFrame = 0;
|
5499
|
+
const THROTTLE = 16;
|
5500
5500
|
|
5501
5501
|
const computeTransformX = (
|
5502
5502
|
index,
|
@@ -5520,7 +5520,7 @@ function Slider($$anchor, $$props) {
|
|
5520
5520
|
|
5521
5521
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
5522
5522
|
|
5523
|
-
return `
|
5523
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
5524
5524
|
};
|
5525
5525
|
|
5526
5526
|
const handleClickIndicator = (index) => {
|
@@ -5536,8 +5536,6 @@ function Slider($$anchor, $$props) {
|
|
5536
5536
|
};
|
5537
5537
|
|
5538
5538
|
const toNext = () => {
|
5539
|
-
console.log('toNext');
|
5540
|
-
|
5541
5539
|
if ($.get(currentIndex) < $.get(childCount) - 1) {
|
5542
5540
|
$.set(currentIndex, $.get(currentIndex) + 1);
|
5543
5541
|
} else if (props().loop) {
|
@@ -5554,20 +5552,33 @@ function Slider($$anchor, $$props) {
|
|
5554
5552
|
};
|
5555
5553
|
|
5556
5554
|
const handleClick = (e) => {
|
5557
|
-
|
5555
|
+
const isParentContainer = (el) => {
|
5556
|
+
if (!el) return false;
|
5557
|
+
return el === $.get(containerElement) || isParentContainer(el.parentElement);
|
5558
|
+
};
|
5559
|
+
|
5560
|
+
if (isParentContainer(e.target) && isDragging) {
|
5558
5561
|
e.preventDefault();
|
5559
5562
|
e.stopPropagation();
|
5560
5563
|
}
|
5561
5564
|
};
|
5562
5565
|
|
5563
|
-
const
|
5564
|
-
$.set(movedX,
|
5566
|
+
const move = (moved) => {
|
5567
|
+
$.set(movedX, moved);
|
5565
5568
|
|
5566
|
-
if (
|
5569
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
5567
5570
|
isDragging = true;
|
5568
5571
|
}
|
5569
5572
|
};
|
5570
5573
|
|
5574
|
+
const handleTouchmove = (e) => {
|
5575
|
+
const now = performance.now();
|
5576
|
+
|
5577
|
+
if (now - lastFrame < THROTTLE) return;
|
5578
|
+
move(startX - e.touches[0].clientX);
|
5579
|
+
lastFrame = now;
|
5580
|
+
};
|
5581
|
+
|
5571
5582
|
const handleTouchend = () => {
|
5572
5583
|
if ($.get(movedX) >= 32) {
|
5573
5584
|
toNext();
|
@@ -5585,16 +5596,12 @@ function Slider($$anchor, $$props) {
|
|
5585
5596
|
startX = e.touches[0].clientX;
|
5586
5597
|
isDragging = false;
|
5587
5598
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
5588
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
5589
|
-
document.addEventListener('click', handleClick
|
5599
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
5600
|
+
document.addEventListener('click', handleClick);
|
5590
5601
|
};
|
5591
5602
|
|
5592
5603
|
const handleMousemove = (e) => {
|
5593
|
-
|
5594
|
-
|
5595
|
-
if ($.get(movedX) > 10 || $.get(movedX) < -10) {
|
5596
|
-
isDragging = true;
|
5597
|
-
}
|
5604
|
+
move(startX - e.clientX);
|
5598
5605
|
};
|
5599
5606
|
|
5600
5607
|
const handleMouseup = (e) => {
|
@@ -5607,7 +5614,6 @@ function Slider($$anchor, $$props) {
|
|
5607
5614
|
$.set(movedX, null);
|
5608
5615
|
|
5609
5616
|
if (isDragging) {
|
5610
|
-
e.preventDefault();
|
5611
5617
|
e.stopPropagation();
|
5612
5618
|
}
|
5613
5619
|
|
@@ -5627,7 +5633,6 @@ function Slider($$anchor, $$props) {
|
|
5627
5633
|
onMount$1(() => {
|
5628
5634
|
setChildCount();
|
5629
5635
|
|
5630
|
-
// const childCountTimer = setInterval(setChildCount, 300);
|
5631
5636
|
let autoSlideTimer;
|
5632
5637
|
|
5633
5638
|
if (props().auto) {
|
@@ -5640,7 +5645,6 @@ function Slider($$anchor, $$props) {
|
|
5640
5645
|
}
|
5641
5646
|
|
5642
5647
|
return () => {
|
5643
|
-
// clearInterval(childCountTimer)
|
5644
5648
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
5645
5649
|
};
|
5646
5650
|
});
|
@@ -5668,10 +5672,6 @@ function Slider($$anchor, $$props) {
|
|
5668
5672
|
$.set(itemWidthPercentage, props().itemWidthPercentage ?? 100);
|
5669
5673
|
});
|
5670
5674
|
|
5671
|
-
$.legacy_pre_effect(() => (objToStyle), () => {
|
5672
|
-
$.set(style, objToStyle({ overflow: 'hidden', width: '100%' }));
|
5673
|
-
});
|
5674
|
-
|
5675
5675
|
$.legacy_pre_effect(
|
5676
5676
|
() => (
|
5677
5677
|
$.get(currentIndex),
|
@@ -5735,7 +5735,8 @@ function Slider($$anchor, $$props) {
|
|
5735
5735
|
borderRadius: '100%',
|
5736
5736
|
display: 'block',
|
5737
5737
|
background: '#AAAAAA',
|
5738
|
-
border: 0
|
5738
|
+
border: 0,
|
5739
|
+
cursor: 'pointer'
|
5739
5740
|
});
|
5740
5741
|
});
|
5741
5742
|
|
@@ -5743,16 +5744,19 @@ function Slider($$anchor, $$props) {
|
|
5743
5744
|
$.init();
|
5744
5745
|
|
5745
5746
|
var div = root$d();
|
5746
|
-
var
|
5747
|
+
var div_1 = $.child(div);
|
5748
|
+
var ul = $.child(div_1);
|
5747
5749
|
var node = $.child(ul);
|
5748
5750
|
|
5749
5751
|
$.slot(node, $$props, 'default', {}, null);
|
5750
5752
|
$.reset(ul);
|
5751
5753
|
$.bind_this(ul, ($$value) => $.set(slotElement, $$value), () => $.get(slotElement));
|
5754
|
+
$.reset(div_1);
|
5755
|
+
$.bind_this(div_1, ($$value) => $.set(containerElement, $$value), () => $.get(containerElement));
|
5752
5756
|
|
5753
|
-
var
|
5757
|
+
var div_2 = $.sibling(div_1, 2);
|
5754
5758
|
|
5755
|
-
$.each(
|
5759
|
+
$.each(div_2, 5, () => $.get(indicators) ?? [], $.index, ($$anchor, indicator, i) => {
|
5756
5760
|
var button = root_1$2();
|
5757
5761
|
var i_1 = $.child(button);
|
5758
5762
|
|
@@ -5783,15 +5787,14 @@ function Slider($$anchor, $$props) {
|
|
5783
5787
|
$.append($$anchor, button);
|
5784
5788
|
});
|
5785
5789
|
|
5786
|
-
$.reset(
|
5790
|
+
$.reset(div_2);
|
5787
5791
|
$.reset(div);
|
5788
5792
|
|
5789
5793
|
$.template_effect(
|
5790
5794
|
($0) => {
|
5791
5795
|
$.set_attribute(div, 'data-layer-id', layerId());
|
5792
|
-
$.set_style(div, $.get(style));
|
5793
5796
|
$.set_style(ul, $0);
|
5794
|
-
$.set_style(
|
5797
|
+
$.set_style(div_2, $.get(indicatorListStyle));
|
5795
5798
|
},
|
5796
5799
|
[
|
5797
5800
|
() => [
|
@@ -5802,8 +5805,8 @@ function Slider($$anchor, $$props) {
|
|
5802
5805
|
$.derived_safe_equal
|
5803
5806
|
);
|
5804
5807
|
|
5805
|
-
$.event('mousedown',
|
5806
|
-
$.event('touchstart',
|
5808
|
+
$.event('mousedown', div_1, handleMousedown);
|
5809
|
+
$.event('touchstart', div_1, handleTouchstart);
|
5807
5810
|
$.append($$anchor, div);
|
5808
5811
|
$.pop();
|
5809
5812
|
}
|