flowbite-svelte 1.8.1 → 1.8.2
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.
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
let forward = $state(true);
|
|
21
|
+
let initialized = false;
|
|
21
22
|
|
|
22
23
|
subscribe((_state) => {
|
|
23
24
|
index = _state.index;
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
|
|
28
29
|
onMount(() => {
|
|
29
30
|
onchange?.(images[index]);
|
|
31
|
+
initialized = true;
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
const nextSlide = () => {
|
|
@@ -49,20 +51,17 @@
|
|
|
49
51
|
});
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
const loop = (node: HTMLElement
|
|
54
|
+
const loop = (node: HTMLElement) => {
|
|
53
55
|
// loop timer
|
|
54
56
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
55
57
|
let intervalId: any;
|
|
56
58
|
|
|
57
|
-
if (duration > 0)
|
|
59
|
+
if (duration > 0) {
|
|
60
|
+
intervalId = setInterval(nextSlide, duration);
|
|
61
|
+
if (initialized) forward ? nextSlide() : prevSlide();
|
|
62
|
+
}
|
|
58
63
|
|
|
59
|
-
return
|
|
60
|
-
update: (duration: number) => {
|
|
61
|
-
clearInterval(intervalId);
|
|
62
|
-
if (duration > 0) intervalId = setInterval(nextSlide, duration);
|
|
63
|
-
},
|
|
64
|
-
destroy: () => clearInterval(intervalId)
|
|
65
|
-
};
|
|
64
|
+
return () => clearInterval(intervalId);
|
|
66
65
|
};
|
|
67
66
|
|
|
68
67
|
type ActiveDragGesture = {
|
|
@@ -167,7 +166,7 @@
|
|
|
167
166
|
<!-- The move listeners go here, so things keep working if the touch strays out of the element. -->
|
|
168
167
|
<svelte:document onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} />
|
|
169
168
|
<div bind:this={carouselDiv} class={cn("relative", divClass)} onmousedown={onDragStart} ontouchstart={onDragStart} onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} role="button" aria-label={ariaLabel} tabindex="0">
|
|
170
|
-
<div {...restProps} class={cn(carousel(), activeDragGesture === undefined ? "transition-transform" : "", className)}
|
|
169
|
+
<div {...restProps} class={cn(carousel(), activeDragGesture === undefined ? "transition-transform" : "", className)} {@attach loop}>
|
|
171
170
|
{#if slide}
|
|
172
171
|
{@render slide({ index, Slide })}
|
|
173
172
|
{:else}
|
package/dist/modal/Modal.svelte
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</script>
|
|
64
64
|
|
|
65
65
|
{#if open}
|
|
66
|
-
<dialog use:trapFocus={{ onEscape: handleEscape }} bind:this={dlg} {...restProps} class={twMerge(base(), clsx(className))} tabindex="-1" oncancel={_oncancel} onclick={_onclick} transition:transition={paramsOptions as ParamsType} onintrostart={() => (modal ? dlg?.showModal() : dlg?.show())} onoutroend={() => dlg?.close()}>
|
|
66
|
+
<dialog use:trapFocus={{ onEscape: handleEscape }} bind:this={dlg} {...restProps} class={twMerge(base(), clsx(className))} tabindex="-1" oncancel={_oncancel} onclick={_onclick} transition:transition|global={paramsOptions as ParamsType} onintrostart={() => (modal ? dlg?.showModal() : dlg?.show())} onoutroend={() => dlg?.close()}>
|
|
67
67
|
{#if title || header}
|
|
68
68
|
<div class={twMerge(headerCls(), clsx(headerClass))}>
|
|
69
69
|
{#if title}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@eslint/js": "^9.29.0",
|
|
20
20
|
"@flowbite-svelte-plugins/chart": "^0.2.4",
|
|
21
21
|
"@flowbite-svelte-plugins/datatable": "^0.3.4",
|
|
22
|
-
"@flowbite-svelte-plugins/texteditor": "^0.
|
|
22
|
+
"@flowbite-svelte-plugins/texteditor": "^0.13.3",
|
|
23
23
|
"@playwright/test": "^1.53.1",
|
|
24
24
|
"@sveltejs/adapter-auto": "^6.0.1",
|
|
25
25
|
"@sveltejs/adapter-vercel": "^5.7.2",
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
"flowbite-svelte-icons": "^2.2.1",
|
|
41
41
|
"flowbite-typography": "^1.0.5",
|
|
42
42
|
"globals": "^16.2.0",
|
|
43
|
+
"highlight.js": "^11.11.1",
|
|
43
44
|
"jsdom": "^26.1.0",
|
|
44
45
|
"lowlight": "^3.3.0",
|
|
45
46
|
"mdsvex": "^0.12.6",
|
|
46
47
|
"mdsvexamples": "^0.5.0",
|
|
47
|
-
"prettier": "^3.
|
|
48
|
+
"prettier": "^3.6.0",
|
|
48
49
|
"prettier-plugin-svelte": "^3.4.0",
|
|
49
50
|
"prettier-plugin-tailwindcss": "^0.6.13",
|
|
50
51
|
"prism-themes": "^1.9.0",
|