7.6.0 • Published 1 month ago

solid-imask v7.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Solid IMask Plugin

solid-imask

npm version License: MIT

Install

npm install solid-imask

Mask Input Example

import { createMaskedInput } from "solid-imask";

const NumberInput = createMaskedInput({
  mask: "+{7}(000)000-00-00",
  lazy: false, // make placeholder always visible
  placeholderChar: "#", // defaults to '_'
});

const App = () => {
  return (
    <div>
      <NumberInput
        onAccept={({ value, unmaskedValue, typedValue }, maskRef, e) => {
          console.log({ value, unmaskedValue, typedValue });
          console.log(maskRef);
          console.log(e);
        }}
        onComplete={() => console.log("complete")}
      ></NumberInput>
    </div>
  );
};

Mask Directive Example

import { masked } from "solid-imask";

const mask = {
  mask: "+{7}(000)000-00-00",
  lazy: false, // make placeholder always visible
  placeholderChar: "#", // defaults to '_'
};

const App = () => {
  return (
    <div>
      <input
        use:masked={{
          mask,
          onAccept: ({ value, unmaskedValue, typedValue }, maskRef, e) => {
            console.log({ value, unmaskedValue, typedValue });
            console.log(maskRef);
            console.log(e);
          },
          onComplete: () => console.log("complete"),
        }}
      ></input>
      <p
        contenteditable="true"
        use:masked={{
          mask,
          onAccept: ({ value, unmaskedValue, typedValue }, maskRef, e) => {
            console.log({ value, unmaskedValue, typedValue });
            console.log(maskRef);
            console.log(e);
          },
          onComplete: () => console.log("complete"),
        }}
      ></p>
    </div>
  );
};
7.6.0

1 month ago

7.5.1-alpha.0

2 months ago

7.5.0

2 months ago

7.4.0

3 months ago

7.3.0

5 months ago

7.2.1

5 months ago

7.2.0

5 months ago

7.0.0-alpha.1

11 months ago

7.0.0-alpha.0

11 months ago

7.0.1-alpha.0

11 months ago

7.0.0

11 months ago

7.0.1-alpha.1

11 months ago

7.0.0-alpha.6

11 months ago

7.1.3

10 months ago

7.0.0-alpha.3

11 months ago

7.1.2

10 months ago

7.0.0-alpha.2

11 months ago

7.1.1

10 months ago

7.0.0-alpha.5

11 months ago

7.0.1

11 months ago

7.0.0-alpha.4

11 months ago

7.1.0-alpha.0

10 months ago

6.6.3

11 months ago

6.6.2

11 months ago

7.1.0-alpha.1

10 months ago

7.1.0-alpha.2

10 months ago

6.5.1-alpha.1

1 year ago

6.6.0-alpha.0

1 year ago

6.5.1-alpha.0

1 year ago

6.5.0-alpha.1

1 year ago

6.5.0-alpha.0

1 year ago

6.5.0

1 year ago

6.6.1

1 year ago

6.6.0

1 year ago

6.5.1

1 year ago

6.6.1-alpha.2

1 year ago

6.6.1-alpha.1

1 year ago

6.6.1-alpha.0

1 year ago

6.4.3

2 years ago

6.4.3-alpha.0

2 years ago

0.0.1

2 years ago