Skip to content

Commit 1498862

Browse files
committed
comp(MdDatePicker): add 'md-disabled-input' option
1 parent 8d53f12 commit 1498862

File tree

5 files changed

+32748
-11141
lines changed

5 files changed

+32748
-11141
lines changed

docs/app/pages/Components/Datepicker/Datepicker.vue

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<example src="./examples/CancelOpenDatepicker.vue" />
55
<example src="./examples/CloseOnSelectDatepicker.vue" />
66
<example src="./examples/DisabledDatesDatepicker.vue" />
7+
<example src="./examples/DisabledInputDatepicker.vue" />
78

89
<template>
910
<page-container centered :title="$t('pages.datepicker.title')">
@@ -42,6 +43,12 @@
4243
<p>Sometimes you may need to disable certain dates from being selected. Let's suppose that you want to let the user select only week days:</p>
4344
<code-example title="No weekends available" :component="examples['disabled-dates-datepicker']" />
4445

46+
<div class="page-container-section">
47+
<h2 id="disabledInput">Disabled input</h2>
48+
<p>Forbid manual entering to input element. The only way to choose date is interacting with dialog:</p>
49+
<code-example title="Disabled input" :component="examples['disabled-input-datepicker']" />
50+
</div>
51+
4552
<api-item title="API - md-datepicker">
4653
<p>All the following options can be applied to the md-datepicker component:</p>
4754

@@ -103,6 +110,12 @@
103110
type: 'Number',
104111
description: 'Debounces the conversion of plaintext into a date object. Set to a longer time if your users type slowly, or shorter if your users type really fast.',
105112
defaults: 1000
113+
},
114+
{
115+
name: 'md-disabled-input',
116+
type: 'Boolean',
117+
description: 'Forbid manual entering to input element. The only way to choose date is interacting with dialog.',
118+
defaults: 'false'
106119
}
107120
]
108121
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template>
2+
<div>
3+
<md-datepicker v-model="selectedDate" :md-disabled-input="true" />
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'DisabledInputDatepicker',
10+
data: () => ({
11+
selectedDate: new Date('2018/03/26')
12+
})
13+
}
14+
</script>

0 commit comments

Comments
 (0)