1.0.36 • Published 4 years ago

@jiffylive/vue-j-editable v1.0.36

Weekly downloads
36
License
MIT
Repository
-
Last release
4 years ago

Demo

  • Install the component, run "cd node_modules/@jiffylive/vue-j-editable" then "npm run serve" to see examples.
  • Online demo coming soon

Docs

Why use vue-j-editable?

  • Usability: Easy for users to update text

  • Control: Different inputs and options

  • Validation: Uses vuelidate to validate fields

  • Tooltips: Presented for invalid fields using popperjs

  • Color coding: optionally show color if invalid

  • Currency support: show currency in different international formats

  • Date support: using date picker

Form input types

  • Default: contentEditable div
  • Input: input form field
  • Select: select with options provided by :selectOptions
  • Date: date picker to choose date

Future field types include image, file input, time, date range, color picker

Available rules

The package uses vuelidate for field validation. See vuelidate documentation for more info about specific rules. These rules can be specified by property or via rules JSON

eg.
<jEditable :item="item" field="name" :rules="{required: true, minLength: 4}" />
<jEditable :item="item" field="name" required="true" :rules="{format: 'email'}"  />
<jEditable :item="item" field="name" format="email"  />

Direct property rules:

  • Required

Current supported formats:

  • Email
  • minLength
  • numeric
  • decimal
  • currency (not supported by vuelidate but allows a $ or € symbol to be proceeding the figure)
  • URL

Currencies can be supported by providing formatParam parameter eg :formatParam="{country: 'it-IT', currency: 'EUR'}" or {"country": "jp-JP", "currency": "JPY"} See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat for more information about

Input properties

  • item - an item (object) or array of values
  • field - the name of the field from the object

Available events

  • @update when the field is changed and complete (via enter, tab or field blur)
  • @updateLive when a character is typed
  • @onFocus when the field comes into focus
  • @onBlur when the field leaves focus

Current modes

All features are available via properties but these modes are presets to save time

  • jEditable: Reads field from object / array and emit updates
  • jEditableItem: Reads directly from item properties and sends updates to item
  • jEditableItemGetSet: Reads an object via get / set methods

Installation

1. Package Manager

# With npm
npm i @jiffylive/vue-j-editable
import jEditable from '@jiffylive/vue-j-editable';

components: {
  "Editable": jEditable
}

<Editable :item="item" :field="field" />

License

MIT

1.0.36

4 years ago

1.0.35

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.34

4 years ago

1.0.29

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.23

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago