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

@maggioli-design-system/mds-input

v7.1.0

Published

mds-input is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.

Downloads

1,358

Readme

mds-input

Form interaction

This component is scoped and not shadowed, so the inner input element interacts natively with form element.

This is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.

Properties

| Property | Attribute | Description | Type | Default | | ---------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------ | | autocomplete | autocomplete | Specifies whether the element should have autocomplete enabled | AutocompleteType \| undefined | 'off' | | autofocus | autofocus | Specifies that the element should automatically get focus when the page loads | boolean | false | | await | await | Specifies if the spinner icon is shown, replacing the icon if present | boolean | false | | controlDecreaseLabel | control-decrease-label | Specifies the label for control button decrease for component when type is number | string \| undefined | 'Riduci' | | controlIncreaseLabel | control-increase-label | Specifies the label for control button increase for component when type is number | string \| undefined | 'Aumenta' | | controlsIcon | controls-icon | Specifies the icon type of the counter button when the input type is set to number | "arithmetic" \| "arrow" \| undefined | 'arrow' | | controlsLayout | controls-layout | Specifies the layout of the counter button when the input type is set to number | "horizontal" \| "vertical" \| undefined | 'vertical' | | datalist | -- | A list of search terms to be searched from the input field, it should be used with type="search" input. | string[] \| undefined | undefined | | disabled | disabled | If true, the element is displayed as disabled | boolean \| undefined | false | | icon | icon | An icon displayed at the right of the input | string \| undefined | undefined | | max | max | Specifies the maximum value use it with input type="number" or type="date" Example: max="180", max="2046-12-04" | string \| undefined | undefined | | maxlength | maxlength | Specifies the maximum number of characters allowed in an element use it with input type="number" | number \| undefined | undefined | | min | min | Specifies the minimum value use it with input type="number" or type="date" Example: min="-3", min="1988-04-15" | number \| string \| undefined | undefined | | minlength | minlength | Specifies the minimum number of characters allowed in an element use it with input type="number" | number \| undefined | undefined | | name | name | Is needed to reference the form data after the form is submitted | string \| undefined | undefined | | pattern | pattern | Specifies a regular expression that element's value is checked against | string \| undefined | undefined | | placeholder | placeholder | Specifies a short hint that describes the expected value of the element | string | '' | | readonly | readonly | Specifies that the element is read-only | boolean \| undefined | false | | required | required | Specifies that the element must be filled out before submitting the form | boolean \| undefined | false | | step | step | Specifies the interval between legal numbers in an input field | string \| undefined | undefined | | tip | tip | Sets the word(s) of the tip of the input field | string \| undefined | undefined | | type | type | Specifies the type of input element | "date" \| "email" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "textarea" \| "time" \| "url" \| undefined | 'text' | | typography | typography | Specifies the typography of input element | "detail" \| "snippet" | 'detail' | | value | value | Specifies the value of the input element | string \| undefined | '' | | variant | variant | Sets the variant of the input field | "error" \| "info" \| "success" \| "warning" \| undefined | undefined |

Events

| Event | Description | Type | | ----------------- | --------------------------------------------------------------------------------- | ---------------------------------- | | mdsInputBlur | Emits a void event when input element is blurred | CustomEvent<void> | | mdsInputChange | Emits an InputChangeEventDetail when the value of the input element changes | CustomEvent<MdsInputEventDetail> | | mdsInputFocus | Emits a void event when input element is focused | CustomEvent<void> | | mdsInputKeydown | Emits a KeyboardEvent when a keyboard key is pressed on the focused input element | CustomEvent<KeyboardEvent> |

Methods

getInputElement() => Promise<HTMLInputElement | HTMLTextAreaElement>

Returns the native <input> element used under the hood.

Returns

Type: Promise<HTMLTextAreaElement | HTMLInputElement>

setFocus() => Promise<void>

Sets focus on the specified my-input. Use this method instead of the global input.focus().

Returns

Type: Promise<void>

updateLang() => Promise<void>

Returns

Type: Promise<void>

Shadow Parts

| Part | Description | | --------------------------- | ----------- | | "counter-button-decrease" | | | "counter-button-increase" | | | "field" | | | "password-toggle-button" | |

CSS Custom Properties

| Name | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | --mds-input-background | Sets the background-color of the component | | --mds-input-icon-color | Sets the icon color of the component | | --mds-input-ring | Sets the box-shadow of the component's input | | --mds-input-shadow | Sets the box-shadow of the component's input | | --mds-input-textarea-field-sizing | Sets the height of the textarea automatically, this is an EXPERIMENTAL css property, so it couldn't work in every browser | | --mds-input-textarea-max-height | Sets the max-height of the component when attribute type is set to textarea | | --mds-input-textarea-min-height | Sets the min-height of the component when attribute type is set to textarea | | --mds-input-tip-background | Sets the background color of the tip message at the bottom right of the component | | --mds-input-variant-color | Sets the variant colors of the component |

Dependencies

Used by

Depends on

Graph

graph TD;
  mds-input --> mds-button
  mds-input --> mds-input-tip
  mds-input --> mds-input-tip-item
  mds-input --> mds-icon
  mds-input --> mds-spinner
  mds-button --> mds-spinner
  mds-button --> mds-icon
  mds-button --> mds-text
  mds-input-tip-item --> mds-text
  mds-input-field --> mds-input
  style mds-input fill:#f9f,stroke:#333,stroke-width:4px

Built with love @ Gruppo Maggioli from R&D Department