Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Dec 10, 2017
1 parent ebedd34 commit eeb0ee6
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
2 changes: 1 addition & 1 deletion docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ <h2><a href="#validator-example">Validator Example</a></h2>
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
File renamed without changes.
11 changes: 0 additions & 11 deletions docs/assets/js/vendor-b954a9a56f027d21c380.js

This file was deleted.

11 changes: 11 additions & 0 deletions docs/assets/js/vendor-e3a702590a301a44d319.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -814,4 +814,4 @@ <h2><a href="#initial-value">Initial Value Validation</a></h2>
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
20 changes: 18 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ <h2><a href="#configuration">Configuration</a></h2>
events: 'input|blur',
inject: true,
validity: false,
aria: true
aria: true,
i18n: null // the vue-i18n plugin instance,
i18nRootKey: 'validations' // the nested key under which the validation messsages will be located
};

Vue.use(VeeValidate, config);
Expand Down Expand Up @@ -283,6 +285,20 @@ <h2><a href="#configuration">Configuration</a></h2>
Sets `aria-invalid` and `aria-required` on native HTML inputs.
</td>
</tr>
<tr>
<td class="is-method-name">i18n</td>
<td>null</td>
<td>
The `vue-i18n` instance, if provided will integrate vee-validate with the i18n plugin and will use it to produce the error messages instead of the built in dictionary.
</td>
</tr>
<tr>
<td class="is-method-name">i18nRootKey</td>
<td>validations</td>
<td>
The key name of the validation messages for each locale.
</td>
</tr>
</tbody>
</table>
</div></div></div></div></div></svg><script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script><script>Array.from(document.querySelectorAll('h2')).forEach(h => {
Expand All @@ -305,4 +321,4 @@ <h2><a href="#configuration">Configuration</a></h2>
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
2 changes: 1 addition & 1 deletion docs/localization.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ <h2><a href="#localized-files">Localized Files</a></h2>
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"bulma": "0.2.1",
"font-awesome": "^4.7.0",
"highlight.js": "^9.12.0",
"vee-validate": "^2.0.0-rc.22",
"vee-validate": "^2.0.0-rc.26",
"vue": "^2.4.2",
"whatwg-fetch": "^2.0.3"
}
Expand Down
25 changes: 18 additions & 7 deletions docs/rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<pre><code class="highlight-js">const someRule = 'in:1,2,3,4';
const someRuleObj = { in: [1, 2, 3, 4] };
</code></pre>
<blockquote>
<p>In object form, rules keys accepts a single value if the rule accepts a single argument, if multiple arguments are passed you should pass them as an array in the same order.</p>
</blockquote>
<h2><a href="#available-rules">Available Rules</a></h2>
<p>There are more than 20 rules available to validate your inputs:</p>
<div class="columns is-multiline">
Expand Down Expand Up @@ -194,21 +197,21 @@ <h3><a href="#rule-date_between">date_between:{min,max},{inclusion?}</a></h3>
<li><code>min:</code>The minimum allowed value for date. Must be in the same format as the date_format rule.</li>
<li><code>max:</code>The maximum allowed value for date. Must be in the same format as the date_format rule.</li>
<li><code>inclusion</code>: Whether to include equal dates as a valid value, it is set to <code>()</code> (exclude) by default.<br>
(For further information check the <a href="https://momentjs.com/docs/#/query/is-between/">monentjs inclusion docs</a>. vee-validate switched to <a href="https://date-fns.org">date-fns</a> but ported this functionality.</li>
(For further information check the <a href="https://momentjs.com/docs/#/query/is-between/">monentjs inclusion docs</a>vee-validate uses <a href="https://date-fns.org">date-fns</a> but ported this functionality.</li>
</ul>
<input v-validate="'date_format:DD/MM/YYYY|date_between:10/09/2016,20/09/2016'" :class="{'input': true, 'is-danger': errors.has('date_between_field') }" name="date_between_field" type="text" placeholder="DD/MM/YYYY betweem 10/09/2016 and 20/09/2016">
<span v-show="errors.has('date_between_field')" class="help is-danger">{{ errors.first('date_between_field') }}</span>
<h3><a href="#rule-date_format">date_format:{format}</a></h3>
<p>The field under validation must be a valid date in the specified format. This rule must be present when using any date rule.</p>
<ul>
<li><code>format:</code> The date format. See <a href="http://momentjs.com/docs/#/parsing/string-format/">momentjs parsing.</a></li>
<li><code>format:</code> The date format. See <a href="https://date-fns.org/v2.0.0-alpha.7/docs/format">date-fns format</a></li>
</ul>
<input v-validate="'date_format:DD/MM/YYYY'" :class="{'input': true, 'is-danger': errors.has('date_format_field') }" name="date_format_field" type="text" placeholder="DD/MM/YYYY">
<span v-show="errors.has('date_format_field')" class="help is-danger">{{ errors.first('date_format_field') }}</span>
<h3><a href="#rule-decimal">decimal:{decimals?}</a></h3>
<p>The field under validation must be numeric and may contain the specified amount of decmial point.</p>
<p>The field under validation must be numeric and may contain the specified amount of decimal point.</p>
<ul>
<li><code>decmials:</code> The maximum allowed number of decimal point numbers. Not passing the decmials will accept numeric data which may or may not contain decimal point numbers.</li>
<li><code>decimals:</code> The maximum allowed number of decimal point numbers. Not passing the decimals will accept numeric data which may or may not contain decimal point numbers.</li>
</ul>
<input v-validate="'decimal:3'" :class="{'input': true, 'is-danger': errors.has('decimal_field') }" name="decimal_field" type="text" placeholder="Numeric value with decimals">
<span v-show="errors.has('decimal_field')" class="help is-danger">{{ errors.first('decimal_field') }}</span>
Expand Down Expand Up @@ -256,10 +259,18 @@ <h3><a href="#rule-in">in:[list]</a></h3>
</select>
</span>
<span v-show="errors.has('in_field')" class="help is-danger">{{ errors.first('in_field') }}</span>
### [ip](#rule-ip)
The field under validation must have a string that is a valid ipv4 value.
<h3><a href="#rule-ip">ip</a></h3>
<p>The field under validation must have a string that is a valid ipv4 value.</p>
<input v-validate="'ip'" data-vv-as="ip" :class="{'input': true, 'is-danger': errors.has('ip_field') }" name="ip_field" type="text" placeholder="Your IP Address">
<span v-show="errors.has('ip_field')" class="help is-danger">{{ errors.first('ip_field') }}</span>
<h3><a href="#rule-is">is:{value}</a></h3>
<p>The field under validation must be equal to the first argument passed, uses <code>===</code> for equality checks. This rule is useful for confirming passwords when used in object form. Note that using the string format will cause any arguments to be parsed as strings, So use the object format when using this rule.</p>
<ul>
<li><code>value:</code> A value of anytype to be compared against the field value.</li>
</ul>
<pre><code class="highlight-html">&lt;input v-validate=&quot;{ is: confirmation }&quot; type=&quot;text&quot; name=&quot;password&quot;&gt;
&lt;input v-model=&quot;confirmation&quot; type=&quot;text&quot; name=&quot;password_confirmation&quot;&gt;
</code></pre>
<h3><a href="#rule-max">max:{length}</a></h3>
<p>The field under validation length may not exceed the specified length.</p>
<ul>
Expand Down Expand Up @@ -523,4 +534,4 @@ <h2><a href="#field-sepecific-messages">Field-specific Custom Messages</a></h2>
var hash = location.hash;
location.hash = '';
location.hash = hash;
}</script><script type="text/javascript" src="/assets/js/vendor-b954a9a56f027d21c380.js"></script><script type="text/javascript" src="/assets/js/bundle-b954a9a56f027d21c380.js"></script></body></html>
}</script><script type="text/javascript" src="/assets/js/vendor-e3a702590a301a44d319.js"></script><script type="text/javascript" src="/assets/js/bundle-e3a702590a301a44d319.js"></script></body></html>
18 changes: 17 additions & 1 deletion docs/src/templates/markdown/home/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const config = {
events: 'input|blur',
inject: true,
validity: false,
aria: true
aria: true,
i18n: null // the vue-i18n plugin instance,
i18nRootKey: 'validations' // the nested key under which the validation messsages will be located
};

Vue.use(VeeValidate, config);
Expand Down Expand Up @@ -121,5 +123,19 @@ Vue.use(VeeValidate, config);
Sets `aria-invalid` and `aria-required` on native HTML inputs.
</td>
</tr>
<tr>
<td class="is-method-name">i18n</td>
<td>null</td>
<td>
The `vue-i18n` instance, if provided will integrate vee-validate with the i18n plugin and will use it to produce the error messages instead of the built in dictionary.
</td>
</tr>
<tr>
<td class="is-method-name">i18nRootKey</td>
<td>validations</td>
<td>
The key name of the validation messages for each locale.
</td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion docs/src/templates/markdown/rules/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ const someRule = 'in:1,2,3,4';
const someRuleObj = { in: [1, 2, 3, 4] };
```

> In object form, rules keys accepts a single value **if the rule accepts a single argument**, if multiple arguments are passed you should pass them as an array in the same order.
> In object form, rules keys accepts a single value if the rule accepts a single argument, if multiple arguments are passed you should pass them as an array in the same order.
12 changes: 12 additions & 0 deletions docs/src/templates/markdown/rules/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,24 @@ The field under validation must have a value that is in the specified list.
</select>
</span>
<span v-show="errors.has('in_field')" class="help is-danger">{{ errors.first('in_field') }}</span>

### [ip](#rule-ip)
The field under validation must have a string that is a valid ipv4 value.

<input v-validate="'ip'" data-vv-as="ip" :class="{'input': true, 'is-danger': errors.has('ip_field') }" name="ip_field" type="text" placeholder="Your IP Address">
<span v-show="errors.has('ip_field')" class="help is-danger">{{ errors.first('ip_field') }}</span>

### [is:{value}](#rule-is)

The field under validation must be equal to the first argument passed, uses `===` for equality checks. This rule is useful for confirming passwords when used in object form. Note that using the string format will cause any arguments to be parsed as strings, So use the object format when using this rule.

- `value:` A value of anytype to be compared against the field value.

```html
<input v-validate="{ is: confirmation }" type="text" name="password">
<input v-model="confirmation" type="text" name="password_confirmation">
```

### [max:{length}](#rule-max)

The field under validation length may not exceed the specified length.
Expand Down
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5655,9 +5655,9 @@ vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

vee-validate@^2.0.0-rc.22:
version "2.0.0-rc.25"
resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-2.0.0-rc.25.tgz#bfd80f6c55c560526dcc2be194731adffad63b1d"
vee-validate@^2.0.0-rc.26:
version "2.0.0-rc.26"
resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-2.0.0-rc.26.tgz#e556f98ca4a305484bdf153f94a227edc7bc7c4f"

vendors@^1.0.0:
version "1.0.1"
Expand Down

0 comments on commit eeb0ee6

Please sign in to comment.