-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathDatepickerInline.vue
95 lines (89 loc) · 3.44 KB
/
DatepickerInline.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<example src="./examples/BasicDatepicker.vue"/>
<example src="./examples/DisabledDatesDatepicker.vue"/>
<example src="./examples/InputAndMenuDatepicker.vue"/>
<template>
<page-container centered :title="$t('pages.datepicker.title')">
<div class="page-container-section">
<p>Datepicker provide a calendar to pick a date from. The component can switch between landscape and vertical mode
based on css breakpoints.</p>
</div>
<div class="page-container-section">
<h2>Datepicker</h2>
<code-example title="Basic Example" :component="examples['basic-datepicker']"/>
</div>
<div class="page-container-section">
<h2>Disabled dates</h2>
<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>
<code-example title="No weekends available" :component="examples['disabled-dates-datepicker']"/>
</div>
<div class="page-container-section">
<h2>Datepicker with input and menu</h2>
<p>Inline datepickers intergrate well with <code>md-menu</code>. Just add <code>.md-datepicker-popup</code> class.</p>
<code-example title="Datepicker inside menu" :component="examples['input-and-menu-datepicker']"/>
</div>
<div class="page-container-section">
<api-item title="API - md-datepicker-inline">
<p>All the following options can be applied to the md-datepicker-inline component:</p>
<api-table :headings="props.headings" :props="props.props" slot="props"/>
<api-table :headings="events.headings" :props="events.props" slot="events"/>
<api-table :headings="classes.headings" :props="classes.props" slot="classes"/>
</api-item>
</div>
</page-container>
</template>
<script>
import examples from 'docs-mixins/docsExample'
export default {
name: 'DocDatepickerInline',
mixins: [examples],
data: () => ({
props: {
headings: ['Name', 'Description', 'Default'],
props: [
{
name: 'md-date',
type: 'Date',
description: 'Selected date',
defaults: 'null'
},
{
name: 'md-current-date',
type: 'Date',
description: 'Default date to show in datepicker',
defaults: 'null'
},
{
name: 'md-disabled-dates',
type: 'Array|Function',
description: 'The optional disabled dates. Can be either Array or Function. <br>- If <code>Array</code>, the Datepicker will disable all days inside. <br>- If <code>Function</code>, the Datepicker will pass the current day as a parameter of this function. If the return false, then the date will be disabled.',
defaults: 'null'
},
]
},
events: {
headings: ['Name', 'Description', 'Value'],
props: [
{
name: 'md-click:day',
description: 'Triggered when day clicked',
value: 'null'
},
]
},
classes: {
headings: ['Name', 'Description'],
props: [
{
name: 'md-<code>[breakpoint]</code>-vertical',
description: 'Activates vertical mode for a particular breakpoint',
},
{
name: 'md-<code>[breakpoint]</code>-landscape',
description: 'Activates landscape mode for a particular breakpoint',
},
]
}
})
}
</script>