0.0.4 • Published 3 years ago

@onereach/regexes-favorites-and-library v0.0.4

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
3 years ago

@onereach/regexes-favorites-and-library

🗄 UI for browsing Regular Expressions from Favorites (in your OR account) and Library (in Provides account) storage & FavoritesAPI Service for CRUD operations with Favorites list.

🚀 Usage example

<template>
  <RegexHelper :regex.sync="regex" />
</template>

<script>
  import { RegexHelper,  getRegexBodyFlags } from '@onereach/regex-helper'

  export default {
    components: {
      RegexHelper
    },

    data () {
      return {
        regex: '/\d{2}/'
      }
    },

    watch: {
      regex (v) {
        const { body, flags } = getRegexBodyFlags(v)
        console.log('regex change', new RegExp(body, flags))
      }
    }
  }
</script>

⚙ Props

{
  /**
   * RegExp value
  */
  regex: {
    type: String,
    default: ''
  },

  /**
   * Testable text value
  */
  testInput: {
    type: String, 
    default: ''
  },

  /**
   * Error message. If not empty component will be in error state.
  */
  error: {
    type: String,
    default: ''
  },

  /**
   * Input field for RegExp
  */
  regexInputVisibility: {
    type: Boolean,
    default: true
  },

  /**
   * Extended information about RegExp parts
  */
  regexDetailsVisibility: {
    type: Boolean,
    default: false
  },

  /**
   * Docs/help information popup
  */
  docsVisibility: {
    type: Boolean,
    default: false
  },

  /**
   * Testable text input field
  */
  testInputVisibility: {
    type: Boolean,
    default: false
  },

  /**
   * Extended information about findings in testInput
  */
  matchDetailsVisibility: {
    type: Boolean,
    default: false
  },

  /**
   * Text input labels
  */
  labels: {
        type: Object,
        default: () => ({ regex: '', testInput: '' })
      }

  readonly: {
    type: Boolean,
    default: false
  },
}

🔥 Events

EventPayloadDescription
matchFoundarrayOfMatchesEmitted when got match in testInput
focusnullEmitted when regex input field is focused
blurnullEmitted when regex input field is unfocused

Exports

{ RegexHelper, RegexDocs, getRegexBodyFlags }

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago