Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage Status Published on NPM

Paper Input Date Picker

Is a Polymer 3 input web-component only for date.

Is composed by three component (ordered by dependencies hierarchy):

  • paper-month-control;
  • paper-calendar;
  • paper-input-datepicker;

All components could be used like web-components (see Demo for the example).

Usage

Installation

npm install --save @fluidnext-polymer/paper-input-datepicker

In an html file

<html>
  <head>
    <script type="module" src="@fluid-next/paper-input-datepicker/paper-input-datepicker.js"></script>
  </head>
  <body>
    <paper-input-datepicker></paper-input-datepicker>
  </body>
</html>

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@fluid-next/paper-input-datepicker/paper-input-datepicker';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <paper-input-datepicker></paper-input-datepicker>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Custom icons

Icons can be customized by importing a different iconset. For example, here is the iconset code imported in the Demo.

import '@polymer/iron-iconset-svg/iron-iconset-svg.js';

import {html} from '@polymer/polymer/lib/utils/html-tag.js';

const template = html`
    <iron-iconset-svg name="paper-input-datepicker" size="24">
        <svg><defs>
          <g id="clear"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></g>
        </defs></svg>
    </iron-iconset-svg>
`;

document.head.appendChild(template.content);

Contributing

If you want to send a PR to this element, here are the instructions for running the tests and demo locally:

Installation

git clone https://github.com/fluidnext/paper-input-datepicker
cd paper-input-datepicker
npm install

Running the demo locally

Open terminal in the project root folder and run the following command.

polymer serve --open

Running the tests

Open terminal in the project root folder and run the following command.

polymer test

To see tests details, open the generated "index.html" inside "coverage/lcov-report" folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages