@plaidev/karte-action-sdk 1.1.268-29089896.0dceea5e → 1.1.268-29092453.64ab24dc
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.d.ts +4 -4
- package/dist/hydrate/index.es.js +100 -81
- package/dist/index.es.d.ts +4 -4
- package/dist/index.es.js +100 -81
- package/dist/svelte5/hydrate/index.es.d.ts +4 -4
- package/dist/svelte5/hydrate/index.es.js +38 -30
- package/dist/svelte5/index.es.d.ts +4 -4
- package/dist/svelte5/index.es.js +38 -30
- package/dist/svelte5/index.front2.es.js +38 -30
- package/package.json +2 -2
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);
|
@@ -16227,9 +16227,9 @@ function create_fragment$j(ctx) {
|
|
16227
16227
|
let current;
|
16228
16228
|
let mounted;
|
16229
16229
|
let dispose;
|
16230
|
-
const default_slot_template = /*#slots*/ ctx[
|
16231
|
-
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[
|
16232
|
-
let each_value = /*indicators*/ ctx[
|
16230
|
+
const default_slot_template = /*#slots*/ ctx[19].default;
|
16231
|
+
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[18], null);
|
16232
|
+
let each_value = /*indicators*/ ctx[7] ?? [];
|
16233
16233
|
let each_blocks = [];
|
16234
16234
|
|
16235
16235
|
for (let i = 0; i < each_value.length; i += 1) {
|
@@ -16249,12 +16249,12 @@ function create_fragment$j(ctx) {
|
|
16249
16249
|
each_blocks[i].c();
|
16250
16250
|
}
|
16251
16251
|
|
16252
|
-
attr(ul, "class", "slider-list svelte-
|
16253
|
-
attr(ul, "style", ul_style_value = [/*containerStyle*/ ctx[
|
16254
|
-
attr(div0, "class", "slider-container svelte-
|
16255
|
-
attr(div1, "style", /*indicatorListStyle*/ ctx[
|
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
16256
|
attr(div2, "data-layer-id", /*layerId*/ ctx[0]);
|
16257
|
-
attr(div2, "class", "slider svelte-
|
16257
|
+
attr(div2, "class", "slider svelte-wwv1o");
|
16258
16258
|
},
|
16259
16259
|
m(target, anchor) {
|
16260
16260
|
insert(target, div2, anchor);
|
@@ -16265,7 +16265,8 @@ function create_fragment$j(ctx) {
|
|
16265
16265
|
default_slot.m(ul, null);
|
16266
16266
|
}
|
16267
16267
|
|
16268
|
-
/*ul_binding*/ ctx[
|
16268
|
+
/*ul_binding*/ ctx[20](ul);
|
16269
|
+
/*div0_binding*/ ctx[21](div0);
|
16269
16270
|
append(div2, t);
|
16270
16271
|
append(div2, div1);
|
16271
16272
|
|
@@ -16277,8 +16278,8 @@ function create_fragment$j(ctx) {
|
|
16277
16278
|
|
16278
16279
|
if (!mounted) {
|
16279
16280
|
dispose = [
|
16280
|
-
listen(div0, "mousedown", /*handleMousedown*/ ctx[
|
16281
|
-
listen(div0, "touchstart", /*handleTouchstart*/ ctx[
|
16281
|
+
listen(div0, "mousedown", /*handleMousedown*/ ctx[10]),
|
16282
|
+
listen(div0, "touchstart", /*handleTouchstart*/ ctx[9])
|
16282
16283
|
];
|
16283
16284
|
|
16284
16285
|
mounted = true;
|
@@ -16286,26 +16287,26 @@ function create_fragment$j(ctx) {
|
|
16286
16287
|
},
|
16287
16288
|
p(ctx, dirty) {
|
16288
16289
|
if (default_slot) {
|
16289
|
-
if (default_slot.p && (!current || dirty[0] & /*$$scope*/
|
16290
|
+
if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 262144)) {
|
16290
16291
|
update_slot_base(
|
16291
16292
|
default_slot,
|
16292
16293
|
default_slot_template,
|
16293
16294
|
ctx,
|
16294
|
-
/*$$scope*/ ctx[
|
16295
|
+
/*$$scope*/ ctx[18],
|
16295
16296
|
!current
|
16296
|
-
? get_all_dirty_from_scope(/*$$scope*/ ctx[
|
16297
|
-
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[
|
16297
|
+
? get_all_dirty_from_scope(/*$$scope*/ ctx[18])
|
16298
|
+
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[18], dirty, null),
|
16298
16299
|
null
|
16299
16300
|
);
|
16300
16301
|
}
|
16301
16302
|
}
|
16302
16303
|
|
16303
|
-
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(' '))) {
|
16304
16305
|
attr(ul, "style", ul_style_value);
|
16305
16306
|
}
|
16306
16307
|
|
16307
|
-
if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/
|
16308
|
-
each_value = /*indicators*/ ctx[
|
16308
|
+
if (dirty[0] & /*handleClickIndicator, indicatorItemStyle, indicators*/ 400) {
|
16309
|
+
each_value = /*indicators*/ ctx[7] ?? [];
|
16309
16310
|
let i;
|
16310
16311
|
|
16311
16312
|
for (i = 0; i < each_value.length; i += 1) {
|
@@ -16327,8 +16328,8 @@ function create_fragment$j(ctx) {
|
|
16327
16328
|
each_blocks.length = each_value.length;
|
16328
16329
|
}
|
16329
16330
|
|
16330
|
-
if (!current || dirty[0] & /*indicatorListStyle*/
|
16331
|
-
attr(div1, "style", /*indicatorListStyle*/ ctx[
|
16331
|
+
if (!current || dirty[0] & /*indicatorListStyle*/ 32) {
|
16332
|
+
attr(div1, "style", /*indicatorListStyle*/ ctx[5]);
|
16332
16333
|
}
|
16333
16334
|
|
16334
16335
|
if (!current || dirty[0] & /*layerId*/ 1) {
|
@@ -16347,7 +16348,8 @@ function create_fragment$j(ctx) {
|
|
16347
16348
|
d(detaching) {
|
16348
16349
|
if (detaching) detach(div2);
|
16349
16350
|
if (default_slot) default_slot.d(detaching);
|
16350
|
-
/*ul_binding*/ ctx[
|
16351
|
+
/*ul_binding*/ ctx[20](null);
|
16352
|
+
/*div0_binding*/ ctx[21](null);
|
16351
16353
|
destroy_each(each_blocks, detaching);
|
16352
16354
|
mounted = false;
|
16353
16355
|
run_all(dispose);
|
@@ -16355,6 +16357,8 @@ function create_fragment$j(ctx) {
|
|
16355
16357
|
};
|
16356
16358
|
}
|
16357
16359
|
|
16360
|
+
const THROTTLE = 16;
|
16361
|
+
|
16358
16362
|
function instance$j($$self, $$props, $$invalidate) {
|
16359
16363
|
let indicators;
|
16360
16364
|
let itemWidthPercentage;
|
@@ -16367,6 +16371,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16367
16371
|
let { props } = $$props;
|
16368
16372
|
let { overrideStyle } = $$props;
|
16369
16373
|
useInjectCustomizeCss(props);
|
16374
|
+
let containerElement;
|
16370
16375
|
let slotElement;
|
16371
16376
|
let currentIndex = 0;
|
16372
16377
|
let isDragging = false;
|
@@ -16374,7 +16379,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16374
16379
|
let movedX = null;
|
16375
16380
|
let childCount = 0;
|
16376
16381
|
let transformX;
|
16377
|
-
|
16382
|
+
let lastFrame = 0;
|
16378
16383
|
|
16379
16384
|
const computeTransformX = (index, itemCount, movedX, itemWidthPercentage, gap) => {
|
16380
16385
|
if (index === 0) return;
|
@@ -16390,54 +16395,64 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16390
16395
|
}
|
16391
16396
|
|
16392
16397
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
16393
|
-
return `
|
16398
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
16394
16399
|
};
|
16395
16400
|
|
16396
16401
|
const handleClickIndicator = index => {
|
16397
|
-
$$invalidate(
|
16402
|
+
$$invalidate(12, currentIndex = index);
|
16398
16403
|
};
|
16399
16404
|
|
16400
16405
|
const setChildCount = () => {
|
16401
16406
|
const count = slotElement?.children?.length ?? 0;
|
16402
16407
|
|
16403
16408
|
if (count !== childCount) {
|
16404
|
-
$$invalidate(
|
16409
|
+
$$invalidate(14, childCount = slotElement?.children?.length ?? 0);
|
16405
16410
|
}
|
16406
16411
|
};
|
16407
16412
|
|
16408
16413
|
const toNext = () => {
|
16409
|
-
console.log('toNext');
|
16410
|
-
|
16411
16414
|
if (currentIndex < childCount - 1) {
|
16412
|
-
$$invalidate(
|
16415
|
+
$$invalidate(12, currentIndex = currentIndex + 1);
|
16413
16416
|
} else if (props.loop) {
|
16414
|
-
$$invalidate(
|
16417
|
+
$$invalidate(12, currentIndex = 0);
|
16415
16418
|
}
|
16416
16419
|
};
|
16417
16420
|
|
16418
16421
|
const toPrev = () => {
|
16419
16422
|
if (currentIndex > 0) {
|
16420
|
-
$$invalidate(
|
16423
|
+
$$invalidate(12, currentIndex = currentIndex - 1);
|
16421
16424
|
} else if (props.loop) {
|
16422
|
-
$$invalidate(
|
16425
|
+
$$invalidate(12, currentIndex = childCount - 1);
|
16423
16426
|
}
|
16424
16427
|
};
|
16425
16428
|
|
16426
16429
|
const handleClick = e => {
|
16427
|
-
|
16430
|
+
const isParentContainer = el => {
|
16431
|
+
if (!el) return false;
|
16432
|
+
return el === containerElement || isParentContainer(el.parentElement);
|
16433
|
+
};
|
16434
|
+
|
16435
|
+
if (isParentContainer(e.target) && isDragging) {
|
16428
16436
|
e.preventDefault();
|
16429
16437
|
e.stopPropagation();
|
16430
16438
|
}
|
16431
16439
|
};
|
16432
16440
|
|
16433
|
-
const
|
16434
|
-
$$invalidate(
|
16441
|
+
const move = moved => {
|
16442
|
+
$$invalidate(13, movedX = moved);
|
16435
16443
|
|
16436
|
-
if (
|
16444
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
16437
16445
|
isDragging = true;
|
16438
16446
|
}
|
16439
16447
|
};
|
16440
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
|
+
|
16441
16456
|
const handleTouchend = () => {
|
16442
16457
|
if (movedX >= 32) {
|
16443
16458
|
toNext();
|
@@ -16445,7 +16460,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16445
16460
|
toPrev();
|
16446
16461
|
}
|
16447
16462
|
|
16448
|
-
$$invalidate(
|
16463
|
+
$$invalidate(13, movedX = null);
|
16449
16464
|
document.removeEventListener('touchmove', handleTouchmove);
|
16450
16465
|
document.removeEventListener('touchend', handleTouchend);
|
16451
16466
|
document.removeEventListener('click', handleClick);
|
@@ -16455,16 +16470,12 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16455
16470
|
startX = e.touches[0].clientX;
|
16456
16471
|
isDragging = false;
|
16457
16472
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
16458
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
16459
|
-
document.addEventListener('click', handleClick
|
16473
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
16474
|
+
document.addEventListener('click', handleClick);
|
16460
16475
|
};
|
16461
16476
|
|
16462
16477
|
const handleMousemove = e => {
|
16463
|
-
|
16464
|
-
|
16465
|
-
if (movedX > 10 || movedX < -10) {
|
16466
|
-
isDragging = true;
|
16467
|
-
}
|
16478
|
+
move(startX - e.clientX);
|
16468
16479
|
};
|
16469
16480
|
|
16470
16481
|
const handleMouseup = e => {
|
@@ -16474,10 +16485,9 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16474
16485
|
toPrev();
|
16475
16486
|
}
|
16476
16487
|
|
16477
|
-
$$invalidate(
|
16488
|
+
$$invalidate(13, movedX = null);
|
16478
16489
|
|
16479
16490
|
if (isDragging) {
|
16480
|
-
// e.preventDefault()
|
16481
16491
|
e.stopPropagation();
|
16482
16492
|
}
|
16483
16493
|
|
@@ -16508,7 +16518,6 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16508
16518
|
}
|
16509
16519
|
|
16510
16520
|
return () => {
|
16511
|
-
// clearInterval(childCountTimer)
|
16512
16521
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
16513
16522
|
};
|
16514
16523
|
});
|
@@ -16520,36 +16529,43 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16520
16529
|
});
|
16521
16530
|
}
|
16522
16531
|
|
16532
|
+
function div0_binding($$value) {
|
16533
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
16534
|
+
containerElement = $$value;
|
16535
|
+
$$invalidate(3, containerElement);
|
16536
|
+
});
|
16537
|
+
}
|
16538
|
+
|
16523
16539
|
const click_handler = i => handleClickIndicator(i);
|
16524
16540
|
|
16525
16541
|
$$self.$$set = $$props => {
|
16526
16542
|
if ('layerId' in $$props) $$invalidate(0, layerId = $$props.layerId);
|
16527
|
-
if ('props' in $$props) $$invalidate(
|
16543
|
+
if ('props' in $$props) $$invalidate(11, props = $$props.props);
|
16528
16544
|
if ('overrideStyle' in $$props) $$invalidate(1, overrideStyle = $$props.overrideStyle);
|
16529
|
-
if ('$$scope' in $$props) $$invalidate(
|
16545
|
+
if ('$$scope' in $$props) $$invalidate(18, $$scope = $$props.$$scope);
|
16530
16546
|
};
|
16531
16547
|
|
16532
16548
|
$$self.$$.update = () => {
|
16533
16549
|
if ($$self.$$.dirty[0] & /*slotElement*/ 4) {
|
16534
16550
|
if (slotElement) {
|
16535
|
-
$$invalidate(
|
16551
|
+
$$invalidate(14, childCount = slotElement.children.length);
|
16536
16552
|
}
|
16537
16553
|
}
|
16538
16554
|
|
16539
|
-
if ($$self.$$.dirty[0] & /*childCount, currentIndex*/
|
16540
|
-
$$invalidate(
|
16555
|
+
if ($$self.$$.dirty[0] & /*childCount, currentIndex*/ 20480) {
|
16556
|
+
$$invalidate(7, indicators = [...Array(childCount)].map((_, i) => ({ index: i, isActive: i === currentIndex })));
|
16541
16557
|
}
|
16542
16558
|
|
16543
|
-
if ($$self.$$.dirty[0] & /*props*/
|
16544
|
-
$$invalidate(
|
16559
|
+
if ($$self.$$.dirty[0] & /*props*/ 2048) {
|
16560
|
+
$$invalidate(17, itemWidthPercentage = props.itemWidthPercentage ?? 100);
|
16545
16561
|
}
|
16546
16562
|
|
16547
|
-
if ($$self.$$.dirty[0] & /*currentIndex, childCount, movedX, itemWidthPercentage, props*/
|
16548
|
-
$$invalidate(
|
16563
|
+
if ($$self.$$.dirty[0] & /*currentIndex, childCount, movedX, itemWidthPercentage, props*/ 161792) {
|
16564
|
+
$$invalidate(15, transformX = computeTransformX(currentIndex, childCount, movedX, itemWidthPercentage, props.gap ?? 0));
|
16549
16565
|
}
|
16550
16566
|
|
16551
|
-
if ($$self.$$.dirty[0] & /*props, itemWidthPercentage, movedX*/
|
16552
|
-
$$invalidate(
|
16567
|
+
if ($$self.$$.dirty[0] & /*props, itemWidthPercentage, movedX*/ 141312) {
|
16568
|
+
$$invalidate(16, baseContainerStyle = {
|
16553
16569
|
display: 'grid',
|
16554
16570
|
// marginInline: `-${props.gap}px`,
|
16555
16571
|
gap: `${props.gap}px`,
|
@@ -16562,34 +16578,36 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16562
16578
|
});
|
16563
16579
|
}
|
16564
16580
|
|
16565
|
-
if ($$self.$$.dirty[0] & /*baseContainerStyle, transformX*/
|
16566
|
-
$$invalidate(
|
16581
|
+
if ($$self.$$.dirty[0] & /*baseContainerStyle, transformX*/ 98304) {
|
16582
|
+
$$invalidate(6, containerStyle = objToStyle({
|
16567
16583
|
...baseContainerStyle,
|
16568
16584
|
transform: transformX
|
16569
16585
|
}));
|
16570
16586
|
}
|
16571
16587
|
};
|
16572
16588
|
|
16573
|
-
$$invalidate(
|
16589
|
+
$$invalidate(5, indicatorListStyle = objToStyle({
|
16574
16590
|
display: 'flex',
|
16575
16591
|
justifyContent: 'center',
|
16576
16592
|
gap: '4px',
|
16577
16593
|
marginTop: '12px'
|
16578
16594
|
}));
|
16579
16595
|
|
16580
|
-
$$invalidate(
|
16596
|
+
$$invalidate(4, indicatorItemStyle = {
|
16581
16597
|
width: '8px',
|
16582
16598
|
height: '8px',
|
16583
16599
|
borderRadius: '100%',
|
16584
16600
|
display: 'block',
|
16585
16601
|
background: '#AAAAAA',
|
16586
|
-
border: 0
|
16602
|
+
border: 0,
|
16603
|
+
cursor: 'pointer'
|
16587
16604
|
});
|
16588
16605
|
|
16589
16606
|
return [
|
16590
16607
|
layerId,
|
16591
16608
|
overrideStyle,
|
16592
16609
|
slotElement,
|
16610
|
+
containerElement,
|
16593
16611
|
indicatorItemStyle,
|
16594
16612
|
indicatorListStyle,
|
16595
16613
|
containerStyle,
|
@@ -16607,6 +16625,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16607
16625
|
$$scope,
|
16608
16626
|
slots,
|
16609
16627
|
ul_binding,
|
16628
|
+
div0_binding,
|
16610
16629
|
click_handler
|
16611
16630
|
];
|
16612
16631
|
}
|
@@ -16614,7 +16633,7 @@ function instance$j($$self, $$props, $$invalidate) {
|
|
16614
16633
|
class Slider extends SvelteComponent {
|
16615
16634
|
constructor(options) {
|
16616
16635
|
super();
|
16617
|
-
init(this, options, instance$j, create_fragment$j, safe_not_equal, { layerId: 0, props:
|
16636
|
+
init(this, options, instance$j, create_fragment$j, safe_not_equal, { layerId: 0, props: 11, overrideStyle: 1 }, add_css$f, [-1, -1]);
|
16618
16637
|
}
|
16619
16638
|
}
|
16620
16639
|
|
@@ -19315,10 +19334,10 @@ function formatTimeDiff(ms) {
|
|
19315
19334
|
const diffSec = Math.floor(ms / 1000) % 60;
|
19316
19335
|
|
19317
19336
|
return {
|
19318
|
-
day: diffDay
|
19319
|
-
hour: diffHour
|
19320
|
-
min: diffMin
|
19321
|
-
sec: diffSec
|
19337
|
+
day: diffDay,
|
19338
|
+
hour: diffHour,
|
19339
|
+
min: diffMin,
|
19340
|
+
sec: diffSec
|
19322
19341
|
};
|
19323
19342
|
}
|
19324
19343
|
|
@@ -19523,13 +19542,13 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
19523
19542
|
const { day, hour, min, sec } = $countdownStore;
|
19524
19543
|
|
19525
19544
|
switch (props.type) {
|
19526
|
-
case
|
19545
|
+
case 'day':
|
19527
19546
|
return day?.toString().padStart(2, '0') ?? '';
|
19528
|
-
case
|
19547
|
+
case 'hour':
|
19529
19548
|
return hour?.toString().padStart(2, '0') ?? '';
|
19530
|
-
case
|
19549
|
+
case 'minute':
|
19531
19550
|
return min?.toString().padStart(2, '0') ?? '';
|
19532
|
-
case
|
19551
|
+
case 'second':
|
19533
19552
|
return sec?.toString().padStart(2, '0') ?? '';
|
19534
19553
|
default:
|
19535
19554
|
return '';
|
@@ -2886,10 +2886,10 @@ type CountDownValueProps = LayerTextProps & {
|
|
2886
2886
|
type: CountDownValueType;
|
2887
2887
|
};
|
2888
2888
|
type CountDownValues = {
|
2889
|
-
day:
|
2890
|
-
hour:
|
2891
|
-
min:
|
2892
|
-
sec:
|
2889
|
+
day: number;
|
2890
|
+
hour: number;
|
2891
|
+
min: number;
|
2892
|
+
sec: number;
|
2893
2893
|
};
|
2894
2894
|
type ClipboardProps = CommonProps & {
|
2895
2895
|
content?: string;
|
@@ -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.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) {
|
@@ -5487,6 +5487,7 @@ function Slider($$anchor, $$props) {
|
|
5487
5487
|
|
5488
5488
|
useInjectCustomizeCss(props());
|
5489
5489
|
|
5490
|
+
let containerElement = $.mutable_state();
|
5490
5491
|
let slotElement = $.mutable_state();
|
5491
5492
|
let currentIndex = $.mutable_state(0);
|
5492
5493
|
let isDragging = false;
|
@@ -5494,8 +5495,8 @@ function Slider($$anchor, $$props) {
|
|
5494
5495
|
let movedX = $.mutable_state(null);
|
5495
5496
|
let childCount = $.mutable_state(0);
|
5496
5497
|
let transformX = $.mutable_state();
|
5497
|
-
|
5498
|
-
|
5498
|
+
let lastFrame = 0;
|
5499
|
+
const THROTTLE = 16;
|
5499
5500
|
|
5500
5501
|
const computeTransformX = (
|
5501
5502
|
index,
|
@@ -5519,7 +5520,7 @@ function Slider($$anchor, $$props) {
|
|
5519
5520
|
|
5520
5521
|
const moved = movedX ? ` + ${-movedX}px` : '';
|
5521
5522
|
|
5522
|
-
return `
|
5523
|
+
return `translate3d(calc(-${result}% - ${gap * index}px${moved}), 0, 0)`;
|
5523
5524
|
};
|
5524
5525
|
|
5525
5526
|
const handleClickIndicator = (index) => {
|
@@ -5535,8 +5536,6 @@ function Slider($$anchor, $$props) {
|
|
5535
5536
|
};
|
5536
5537
|
|
5537
5538
|
const toNext = () => {
|
5538
|
-
console.log('toNext');
|
5539
|
-
|
5540
5539
|
if ($.get(currentIndex) < $.get(childCount) - 1) {
|
5541
5540
|
$.set(currentIndex, $.get(currentIndex) + 1);
|
5542
5541
|
} else if (props().loop) {
|
@@ -5553,20 +5552,33 @@ function Slider($$anchor, $$props) {
|
|
5553
5552
|
};
|
5554
5553
|
|
5555
5554
|
const handleClick = (e) => {
|
5556
|
-
|
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) {
|
5557
5561
|
e.preventDefault();
|
5558
5562
|
e.stopPropagation();
|
5559
5563
|
}
|
5560
5564
|
};
|
5561
5565
|
|
5562
|
-
const
|
5563
|
-
$.set(movedX,
|
5566
|
+
const move = (moved) => {
|
5567
|
+
$.set(movedX, moved);
|
5564
5568
|
|
5565
|
-
if (
|
5569
|
+
if ((moved > 10 || moved < -10) && !isDragging) {
|
5566
5570
|
isDragging = true;
|
5567
5571
|
}
|
5568
5572
|
};
|
5569
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
|
+
|
5570
5582
|
const handleTouchend = () => {
|
5571
5583
|
if ($.get(movedX) >= 32) {
|
5572
5584
|
toNext();
|
@@ -5584,16 +5596,12 @@ function Slider($$anchor, $$props) {
|
|
5584
5596
|
startX = e.touches[0].clientX;
|
5585
5597
|
isDragging = false;
|
5586
5598
|
document.addEventListener('touchmove', handleTouchmove, { passive: true });
|
5587
|
-
document.addEventListener('touchend', handleTouchend, { passive:
|
5588
|
-
document.addEventListener('click', handleClick
|
5599
|
+
document.addEventListener('touchend', handleTouchend, { passive: false });
|
5600
|
+
document.addEventListener('click', handleClick);
|
5589
5601
|
};
|
5590
5602
|
|
5591
5603
|
const handleMousemove = (e) => {
|
5592
|
-
|
5593
|
-
|
5594
|
-
if ($.get(movedX) > 10 || $.get(movedX) < -10) {
|
5595
|
-
isDragging = true;
|
5596
|
-
}
|
5604
|
+
move(startX - e.clientX);
|
5597
5605
|
};
|
5598
5606
|
|
5599
5607
|
const handleMouseup = (e) => {
|
@@ -5606,7 +5614,6 @@ function Slider($$anchor, $$props) {
|
|
5606
5614
|
$.set(movedX, null);
|
5607
5615
|
|
5608
5616
|
if (isDragging) {
|
5609
|
-
// e.preventDefault()
|
5610
5617
|
e.stopPropagation();
|
5611
5618
|
}
|
5612
5619
|
|
@@ -5638,7 +5645,6 @@ function Slider($$anchor, $$props) {
|
|
5638
5645
|
}
|
5639
5646
|
|
5640
5647
|
return () => {
|
5641
|
-
// clearInterval(childCountTimer)
|
5642
5648
|
if (autoSlideTimer) clearInterval(autoSlideTimer);
|
5643
5649
|
};
|
5644
5650
|
});
|
@@ -5729,7 +5735,8 @@ function Slider($$anchor, $$props) {
|
|
5729
5735
|
borderRadius: '100%',
|
5730
5736
|
display: 'block',
|
5731
5737
|
background: '#AAAAAA',
|
5732
|
-
border: 0
|
5738
|
+
border: 0,
|
5739
|
+
cursor: 'pointer'
|
5733
5740
|
});
|
5734
5741
|
});
|
5735
5742
|
|
@@ -5745,6 +5752,7 @@ function Slider($$anchor, $$props) {
|
|
5745
5752
|
$.reset(ul);
|
5746
5753
|
$.bind_this(ul, ($$value) => $.set(slotElement, $$value), () => $.get(slotElement));
|
5747
5754
|
$.reset(div_1);
|
5755
|
+
$.bind_this(div_1, ($$value) => $.set(containerElement, $$value), () => $.get(containerElement));
|
5748
5756
|
|
5749
5757
|
var div_2 = $.sibling(div_1, 2);
|
5750
5758
|
|
@@ -7403,10 +7411,10 @@ function CountDown($$anchor, $$props) {
|
|
7403
7411
|
const diffSec = Math.floor(ms / 1000) % 60;
|
7404
7412
|
|
7405
7413
|
return {
|
7406
|
-
day: diffDay
|
7407
|
-
hour: diffHour
|
7408
|
-
min: diffMin
|
7409
|
-
sec: diffSec
|
7414
|
+
day: diffDay,
|
7415
|
+
hour: diffHour,
|
7416
|
+
min: diffMin,
|
7417
|
+
sec: diffSec
|
7410
7418
|
};
|
7411
7419
|
}
|
7412
7420
|
|
@@ -7584,16 +7592,16 @@ function CountDownValue($$anchor, $$props) {
|
|
7584
7592
|
const { day, hour, min, sec } = $countdownStore();
|
7585
7593
|
|
7586
7594
|
switch (props().type) {
|
7587
|
-
case
|
7595
|
+
case 'day':
|
7588
7596
|
return day?.toString().padStart(2, '0') ?? '';
|
7589
7597
|
|
7590
|
-
case
|
7598
|
+
case 'hour':
|
7591
7599
|
return hour?.toString().padStart(2, '0') ?? '';
|
7592
7600
|
|
7593
|
-
case
|
7601
|
+
case 'minute':
|
7594
7602
|
return min?.toString().padStart(2, '0') ?? '';
|
7595
7603
|
|
7596
|
-
case
|
7604
|
+
case 'second':
|
7597
7605
|
return sec?.toString().padStart(2, '0') ?? '';
|
7598
7606
|
|
7599
7607
|
default:
|
@@ -2886,10 +2886,10 @@ type CountDownValueProps = LayerTextProps & {
|
|
2886
2886
|
type: CountDownValueType;
|
2887
2887
|
};
|
2888
2888
|
type CountDownValues = {
|
2889
|
-
day:
|
2890
|
-
hour:
|
2891
|
-
min:
|
2892
|
-
sec:
|
2889
|
+
day: number;
|
2890
|
+
hour: number;
|
2891
|
+
min: number;
|
2892
|
+
sec: number;
|
2893
2893
|
};
|
2894
2894
|
type ClipboardProps = CommonProps & {
|
2895
2895
|
content?: string;
|