Socket
Socket
Sign inDemoInstall

@beyonk/svelte-carousel

Package Overview
Dependencies
1
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.2.0

LICENSE

31

dist/index.js

@@ -83,2 +83,7 @@ (function (global, factory) {

}
function custom_event(type, detail) {
const e = document.createEvent('CustomEvent');
e.initCustomEvent(type, false, false, detail);
return e;
}

@@ -97,2 +102,16 @@ let current_component;

}
function createEventDispatcher() {
const component = current_component;
return (type, detail) => {
const callbacks = component.$$.callbacks[type];
if (callbacks) {
// TODO are there situations where events could be dispatched
// in a server (non-DOM) environment?
const event = custom_event(type, detail);
callbacks.slice().forEach(fn => {
fn.call(component, event);
});
}
};
}

@@ -538,2 +557,4 @@ const dirty_components = [];

let timer;
const dispatch = createEventDispatcher();

@@ -544,3 +565,4 @@ onMount(() => {

perPage,
loop
loop,
onChange: handleChange
}));

@@ -568,2 +590,9 @@

function handleChange (event) {
dispatch('change', {
currentSlide: controller.currentSlide,
slideCount: controller.innerElements.length
} );
}
let { $$slots = {}, $$scope } = $$props;

@@ -570,0 +599,0 @@

2

package.json

@@ -6,3 +6,3 @@ {

"main": "dist/index.js",
"version": "2.1.1",
"version": "2.2.0",
"scripts": {

@@ -9,0 +9,0 @@ "build": "rollup -c",

@@ -20,2 +20,3 @@ <p align="center">

```
npm install
npm run dev # http://localhost:12001

@@ -102,2 +103,10 @@ ```

// will show 1 slide below 500px width, 2 at 500, 3 at 800.
```
```
### Events
The Carousel components emits the following events:
| Name | Data | Description |
|----------|--------------------------------|--------------------------------------------------------------------------------|
| `change` | `{ currentSlide, slideCount }` | `currentSlide`: The current slide index. Can be a positive or negative integer. `slideCount`: The number of slides. |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc