npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-split-panel

v1.0.4

Published

Vue.js split-panel component

Downloads

4,527

Readme

Vue-Split-Panel

  • Fast: No overhead or attached window event listeners, uses pure CSS for resizing.
  • Compatible: Works great in IE9, and even loads in IE8 with polyfills. Early Firefox/Chrome/Safari/Opera supported too.

Installation

npm:

$ npm install --save vue-split-panel

Getting Started

// using ES6 modules
import VueSplit from 'vue-split-panel'
Vue.use(VueSplit)

Usage Examples

A split with two elements, starting at 25% and 75% wide.

<Split style="height: 500px;">
    <SplitArea :size="25">
        panel left
    </SplitArea>
    <SplitArea :size="75">
        panel right
    </SplitArea>
</Split>

A split with three elements, starting with even widths with 100px, 100px and 300px minimum widths, respectively.

<Split style="height: 500px;">
    <SplitArea :size="33" :minSize="100">
        panel left
    </SplitArea>
    <SplitArea :size="33" :minSize="100">
        panel center
    </SplitArea>
    <SplitArea :size="33" :minSize="300">
        panel right
    </SplitArea>
</Split>

A vertical split with two elements.

<Split style="height: 500px;" :direction="vertical">
    <SplitArea>
        panel left
    </SplitArea>
    <SplitArea>
        panel center
    </SplitArea>
</Split>

A Setting the gutter size to 20px.

<Split style="height: 500px;" :gutterSize="20">
    <SplitArea>
        panel left
    </SplitArea>
    <SplitArea>
        panel center
    </SplitArea>
</Split>

Callbacks that can be added on drag (fired continously), drag start and drag end. If doing more than basic operations in onDrag, add a debounce function to rate limit the callback.

<Split style="height: 500px;" @onDragEnd="onDragEnd" @onDragStart="onDragStart" onDrag="onDrag">
    <SplitArea>
        panel left
    </SplitArea>
    <SplitArea>
        panel center
    </SplitArea>
</Split>
methods: {
    onDragStart (size) {
        console.log('Drag Start', size) // callback existing size
    },
    onDrag (size) {
        console.log('on Drag', size) // callback new size
    },
    onDragEnd (size) {
        console.log('Drag End', size) // callback new size
    }
}

A Reset the panel and get new sizes

<Split style="height: 500px;" ref="mySplit">
    <SplitArea>
        panel left
    </SplitArea>
    <SplitArea>
        panel center
    </SplitArea>
</Split>
methods: {
    Reset () {
        console.log(this.$refs.mySplit.reset())
    }
    getSizes () {
        console.log(this.$refs.mySplit.getSizes())
    }
}

API

Split props

| Property | Type | Default | Description | |---|---|---|---| | gutterSize | Number | 10 | Gutter size in pixels. | | direction | String | 'horizontal' | Direction to split: horizontal or vertical. |

Split events

| Event Name | Description | Return Value |---|---|---| | onDrag | Callback on drag. | current size | | onDragStart | Callback on drag start. | new size | | onDragEnd | Callback on drag end. | new size |

Split methods

| Method Name | Description | Arguments |---|---|---| | reset | Reset panel. | none |

SplitArea props

| Property | Type | Default | Description | |---|---|---|---| | sizes | Array | | Initial sizes of each element in percents or CSS values. | | minSize | Number or Array | 100 | Minimum size of each element. |

Important Note

vue-split-panel does not set CSS beyond the minimum needed to manage the width or height of the elements.

Browser Support

This library uses Split.js. These features are supported in the following browsers:

| | | | | | | |:---:|:---:|:---:|:---:|:---:|:----| | 22+ ✔ | 6+ ✔ | 9+ ✔ | 15+ ✔ | 6.2+ ✔ | Sponsored ✔ |

Built With

  • Webpack - The web framework used
  • gulp - Automated development toolkit

License

This project is licensed under the MIT License - see the LICENSE.md file for details