Skip to content

Commit d8c746b

Browse files
committed
create initial datePicker
1 parent 6c3a5da commit d8c746b

File tree

7 files changed

+219
-67
lines changed

7 files changed

+219
-67
lines changed

src/components/mdButton/mdButton.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ $button-icon-size: 40px;
9696
border-radius: 50%;
9797
line-height: 24px;
9898

99-
&:not([disabled]) {
100-
&:hover {
101-
background: none;
102-
}
103-
}
104-
10599
&.md-dense {
106100
width: $button-dense-height;
107101
min-width: $button-dense-height;

src/components/mdChips/mdChip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<slot></slot>
44

55
<md-button
6-
class="md-icon-button md-dense md-delete"
6+
class="md-icon-button md-dense md-delete md-input-action"
77
v-if="mdDeletable"
88
@click.native="!disabled && $emit('delete')"
99
@keyup.native.delete="!disabled && $emit('delete')"

src/components/mdDatePicker/mdDatePicker.scss

Lines changed: 110 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -125,53 +125,115 @@ $month-small-width: 280px;
125125
@include layout-xsmall {
126126
width: 296px;
127127
}
128+
129+
.md-button {
130+
margin: 0;
131+
132+
&.md-primary.md-raised {
133+
box-shadow: none;
134+
}
135+
}
128136
}
129137

130138
.md-datepicker-calendar {
131139
margin: 8px;
132140
overflow: hidden;
133141
text-align: center;
134142

135-
.md-button {
136-
margin: 0;
137-
}
138-
139143
.md-datepicker-controls {
140144
display: flex;
141145
justify-content: space-between;
142146
align-items: center;
143-
position: relative;
144-
z-index: 2;
145-
}
146147

147-
.md-current-date {
148-
height: 40px;
149-
margin-top: -40px;
150-
display: flex;
151-
justify-content: center;
152-
align-items: center;
148+
.md-button {
149+
position: relative;
150+
z-index: 2;
151+
}
153152
}
154153

155154
.md-calendar-container {
156-
width: $month-width * 3;
157-
display: flex;
158-
transform: translate3d(-$month-width, 0, 0);
159-
transition: $swift-ease-out;
155+
width: 999em;
156+
transform: translate3d(0, 0, 0);
160157

161-
@include layout-xsmall {
162-
width: $month-small-width * 3;
163-
transform: translate3d(-$month-small-width, 0, 0);
158+
&.md-previous .md-datepicker-month {
159+
&.slide-month-enter-active,
160+
&.slide-month-leave-to {
161+
transform: translate3D(-200%, 0, 0);
162+
163+
.md-current-date {
164+
transform: translate3d(-110%, 0, 0);
165+
}
166+
}
167+
168+
&.slide-month-enter-to,
169+
&.slide-month-leave-active {
170+
transform: translate3D(-100%, 0, 0);
171+
172+
.md-current-date {
173+
transform: translate3d(0, 0, 0);
174+
}
175+
}
176+
177+
&.slide-month-leave-to {
178+
opacity: 0;
179+
transform: translate3D(100%, 0, 0);
180+
}
181+
}
182+
183+
&.md-next .md-datepicker-month {
184+
&.slide-month-enter-active,
185+
&.slide-month-leave-to {
186+
.md-current-date {
187+
transform: translate3d(110%, 0, 0);
188+
}
189+
}
190+
191+
&.slide-month-enter-to,
192+
&.slide-month-leave-active {
193+
.md-current-date {
194+
transform: translate3d(0, 0, 0);
195+
}
196+
}
197+
198+
&.slide-month-enter-to,
199+
&.slide-month-leave-to {
200+
transform: translate3D(-100%, 0, 0);
201+
}
202+
203+
&.slide-month-leave-to {
204+
opacity: 0;
205+
}
164206
}
165207
}
166208

167209
.md-datepicker-month {
168210
width: $month-width;
169-
position: relative;
170-
z-index: 1;
211+
margin-top: -40px;
212+
float: left;
213+
overflow: hidden;
171214

172215
@include layout-xsmall {
173216
width: $month-small-width;
174217
}
218+
219+
&.slide-month-enter,
220+
&.slide-month-enter-active,
221+
&.slide-month-leave-active {
222+
transition: $swift-ease-out;
223+
}
224+
}
225+
226+
.md-current-date {
227+
width: calc(100% - 96px);
228+
height: 40px;
229+
margin: 0 48px;
230+
padding: 0;
231+
display: flex;
232+
justify-content: center;
233+
align-items: center;
234+
transition: $swift-ease-out;
235+
font-weight: 400;
236+
text-transform: none;
175237
}
176238

177239
.md-datepicker-week-days {
@@ -249,23 +311,36 @@ $month-small-width: 280px;
249311
@include layout-xsmall {
250312
flex-flow: column;
251313
}
252-
}
253314

254-
.md-datepicker-year {
255-
min-width: 60px;
256-
margin: 8px 4px;
257-
padding: 0;
258-
flex: 1;
315+
.md-datepicker-year {
316+
min-width: 60px;
317+
margin: 8px 4px;
318+
padding: 0;
319+
flex: 1;
259320

260-
&.md-primary {
261-
font-weight: 900;
321+
&.md-primary {
322+
font-weight: 900;
262323

263-
&.md-raised {
264-
box-shadow: none;
324+
@include layout-xsmall {
325+
font-size: 22px;
326+
}
265327
}
328+
}
329+
}
266330

267-
@include layout-xsmall {
268-
font-size: 22px;
269-
}
331+
.md-datepicker-months {
332+
padding: 0 8px 7px;
333+
display: flex;
334+
flex-wrap: wrap;
335+
overflow: auto;
336+
337+
@include layout-xsmall {
338+
flex-flow: column;
339+
}
340+
341+
.md-datepicker-month {
342+
margin: 8px 4px;
343+
padding: 0;
344+
flex: 1 1 calc(33.333% - 8px);
270345
}
271346
}

src/components/mdDatePicker/mdDatePicker.theme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
}
1111
}
1212

13+
&.md-select-month {
14+
.md-datepicker-year-select,
15+
.md-datepicker-date-select {
16+
color: #{'PRIMARY-CONTRAST-0.54'};
17+
18+
&:hover {
19+
color: #{'PRIMARY-CONTRAST-0.87'};
20+
}
21+
}
22+
}
23+
1324
&.md-select-year {
1425
.md-datepicker-date-select {
1526
color: #{'PRIMARY-CONTRAST-0.54'};

0 commit comments

Comments
 (0)