From 4e5f847fcaca5c5e9ac3344a4fe55cde805ac3ae Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 22 Mar 2018 18:06:45 -0700 Subject: [PATCH 1/3] update DateInput and DatePicker to no longer use vendored components --- package.json | 7 ++++--- src/DateInput/DateInput.jsx | 2 +- src/DatePicker/DatePicker.jsx | 2 +- tsconfig.json | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c9fb9aa78..d5f3c4f8e 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,15 @@ "react-accessible-accordion": "^1.0.2", "react-transition-group": "~1.2.0", "react-autosize-textarea": "^3.0.1", - "react-bootstrap": "^0.30.0", + "react-bootstrap": "^0.32.1", "react-copy-to-clipboard": "^4.2.1", - "react-datetime": "^2.12.0", + "react-datepicker": "1.2.2", + "react-datetime": "^2.14.0", "react-dropzone": "^3.11.0", "react-fontawesome": "^1.6.1", "react-linkify": "^0.2.1", "react-onclickoutside": "^5.11.1", - "react-overlays": "^0.7.0", + "react-overlays": "^0.8.3", "react-select": "^1.2.1", "react-sticky": "^6.0.1", "short-number": "^1.0.6", diff --git a/src/DateInput/DateInput.jsx b/src/DateInput/DateInput.jsx index 133711534..328b342ca 100644 --- a/src/DateInput/DateInput.jsx +++ b/src/DateInput/DateInput.jsx @@ -2,7 +2,7 @@ import moment from "moment"; import React from "react"; import * as PropTypes from "prop-types"; import classnames from "classnames"; -import ReactDatePicker from "../../vendor/react-datepicker/dist/react-datepicker.min.js"; +import ReactDatePicker from "react-datepicker"; import ReactDateTime from "react-datetime"; import "./DateInput.less"; diff --git a/src/DatePicker/DatePicker.jsx b/src/DatePicker/DatePicker.jsx index a96621968..91d28c330 100644 --- a/src/DatePicker/DatePicker.jsx +++ b/src/DatePicker/DatePicker.jsx @@ -1,8 +1,8 @@ import moment from "moment"; import classnames from "classnames"; -import ReactDatePicker from "../../vendor/react-datepicker/dist/react-datepicker.min.js"; import React from "react"; import * as PropTypes from "prop-types"; +import ReactDatePicker from "react-datepicker"; import "./DatePicker.less"; diff --git a/tsconfig.json b/tsconfig.json index 0e6e47393..678ef4b9c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,6 @@ }, "exclude": [ "./dist", - "./node_modules", - "./vendor" + "./node_modules" ] } From d857c18abfba1186de2d139f842dccba38f41d78 Mon Sep 17 00:00:00 2001 From: Renato Date: Wed, 7 Mar 2018 11:58:35 -0800 Subject: [PATCH 2/3] remove vendor directory --- Makefile | 6 +- src/DateInput/DateInput.less | 2 +- src/DatePicker/DatePicker.less | 2 +- tsconfig.build.json | 1 - tsconfig.docs.json | 1 - vendor/react-datepicker/README.md | 4 - .../dist/react-datepicker.min.css | 328 ------------------ .../dist/react-datepicker.min.js | 7 - vendor/react-datetime/react-datetime.css | 209 ----------- 9 files changed, 5 insertions(+), 555 deletions(-) delete mode 100644 vendor/react-datepicker/README.md delete mode 100644 vendor/react-datepicker/dist/react-datepicker.min.css delete mode 100644 vendor/react-datepicker/dist/react-datepicker.min.js delete mode 100644 vendor/react-datetime/react-datetime.css diff --git a/Makefile b/Makefile index a3c51d51f..e61815b53 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,10 @@ SHELL = /bin/bash BABEL := node_modules/babel-cli/bin/babel.js JEST := ./node_modules/.bin/jest --maxWorkers=1 --config ./jestconfig.json -JS_FILES := $(shell find . -name "*.js" -not -path "./node_modules/*" -not -path "./dist/*" -not -name "bundle.js" -not -path "./vendor/*") -JSX_FILES := $(shell find . -name "*.jsx" -not -path "./node_modules/*" -not -path "./dist/*" -not -path "./vendor/*") +JS_FILES := $(shell find . -name "*.js" -not -path "./node_modules/*" -not -path "./dist/*" -not -name "bundle.js") +JSX_FILES := $(shell find . -name "*.jsx" -not -path "./node_modules/*" -not -path "./dist/*") TS_FILES := $(shell find . -regex ".*\.tsx*" -not -path "./node_modules/*") -LESS_FILES := $(shell find . -name "*.less" -not -path "./node_modules/*" -not -path "./dist/*" -not -path "./vendor/*") +LESS_FILES := $(shell find . -name "*.less" -not -path "./node_modules/*" -not -path "./dist/*") LINT := ./node_modules/.bin/eslint STYLELINT := ./node_modules/.bin/stylelint --config ./stylelint.config.js TESTS := $(TESTS_JS) $(TESTS_TS) diff --git a/src/DateInput/DateInput.less b/src/DateInput/DateInput.less index 2ac002af2..43b32ff19 100644 --- a/src/DateInput/DateInput.less +++ b/src/DateInput/DateInput.less @@ -4,7 +4,7 @@ @import (reference) "../less/type-size"; @import (reference) "../less/type-utilities"; @import (reference) "../less/spacing"; -@import "../../vendor/react-datetime/react-datetime.css"; +@import "~react-datetime/css/react-datetime.css"; .DateInput { .padding--x--s; diff --git a/src/DatePicker/DatePicker.less b/src/DatePicker/DatePicker.less index a98807048..9fa8acd50 100644 --- a/src/DatePicker/DatePicker.less +++ b/src/DatePicker/DatePicker.less @@ -1,5 +1,5 @@ @import (reference) "../less/index"; -@import "../../vendor/react-datepicker/dist/react-datepicker.min.css"; +@import "~react-datepicker/dist/react-datepicker.min.css"; .DatePicker { .borderRadius--0; diff --git a/tsconfig.build.json b/tsconfig.build.json index 7061825ce..4caa44559 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -13,7 +13,6 @@ "./dist", "./docs", "./node_modules", - "./vendor", "**/*.js", "**/*.jsx", "**/*_test.ts", diff --git a/tsconfig.docs.json b/tsconfig.docs.json index 5b4ff5ff0..5f5a0af88 100644 --- a/tsconfig.docs.json +++ b/tsconfig.docs.json @@ -12,7 +12,6 @@ "./dist", "./src", "./node_modules", - "./vendor", "**/*.js", "**/*.jsx", "**/*_test.ts", diff --git a/vendor/react-datepicker/README.md b/vendor/react-datepicker/README.md deleted file mode 100644 index 4ac0f1058..000000000 --- a/vendor/react-datepicker/README.md +++ /dev/null @@ -1,4 +0,0 @@ -This is a built and checked in version of a fork of react datepicker. -It exists to resolve this issue https://github.com/Hacker0x01/react-datepicker/issues/743 -The commit is https://github.com/Amauris/react-datepicker/tree/dd3ca7147fa0e07d47e679de95196147efe100ed -Once https://github.com/Hacker0x01/react-datepicker/pull/825 is merged we should revert back to npm installing datepicker diff --git a/vendor/react-datepicker/dist/react-datepicker.min.css b/vendor/react-datepicker/dist/react-datepicker.min.css deleted file mode 100644 index 17c48c3bf..000000000 --- a/vendor/react-datepicker/dist/react-datepicker.min.css +++ /dev/null @@ -1,328 +0,0 @@ -.react-datepicker__tether-element-attached-top .react-datepicker__triangle, .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, -.react-datepicker__month-read-view--down-arrow { - margin-left: -8px; - position: absolute; } - .react-datepicker__tether-element-attached-top .react-datepicker__triangle, .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, - .react-datepicker__month-read-view--down-arrow, .react-datepicker__tether-element-attached-top .react-datepicker__triangle::before, .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle::before, .react-datepicker__year-read-view--down-arrow::before, - .react-datepicker__month-read-view--down-arrow::before { - box-sizing: content-box; - position: absolute; - border: 8px solid transparent; - height: 0; - width: 1px; } - .react-datepicker__tether-element-attached-top .react-datepicker__triangle::before, .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle::before, .react-datepicker__year-read-view--down-arrow::before, - .react-datepicker__month-read-view--down-arrow::before { - content: ""; - z-index: -1; - border-width: 8px; - left: -8px; - border-bottom-color: #aeaeae; } - -.react-datepicker__tether-element-attached-top .react-datepicker__triangle { - top: 0; - margin-top: -8px; } - .react-datepicker__tether-element-attached-top .react-datepicker__triangle, .react-datepicker__tether-element-attached-top .react-datepicker__triangle::before { - border-top: none; - border-bottom-color: #f0f0f0; } - .react-datepicker__tether-element-attached-top .react-datepicker__triangle::before { - top: -1px; - border-bottom-color: #aeaeae; } - -.react-datepicker__tether-element-attached-bottom .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, -.react-datepicker__month-read-view--down-arrow { - bottom: 0; - margin-bottom: -8px; } - .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, - .react-datepicker__month-read-view--down-arrow, .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle::before, .react-datepicker__year-read-view--down-arrow::before, - .react-datepicker__month-read-view--down-arrow::before { - border-bottom: none; - border-top-color: #fff; } - .react-datepicker__tether-element-attached-bottom .react-datepicker__triangle::before, .react-datepicker__year-read-view--down-arrow::before, - .react-datepicker__month-read-view--down-arrow::before { - bottom: -1px; - border-top-color: #aeaeae; } - -.react-datepicker { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 0.8rem; - background-color: #fff; - color: #000; - border: 1px solid #aeaeae; - border-radius: 0.3rem; - display: inline-block; - position: relative; } - -.react-datepicker__triangle { - position: absolute; - left: 50px; } - -.react-datepicker__tether-element-attached-bottom.react-datepicker__tether-element { - margin-top: -20px; } - -.react-datepicker__header { - text-align: center; - background-color: #f0f0f0; - border-bottom: 1px solid #aeaeae; - border-top-left-radius: 0.3rem; - border-top-right-radius: 0.3rem; - padding-top: 8px; - position: relative; } - -.react-datepicker__year-dropdown-container--select, -.react-datepicker__month-dropdown-container--select, -.react-datepicker__year-dropdown-container--scroll, -.react-datepicker__month-dropdown-container--scroll { - display: inline-block; - margin: 0 2px; } - -.react-datepicker__current-month { - margin-top: 0; - color: #000; - font-weight: bold; - font-size: 0.944rem; } - -.react-datepicker__navigation { - line-height: 1.7rem; - text-align: center; - cursor: pointer; - position: absolute; - top: 10px; - width: 0; - border: 0.45rem solid transparent; - z-index: 1; } - .react-datepicker__navigation--previous { - left: 10px; - border-right-color: #ccc; } - .react-datepicker__navigation--previous:hover { - border-right-color: #b3b2b2; } - .react-datepicker__navigation--next { - right: 10px; - border-left-color: #ccc; } - .react-datepicker__navigation--next:hover { - border-left-color: #b3b2b2; } - .react-datepicker__navigation--years { - position: relative; - top: 0; - display: block; - margin-left: auto; - margin-right: auto; } - .react-datepicker__navigation--years-previous { - top: 4px; - border-top-color: #ccc; } - .react-datepicker__navigation--years-previous:hover { - border-top-color: #b3b2b2; } - .react-datepicker__navigation--years-upcoming { - top: -4px; - border-bottom-color: #ccc; } - .react-datepicker__navigation--years-upcoming:hover { - border-bottom-color: #b3b2b2; } - -.react-datepicker__month-container { - display: inline; - float: left; } - -.react-datepicker__month { - margin: 0.4rem; - text-align: center; } - -.react-datepicker__week-number { - color: #ccc; - display: inline-block; - width: 1.7rem; - line-height: 1.7rem; - text-align: center; - margin: 0.166rem; } - -.react-datepicker__day-name, -.react-datepicker__day { - color: #000; - display: inline-block; - width: 1.7rem; - line-height: 1.7rem; - text-align: center; - margin: 0.166rem; } - -.react-datepicker__day { - cursor: pointer; } - .react-datepicker__day:hover { - border-radius: 0.3rem; - background-color: #f0f0f0; } - .react-datepicker__day--today { - font-weight: bold; } - .react-datepicker__day--highlighted { - border-radius: 0.3rem; - background-color: #3dcc4a; - color: #fff; } - .react-datepicker__day--highlighted:hover { - background-color: #32be3f; } - .react-datepicker__day--selected, .react-datepicker__day--in-selecting-range, .react-datepicker__day--in-range { - border-radius: 0.3rem; - background-color: #216ba5; - color: #fff; } - .react-datepicker__day--selected:hover, .react-datepicker__day--in-selecting-range:hover, .react-datepicker__day--in-range:hover { - background-color: #1d5d90; } - .react-datepicker__day--keyboard-selected { - border-radius: 0.3rem; - background-color: #2a87d0; - color: #fff; } - .react-datepicker__day--keyboard-selected:hover { - background-color: #1d5d90; } - .react-datepicker__day--in-selecting-range:not(.react-datepicker__day--in-range) { - background-color: rgba(33, 107, 165, 0.5); } - .react-datepicker__month--selecting-range .react-datepicker__day--in-range:not(.react-datepicker__day--in-selecting-range) { - background-color: #f0f0f0; - color: #000; } - .react-datepicker__day--disabled { - cursor: default; - color: #ccc; } - .react-datepicker__day--disabled:hover { - background-color: transparent; } - -.react-datepicker__input-container { - position: relative; - display: inline-block; } - -.react-datepicker__year-read-view, -.react-datepicker__month-read-view { - border: 1px solid transparent; - border-radius: 0.3rem; } - .react-datepicker__year-read-view:hover, - .react-datepicker__month-read-view:hover { - cursor: pointer; } - .react-datepicker__year-read-view:hover .react-datepicker__year-read-view--down-arrow, - .react-datepicker__year-read-view:hover .react-datepicker__month-read-view--down-arrow, - .react-datepicker__month-read-view:hover .react-datepicker__year-read-view--down-arrow, - .react-datepicker__month-read-view:hover .react-datepicker__month-read-view--down-arrow { - border-top-color: #b3b2b2; } - .react-datepicker__year-read-view--down-arrow, - .react-datepicker__month-read-view--down-arrow { - border-top-color: #ccc; - float: right; - margin-left: 20px; - top: 8px; - position: relative; - border-width: 0.45rem; } - -.react-datepicker__year-dropdown, -.react-datepicker__month-dropdown { - background-color: #f0f0f0; - position: absolute; - width: 50%; - left: 25%; - top: 30px; - text-align: center; - border-radius: 0.3rem; - border: 1px solid #aeaeae; } - .react-datepicker__year-dropdown:hover, - .react-datepicker__month-dropdown:hover { - cursor: pointer; } - .react-datepicker__year-dropdown--scrollable, - .react-datepicker__month-dropdown--scrollable { - height: 150px; - overflow-y: scroll; } - -.react-datepicker__year-option, -.react-datepicker__month-option { - line-height: 20px; - width: 100%; - display: block; - margin-left: auto; - margin-right: auto; } - .react-datepicker__year-option:first-of-type, - .react-datepicker__month-option:first-of-type { - border-top-left-radius: 0.3rem; - border-top-right-radius: 0.3rem; } - .react-datepicker__year-option:last-of-type, - .react-datepicker__month-option:last-of-type { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - border-bottom-left-radius: 0.3rem; - border-bottom-right-radius: 0.3rem; } - .react-datepicker__year-option:hover, - .react-datepicker__month-option:hover { - background-color: #ccc; } - .react-datepicker__year-option:hover .react-datepicker__navigation--years-upcoming, - .react-datepicker__month-option:hover .react-datepicker__navigation--years-upcoming { - border-bottom-color: #b3b2b2; } - .react-datepicker__year-option:hover .react-datepicker__navigation--years-previous, - .react-datepicker__month-option:hover .react-datepicker__navigation--years-previous { - border-top-color: #b3b2b2; } - .react-datepicker__year-option--selected, - .react-datepicker__month-option--selected { - position: absolute; - left: 15px; } - -.react-datepicker__close-icon { - background-color: transparent; - border: 0; - cursor: pointer; - display: inline-block; - height: 0; - outline: 0; - padding: 0; - vertical-align: middle; } - .react-datepicker__close-icon::after { - background-color: #216ba5; - border-radius: 50%; - bottom: 0; - box-sizing: border-box; - color: #fff; - content: "\00d7"; - cursor: pointer; - font-size: 12px; - height: 16px; - width: 16px; - line-height: 1; - margin: -8px auto 0; - padding: 2px; - position: absolute; - right: 7px; - text-align: center; - top: 50%; } - -.react-datepicker__today-button { - background: #f0f0f0; - border-top: 1px solid #aeaeae; - cursor: pointer; - text-align: center; - font-weight: bold; - padding: 5px 0; - clear: left; } - -.react-datepicker__tether-element { - z-index: 2147483647; } - -.react-datepicker__portal { - position: fixed; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.8); - left: 0; - top: 0; - justify-content: center; - align-items: center; - display: flex; - z-index: 2147483647; } - .react-datepicker__portal .react-datepicker__day-name, - .react-datepicker__portal .react-datepicker__day { - width: 3rem; - line-height: 3rem; } - @media (max-width: 400px), (max-height: 550px) { - .react-datepicker__portal .react-datepicker__day-name, - .react-datepicker__portal .react-datepicker__day { - width: 2rem; - line-height: 2rem; } } - .react-datepicker__portal .react-datepicker__current-month { - font-size: 1.44rem; } - .react-datepicker__portal .react-datepicker__navigation { - border: 0.81rem solid transparent; } - .react-datepicker__portal .react-datepicker__navigation--previous { - border-right-color: #ccc; } - .react-datepicker__portal .react-datepicker__navigation--previous:hover { - border-right-color: #b3b2b2; } - .react-datepicker__portal .react-datepicker__navigation--next { - border-left-color: #ccc; } - .react-datepicker__portal .react-datepicker__navigation--next:hover { - border-left-color: #b3b2b2; } diff --git a/vendor/react-datepicker/dist/react-datepicker.min.js b/vendor/react-datepicker/dist/react-datepicker.min.js deleted file mode 100644 index 0fc4a3c3c..000000000 --- a/vendor/react-datepicker/dist/react-datepicker.min.js +++ /dev/null @@ -1,7 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("moment"),require("react"),require("react-onclickoutside"),require("react-dom")):"function"==typeof define&&define.amd?define(["moment","react","react-onclickoutside","react-dom"],e):"object"==typeof exports?exports.DatePicker=e(require("moment"),require("react"),require("react-onclickoutside"),require("react-dom")):t.DatePicker=e(t.moment,t.React,t.onClickOutside,t.ReactDOM)}(this,function(t,e,n,o){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(1),s=o(i),a=n(4),l=o(a),p=n(15),d=o(p),h=n(6),c=o(h),u=n(13),f=n(2),m=o(f),g=n(7),v=o(g),y="react-datepicker-ignore-onclickoutside",D=(0,v.default)(s.default),b=l.default.createClass({displayName:"DatePicker",getDefaultProps:function(){return{dateFormat:"L",dateFormatCalendar:"MMMM YYYY",onChange:function(){},disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",onFocus:function(){},onBlur:function(){},onSelect:function(){},onClickOutside:function(){},onMonthChange:function(){},popoverAttachment:"top left",popoverTargetAttachment:"bottom left",popoverTargetOffset:"10px 0",tetherConstraints:[{to:"window",attachment:"together"}],utcOffset:(0,m.default)().utcOffset(),monthsShown:1,withPortal:!1}},getInitialState:function(){var t=this.props.openToDate?(0,m.default)(this.props.openToDate):this.props.selectsEnd&&this.props.startDate?(0,m.default)(this.props.startDate):this.props.selectsStart&&this.props.endDate?(0,m.default)(this.props.endDate):(0,m.default)(),e=(0,u.getEffectiveMinDate)(this.props),n=(0,u.getEffectiveMaxDate)(this.props),o=e&&t.isBefore(e)?e:n&&t.isAfter(n)?n:t;return{open:!1,preventFocus:!1,preSelection:this.props.selected?(0,m.default)(this.props.selected):o}},componentWillUnmount:function(){this.clearPreventFocusTimeout()},clearPreventFocusTimeout:function(){this.preventFocusTimeout&&clearTimeout(this.preventFocusTimeout)},setFocus:function(){this.refs.input.focus()},setOpen:function(t){this.setState({open:t,preSelection:t&&this.state.open?this.state.preSelection:this.getInitialState().preSelection})},handleFocus:function(t){this.state.preventFocus||(this.props.onFocus(t),this.setOpen(!0))},cancelFocusInput:function(){clearTimeout(this.inputFocusTimeout),this.inputFocusTimeout=null},deferFocusInput:function(){var t=this;this.cancelFocusInput(),this.inputFocusTimeout=window.setTimeout(function(){return t.setFocus()},1)},handleDropdownFocus:function(){this.cancelFocusInput()},handleBlur:function(t){this.state.open?this.deferFocusInput():this.props.onBlur(t)},handleCalendarClickOutside:function(t){this.setOpen(!1),this.props.onClickOutside(t),this.props.withPortal&&t.preventDefault()},handleChange:function(t){if(!this.props.onChangeRaw||(this.props.onChangeRaw(t),!t.isDefaultPrevented())){this.setState({inputValue:t.target.value});var e=(0,u.parseDate)(t.target.value,this.props);!e&&t.target.value||this.setSelected(e,t,!0)}},handleSelect:function(t,e){var n=this;this.setState({preventFocus:!0},function(){return n.preventFocusTimeout=setTimeout(function(){return n.setState({preventFocus:!1})},50),n.preventFocusTimeout}),this.setSelected(t,e),this.props.inline||this.setOpen(!1)},setSelected:function(t,e,n){var o=t;null!==o&&(0,u.isDayDisabled)(o,this.props)||((0,u.isSameDay)(this.props.selected,o)||(null!==o&&(this.props.selected&&(o=(0,m.default)(o).set({hour:this.props.selected.hour(),minute:this.props.selected.minute(),second:this.props.selected.second()})),this.setState({preSelection:o})),this.props.onChange(o,e)),this.props.onSelect(o,e),n||this.setState({inputValue:null}))},setPreSelection:function(t){var e="undefined"!=typeof this.props.minDate&&"undefined"!=typeof this.props.maxDate,n=!e||!t||(0,u.isDayInRange)(t,this.props.minDate,this.props.maxDate);n&&this.setState({preSelection:t})},onInputClick:function(){this.props.disabled||this.setOpen(!0)},onInputKeyDown:function(t){if(!this.state.open&&!this.props.inline)return void(/^Arrow/.test(t.key)&&this.onInputClick());var e=(0,m.default)(this.state.preSelection);if("Enter"===t.key?(t.preventDefault(),this.handleSelect(e,t)):"Escape"===t.key?(t.preventDefault(),this.setOpen(!1)):"Tab"===t.key&&this.setOpen(!1),!this.props.disabledKeyboardNavigation){var n=void 0;switch(t.key){case"ArrowLeft":t.preventDefault(),n=e.subtract(1,"days");break;case"ArrowRight":t.preventDefault(),n=e.add(1,"days");break;case"ArrowUp":t.preventDefault(),n=e.subtract(1,"weeks");break;case"ArrowDown":t.preventDefault(),n=e.add(1,"weeks");break;case"PageUp":t.preventDefault(),n=e.subtract(1,"months");break;case"PageDown":t.preventDefault(),n=e.add(1,"months");break;case"Home":t.preventDefault(),n=e.subtract(1,"years");break;case"End":t.preventDefault(),n=e.add(1,"years")}this.setPreSelection(n)}},onClearClick:function(t){t.preventDefault(),this.props.onChange(null,t)},renderCalendar:function(){return this.props.inline||this.state.open&&!this.props.disabled?l.default.createElement(D,{ref:"calendar",locale:this.props.locale,dateFormat:this.props.dateFormatCalendar,dropdownMode:this.props.dropdownMode,selected:this.props.selected,preSelection:this.state.preSelection,onSelect:this.handleSelect,openToDate:this.props.openToDate,minDate:this.props.minDate,maxDate:this.props.maxDate,selectsStart:this.props.selectsStart,selectsEnd:this.props.selectsEnd,startDate:this.props.startDate,endDate:this.props.endDate,excludeDates:this.props.excludeDates,filterDate:this.props.filterDate,onClickOutside:this.handleCalendarClickOutside,highlightDates:this.props.highlightDates,includeDates:this.props.includeDates,inline:this.props.inline,peekNextMonth:this.props.peekNextMonth,showMonthDropdown:this.props.showMonthDropdown,showWeekNumbers:this.props.showWeekNumbers,showYearDropdown:this.props.showYearDropdown,forceShowMonthNavigation:this.props.forceShowMonthNavigation,scrollableYearDropdown:this.props.scrollableYearDropdown,todayButton:this.props.todayButton,utcOffset:this.props.utcOffset,outsideClickIgnoreClass:y,fixedHeight:this.props.fixedHeight,monthsShown:this.props.monthsShown,onDropdownFocus:this.handleDropdownFocus,onMonthChange:this.props.onMonthChange,className:this.props.calendarClassName},this.props.children):null},renderDateInput:function(){var t=(0,c.default)(this.props.className,r({},y,this.state.open)),e=this.props.customInput||l.default.createElement("input",{type:"text"}),n="string"==typeof this.props.value?this.props.value:"string"==typeof this.state.inputValue?this.state.inputValue:(0,u.safeDateFormat)(this.props.selected,this.props);return l.default.cloneElement(e,{ref:"input",value:n,onBlur:this.handleBlur,onChange:this.handleChange,onClick:this.onInputClick,onFocus:this.handleFocus,onKeyDown:this.onInputKeyDown,id:this.props.id,name:this.props.name,autoFocus:this.props.autoFocus,placeholder:this.props.placeholderText,disabled:this.props.disabled,autoComplete:this.props.autoComplete,className:t,title:this.props.title,readOnly:this.props.readOnly,required:this.props.required,tabIndex:this.props.tabIndex})},renderClearButton:function(){return this.props.isClearable&&null!=this.props.selected?l.default.createElement("a",{className:"react-datepicker__close-icon",href:"#",onClick:this.onClearClick}):null},render:function(){var t=this.renderCalendar();return this.props.inline&&!this.props.withPortal?t:this.props.withPortal?l.default.createElement("div",null,this.props.inline?null:l.default.createElement("div",{className:"react-datepicker__input-container"},this.renderDateInput(),this.renderClearButton()),this.state.open||this.props.inline?l.default.createElement("div",{className:"react-datepicker__portal"},t):null):l.default.createElement(d.default,{classPrefix:"react-datepicker__tether",attachment:this.props.popoverAttachment,targetAttachment:this.props.popoverTargetAttachment,targetOffset:this.props.popoverTargetOffset,renderElementTo:this.props.renderCalendarTo,constraints:this.props.tetherConstraints},l.default.createElement("div",{className:"react-datepicker__input-container"},this.renderDateInput(),this.renderClearButton()),t)}});t.exports=b},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}var r=n(2),i=o(r),s=n(3),a=o(s),l=n(8),p=o(l),d=n(10),h=o(d),c=n(4),u=o(c),f=n(6),m=o(f),g=n(13),v=["react-datepicker__year-select","react-datepicker__month-select"],y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(t.className||"").split(/\s+/);return v.some(function(t){return e.indexOf(t)>=0})},D=u.default.createClass({displayName:"Calendar",defaultProps:{onDropdownFocus:function(){}},getDefaultProps:function(){return{utcOffset:i.default.utc().utcOffset(),monthsShown:1,forceShowMonthNavigation:!1}},getInitialState:function(){return{date:this.localizeMoment(this.getDateInView()),selectingDate:null}},componentWillReceiveProps:function(t){t.preSelection&&!(0,g.isSameDay)(t.preSelection,this.props.preSelection)?this.setState({date:this.localizeMoment(t.preSelection)}):t.openToDate&&!(0,g.isSameDay)(t.openToDate,this.props.openToDate)&&this.setState({date:this.localizeMoment(t.openToDate)})},handleClickOutside:function(t){this.props.onClickOutside(t)},handleDropdownFocus:function(t){y(t.target)&&this.props.onDropdownFocus()},getDateInView:function(){var t=this.props,e=t.preSelection,n=t.selected,o=t.openToDate,r=t.utcOffset,s=(0,g.getEffectiveMinDate)(this.props),a=(0,g.getEffectiveMaxDate)(this.props),l=i.default.utc().utcOffset(r),p=e||n;return p?p:s&&a&&o&&o.isBetween(s,a)?o:s&&o&&o.isAfter(s)?o:s&&s.isAfter(l)?s:a&&o&&o.isBefore(a)?o:a&&a.isBefore(l)?a:o?o:l},localizeMoment:function(t){return t.clone().locale(this.props.locale||i.default.locale())},increaseMonth:function(){var t=this;this.setState({date:this.state.date.clone().add(1,"month")},function(){return t.handleMonthChange(t.state.date)})},decreaseMonth:function(){var t=this;this.setState({date:this.state.date.clone().subtract(1,"month")},function(){return t.handleMonthChange(t.state.date)})},handleDayClick:function(t,e){this.props.onSelect(t,e)},handleDayMouseEnter:function(t){this.setState({selectingDate:t})},handleMonthMouseLeave:function(){this.setState({selectingDate:null})},handleMonthChange:function(t){this.props.onMonthChange&&this.props.onMonthChange(t)},changeYear:function(t){this.setState({date:this.state.date.clone().set("year",t)})},changeMonth:function(t){var e=this;this.setState({date:this.state.date.clone().set("month",t)},function(){return e.handleMonthChange(e.state.date)})},header:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.date,e=t.clone().startOf("week"),n=[];return this.props.showWeekNumbers&&n.push(u.default.createElement("div",{key:"W",className:"react-datepicker__day-name"},"#")),n.concat([0,1,2,3,4,5,6].map(function(t){var n=e.clone().add(t,"days");return u.default.createElement("div",{key:t,className:"react-datepicker__day-name"},n.localeData().weekdaysMin(n))}))},renderPreviousMonthButton:function(){if(this.props.forceShowMonthNavigation||!(0,g.allDaysDisabledBefore)(this.state.date,"month",this.props))return u.default.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--previous",onClick:this.decreaseMonth})},renderNextMonthButton:function(){if(this.props.forceShowMonthNavigation||!(0,g.allDaysDisabledAfter)(this.state.date,"month",this.props))return u.default.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--next",onClick:this.increaseMonth})},renderCurrentMonth:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.date,e=["react-datepicker__current-month"];return this.props.showYearDropdown&&e.push("react-datepicker__current-month--hasYearDropdown"),this.props.showMonthDropdown&&e.push("react-datepicker__current-month--hasMonthDropdown"),u.default.createElement("div",{className:e.join(" ")},t.format(this.props.dateFormat))},renderYearDropdown:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.props.showYearDropdown&&!t)return u.default.createElement(a.default,{dropdownMode:this.props.dropdownMode,onChange:this.changeYear,minDate:this.props.minDate,maxDate:this.props.maxDate,year:this.state.date.year(),scrollableYearDropdown:this.props.scrollableYearDropdown})},renderMonthDropdown:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.props.showMonthDropdown)return u.default.createElement(p.default,{dropdownMode:this.props.dropdownMode,locale:this.props.locale,onChange:this.changeMonth,month:this.state.date.month()})},renderTodayButton:function(){var t=this;if(this.props.todayButton)return u.default.createElement("div",{className:"react-datepicker__today-button",onClick:function(e){return t.props.onSelect(i.default.utc().utcOffset(t.props.utcOffset).startOf("date"),e)}},this.props.todayButton)},renderMonths:function(){for(var t=[],e=0;e=d,a=!e&&!this.isWeekInMonth(n);if(s||a){if(!this.props.peekNextMonth)break;r=!0}}return t},getClassNames:function(){var t=this.props,e=t.selectingDate,n=t.selectsStart,o=t.selectsEnd;return(0,a.default)("react-datepicker__month",{"react-datepicker__month--selecting-range":e&&(n||o)})},render:function(){return i.default.createElement("div",{className:this.getClassNames(),onMouseLeave:this.handleMouseLeave,role:"listbox"},this.renderWeeks())}});t.exports=h},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}var r=n(4),i=o(r),s=n(12),a=o(s),l=n(14),p=o(l),d=i.default.createClass({displayName:"Week",handleDayClick:function(t,e){this.props.onDayClick&&this.props.onDayClick(t,e)},handleDayMouseEnter:function(t){this.props.onDayMouseEnter&&this.props.onDayMouseEnter(t)},renderDays:function(){var t=this,e=this.props.day.clone().startOf("week"),n=[];return this.props.showWeekNumber&&n.push(i.default.createElement(p.default,{key:"W",weekNumber:parseInt(e.format("w"),10)})),n.concat([0,1,2,3,4,5,6].map(function(n){var o=e.clone().add(n,"days");return i.default.createElement(a.default,{key:n,day:o,month:t.props.month,onClick:t.handleDayClick.bind(t,o),onMouseEnter:t.handleDayMouseEnter.bind(t,o),minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,includeDates:t.props.includeDates,inline:t.props.inline,highlightDates:t.props.highlightDates,selectingDate:t.props.selectingDate,filterDate:t.props.filterDate,preSelection:t.props.preSelection,selected:t.props.selected,selectsStart:t.props.selectsStart,selectsEnd:t.props.selectsEnd,startDate:t.props.startDate,endDate:t.props.endDate,utcOffset:t.props.utcOffset})}))},render:function(){return i.default.createElement("div",{className:"react-datepicker__week"},this.renderDays())}});t.exports=d},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}var r=n(2),i=o(r),s=n(4),a=o(s),l=n(6),p=o(l),d=n(13),h=a.default.createClass({displayName:"Day",getDefaultProps:function(){return{utcOffset:i.default.utc().utcOffset()}},handleClick:function(t){!this.isDisabled()&&this.props.onClick&&this.props.onClick(t)},handleMouseEnter:function(t){!this.isDisabled()&&this.props.onMouseEnter&&this.props.onMouseEnter(t)},isSameDay:function(t){return(0,d.isSameDay)(this.props.day,t)},isKeyboardSelected:function(){return!this.props.inline&&!this.isSameDay(this.props.selected)&&this.isSameDay(this.props.preSelection)},isDisabled:function(){return(0,d.isDayDisabled)(this.props.day,this.props)},isHighlighted:function(){var t=this.props,e=t.day,n=t.highlightDates;return!!n&&n.some(function(t){return(0,d.isSameDay)(e,t)})},isInRange:function(){var t=this.props,e=t.day,n=t.startDate,o=t.endDate;return!(!n||!o)&&(0,d.isDayInRange)(e,n,o)},isInSelectingRange:function(){var t=this.props,e=t.day,n=t.selectsStart,o=t.selectsEnd,r=t.selectingDate,i=t.startDate,s=t.endDate;return!(!n&&!o||!r||this.isDisabled())&&(n&&s&&r.isSameOrBefore(s)?(0,d.isDayInRange)(e,r,s):!!(o&&i&&r.isSameOrAfter(i))&&(0,d.isDayInRange)(e,i,r))},isSelectingRangeStart:function(){if(!this.isInSelectingRange())return!1;var t=this.props,e=t.day,n=t.selectingDate,o=t.startDate,r=t.selectsStart;return r?(0,d.isSameDay)(e,n):(0,d.isSameDay)(e,o)},isSelectingRangeEnd:function(){if(!this.isInSelectingRange())return!1;var t=this.props,e=t.day,n=t.selectingDate,o=t.endDate,r=t.selectsEnd;return r?(0,d.isSameDay)(e,n):(0,d.isSameDay)(e,o)},isRangeStart:function(){var t=this.props,e=t.day,n=t.startDate,o=t.endDate;return!(!n||!o)&&(0,d.isSameDay)(n,e)},isRangeEnd:function(){var t=this.props,e=t.day,n=t.startDate,o=t.endDate;return!(!n||!o)&&(0,d.isSameDay)(o,e)},isWeekend:function(){var t=this.props.day.day();return 0===t||6===t},isOutsideMonth:function(){return void 0!==this.props.month&&this.props.month!==this.props.day.month()},getClassNames:function(){return(0,p.default)("react-datepicker__day",{"react-datepicker__day--disabled":this.isDisabled(),"react-datepicker__day--selected":this.isSameDay(this.props.selected),"react-datepicker__day--keyboard-selected":this.isKeyboardSelected(),"react-datepicker__day--highlighted":this.isHighlighted(),"react-datepicker__day--range-start":this.isRangeStart(),"react-datepicker__day--range-end":this.isRangeEnd(),"react-datepicker__day--in-range":this.isInRange(),"react-datepicker__day--in-selecting-range":this.isInSelectingRange(),"react-datepicker__day--selecting-range-start":this.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":this.isSelectingRangeEnd(),"react-datepicker__day--today":this.isSameDay(i.default.utc().utcOffset(this.props.utcOffset)),"react-datepicker__day--weekend":this.isWeekend(),"react-datepicker__day--outside-month":this.isOutsideMonth()})},render:function(){return a.default.createElement("div",{className:this.getClassNames(),onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,"aria-label":"day-"+this.props.day.date(),role:"option"},this.props.day.date())}});t.exports=h},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){return t&&e?t.isSame(e,"day"):!t&&!e}function i(t,e){return t&&e?t.utcOffset()===e.utcOffset():!t&&!e}function s(t,e,n){var o=e.clone().startOf("day").subtract(1,"seconds"),r=n.clone().startOf("day").add(1,"seconds");return t.clone().startOf("day").isBetween(o,r)}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minDate,o=e.maxDate,i=e.excludeDates,s=e.includeDates,a=e.filterDate;return n&&t.isBefore(n,"day")||o&&t.isAfter(o,"day")||i&&i.some(function(e){return r(t,e)})||s&&!s.some(function(e){return r(t,e)})||a&&!a(t.clone())||!1}function l(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.minDate,r=n.includeDates,i=t.clone().subtract(1,e);return o&&i.isBefore(o,e)||r&&r.every(function(t){return i.isBefore(t,e)})||!1}function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.maxDate,r=n.includeDates,i=t.clone().add(1,e);return o&&i.isAfter(o,e)||r&&r.every(function(t){return i.isAfter(t,e)})||!1}function d(t){var e=t.minDate,n=t.includeDates;return n&&e?m.default.min(n.filter(function(t){return e.isSameOrBefore(t,"day")})):n?m.default.min(n):e}function h(t){var e=t.maxDate,n=t.includeDates;return n&&e?m.default.max(n.filter(function(t){return e.isSameOrAfter(t,"day")})):n?m.default.max(n):e}function c(t,e){var n=e.dateFormat,o=e.locale,r=(0,m.default)(t,n,o||m.default.locale(),!0);return r.isValid()?r:null}function u(t,e){var n=e.dateFormat,o=e.locale;return t&&t.clone().locale(o||m.default.locale()).format(Array.isArray(n)?n[0]:n)||""}Object.defineProperty(e,"__esModule",{value:!0}),e.isSameDay=r,e.isSameUtcOffset=i,e.isDayInRange=s,e.isDayDisabled=a,e.allDaysDisabledBefore=l,e.allDaysDisabledAfter=p,e.getEffectiveMinDate=d,e.getEffectiveMaxDate=h,e.parseDate=c,e.safeDateFormat=u;var f=n(2),m=o(f)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}var r=n(4),i=o(r),s=i.default.createClass({displayName:"WeekNumber",render:function(){return i.default.createElement("div",{className:"react-datepicker__week-number","aria-label":"week-"+this.props.weekNumber},this.props.weekNumber)}});t.exports=s},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var i=Object.assign||function(t){for(var e=1;e=0)&&o.push(r)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}function s(){E&&document.body.removeChild(E),E=null}function a(t){var e=void 0;t===document?(e=document,t=document.documentElement):e=t.ownerDocument;var n=e.documentElement,o=r(t),i=M();return o.top-=i.top,o.left-=i.left,"undefined"==typeof o.width&&(o.width=document.body.scrollWidth-o.left-o.right),"undefined"==typeof o.height&&(o.height=document.body.scrollHeight-o.top-o.bottom),o.top=o.top-n.clientTop,o.left=o.left-n.clientLeft,o.right=e.body.clientWidth-o.width-o.left,o.bottom=e.body.clientHeight-o.height-o.top,o}function l(t){return t.offsetParent||document.documentElement}function p(){if(x)return x;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");d(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;n===o&&(o=e.clientWidth),document.body.removeChild(e);var r=n-o;return x={width:r,height:r}}function d(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function h(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var n=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),o=f(t).replace(n," ");m(t,o)}}function c(t,e){if("undefined"!=typeof t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{h(t,e);var n=f(t)+(" "+e);m(t,n)}}function u(t,e){if("undefined"!=typeof t.classList)return t.classList.contains(e);var n=f(t);return new RegExp("(^| )"+e+"( |$)","gi").test(n)}function f(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function m(t,e){t.setAttribute("class",e)}function g(t,e,n){n.forEach(function(n){e.indexOf(n)===-1&&u(t,n)&&h(t,n)}),e.forEach(function(e){u(t,e)||c(t,e)})}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function y(t,e){var n=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+n>=e&&e>=t-n}function D(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function b(){for(var t={top:0,left:0},e=arguments.length,n=Array(e),o=0;o1?n-1:0),r=1;r16?(e=Math.min(e-16,250),void(n=setTimeout(o,250))):void("undefined"!=typeof t&&D()-t<10||(null!=n&&(clearTimeout(n),n=null),t=D(),R(),e=D()-t))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,o)})}();var L={center:"center",left:"right",right:"left"},j={middle:"middle",top:"bottom",bottom:"top"},V={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},z=function(t,e){var n=t.left,o=t.top;return"auto"===n&&(n=L[e.left]),"auto"===o&&(o=j[e.top]),{left:n,top:o}},H=function(t){var e=t.left,n=t.top;return"undefined"!=typeof V[t.left]&&(e=V[t.left]),"undefined"!=typeof V[t.top]&&(n=V[t.top]),{left:e,top:n}},X=function(t){var e=t.split(" "),n=F(e,2),o=n[0],r=n[1];return{top:o,left:r}},q=X,U=function(t){function e(t){var n=this;o(this,e),B(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.position=this.position.bind(this),I.push(this),this.history=[],this.setOptions(t,!1),C.modules.forEach(function(t){"undefined"!=typeof t.initialize&&t.initialize.call(n)}),this.position()}return v(e,t),k(e,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return"undefined"!=typeof e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,n=arguments.length<=1||void 0===arguments[1]||arguments[1],o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=d(o,t);var r=this.options,s=r.element,a=r.target,l=r.targetModifier;if(this.element=s,this.target=a,this.targetModifier=l,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if("undefined"==typeof e[t])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),c(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&c(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=q(this.options.targetAttachment),this.attachment=q(this.options.attachment),this.offset=X(this.options.offset),this.targetOffset=X(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=i(this.target),this.options.enabled!==!1&&this.enable(n)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return a(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=a(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.topn.clientWidth||[o.overflow,o.overflowX].indexOf("scroll")>=0||this.target!==document.body,i=0;r&&(i=15);var s=t.height-parseFloat(o.borderTopWidth)-parseFloat(o.borderBottomWidth)-i,e={width:15,height:.975*s*(s/n.scrollHeight),left:t.left+t.width-parseFloat(o.borderLeftWidth)-15},l=0;s<408&&this.target===document.body&&(l=-11e-5*Math.pow(s,2)-.00727*s+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var p=this.target.scrollTop/(n.scrollHeight-s);return e.top=p*(s-e.height-l)+t.top+parseFloat(o.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];this.options.addTargetClasses!==!1&&c(this.target,this.getClass("enabled")),c(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),I.forEach(function(e,n){e===t&&I.splice(n,1)}),0===I.length&&s()}},{key:"updateAttachClasses",value:function(t,e){var n=this;t=t||this.attachment,e=e||this.targetAttachment;var o=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var r=this._addAttachClasses;t.top&&r.push(this.getClass("element-attached")+"-"+t.top),t.left&&r.push(this.getClass("element-attached")+"-"+t.left),e.top&&r.push(this.getClass("target-attached")+"-"+e.top),e.left&&r.push(this.getClass("target-attached")+"-"+e.left);var i=[];o.forEach(function(t){i.push(n.getClass("element-attached")+"-"+t),i.push(n.getClass("target-attached")+"-"+t)}),T(function(){"undefined"!=typeof n._addAttachClasses&&(g(n.element,n._addAttachClasses,i),n.options.addTargetClasses!==!1&&g(n.target,n._addAttachClasses,i),delete n._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var n=z(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,n);var o=this.cache("element-bounds",function(){return a(t.element)}),r=o.width,i=o.height;if(0===r&&0===i&&"undefined"!=typeof this.lastSize){var s=this.lastSize;r=s.width,i=s.height}else this.lastSize={width:r,height:i};var d=this.cache("target-bounds",function(){return t.getTargetBounds()}),h=d,c=w(H(this.attachment),{width:r,height:i}),u=w(H(n),h),f=w(this.offset,{width:r,height:i}),m=w(this.targetOffset,h);c=b(c,f),u=b(u,m);for(var g=d.left+u.left-c.left,v=d.top+u.top-c.top,y=0;yE.documentElement.clientHeight&&(O=this.cache("scrollbar-size",p),k.viewport.bottom-=O.height),S.innerWidth>E.documentElement.clientWidth&&(O=this.cache("scrollbar-size",p),k.viewport.right-=O.width),["","static"].indexOf(E.body.style.position)!==-1&&["","static"].indexOf(E.body.parentElement.style.position)!==-1||(k.page.bottom=E.body.scrollHeight-v-i,k.page.right=E.body.scrollWidth-g-r),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var e=t.cache("target-offsetparent",function(){return l(t.target)}),n=t.cache("target-offsetparent-bounds",function(){return a(e)}),o=getComputedStyle(e),r=n,i={};if(["Top","Left","Bottom","Right"].forEach(function(t){i[t.toLowerCase()]=parseFloat(o["border"+t+"Width"])}),n.right=E.body.scrollWidth-n.left-r.width+i.right,n.bottom=E.body.scrollHeight-n.top-r.height+i.bottom,k.page.top>=n.top+i.top&&k.page.bottom>=n.bottom&&k.page.left>=n.left+i.left&&k.page.right>=n.right){var s=e.scrollTop,p=e.scrollLeft;k.offset={top:k.page.top-n.top+s-i.top,left:k.page.left-n.left+p-i.left}}}(),this.move(k),this.history.unshift(k),this.history.length>3&&this.history.pop(),e&&P(),!0}}},{key:"move",value:function(t){var e=this;if("undefined"!=typeof this.element.parentNode){var n={};for(var o in t){n[o]={};for(var r in t[o]){for(var i=!1,s=0;s=0){var f=a.split(" "),g=F(f,2);h=g[0],d=g[1]}else d=h=a;var D=_(e,i);"target"!==h&&"both"!==h||(nD[3]&&"bottom"===v.top&&(n-=c,v.top="top")),"together"===h&&("top"===v.top&&("bottom"===y.top&&nD[3]&&n-(s-c)>=D[1]&&(n-=s-c,v.top="bottom",y.top="bottom")),"bottom"===v.top&&("top"===y.top&&n+s>D[3]?(n-=c,v.top="top",n-=s,y.top="bottom"):"bottom"===y.top&&nD[3]&&"top"===y.top?(n-=s,y.top="bottom"):nD[2]&&"right"===v.left&&(o-=u,v.left="left")),"together"===d&&(oD[2]&&"right"===v.left?"left"===y.left?(o-=u,v.left="left",o-=l,y.left="right"):"right"===y.left&&(o-=u,v.left="left",o+=l,y.left="left"):"center"===v.left&&(o+l>D[2]&&"left"===y.left?(o-=l,y.left="right"):oD[3]&&"top"===y.top&&(n-=s,y.top="bottom")),"element"!==d&&"both"!==d||(oD[2]&&("left"===y.left?(o-=l,y.left="right"):"center"===y.left&&(o-=l/2,y.left="right"))),"string"==typeof p?p=p.split(",").map(function(t){return t.trim()}):p===!0&&(p=["top","left","right","bottom"]),p=p||[];var b=[],w=[];n=0?(n=D[1],b.push("top")):w.push("top")),n+s>D[3]&&(p.indexOf("bottom")>=0?(n=D[3]-s,b.push("bottom")):w.push("bottom")),o=0?(o=D[0],b.push("left")):w.push("left")),o+l>D[2]&&(p.indexOf("right")>=0?(o=D[2]-l,b.push("right")):w.push("right")),b.length&&!function(){var t=void 0;t="undefined"!=typeof e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),b.forEach(function(e){m.push(t+"-"+e)})}(),w.length&&!function(){var t=void 0;t="undefined"!=typeof e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),w.forEach(function(e){m.push(t+"-"+e)})}(),(b.indexOf("left")>=0||b.indexOf("right")>=0)&&(y.left=v.left=!1),(b.indexOf("top")>=0||b.indexOf("bottom")>=0)&&(y.top=v.top=!1),v.top===r.top&&v.left===r.left&&y.top===e.attachment.top&&y.left===e.attachment.left||(e.updateAttachClasses(y,v),e.trigger("update",{attachment:y,targetAttachment:v}))}),T(function(){e.options.addTargetClasses!==!1&&g(e.target,m,f),g(e.element,m,f)}),{top:n,left:o}}});var Y=C.Utils,a=Y.getBounds,g=Y.updateClasses,T=Y.defer;C.modules.push({position:function(t){var e=this,n=t.top,o=t.left,r=this.cache("element-bounds",function(){return a(e.element)}),i=r.height,s=r.width,l=this.getTargetBounds(),p=n+i,d=o+s,h=[];n<=l.bottom&&p>=l.top&&["left","right"].forEach(function(t){var e=l[t];e!==o&&e!==d||h.push(t)}),o<=l.right&&d>=l.left&&["top","bottom"].forEach(function(t){var e=l[t];e!==n&&e!==p||h.push(t)});var c=[],u=[],f=["left","top","right","bottom"];return c.push(this.getClass("abutted")),f.forEach(function(t){c.push(e.getClass("abutted")+"-"+t)}),h.length&&u.push(this.getClass("abutted")),h.forEach(function(t){u.push(e.getClass("abutted")+"-"+t)}),T(function(){e.options.addTargetClasses!==!1&&g(e.target,u,c),g(e.element,u,c)}),!0}});var F=function(){function t(t,e){var n=[],o=!0,r=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){r=!0,i=t}finally{try{!o&&a.return&&a.return()}finally{if(r)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return C.modules.push({position:function(t){var e=t.top,n=t.left;if(this.options.shift){var o=this.options.shift;"function"==typeof this.options.shift&&(o=this.options.shift.call(this,{top:e,left:n}));var r=void 0,i=void 0;if("string"==typeof o){o=o.split(" "),o[1]=o[1]||o[0];var s=o,a=F(s,2);r=a[0],i=a[1],r=parseFloat(r,10),i=parseFloat(i,10)}else r=o.top,i=o.left;return e+=r,n+=i,{top:e,left:n}}}}),K})}])}); \ No newline at end of file diff --git a/vendor/react-datetime/react-datetime.css b/vendor/react-datetime/react-datetime.css deleted file mode 100644 index a123086d0..000000000 --- a/vendor/react-datetime/react-datetime.css +++ /dev/null @@ -1,209 +0,0 @@ -.rdt { - position: relative; -} -.rdtPicker { - display: none; - position: absolute; - width: 250px; - padding: 4px; - margin-top: 1px; - z-index: 99999 !important; - background: #fff; - box-shadow: 0 1px 3px rgba(0,0,0,.1); - border: 1px solid #f9f9f9; -} -.rdtOpen .rdtPicker { - display: block; -} -.rdtStatic .rdtPicker { - box-shadow: none; - position: static; -} - -.rdtPicker .rdtTimeToggle { - text-align: center; -} - -.rdtPicker table { - width: 100%; - margin: 0; -} -.rdtPicker td, -.rdtPicker th { - text-align: center; - height: 28px; -} -.rdtPicker td { - cursor: pointer; -} -.rdtPicker td.rdtDay:hover, -.rdtPicker td.rdtHour:hover, -.rdtPicker td.rdtMinute:hover, -.rdtPicker td.rdtSecond:hover, -.rdtPicker .rdtTimeToggle:hover { - background: #eeeeee; - cursor: pointer; -} -.rdtPicker td.rdtOld, -.rdtPicker td.rdtNew { - color: #999999; -} -.rdtPicker td.rdtToday { - position: relative; -} -.rdtPicker td.rdtToday:before { - content: ''; - display: inline-block; - border-left: 7px solid transparent; - border-bottom: 7px solid #428bca; - border-top-color: rgba(0, 0, 0, 0.2); - position: absolute; - bottom: 4px; - right: 4px; -} -.rdtPicker td.rdtActive, -.rdtPicker td.rdtActive:hover { - background-color: #428bca; - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} -.rdtPicker td.rdtActive.rdtToday:before { - border-bottom-color: #fff; -} -.rdtPicker td.rdtDisabled, -.rdtPicker td.rdtDisabled:hover { - background: none; - color: #999999; - cursor: not-allowed; -} - -.rdtPicker td span.rdtOld { - color: #999999; -} -.rdtPicker td span.rdtDisabled, -.rdtPicker td span.rdtDisabled:hover { - background: none; - color: #999999; - cursor: not-allowed; -} -.rdtPicker th { - border-bottom: 1px solid #f9f9f9; -} -.rdtPicker .dow { - width: 14.2857%; - border-bottom: none; -} -.rdtPicker th.rdtSwitch { - width: 100px; -} -.rdtPicker th.rdtNext, -.rdtPicker th.rdtPrev { - font-size: 21px; - vertical-align: top; -} - -.rdtPrev span, -.rdtNext span { - display: block; - -webkit-touch-callout: none; /* iOS Safari */ - -webkit-user-select: none; /* Chrome/Safari/Opera */ - -khtml-user-select: none; /* Konqueror */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; -} - -.rdtPicker th.rdtDisabled, -.rdtPicker th.rdtDisabled:hover { - background: none; - color: #999999; - cursor: not-allowed; -} -.rdtPicker thead tr:first-child th { - cursor: pointer; -} -.rdtPicker thead tr:first-child th:hover { - background: #eeeeee; -} - -.rdtPicker tfoot { - border-top: 1px solid #f9f9f9; -} - -.rdtPicker button { - border: none; - background: none; - cursor: pointer; -} -.rdtPicker button:hover { - background-color: #eee; -} - -.rdtPicker thead button { - width: 100%; - height: 100%; -} - -td.rdtMonth, -td.rdtYear { - height: 50px; - width: 25%; - cursor: pointer; -} -td.rdtMonth:hover, -td.rdtYear:hover { - background: #eee; -} - -.rdtCounters { - display: inline-block; -} - -.rdtCounters > div { - float: left; -} - -.rdtCounter { - height: 100px; -} - -.rdtCounter { - width: 40px; -} - -.rdtCounterSeparator { - line-height: 100px; -} - -.rdtCounter .rdtBtn { - height: 40%; - line-height: 40px; - cursor: pointer; - display: block; - - -webkit-touch-callout: none; /* iOS Safari */ - -webkit-user-select: none; /* Chrome/Safari/Opera */ - -khtml-user-select: none; /* Konqueror */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; -} -.rdtCounter .rdtBtn:hover { - background: #eee; -} -.rdtCounter .rdtCount { - height: 20%; - font-size: 1.2em; -} - -.rdtMilli { - vertical-align: middle; - padding-left: 8px; - width: 48px; -} - -.rdtMilli input { - width: 100%; - font-size: 1.2em; - margin-top: 37px; -} From d0d1e0a9c5c01e3753ed76044c67d31faafe399b Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 22 Mar 2018 17:56:07 -0700 Subject: [PATCH 3/3] 0.29.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5f3c4f8e..de4f21589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clever-components", - "version": "0.29.3", + "version": "0.29.4", "description": "A library of helpful React components and less styles", "repository": { "type": "git",