Directory

← Back

app-datepicker

Datepicker element built with Google's lit-element and Material Design 2

Author

Contributors

Rating

[ This description is mirrored from README.md at github.com/motss/app-datepicker on 2019-05-22 ]

app-datepicker

Datepicker element built with lit-element and Material Design 2


Buy Me A Coffee tippin.me Follow me

Version lit-element Node version MIT License

Downloads Total downloads Packagephobia Bundlephobia

CircleCI Dependency Status

codebeat badge Codacy Badge Language grade: JavaScript Code of Conduct

A different way of datepicker-ing on the web.

� While it is still in RC release, feel free to try it out.

This marks another completion of an important milestone of app-datepicker with all the love from the Web Components community in making this element great and wonderful. As Web Components getting more and more traction and better at providing a web standard way of creating shareable components, it plays an important role in the JavaScript community as many developers depend on a plethora of development tools written in JavaScript for the web to create a better developer experience when developing a library, a component, or even a large scalable application.

screen shot 2019-01-30 at 12 49 30

Today, app-datepicker has been completely rewritten to adapt to the best of both worlds by leveraging the modern technologies the community most familiar with since year 2018.

The following are the list of tools used that makes it shine:

  1. TypeScript
  2. lit-element

Table of contents

Pre-requisite

Installation

  • NPM

    $ npm i app-datepicker@next
    
  • Alternatively, it can be downloaded from any of the following awesome CDNs:

    1. jsdelivr (ESM)
    2. unpkg (ESM)

How to use

my-app.ts

/**
 * Say you've already installed the element via NPM, simply import the package to your application.
 * Here I'm using `lit-element` for developing my application.
 */
import { css, customElement, html, LitElement } from 'lit-element';
import 'app-datepicker';

@customElement(MyApp.is)
export class MyApp extends LitElement {
  static is() { return 'my-app'; }

  static styles = [
    css`
    :host {
      display: block;
    }

    * {
      box-sizing: border-box;
    }
    `
  ];

  protected render() {
    return html`<app-datepicker></app-datepicker>`;
  }
}

index.html

<!doctype html>
<html>
  <!-- Using ES modules to load the app -->
  <script type="module" src="/my-app.js"></script>
  ...
  <body>
    <my-app>
      <!-- <AppDatepicker> will be rendered when <MyApp> loads. -->
    </my-app>
  </body>
  ...
</html> 

Browser compatibility

Both app-datepicker and app-datepicker-dialog works in all major browsers (Chrome, Firefox, IE, Edge, Safari, and Opera).

Heavily tested on the following browsers:

Name OS
Internet Explorer 11 Windows 7
Edge 13 Windows 10
Edge 17 Windows 10
Safari 9 Mac OS X 10.11
Safari 10.1 Mac OS 10.12
Chrome 41 (WRE) Linux
Chrome 69 (WRE 2019) Windows 10
Firefox 62 (w/o native Shadow DOM) macOS Mojave (10.14)
Firefox 63 (native Shadow DOM support) Windows 10

API references

Demo

Demo with code configurator powered by Glitch

Older versions

Meantime, feel free to check the older version out at:

  1. 2.x branch - Built with Material Design and Polymer 2, published at Bower.
  2. 3.x branch - Built with Material Design and Polymer 3, published at NPM.

License

MIT License © Rong Sen Ng

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • iron-iconset-svg#PolymerElements/iron-iconset-svg#1 - 2
  • iron-list#PolymerElements/iron-list#1 - 2
  • iron-selector#PolymerElements/iron-selector#1 - 2
  • neon-animation#PolymerElements/neon-animation#1 - 2
  • paper-dialog-behavior#PolymerElements/paper-dialog-behavior#1 - 2
  • paper-icon-button#PolymerElements/paper-icon-button#1 - 2
  • polymer#Polymer/polymer#1.9 - 2
  • web-animations-js#web-animations/web-animations-js#^2.2.0
  • paper-button#PolymerElements/paper-button#1 - 2
Released
2018-03-04
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 2.0+
Polymer 1.0+ in 2.9.1
Browser
Browser Independent
Online