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-panel

v3.1.0

Published

Suite of Vue components for building Flexbox layouts

Downloads

37

Readme

#vue-panel

This plugin aims to provide your Vue application with a handful of light, composable, Flexbox-powered components.

###Installation

Just bower or npm install ericmcdaniel/vue-panel. The package is exposed as a UMD module so you can require it with Browserify/Webpack/etc. or include it in your page via script tag.

To use this plugin with Vue, simply call Vue.use(require('vue-panel')), or Vue.use(window.VuePanel) if including in a script tag.

###Components

####VPanel <v-panel> responds to a variety of Flexbox parameters and is useable as both a display: flex element and a flex-item:

<v-panel grow="1" shrink="0"></v-panel>

<v-panel> will display any content inside of the element as it's own transclusion content:

<v-panel basis="200px">
    <h3>Foo</h3>
    <p>Lorem ipsum dolor sit amet...</p>
</v-panel>

<v-panel> responds to

  • align-items,
  • align-self,
  • order,
  • direction (flex-direction),
  • flex,
  • grow (flex-grow),
  • shrink (flex-shrink),
  • basis (flex-basis),
  • and justify (justify-content).

The plugin provides two more components: <v-panel-bar> and <v-panel-content>.

####VPanelBar <v-panel-bar> responds to

  • align-items,
  • direction,
  • justify,
  • and size (flex-basis).

The bar is 30px wide by default. When the direction value changes, the component will broadcast the event v-panel-bar:direction (with it's $data.direction value) to child components so they can respond to it's flex-direction.

####VPanelContent <v-panel-content> is a simple flex-item that responds to flex, grow and shrink.

<v-panel>
    <v-panel-bar>
        <button on="click: updateContent">Click</button>
    </v-panel-bar>
    <v-panel-content v-ref="content">Foo</v-panel-content>
</v-panel>

###Directives

Each of the included components are also provided as directives. These directives can take parameters in the form of attributes, not to be confused with component props. These params follow the same naming conventions as the props documented above.

<section v-panel grow="1" shrink="0">
  <div v-panel-bar size="90px"></div>
  <div v-panel-content></div>
</section>

The directives share common defaults with the components, but you will have to manually declare bindings using the v-bind directive if you want to hook up ViewModel data to the params. For example:

<my-nav v-panel-bar v-bind:size="myBarSize"></my-component>

###Configuration

Each of the vue-panel components can be globally configured to initialize with additional data values via an object literal where the key is the property name and the value is the initial value. This is done by passing an object as the second parameter to the Vue.use function like so:

Vue.use(VuePanel, {
  // either hyphenated
  'v-panel': {
    class: 'Panel',
    style: {
      color: 'red',
      backgroundColor: '#ccc'
    }
  },
  // or camel case:
  'vPanelBar': {
    class: 'Panel-bar'
  },
  'vPanelContent': {
    class: 'Panel-content'
  }
});

class and style are currently the only options that have any built-in effect. The value from class will be merged with the class list of each component instance via the v-bind:class directive. The value(s) from style will be merged with the inline styles of each component instance via the v-bind:style directive.

Note: This feature does not work with the bundled directives. Directives are designed to provide the bare-minimum Flexbox parameters that you can integrate with any component or element.

###Example

Open example/index.html for a straightforward example.

###Tests

The plugin ships with Jasmine specs in the test folder if installing from NPM or GitHub. npm install to pull down the Vue dependency, then open test/index.html to run the specs.