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

@exmg/exmg-form

v8.2.3

Published

Form helper element

Downloads

327

Readme

<exmg-form> Published on npm

This component provides basic form functionality. It is made on top of <iron-form>.

You can put any children elements inside of it, but only elements implementing IronFormElementBehavior will be serialized. Also, any element implementing IronFormElementBehavior have to implement validate() method. In other case form will not be working.

Read more: IronFormElementBehavior (https://github.com/PolymerElements/iron-form-element-behavior).

Installation

npm install @exmg/exmg-copy-to-clipboard

Example Usage

Standard

<exmg-form
  @submit="${this.submit}"
  @cancel="${this.cancel}"
  ?hide-cancel-button="${false}"
  submit-button-copy="Submit"
  ?inline="${false}"
>
  <paper-input label="text input" required></paper-input>
  <paper-input label="text input" value="pre-filled"></paper-input>
  <paper-input label="password input" type="password"></paper-input>
  <paper-input label="disabled input" disabled value="batman"></paper-input>
  <paper-input name="name" label="Summary" required always-float-label></paper-input>
  <paper-input
    name="estimate"
    label="Estimates"
    type="number"
    always-float-label
    style="max-width:180px;"
  ></paper-input>

  <paper-textarea label="autoresizing textarea input"></paper-textarea>

  <exmg-paper-combobox label="Project" name="combobox" style="max-width:280px;" always-float-label required>
    <paper-item>PlayToTV</paper-item>
    <paper-item>Website</paper-item>
  </exmg-paper-combobox>
  <p class="help">
    Some issue types are unavailable due to incompatible field configuration and/or workflow associations.
  </p>
  <hr />
  <p class="help">Start typing to get a list of possible matches.</p>
  <exmg-paper-token-input name="tokens" label="Components" always-float-label>
    <paper-item>javascript</paper-item>
    <paper-item>css</paper-item>
  </exmg-paper-token-input>
  <p class="help">Start typing to get a list of possible matches or press down to select.</p>
  <p class="help">Estimated time needed to resolve this issue in hours.</p>
  <label>Message</label>
  <exmg-markdown-editor name="markdown" required>
    <marked-element markdown="# Hello Word!">
      <div slot="markdown-html"></div>
    </marked-element>
  </exmg-markdown-editor>
</exmg-form>

API

Slots

| Name | Description | | --------- | ------------------- | | default | Form input elements |

Properties/Attributes

| Name | Type | Default | Description | | ------------------------------------- | --------- | ---------- | ------------------------------------------------------------------------------------------- | | hide-submit-button | boolean | false | Option to hide submit button | | hide-reset-button | boolean | false | Option to hide reset button | | submit-button-copy | string | 'Submit' | Default submit button copy | | reset-button-copy | string | 'Reset' | Default reset button copy | | disable-submit-no-changes | boolean | false | With this option the disable button will be disabled while there are no changes in the form | | bubbles | boolean | false | Setting this attribute will cause its | | events to bubble to the window object |

Methods

| Name | Description | | ------------- | --------------------------------------- | | submit | Submit the form when it's valid | | handleError | Error handler for form | | reset | Resets the form and throws form-reset |

Events

| Name | Description | | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | submit | When submit button pressed. Will contain all form serialized data. Submit event will not fire when any of required fields are not set. | | cancel | When cancel button pressed. | | dirty | When the user edit an editable in the form. Is thrown only once. |

CSS Custom Properties

| Name | Description | | ------------------------------------ | ------------------------------------------------------------------------------------ | | --exmg-form-internal-height | set the height of slot container - handy when wanting to control max-height of form. | | --exmg-form-internal-padding-right | set the padding right for the form internal element. | | --exmg-form-actions-padding-right | set the padding right for the actions buttons. | | --exmg-form-actions-padding-bottom | set the padding bottom for the actions buttons. |

Additional references