Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 4211d21

Browse files
committed
feat(datepicker): add documentation for datepicker
1 parent 891d6e8 commit 4211d21

24 files changed

+136
-159
lines changed

src/components/calendar/calendar-theme.scss

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/calendar/datePicker-theme.scss

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/components/calendar/demoCalendar/index.html

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/components/calendar/demoDatePicker/index.html

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/components/calendar/demoDatePicker/style.css

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div ng-controller="AppCtrl" style='padding: 40px;'>
2+
<md-content>
3+
<h1>{{title}}</h1>
4+
5+
<md-calendar ng-model="myDate"></md-calendar>
6+
7+
</md-content>
8+
</div>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/** Theme styles for mdCalendar. */
2+
3+
.md-calendar.md-THEME_NAME-theme {
4+
color: '{{foreground-2}}';
5+
6+
tr:last-child td {
7+
border-bottom-color: '{{background-200}}';
8+
}
9+
}
10+
.md-THEME_NAME-theme {
11+
12+
.md-calendar-day-header {
13+
background: '{{background-200}}'; // grey-200
14+
color: '{{foreground-2}}'; // grey-700
15+
}
16+
17+
.md-calendar-date.md-calendar-date-today {
18+
color: '{{primary-500}}'; // blue-500
19+
}
20+
21+
// The CSS class `md-focus` is used instead of real browser focus for accessibility reasons
22+
// (the root md-calendar holds browser focus).
23+
.md-calendar-date.md-focus {
24+
.md-calendar-date-selection-indicator {
25+
background: '{{background-300}}'; // grey-300
26+
}
27+
}
28+
29+
.md-calendar-date-selection-indicator:hover {
30+
background: '{{background-300}}'; // grey-300
31+
}
32+
33+
// Selected style goes after hover and focus so that it takes priority.
34+
.md-calendar-date.md-calendar-selected-date,
35+
.md-calendar-date.md-focus.md-calendar-selected-date {
36+
.md-calendar-date-selection-indicator {
37+
background: '{{primary-500}}'; // blue-500
38+
color: '{{primary-500-contrast}}'; // white
39+
}
40+
}
41+
42+
}

src/components/calendar/calendar.js renamed to src/components/datepicker/calendar.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
/**
55
* @ngdoc module
6-
* @name material.components.calendar
7-
* @description Calendar
6+
* @name material.components.datepicker
7+
* @description Datepicker
88
*/
9-
angular.module('material.components.calendar', [
9+
angular.module('material.components.datepicker', [
1010
'material.core',
1111
'material.components.virtualRepeat',
1212
'material.components.icon'
@@ -17,6 +17,9 @@
1717
// TODO(mchen): Date "isComplete" logic
1818

1919
// POST RELEASE
20+
// TODO(jelbourn): Clicking on the month label opens the month-picker.
21+
// TODO(jelbourn): Minimum and maximum date
22+
// TODO(jelbourn): Define virtual scrolling constants (compactness).
2023
// TODO(jelbourn): Animated month transition on ng-model change (virtual-repeat)
2124
// TODO(jelbourn): Scroll snapping (virtual repeat)
2225
// TODO(jelbourn): Remove superfluous row from short months (virtual-repeat)
@@ -26,11 +29,6 @@
2629
// announcement and key handling).
2730
// Read-only calendar (not just date-picker).
2831

29-
// COULD GO EITHER WAY
30-
// TODO(jelbourn): Clicking on the month label opens the month-picker.
31-
// TODO(jelbourn): Minimum and maximum date
32-
// TODO(jelbourn): Define virtual scrolling constants (compactness).
33-
3432
/**
3533
* Height of one calendar month tbody. This must be made known to the virtual-repeat and is
3634
* subsequently used for scrolling to specific months.
@@ -78,8 +76,8 @@
7876
* @ngInject @constructor
7977
*/
8078
function CalendarCtrl($element, $attrs, $scope, $animate, $q, $mdConstant,
81-
$$mdDateUtil, $$mdDateLocale, $mdInkRipple, $mdUtil) {
82-
79+
$mdTheming, $$mdDateUtil, $$mdDateLocale, $mdInkRipple, $mdUtil) {
80+
$mdTheming($element);
8381
/**
8482
* Dummy array-like object for virtual-repeat to iterate over. The length is the total
8583
* number of months that can be viewed. This is shorter than ideal because of (potential)

0 commit comments

Comments
 (0)