solid-slider 1.2.5 → 1.2.8
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/README.md +11 -6
- package/dist/chunk-NXJS66U5.mjs +20 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +76 -57
- package/dist/index.mjs +42 -0
- package/dist/plugins/autoplay.js +42 -31
- package/dist/plugins/autoplay.mjs +21 -0
- package/package.json +16 -13
- package/dist/plugins/autoplay.d.ts +0 -28
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/solid-slider)
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
A carousel/slider implementation in TypeScript for SolidJS. It's built on
|
|
7
|
+
A carousel/slider implementation in TypeScript for SolidJS. It's built on Keen-Slider 6, an open-source library agnostic touch slider with native touch/swipe behavior and great performance. It comes with no dependencies, TypeScript support, multitouch support and is compatible with all common browsers.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ yarn add solid-slider ## or in yarn
|
|
|
16
16
|
Add as a module:
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import "solid-slider/
|
|
19
|
+
import "solid-slider/slider.css";
|
|
20
20
|
import createSlider from "solid-slider";
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -26,7 +26,11 @@ You can find a functional demo of the slider with most features implemented here
|
|
|
26
26
|
|
|
27
27
|
## Plugins
|
|
28
28
|
|
|
29
|
-
Plugins may be added directly via the createSlider primitive. You may add a
|
|
29
|
+
Plugins may be added directly via the createSlider primitive. You may add a Keen-Slider plugin directly or built-in plugins shipped with this package. Currently an autoplay plugin is available that will assist with autoplaying actions in the slider. Simply add the plugins after the options parameter. Please feel free to post requests for additional plugins or submit PRs if you decide to improve the base functionality. Some ideas for additional plugins include:
|
|
30
|
+
|
|
31
|
+
- Slider nav (dot, arrow controls even thumbnails)
|
|
32
|
+
- Lazy loaded images
|
|
33
|
+
- Slide transitions
|
|
30
34
|
|
|
31
35
|
### Autoplay
|
|
32
36
|
|
|
@@ -86,16 +90,17 @@ const MyComponent = () => {
|
|
|
86
90
|
|
|
87
91
|
## Implementation
|
|
88
92
|
|
|
89
|
-
Solid Slider is meant to be a lightweight and compact wrapper of
|
|
93
|
+
Solid Slider is meant to be a lightweight and compact wrapper of Keen-Slider. It exposes helpers to make working with the slider convenient. Note that the when the slider mounts it assumes all children in the el are slides. You can override this functionality by passing in a "selector" value to target the specific slides you'd like to include.
|
|
90
94
|
|
|
91
|
-
Thie library exports it's own CSS which is the basic
|
|
95
|
+
Thie library exports it's own CSS which is the basic Keen-Slider implementation for convenience. If you supply options as an accessor function, the slider will reactively update the configuration so that you don't have to destroy and recreate the slider. As of Keen-Slider 6 plugins are now fully supported. You may supply them as a param in createSlider. Note that plugins are not reactively updated and must be supplied on creation.
|
|
92
96
|
|
|
93
97
|
## Changelog
|
|
94
98
|
|
|
95
99
|
- 1.0.0 - Initial release
|
|
96
100
|
- 1.0.3 - Changed the exported API to be slightly more flexible.
|
|
97
|
-
- 1.1.1 - Upgraded to
|
|
101
|
+
- 1.1.1 - Upgraded to Keen-Slider 6 and improved general reactivity.
|
|
98
102
|
- 1.2.5 - Added autoplay plugin and general plugin structure
|
|
103
|
+
- 1.2.7 - Maybe I should actually export the .css? That'd be a good idea, right?
|
|
99
104
|
|
|
100
105
|
## Keen Options API
|
|
101
106
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
__spreadValues
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Accessor } from
|
|
2
|
-
import { KeenSliderHooks,
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { KeenSliderHooks, KeenSliderOptions, KeenSliderPlugin, TrackDetails, KeenSliderInstance } from 'keen-slider';
|
|
3
|
+
|
|
3
4
|
declare module "solid-js" {
|
|
4
5
|
namespace JSX {
|
|
5
6
|
interface Directives {
|
|
@@ -37,4 +38,5 @@ declare const createSlider: <O = {}, P = {}, H extends string = KeenSliderHooks>
|
|
|
37
38
|
slider: Accessor<KeenSliderInstance<O, P, H> | undefined>;
|
|
38
39
|
destroy: Accessor<void>;
|
|
39
40
|
}];
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
export { createSlider as default };
|
package/dist/index.js
CHANGED
|
@@ -1,58 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* const [create, { prev, next }] = createSlider();
|
|
21
|
-
* <div use:slider>...</div>
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
const createSlider = (options, ...plugins) => {
|
|
25
|
-
let slider;
|
|
26
|
-
const [current, setCurrent] = createSignal(0);
|
|
27
|
-
const destroy = () => slider && slider.destroy();
|
|
28
|
-
// Slider creation method and directive function
|
|
29
|
-
const create = (el) => {
|
|
30
|
-
el.classList.add("keen-slider");
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
const opts = () => ({
|
|
33
|
-
selector: el.childNodes,
|
|
34
|
-
...(typeof options == "function" ? options() : options)
|
|
35
|
-
});
|
|
36
|
-
onMount(() => {
|
|
37
|
-
slider = new KeenSlider(el, opts(), plugins);
|
|
38
|
-
slider.on("slideChanged", () => setCurrent(slider.track.details.rel));
|
|
39
|
-
});
|
|
40
|
-
onCleanup(destroy);
|
|
41
|
-
if (typeof options === "function") {
|
|
42
|
-
createEffect(on(() => options, () => slider && slider.update(opts())));
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return [
|
|
46
|
-
create,
|
|
47
|
-
{
|
|
48
|
-
current,
|
|
49
|
-
next: () => slider && slider.next(),
|
|
50
|
-
prev: () => slider && slider.prev(),
|
|
51
|
-
details: () => (slider ? slider.track.details : {}),
|
|
52
|
-
slider: () => slider,
|
|
53
|
-
moveTo: (id, duration = 250, absolute = false, easing) => slider?.moveToIdx(id, absolute, { duration, easing: easing }),
|
|
54
|
-
destroy
|
|
55
|
-
}
|
|
56
|
-
];
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
57
20
|
};
|
|
58
|
-
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// src/index.ts
|
|
37
|
+
var src_exports = {};
|
|
38
|
+
__export(src_exports, {
|
|
39
|
+
default: () => src_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(src_exports);
|
|
42
|
+
var import_solid_js = require("solid-js");
|
|
43
|
+
var import_keen_slider = __toESM(require("keen-slider"));
|
|
44
|
+
var createSlider = (options, ...plugins) => {
|
|
45
|
+
let slider;
|
|
46
|
+
const [current, setCurrent] = (0, import_solid_js.createSignal)(0);
|
|
47
|
+
const destroy = () => slider && slider.destroy();
|
|
48
|
+
const create = (el) => {
|
|
49
|
+
el.classList.add("keen-slider");
|
|
50
|
+
const opts = () => __spreadValues({
|
|
51
|
+
selector: el.childNodes
|
|
52
|
+
}, typeof options == "function" ? options() : options);
|
|
53
|
+
(0, import_solid_js.onMount)(() => {
|
|
54
|
+
slider = new import_keen_slider.default(el, opts(), plugins);
|
|
55
|
+
slider.on("slideChanged", () => setCurrent(slider.track.details.rel));
|
|
56
|
+
});
|
|
57
|
+
(0, import_solid_js.onCleanup)(destroy);
|
|
58
|
+
if (typeof options === "function") {
|
|
59
|
+
(0, import_solid_js.createEffect)((0, import_solid_js.on)(() => options, () => slider && slider.update(opts())));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return [
|
|
63
|
+
create,
|
|
64
|
+
{
|
|
65
|
+
current,
|
|
66
|
+
next: () => slider && slider.next(),
|
|
67
|
+
prev: () => slider && slider.prev(),
|
|
68
|
+
details: () => slider ? slider.track.details : {},
|
|
69
|
+
slider: () => slider,
|
|
70
|
+
moveTo: (id, duration = 250, absolute = false, easing) => slider == null ? void 0 : slider.moveToIdx(id, absolute, { duration, easing }),
|
|
71
|
+
destroy
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
var src_default = createSlider;
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-NXJS66U5.mjs";
|
|
4
|
+
|
|
5
|
+
// src/index.ts
|
|
6
|
+
import { on, onMount, createSignal, onCleanup, createEffect } from "solid-js";
|
|
7
|
+
import KeenSlider from "keen-slider";
|
|
8
|
+
var createSlider = (options, ...plugins) => {
|
|
9
|
+
let slider;
|
|
10
|
+
const [current, setCurrent] = createSignal(0);
|
|
11
|
+
const destroy = () => slider && slider.destroy();
|
|
12
|
+
const create = (el) => {
|
|
13
|
+
el.classList.add("keen-slider");
|
|
14
|
+
const opts = () => __spreadValues({
|
|
15
|
+
selector: el.childNodes
|
|
16
|
+
}, typeof options == "function" ? options() : options);
|
|
17
|
+
onMount(() => {
|
|
18
|
+
slider = new KeenSlider(el, opts(), plugins);
|
|
19
|
+
slider.on("slideChanged", () => setCurrent(slider.track.details.rel));
|
|
20
|
+
});
|
|
21
|
+
onCleanup(destroy);
|
|
22
|
+
if (typeof options === "function") {
|
|
23
|
+
createEffect(on(() => options, () => slider && slider.update(opts())));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return [
|
|
27
|
+
create,
|
|
28
|
+
{
|
|
29
|
+
current,
|
|
30
|
+
next: () => slider && slider.next(),
|
|
31
|
+
prev: () => slider && slider.prev(),
|
|
32
|
+
details: () => slider ? slider.track.details : {},
|
|
33
|
+
slider: () => slider,
|
|
34
|
+
moveTo: (id, duration = 250, absolute = false, easing) => slider == null ? void 0 : slider.moveToIdx(id, absolute, { duration, easing }),
|
|
35
|
+
destroy
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
};
|
|
39
|
+
var src_default = createSlider;
|
|
40
|
+
export {
|
|
41
|
+
src_default as default
|
|
42
|
+
};
|
package/dist/plugins/autoplay.js
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/plugins/autoplay.ts
|
|
23
|
+
var autoplay_exports = {};
|
|
24
|
+
__export(autoplay_exports, {
|
|
25
|
+
default: () => autoplay_default
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(autoplay_exports);
|
|
28
|
+
var import_solid_js = require("solid-js");
|
|
29
|
+
var import_timer = __toESM(require("@solid-primitives/timer"));
|
|
30
|
+
var autoplay = (interval = 1e3, options) => {
|
|
31
|
+
return (slider) => {
|
|
32
|
+
let dispose;
|
|
33
|
+
const start = () => {
|
|
34
|
+
dispose = (0, import_timer.default)(() => slider.moveToIdx(slider.track.details.position + 1, true, options.animation), interval, setInterval);
|
|
31
35
|
};
|
|
36
|
+
if (options.pauseOnDrag || true) {
|
|
37
|
+
slider.on("dragStarted", () => dispose());
|
|
38
|
+
}
|
|
39
|
+
(0, import_solid_js.createEffect)(() => !options.pause || options.pause() === false ? start() : dispose());
|
|
40
|
+
};
|
|
32
41
|
};
|
|
33
|
-
|
|
42
|
+
var autoplay_default = autoplay;
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../chunk-NXJS66U5.mjs";
|
|
2
|
+
|
|
3
|
+
// src/plugins/autoplay.ts
|
|
4
|
+
import { createEffect } from "solid-js";
|
|
5
|
+
import makeTimer from "@solid-primitives/timer";
|
|
6
|
+
var autoplay = (interval = 1e3, options) => {
|
|
7
|
+
return (slider) => {
|
|
8
|
+
let dispose;
|
|
9
|
+
const start = () => {
|
|
10
|
+
dispose = makeTimer(() => slider.moveToIdx(slider.track.details.position + 1, true, options.animation), interval, setInterval);
|
|
11
|
+
};
|
|
12
|
+
if (options.pauseOnDrag || true) {
|
|
13
|
+
slider.on("dragStarted", () => dispose());
|
|
14
|
+
}
|
|
15
|
+
createEffect(() => !options.pause || options.pause() === false ? start() : dispose());
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
var autoplay_default = autoplay;
|
|
19
|
+
export {
|
|
20
|
+
autoplay_default as default
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-slider",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "A slider utility for SolidJS.",
|
|
5
5
|
"author": "David Di Biase",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://davedbase@github.com/davedbase/solid-slider.git"
|
|
9
|
+
},
|
|
6
10
|
"license": "ISC",
|
|
7
11
|
"bugs": {
|
|
8
12
|
"url": "https://github.com/davedbase/solid-slider/issues"
|
|
@@ -12,23 +16,20 @@
|
|
|
12
16
|
"prebuild": "npm run clean",
|
|
13
17
|
"clean": "rimraf dist/",
|
|
14
18
|
"format": "prettier -w \"src/**/*.{js,ts,json,css,tsx,jsx}\"",
|
|
15
|
-
"build": "
|
|
19
|
+
"build": "tsup && cp src/slider.css dist/slider.css"
|
|
16
20
|
},
|
|
17
21
|
"main": "dist/index.js",
|
|
18
|
-
"module": "dist/index.
|
|
22
|
+
"module": "dist/index.mjs",
|
|
19
23
|
"exports": {
|
|
20
24
|
".": "./dist/index.js",
|
|
21
|
-
"./plugins/autoplay": "./dist/plugins/autoplay.js"
|
|
25
|
+
"./plugins/autoplay": "./dist/plugins/autoplay.js",
|
|
26
|
+
"./slider.css": "./dist/slider.css"
|
|
22
27
|
},
|
|
23
28
|
"types": "dist/index.d.ts",
|
|
24
|
-
"sideEffects":
|
|
29
|
+
"sideEffects": false,
|
|
25
30
|
"files": [
|
|
26
31
|
"dist"
|
|
27
32
|
],
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "git+https://davedbase@github.com/davedbase/solid-slider.git"
|
|
31
|
-
},
|
|
32
33
|
"keywords": [
|
|
33
34
|
"slider",
|
|
34
35
|
"carousel",
|
|
@@ -44,11 +45,13 @@
|
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@solid-primitives/timer": "^1.1.0",
|
|
46
47
|
"keen-slider": "^6.6.3",
|
|
47
|
-
"
|
|
48
|
-
"solid-js": "^1.3.5",
|
|
49
|
-
"typescript": "^4.5.5"
|
|
48
|
+
"solid-js": "^1.3.16"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
|
-
"prettier": "^2.5.1"
|
|
51
|
+
"prettier": "^2.5.1",
|
|
52
|
+
"rimraf": "^3.0.2",
|
|
53
|
+
"typescript": "^4.5.5",
|
|
54
|
+
"tsup": "^5.12.6",
|
|
55
|
+
"solid-js": "^1.3.16"
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Accessor } from "solid-js";
|
|
2
|
-
import { KeenSliderInstance } from "keen-slider";
|
|
3
|
-
/**
|
|
4
|
-
* Provides an autoplay plugin.
|
|
5
|
-
*
|
|
6
|
-
* @param {number} interval Interval in milliseconds for switching slides
|
|
7
|
-
* @param {object} options Options to customize the autoplay
|
|
8
|
-
* @param {Function} options.pause A pause signal to control the autoplay
|
|
9
|
-
* @param {boolean} options.pauseOnDrag Denotes of the autoplay should pause on drag.
|
|
10
|
-
* @param {object} options.animation Allows for control of duration and easing.
|
|
11
|
-
* @param {number} options.duration Duration for transitioning the slide.
|
|
12
|
-
* @param {number} options.easing Easing function for the transition animation.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const [create, { prev, next }] = createSlider();
|
|
17
|
-
* <div use:slider>...</div>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare const autoplay: (interval: number | undefined, options: {
|
|
21
|
-
pause?: Accessor<boolean> | undefined;
|
|
22
|
-
pauseOnDrag?: boolean | undefined;
|
|
23
|
-
animation?: {
|
|
24
|
-
duration?: number | undefined;
|
|
25
|
-
easing?: ((t: number) => number) | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
}) => (slider: KeenSliderInstance) => void;
|
|
28
|
-
export default autoplay;
|