notchris

payload mask plugin

by notchris
Custom fields
v1
v2
^0.18.5 || ^1.0.0 || ^2.0.0
MIT

Overview

Summary generated from the README

Adds input masking to text fields in Payload collections and globals using the IMask library. Register the plugin in the Payload config, then set a mask pattern through the field's custom options. Options let you show the masked value and choose whether the masked or raw value is saved. Supports Payload 0.18.5, 1.x and 2.x.

Features

  • Applies IMask patterns to text fields
  • Configured per field through the custom property
  • Option to show the masked value in the field
  • Option to save the masked or unmasked value
  • Works in both collections and globals

Use cases

  • Format phone numbers as editors type them
  • Enforce structured input such as codes or IDs in text fields

From the author

An input mask plugin for Payload

Installation

npm i payload-mask-plugin

17

Stars

0

Forks

2

Open Issues

2 years ago

Last Updated

10

Weekly Downloads

v1.0.2

npm Version

19.1 KB

Unpacked Size

2

Dependencies

GitHub stars

170 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 202617
Dec 4, 202617
Dec 3, 202617
Dec 2, 202617
Dec 1, 202617
Nov 30, 202617
Nov 29, 202617
Nov 28, 202617
Nov 27, 202617
Nov 26, 202617
Nov 25, 202617
Nov 24, 202617
Nov 23, 202617
Nov 22, 202617
Nov 21, 202617
Nov 20, 202617
Nov 19, 202617
Nov 18, 202617
Nov 17, 202617
Nov 16, 202617
Nov 15, 202617
Nov 14, 202617
Nov 13, 202617
Nov 12, 202617
Nov 11, 202617
Nov 10, 202617
Nov 9, 202617
Nov 8, 202617
Nov 7, 202617
Nov 6, 202617
Nov 5, 202617
Nov 4, 202617
Nov 3, 202617
Nov 2, 202617
Nov 1, 202617
Oct 31, 202617
Oct 30, 202617
Oct 29, 202617
Oct 28, 202617
Oct 27, 202617
Oct 26, 202617
Oct 25, 202617
Oct 24, 202617
Oct 23, 202617
Oct 22, 202617
Oct 21, 202617
Oct 20, 202617
Oct 19, 202617
Oct 18, 202617
Oct 17, 202617
Oct 16, 202617
Oct 15, 202617
Oct 14, 202617
Oct 13, 202617
Oct 12, 202617
Oct 11, 202617
Oct 10, 202617
Oct 9, 202617
Oct 8, 202617
Oct 7, 202617
Oct 6, 202617
Oct 5, 202617
Oct 4, 202617
Oct 3, 202617
Oct 2, 202617
Oct 1, 202617
Sep 30, 202617
Sep 29, 202617
Sep 28, 202617
Sep 27, 202617
Sep 26, 202617
Sep 25, 202617
Sep 24, 202617
Sep 23, 202617
Sep 22, 202617
Sep 21, 202617
Sep 20, 202617
Sep 19, 202617
Sep 18, 202617
Sep 17, 202617
Sep 16, 202617
Sep 15, 202617
Sep 14, 202617
Sep 13, 202617
Sep 12, 202617
Sep 11, 202617
Sep 10, 202617
Sep 9, 202617
Sep 8, 202617
Sep 7, 202617
Sep 6, 202617
npm weekly downloads

10−1 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 202610
Dec 4, 20264
Dec 3, 20263
Dec 2, 20265
Dec 1, 20266
Nov 30, 20268
Nov 29, 202610
Nov 28, 202612
Nov 27, 202616
Nov 26, 202616
Nov 25, 202615
Nov 24, 202614
Nov 23, 202617
Nov 22, 202619
Nov 21, 202618
Nov 20, 202614
Nov 19, 202615
Nov 18, 202616
Nov 17, 202617
Nov 16, 202613
Nov 15, 202611
Nov 14, 202610
Nov 13, 202614
Nov 12, 202616
Nov 11, 202614
Nov 10, 202612
Nov 9, 202611
Nov 8, 20269
Nov 7, 20269
Nov 6, 20267
Nov 5, 20265
Nov 4, 20265
Nov 3, 20266
Nov 2, 20267
Nov 1, 20267
Oct 31, 20267
Oct 30, 202623
Oct 29, 202622
Oct 28, 202622
Oct 27, 202622
Oct 26, 202623
Oct 25, 202623
Oct 24, 202626
Oct 23, 20267
Oct 22, 20269
Oct 21, 202612
Oct 20, 202612
Oct 19, 202610
Oct 18, 20269
Oct 17, 20268
Oct 16, 202615
Oct 15, 202617
Oct 14, 202623
Oct 13, 202625
Oct 12, 202626
Oct 11, 202627
Oct 10, 202625
Oct 9, 202618
Oct 8, 202614
Oct 7, 20265
Oct 6, 20262
Oct 5, 20264
Oct 4, 20263
Oct 3, 20263
Oct 2, 20263
Oct 1, 20263
Sep 30, 20263
Sep 29, 20266
Sep 28, 20263
Sep 27, 20264
Sep 26, 20267
Sep 25, 20267
Sep 24, 20267
Sep 23, 20267
Sep 22, 20267
Sep 21, 20267
Sep 20, 20267
Sep 19, 20264
Sep 18, 20265
Sep 17, 20266
Sep 16, 20268
Sep 15, 20265
Sep 14, 20267
Sep 13, 20267
Sep 12, 20267
Sep 11, 202610
Sep 10, 20269
Sep 9, 20268
Sep 8, 202610
Sep 7, 202612
Sep 6, 202611

Each point is npm's rolling 7-day download count.

Health Score

35/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/812111820-root.svg)](https://payloaddirectory.dev/plugins/812111820-root)
HTML
<a href="https://payloaddirectory.dev/plugins/812111820-root"><img src="https://payloaddirectory.dev/badge/812111820-root.svg" alt="Payload Directory"></a>
Updated Jul 20, 2024Created Jun 8, 2024Published Jul 20, 2024

README

Payload Mask Plugin

Adds input masking to Payload.

image

Features:

  • Input masking using IMask

Basic Usage

Install the plugin and use on a text field in a Collection or Global.

Installation

yarn add payload-mask-plugin
// payload.config.ts
import { maskPlugin } from 'payload-mask-plugin'

export default buildConfig({
  ...
  plugins: [maskPlugin({ enabled: true })],
})
// Add to a text field on a Collection or Global

const Examples: CollectionConfig = {
  slug: "examples",
  fields: [
    {
      type: "text",
      name: "example_mask",
      label: "Input Mask Example",
      placeholder: "Enter a US phone number"

      custom: {
        mask: "+{1}(000)000-00-00",
        showValue: true,
        saveMaskedValue: false
      },
    },
  ],
};

export default Examples;

Similar plugins