forked from bendavis78/paper-date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
paper-calendar-month-navigation.html
99 lines (86 loc) · 2.43 KB
/
paper-calendar-month-navigation.html
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
96
97
98
99
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="paper-date-picker-icons.html">
<dom-module id="paper-calendar-month-navigation">
<template>
<style>
:host {
width: 100%;
@apply --layout-horizontal;
@apply --layout-center;
height: calc(100%/8);
box-sizing: border-box;
padding: 0 calc(100%/36);
}
.col {
position: relative;
@apply --layout-vertical;
@apply --layout-center-center;
}
button {
background: 0;
border: 0;
}
button .icon {
cursor: pointer;
}
button .ripple {
position: absolute;
width: 48px;
height: 48px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
button.right {
text-align: right;
}
.flex {
@apply --layout-flex;
}
.flex-5 {
@apply --layout-flex-5;
}
</style>
<div class="flex col self-stretch">
<button type="button" on-tap="_navigateToPrevious" aria-label$="[[labelPreviousMonth]]">
<paper-ripple center class="ripple circle"></paper-ripple>
<iron-icon class="icon flex" icon="date-picker:chevron-left"></iron-icon>
</button>
</div>
<div class="flex-5"></div>
<div class="flex col self-stretch">
<button type="button" on-tap="_navigateToNext" aria-label$="[[labelNextMonth]]">
<paper-ripple center class="ripple circle"></paper-ripple>
<iron-icon class="icon flex" icon="date-picker:chevron-right"></iron-icon>
</button>
</div>
</template>
<script>
Polymer({
is: 'paper-calendar-month-navigation',
properties: {
labelNextMonth: {
type: String,
value: 'next month'
},
labelPreviousMonth: {
type: String,
value: 'previous month'
}
},
_navigateToPrevious: function () {
var event = new Event('navigate');
event.direction = 'previous';
this.dispatchEvent(event);
},
_navigateToNext: function () {
var event = new Event('navigate');
event.direction = 'next';
this.dispatchEvent(event);
}
});
</script>
</dom-module>