From 10a8f125e098093049147437f3d93a108e58016b Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 30 Mar 2020 15:25:38 -0500 Subject: [PATCH 01/46] updated datepicker dialog example --- .../dialog-modal/css/datepicker-dialog.css | 229 +++++ examples/dialog-modal/css/datepicker.css | 198 ----- examples/dialog-modal/datepicker-dialog.html | 143 +-- examples/dialog-modal/js/calendar-button.js | 110 --- examples/dialog-modal/js/datepicker-day.js | 174 ---- examples/dialog-modal/js/datepicker-dialog.js | 839 ++++++++++++++++++ examples/dialog-modal/js/datepicker.js | 579 ------------ 7 files changed, 1140 insertions(+), 1132 deletions(-) create mode 100644 examples/dialog-modal/css/datepicker-dialog.css delete mode 100644 examples/dialog-modal/css/datepicker.css delete mode 100644 examples/dialog-modal/js/calendar-button.js delete mode 100644 examples/dialog-modal/js/datepicker-day.js create mode 100644 examples/dialog-modal/js/datepicker-dialog.js delete mode 100644 examples/dialog-modal/js/datepicker.js diff --git a/examples/dialog-modal/css/datepicker-dialog.css b/examples/dialog-modal/css/datepicker-dialog.css new file mode 100644 index 0000000000..507a08d94e --- /dev/null +++ b/examples/dialog-modal/css/datepicker-dialog.css @@ -0,0 +1,229 @@ +.datepicker { + margin-top: 1em; + position: relative; +} + +.datepicker .group { + display: inline-flex; +} + +.datepicker label { + display: block; +} + +.datepicker input, +.datepicker button { + background-color: white; + color: black; + box-sizing: border-box; + height: 1.75rem; + padding: 0; + margin: 0; + vertical-align: bottom; + border: 1px solid gray; + position: relative; +} + +.datepicker input { + width: 10.75rem; + border-right: none; + outline: none; + font-size: 87.5%; + padding: 0.1em 0.3em; +} + +.datepicker button { + width: 1.25rem; + border-left: none; + outline: none; +} + +.datepicker .group.focus { + outline: 2px solid black; + outline-offset: 1px; +} + +.datepicker .group.focus input, +.datepicker .group.focus button { + background-color: #DEF; +} + +.datepicker.group button[aria-expanded="true"] svg { + transform: rotate(180deg) translate(0, -1px); +} + +.datepicker .group.focus { + outline: 2px solid black; + outline-offset: 1px; +} + +.datepicker .group.focus input, +.datepicker .group.focus button { + background-color: #DEF; +} + +.datepicker .group polygon { + fill: gray; + stroke: transparent; +} + +.datepicker .group button[aria-expanded="true"] polygon, +.datepicker .group.focus polygon { + fill: black; + stroke: white; +} + +.datepicker-dialog { + position: absolute; + width: 320px; + clear: both; + border: 3px solid hsl(216, 80%, 51%); + margin-top: 1em; + border-radius: 5px; + padding: 0; + background-color: #fff; +} + +.datepicker-dialog .header { + cursor: default; + background-color: hsl(216, 80%, 51%); + padding: 7px; + font-weight: bold; + text-transform: uppercase; + color: white; + display: flex; + justify-content: space-around; +} + +.datepicker-dialog h2 { + margin: 0; + padding: 0; + display: inline-block; + font-size: 1em; + color: white; + text-transform: none; + font-weight: bold; +} + +.datepicker-dialog button { + border-style: none; + background: transparent; +} + +.datepicker-dialog button::-moz-focus-inner { + border: 0; +} + +.datepicker-dialog .dates { + width: 320px; +} + +.datepicker-dialog .prev-year, +.datepicker-dialog .prev-month, +.datepicker-dialog .next-month, +.datepicker-dialog .next-year { + padding: 4px; + width: 24px; + height: 24px; + color: white; +} + +.datepicker-dialog .prev-year:focus, +.datepicker-dialog .prev-month:focus, +.datepicker-dialog .next-month:focus, +.datepicker-dialog .next-year:focus { + padding: 2px; + border: 2px solid white; + border-radius: 4px; + outline: 0; +} + +.datepicker-dialog .dialog-ok-cancel-group { + text-align: right; + margin-top: 1em; + margin-bottom: 1em; + margin-right: 1em; +} + +.datepicker-dialog .dialog-ok-cancel-group button { + padding: 5px; + margin-left: 1em; + width: 5em; + background-color: hsl(216, 80%, 92%); + font-size: 0.85em; + color: black; + outline: none; + border: 1px solid hsl(216, 80%, 92%); + border-radius: 5px; +} + +.datepicker-dialog .dialog-button:focus { + padding: 4px; + border: 2px solid black; +} + +.datepicker-dialog .fa-calendar-alt { + color: hsl(216, 89%, 51%); +} + +.datepicker-dialog .month-year { + display: inline-block; + width: 12em; + text-align: center; +} + +.datepicker-dialog .dates { + padding-left: 1em; + padding-right: 1em; + padding-top: 1em; +} + +.datepicker-dialog .dates th, +.datepicker-dialog .dates td { + text-align: center; +} + +.datepicker-dialog .dates tr { + border: 1px solid black; +} + +.datepicker-dialog .dates td { + padding: 1px; + margin: 0; + line-height: inherit; + height: 40px; + width: 40px; + border: 1px solid #eee; + border-radius: 5px; + font-size: 15px; + background: #eee; +} + +.datepicker-dialog .dates td:focus, +.datepicker-dialog .dates td:hover { + padding: 0; + background-color: hsl(216, 80%, 92%); +} + +.datepicker-dialog .dates td:focus { + border-width: 2px; + border-color: rgb(100, 100, 100); + outline: 0; +} + +.datepicker-dialog .dates td[aria-selected] { + border-color: rgb(100, 100, 100); +} + +.datepicker-dialog .dates td[tabindex="0"] { + background-color: hsl(216, 80%, 92%); +} + + +.datepicker-dialog .dialog-message { + padding-top: 0.25em; + padding-left: 1em; + height: 1.75em; + background: hsl(216, 80%, 51%); + color: white; +} diff --git a/examples/dialog-modal/css/datepicker.css b/examples/dialog-modal/css/datepicker.css deleted file mode 100644 index cb367e06c7..0000000000 --- a/examples/dialog-modal/css/datepicker.css +++ /dev/null @@ -1,198 +0,0 @@ -.datepicker { - margin-top: 1em; - position: relative; -} - -.datepicker button.icon { - padding: 4px; - margin: 0; - border: transparent 2px solid; - border-radius: 5px; - text-align: left; - background-color: white; - position: relative; - left: -4px; - top: 3px; -} - -.datepicker button.icon:focus { - outline: none; - border-color: hsl(216, 80%, 51%); -} - -.datepicker span.arrow { - margin: 0; - padding: 0; - display: none; - background: transparent; -} - -.datepicker input { - margin: 0; - width: 20%; -} - -.datepicker .datepickerDialog { - position: absolute; - width: 45%; - clear: both; - display: none; - border: 3px solid hsl(216, 80%, 51%); - margin-top: 1em; - border-radius: 5px; - padding: 0; - background-color: #fff; -} - -.datepicker .header { - cursor: default; - background-color: hsl(216, 80%, 51%); - padding: 7px; - font-weight: bold; - text-transform: uppercase; - color: white; - display: flex; - justify-content: space-around; -} - -.datepicker .header h2 { - margin: 0; - padding: 0; - display: inline-block; - font-size: 1em; - color: white; - text-transform: none; - font-weight: bold; -} - -.datepicker .header button { - border-style: none; - background: transparent; -} - -.datepicker .datepickerDialog button::-moz-focus-inner { - border: 0; -} - -.datepicker .prevYear, -.datepicker .prevMonth, -.datepicker .nextMonth, -.datepicker .nextYear { - padding: 4px; - width: 24px; - height: 24px; - color: white; -} - -.datepicker .prevYear:focus, -.datepicker .prevMonth:focus, -.datepicker .nextMonth:focus, -.datepicker .nextYear:focus { - padding: 2px; - border: 2px solid white; - border-radius: 4px; - outline: 0; -} - -.datepicker .dialogButtonGroup { - text-align: right; - margin-top: 1em; - margin-bottom: 1em; - margin-right: 1em; -} - -.datepicker .dialogButton { - padding: 5px; - margin-left: 1em; - width: 5em; - background-color: hsl(216, 80%, 92%); - font-size: 0.85em; - color: black; - outline: none; - border: 1px solid hsl(216, 80%, 92%); - border-radius: 5px; -} - -.datepicker .dialogButton:focus { - padding: 4px; - border: 2px solid black; -} - -.datepicker .fa-calendar-alt { - color: hsl(216, 89%, 51%); -} - -.datepicker .monthYear { - display: inline-block; - width: 12em; - text-align: center; -} - -.datepicker table.dates { - width: 100%; - padding-left: 1em; - padding-right: 1em; - padding-top: 1em; -} - -.datepicker table.dates th, -.datepicker table.dates td { - text-align: center; -} - -.datepicker .dateRow { - border: 1px solid black; -} - -.datepicker .dateCell { - outline: 0; - border: 0; - padding: 0; - margin: 0; - height: 40px; - width: 40px; -} - -.datepicker .dateButton { - padding: 0; - margin: 0; - line-height: inherit; - height: 100%; - width: 100%; - border: 1px solid #eee; - border-radius: 5px; - font-size: 15px; - background: #eee; -} - -.datepicker .dateButton:focus, -.datepicker .dateButton:hover { - padding: 0; - background-color: hsl(216, 80%, 92%); -} - -.datepicker .dateButton:focus { - border-width: 2px; - border-color: rgb(100, 100, 100); - outline: 0; -} - -.datepicker .dateButton[aria-selected] { - border-color: rgb(100, 100, 100); -} - -.datepicker .dateButton[tabindex="0"] { - background-color: hsl(216, 80%, 92%); -} - -.datepicker .disabled { - visibility: hidden; -} - -.datepicker .message { - padding-top: 0.25em; - padding-left: 1em; - height: 1.75em; - background: hsl(216, 80%, 51%); - color: white; -} diff --git a/examples/dialog-modal/datepicker-dialog.html b/examples/dialog-modal/datepicker-dialog.html index 631e07373c..e3f6c2343d 100644 --- a/examples/dialog-modal/datepicker-dialog.html +++ b/examples/dialog-modal/datepicker-dialog.html @@ -13,10 +13,8 @@ - - - - + +