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

@moduware/morph-swipeout

v2.0.1

Published

Component to allow swipeout of content by use that will reveal additional actions that don't take screen space normally

Downloads

1

Readme

morph-swipeout

License Published on webcomponents.org

Component to allow swipeout of content by use that will reveal additional actions that don't take screen space normally

Getting Started

For the information about how to clone the desired repository, running the local server and testing, please refer to Polymorph elements getting started docs at the end of this repository. This is now using LitElement 2.0.1 as base class.

Demo

  • Here is a quick demo of the morph-swipeout element swiping open delete button and clicking on the button to delete item.

  • This is a sample HTML markup for morph-swipeout with left and right buttons

    
    <morph-swipeout>
    
      Swipeout content 
    
      <span slot="right-buttons">
        <morph-button class="swiper-integration-class" color="red" filled flat>Delete</morph-button>
      </span>
    
    </morph-swipeout>
    
  • IMPORTANT: class="swiper-integration-class" required to be added on the morph-button class for the button to render properly

  • The <span slot="left-buttons"> for the left action button is optional. The <span slot="right-buttons"> for the right action button is required for there is no point in having overswipe when there is no action button to show

  • The morph-button polymer element is required for the action buttons

Basic morph-swipeout Markup

  • Example Minimum Basic Markup

  <morph-swipeout>

    <div>
      <p>Swipeout content</p>
    </div>

    <span slot="right-buttons">
      <morph-button class="swiper-integration-class" color="red" filled flat item-delete>Delete</morph-button>
    </span>

  </morph-swipeout>

Attributes for morph-swipeout Element

| Custom Attribute | Type | Description | Default | |:---------------------------------:|:-------:|-----------------------------------------------------------------------------------------------|------------------| | overswiper | Boolean | Property used to decide if action on the left or right is executed when swipe far enough | false | | overswipeTreshold | Number | The amount of pixel swipe to trigger overswipe. (Default to offsetWidth / 2) | See Notes | | _trackInitialTransform | Number | Initial value of transform during event.detail.state == 'start' | No default |

Required Attributes for morph-button Action Button to Work Properly

| Custom Attribute | Type | Description | |:--------------------:|:-------:|---------------------------------------------------------------------------------| | color | Boolean | morph-button property used to set button color - REQUIRED | | flat | Boolean | morph-button property used to get flat corners - REQUIRED | | filled | Boolean | morph-button property used to get white text on colored background - REQUIRED | | item-delete | Boolean | morph-button property used to delete item when button is clicked |

Overswiper morph-swipeout markup with swipeout-delete

  • Example Overswiper with swipeout-delete markup

  <morph-swipeout overswiper>

    <div>
      <p>Swipeout content</p>
    </div>

    <span slot="right-buttons">
      <morph-button class="swiper-integration-class" color="red" filled flat swipeout-delete>Delete</morph-button>
    </span>

  </morph-swipeout>

Attributes for morph-swipeout Overswiper

| morph-swipeout Attribute | Type | Description | |:----------------------------:|:-------:|----------------------------------------------------------| | overswiper | Boolean | morph-swipeout property used to activate overswiping |

Attributes for morph-button Overswiper

| morph-swipeout Attribute | Type | Description | |:----------------------------:|:-------:|---------------------------------------------------------------------------| | swipeout-delete | Boolean | morph-button property used to activate deleting item when overswiping |

Overswiper morph-swipeout markup with swipeout-delete and swipeout-prompt-text

  • Example Overswiper with swipeout-delete and swipeout-prompt-text markup

  <morph-swipeout overswiper>

    <div>
      <p>Swipeout content</p>
    </div>

    <span slot="right-buttons">
      <morph-button class="swiper-integration-class" color="red" filled flat swipeout-delete swipeout-prompt-text="Do you to delete item?">Delete</morph-button>
    </span>

  </morph-swipeout>

Attributes for morph-swipeout Overswiper

| morph-swipeout Attribute | Type | Description | |:----------------------------:|:-------:|----------------------------------------------------------| | overswiper | Boolean | morph-swipeout property used to activate overswiping |

Attributes for morph-button Overswiper

| morph-swipeout Attribute | Type | Description | |:----------------------------:|:-------:|---------------------------------------------------------------------------------------| | swipeout-delete | Boolean | morph-button property used to activate deleting item when overswiping | | swipeout-prompt-text | Boolean | morph-button property used to add prompt text before deleting item when overswiping |

Styling

  • The following custom CSS properties are available for styling morph-swipeout component

Custom property | Description | Default | ----------------------------------------------|----------------------------------------------------------------------------------|------------| --back-container-background-color | Background color for back container property | #fff | --swipe-action-after-background-color-left | To help get the left morph-button background-color swipe action psuedo element | yellow | --swipe-action-after-background-color-right | To help get the right morph-button background-color swipe action psuedo element | yellow |

Further help

For more information on how to install and run test please go here - Polymorph elements getting started