Skip to content

Commit b97218f

Browse files
committed
docs: add additional docs in regards to dynamic masks
1 parent a88a78b commit b97218f

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

docs/component.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ let masked = false
1717
Accepts an array of masking pattern and dynamically chooses the appropriate one based on the number of characters in the field.
1818

1919
```js
20-
let value = ''
21-
let masked = true
20+
let USPostal = ''
21+
let UKPostal = ''
2222

23+
let masked = true
2324
<example label="US Zip Code">
24-
<input-facade v-model="value" :mask="['#####', '#####-####']" :masked="masked" />
25+
<input-facade v-model="USPostal" :mask="['#####', '#####-####']" :masked="masked" />
26+
</example>
27+
28+
<example label="UK Postal Code">
29+
<input-facade v-model="UKPostal" :mask="['A# #AA', 'AXX #AA', 'AA#X #AA']" :masked="masked" />
2530
</example>
2631

2732
<checkbox v-model="masked" />
28-
<display :value="value" />
33+
<display label="Zip Code" :value="USPostal" />
34+
<display label="Postal Code" :value="UKPostal" />
2935
```
3036

3137
### Custom Tokens

docs/directive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You have access to the unmasked value via the input event. The `unmaskedValue`
2020
let event = ''
2121

2222
<example label="Enter your phone number">
23-
<input type="tel" v-facade="'(###) ### - ####'" @input="event = $event">
23+
<input type="tel" v-facade="'(###) ### - ####'" v-on:input="event = $event">
2424
</example>
2525

2626
<display :value="event" />

src/component.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default {
5858
formatter: Function,
5959
/**
6060
* If the mask starts with static characters, show them in the field initially before typing anything.
61+
* @since v1.2
6162
*/
6263
prepend: {
6364
type: Boolean,

styleguide/components/Checkbox.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export default {
7676
}
7777
7878
.checkbox__input:checked + .checkbox__label::before {
79-
color: #1a73e8;
79+
color: #ffffff;
8080
border: 1px solid #1a73e8;
81+
background-color: #1a73e8;
8182
}
8283
</style>

styleguide/components/Display.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script>
88
export default {
99
name: 'Display',
10-
props: ['value'],
10+
props: ['value', 'label'],
1111
computed: {
1212
display() {
1313
let output = ''
@@ -21,7 +21,7 @@ export default {
2121
unmaskedValue: '${unmasked}'
2222
}`
2323
} else if (typeof this.value === 'string') {
24-
output = `value: '${this.value}'`
24+
output = `${this.label || 'value'}: '${this.value}'`
2525
}
2626
2727
return output
@@ -33,9 +33,14 @@ export default {
3333
<style>
3434
.display {
3535
margin: 0;
36+
margin-bottom: 4px;
3637
margin-left: -16px;
3738
}
3839
40+
.display:last-child {
41+
margin-bottom: 0;
42+
}
43+
3944
.display__value {
4045
padding: 12px;
4146
border-radius: 10px;

0 commit comments

Comments
 (0)