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

ios-ui

v1.3.3

Published

ios ui style web component, based on Web Component technologies

Downloads

39

Readme

Table of contents generated with markdown-toc

ios-ui

This package has several custom elements which are follow Web Component rules.

Todos

  1. Adding width, height, acc attributes (O)

  2. Implement endless style (O)

  3. Implement scroll event (O)

  4. Implement giving opportunity nameing for the event to user (O)

  5. Implement keydown event (O)

  6. Implement bouncing animation (O)

  7. Deploy npm (O)

  8. Support typescript (O)

installetion

npm

  $ npm i ios-ui

cdn

  <script src="https://unpkg.com/ios-ui/dist/bundle.js"></script>

  <!-- or -->

  <script src="https://unpkg.com/ios-ui/dist/bundle.min.js"></script>


  <!-- <script src="https://unpkg.com/iou-ui/dist/picker.js"> -->
  <!-- if you only want to get one ui component -->
  <!-- This file hasn't set yet. 😥 But it will support ASAP -->

Ui types

1. Picker

user parameters

  • width (default: '100%')

    • width of the component
    • example : width='100%'
  • height: (default: '100%')

    • height of the component.
    • example : height='100%'
  • num-list (default: [10])

    • insert number many as you want.
    • example : num-list="24,60,60"
  • title-list (default: [])

    • example : title-list="시간,분,초"
  • picker-type-list (default: "end")

    • define each picker's style ('end' | 'endless')

    • example : picker-type-list="end,end,end"

      if you define style only one, then it will unify all pickers

        <ios-ui-picker
          num-list="24,60,60"  
          picker-type-list="end"
        ></ios-ui-picker>
  • flexible (default: false)

    • if true, picker size will change if window resized
    • example : flexible="true"
  • allow-key-event (default: false)

    • if true, user can choose number by pressing keyboard
    • example : allow-key-event="false"
  • event-name (default: setnumber)

    • the component fire its result numbers by Element.dispatchEvent() and its event name is 'setnumber' as default.

      if you want to change it, insert to this parameter

    • example : event-name='result'

  • sound-src (default: "https://unpkg.com/ios-ui/dist/bundle.js")

    • if true, picker will make sound
    • example: sound-src="/public/mp3/example.mp3""

caution

  • All parameters are should be a string since the custom component get these params by Element.getAttributes() function.

guide

  1. In browser
<!DOCTYPE html>

<html>
  <style>
      body {
          background-color: rgb(255, 255, 255);
          overflow: hidden;
          width: 100vw;
          height: 100vh;
      }
  </style>
// ...

  <body>
    <ios-ui-picker num-list="24,60,60" picker-type-list="end"></ios-ui-picker>
    <script src="./dist/bundle.js"></script>

    <script>
        UI.Picker.config('picker')
    </script>
  </body>
</html>
  1. In webpack(or other bundle tools) environment
import { Picker } from 'ios-ui';

// put this line somewhere in your codes
Picker.config('picker');

// and use it like using custom web component

  <div>
    <ios-ui-picker></ios-ui-picker>
  </div>
  • if you turn off flag in option, you can define component with only your tag name
Picker.config("web-picker", { flag: false });
<web-picker></web-picker>

examples

<ios-ui-picker
  width="600px"
  height="400px"
  num-list="10"
  title-list="hour"
  picker-type-list="end"
  flexible="true"
  allow-key-event="false"
></ios-ui-picker>
<ios-ui-picker
  event-name="getnumber"
></ios-ui-picker>
  /**
   * @param {CustomEvent<Array<number>>} e
   */
  element.addEventListener('getnumber', ({detail}) => console.log(detail));
  // if num-list length is 3 -> [0, 0, 0]