Update bootstrap-datetimepicker and styles. Closes #675

This commit is contained in:
James Brooks
2015-05-28 14:26:51 +01:00
parent 40a65fe7e2
commit 8299afaa8a
5 changed files with 275 additions and 234 deletions

View File

@@ -15,7 +15,7 @@
"moment": "~2.9", "moment": "~2.9",
"livestampjs": "~1.1.2", "livestampjs": "~1.1.2",
"chartjs": "~1.0.1", "chartjs": "~1.0.1",
"eonasdan-bootstrap-datetimepicker": "~4.0.0" "eonasdan-bootstrap-datetimepicker": "~4.7.14"
}, },
"resolutions": { "resolutions": {
"jquery": "~2.1.1" "jquery": "~2.1.1"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{ {
"dist/css/all.css": "dist/css/all-a3ad1e03.css", "dist/css/all.css": "dist/css/all-100868c6.css",
"dist/js/all.js": "dist/js/all-d0596004.js" "dist/js/all.js": "dist/js/all-c132bc1e.js"
} }

View File

@@ -2,91 +2,90 @@
@import "./bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_variables"; @import "./bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_variables";
.bootstrap-datetimepicker-widget { .bootstrap-datetimepicker-widget {
top: 0; list-style: none;
left: 0;
width: 250px;
padding: 4px;
margin-top: 1px;
z-index: 99999 !important;
border-radius: $border-radius-base;
&.timepicker-sbs { &.dropdown-menu {
width: 600px; margin: 2px 0;
} padding: 4px;
width: 19em;
&.bottom { &.timepicker-sbs {
&:before { @media (min-width: $screen-sm-min) {
width: 38em;
}
@media (min-width: $screen-md-min) {
width: 38em;
}
@media (min-width: $screen-lg-min) {
width: 38em;
}
}
&:before, &:after {
content: ''; content: '';
display: inline-block; display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0,0,0,.2);
position: absolute; position: absolute;
top: -7px;
left: 7px;
} }
&:after { &.bottom {
content: ''; &:before {
display: inline-block; border-left: 7px solid transparent;
border-left: 6px solid transparent; border-right: 7px solid transparent;
border-right: 6px solid transparent; border-bottom: 7px solid #ccc;
border-bottom: 6px solid white; border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute; top: -7px;
top: -6px; left: 7px;
left: 8px; }
&:after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
top: -6px;
left: 8px;
}
}
&.top {
&:before {
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
bottom: -7px;
left: 6px;
}
&:after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid white;
bottom: -6px;
left: 7px;
}
}
&.pull-right {
&:before {
left: auto;
right: 6px;
}
&:after {
left: auto;
right: 7px;
}
} }
} }
&.top { .list-unstyled {
&:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0,0,0,.2);
position: absolute;
bottom: -7px;
left: 6px;
}
&:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid white;
position: absolute;
bottom: -6px;
left: 7px;
}
}
& .dow {
width: 14.2857%;
}
&.pull-right {
&:before {
left: auto;
right: 6px;
}
&:after {
left: auto;
right: 7px;
}
}
>ul {
list-style-type: none;
margin: 0; margin: 0;
} }
a[data-action] { a[data-action] {
padding: 6px 0; padding: 6px 0;
} }
a[data-action]:active { a[data-action]:active {
@@ -101,119 +100,95 @@
} }
button[data-action] { button[data-action] {
padding: 6px; padding: 6px;
} }
table[data-hour-format="12"] .separator { .btn[data-action="incrementHours"]::after {
width: 4px; @extend .sr-only;
padding: 0; content: "Increment Hours";
margin: 0;
} }
.datepicker > div { .btn[data-action="incrementMinutes"]::after {
display: none; @extend .sr-only;
content: "Increment Minutes";
}
.btn[data-action="decrementHours"]::after {
@extend .sr-only;
content: "Decrement Hours";
}
.btn[data-action="decrementMinutes"]::after {
@extend .sr-only;
content: "Decrement Minutes";
}
.btn[data-action="showHours"]::after {
@extend .sr-only;
content: "Show Hours";
}
.btn[data-action="showMinutes"]::after {
@extend .sr-only;
content: "Show Minutes";
}
.btn[data-action="togglePeriod"]::after {
@extend .sr-only;
content: "Toggle AM/PM";
}
.btn[data-action="clear"]::after {
@extend .sr-only;
content: "Clear the picker";
}
.btn[data-action="today"]::after {
@extend .sr-only;
content: "Set the date to today";
} }
.picker-switch { .picker-switch {
text-align: center; text-align: center;
&::after {
@extend .sr-only;
content: "Toggle Date and Time Screens";
}
td {
padding: 0;
margin: 0;
height: auto;
width: auto;
line-height: inherit;
span {
line-height: 2.5;
height: 2.5em;
width: 100%;
}
}
} }
table { table {
width: 100%; width: 100%;
margin: 0; margin: 0;
}
td,
th {
text-align: center;
border-radius: $border-radius-base;
}
td { & td,
height: 54px; & th {
line-height: 54px; text-align: center;
width: 54px; border-radius: $border-radius-base;
&.cw {
font-size: 10px;
height: 20px;
line-height: 20px;
color: $gray-light;
} }
&.day { & th {
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
width: 20px; width: 20px;
}
&.day:hover, &.picker-switch {
&.hour:hover, width: 145px;
&.minute:hover,
&.second:hover {
background: $gray-lighter;
cursor: pointer;
}
&.old,
&.new {
color: $gray-light;
}
&.today {
position: relative;
&:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-bottom: 7px solid $btn-primary-bg;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 4px;
right: 4px;
}
}
&.active,
&.active:hover {
background-color: $btn-primary-bg;
color: $btn-primary-color;
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
}
&.active.today:before {
border-bottom-color: #fff;
}
&.disabled,
&.disabled:hover {
background: none;
color: $gray-light;
cursor: not-allowed;
}
span {
display: inline-block;
width: 54px;
height: 54px;
line-height: 54px;
margin: 2px 1.5px;
cursor: pointer;
border-radius: $border-radius-base;
&:hover {
background: $gray-lighter;
}
&.active {
background-color: $btn-primary-bg;
color: $btn-primary-color;
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
}
&.old {
color: $gray-light;
} }
&.disabled, &.disabled,
@@ -222,70 +197,134 @@
color: $gray-light; color: $gray-light;
cursor: not-allowed; cursor: not-allowed;
} }
}
}
th { &.prev::after {
height: 20px; @extend .sr-only;
line-height: 20px; content: "Previous Month";
width: 20px; }
&.picker-switch { &.next::after {
width: 145px; @extend .sr-only;
content: "Next Month";
}
} }
&.next, & thead tr:first-child th {
&.prev {
font-size: $font-size-base * 1.5;
}
&.disabled,
&.disabled:hover {
background: none;
color: $gray-light;
cursor: not-allowed;
}
}
thead tr:first-child th {
cursor: pointer;
&:hover {
background: $gray-lighter;
}
}
}
.input-group {
&.date {
.input-group-addon span {
display: block;
cursor: pointer; cursor: pointer;
width: 16px;
height: 16px; &:hover {
background: $gray-lighter;
}
}
& td {
height: 54px;
line-height: 54px;
width: 54px;
&.cw {
font-size: .8em;
height: 20px;
line-height: 20px;
color: $gray-light;
}
&.day {
height: 20px;
line-height: 20px;
width: 20px;
}
&.day:hover,
&.hour:hover,
&.minute:hover,
&.second:hover {
background: $gray-lighter;
cursor: pointer;
}
&.old,
&.new {
color: $gray-light;
}
&.today {
position: relative;
&:before {
content: '';
display: inline-block;
border: 0 0 7px 7px solid transparent;
border-bottom-color: $cachet-primary;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 4px;
right: 4px;
}
}
&.active,
&.active:hover {
background-color: $cachet-primary;
color: $btn-primary-color;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
&.active.today:before {
border-bottom-color: #fff;
}
&.disabled,
&.disabled:hover {
background: none;
color: $gray-light;
cursor: not-allowed;
}
span {
display: inline-block;
width: 54px;
height: 54px;
line-height: 54px;
margin: 2px 1.5px;
cursor: pointer;
border-radius: $border-radius-base;
&:hover {
background: $gray-lighter;
}
&.active {
background-color: $cachet-primary;
color: $btn-primary-color;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
&.old {
color: $gray-light;
}
&.disabled,
&.disabled:hover {
background: none;
color: $gray-light;
cursor: not-allowed;
}
}
}
}
&.usetwentyfour {
td.hour {
height: 27px;
line-height: 27px;
} }
} }
} }
.bootstrap-datetimepicker-widget.left-oriented { .input-group.date {
&:before { & .input-group-addon {
left: auto; cursor: pointer;
right: 6px;
}
&:after {
left: auto;
right: 7px;
}
}
.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
padding: 0px !important;
}
@media screen and (max-width: 767px) {
.bootstrap-datetimepicker-widget.timepicker-sbs {
width: 283px;
} }
} }