@onereach/regexes-favorites-and-librarydeprecated

🗄 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 no npm install needed!

<script type="module">
  import onereachRegexesFavoritesAndLibrary from 'https://cdn.skypack.dev/@onereach/regexes-favorites-and-library';
</script>

README

@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

| Event | Payload | Description | | -| - | -| | matchFound | arrayOfMatches | Emitted when got match in testInput | | focus | null | Emitted when regex input field is focused | | blur | null | Emitted when regex input field is unfocused |

Exports

{ RegexHelper, RegexDocs, getRegexBodyFlags }