diff --git a/dist/react-pikaday-component.js b/dist/react-pikaday-component.js index 51b591e..5a314ab 100644 --- a/dist/react-pikaday-component.js +++ b/dist/react-pikaday-component.js @@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { 'use strict'; @@ -107,9 +107,9 @@ return /******/ (function(modules) { // webpackBootstrap var newDate = this._getValueLink(nextProps).value; var lastDate = this._getValueLink(this.props).value; - this._setDateIfChanged(newDate, lastDate); this._setMinDateIfChanged(nextProps.minDate, this.props.minDate); this._setMaxDateIfChanged(nextProps.maxDate, this.props.maxDate); + this._setDateIfChanged(newDate, lastDate); } }, { key: 'componentDidUpdate', @@ -134,18 +134,20 @@ return /******/ (function(modules) { // webpackBootstrap value: function render() { var _props = this.props, id = _props.id, + type = _props.type, className = _props.className, name = _props.name, tabIndex = _props.tabIndex, disabled = _props.disabled, placeholder = _props.placeholder, readOnly = _props.readOnly, - style = _props.style; + style = _props.style, + _onChange = _props.onChange; return _react2.default.createElement('input', { id: id, - type: 'text', + type: type, ref: 'pikaday', name: name, className: className, @@ -153,7 +155,10 @@ return /******/ (function(modules) { // webpackBootstrap placeholder: placeholder, disabled: disabled, readOnly: readOnly, - tabIndex: tabIndex + tabIndex: tabIndex, + onChange: function onChange(e) { + return e.target.value === '' ? _onChange(undefined) : null; + } }); } }, { @@ -235,6 +240,7 @@ return /******/ (function(modules) { // webpackBootstrap ReactPikadayComponent.propTypes = { id: _react.PropTypes.string, + type: _react.PropTypes.string, value: _react.PropTypes.instanceOf(Date), onChange: _react.PropTypes.func, disabled: _react.PropTypes.bool, @@ -251,22 +257,25 @@ return /******/ (function(modules) { // webpackBootstrap // see Pikaday options at https://github.com/dbushell/Pikaday#configuration // except `onSelect` and `field` }; + ReactPikadayComponent.defaultProps = { + type: 'text' + }; exports.default = ReactPikadayComponent; module.exports = exports['default']; -/***/ }, +/***/ }), /* 1 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_1__; -/***/ }, +/***/ }), /* 2 */ -/***/ function(module, exports) { +/***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; -/***/ } +/***/ }) /******/ ]) }); ; \ No newline at end of file diff --git a/dist/react-pikaday-component.min.js b/dist/react-pikaday-component.min.js index f990a5f..03c1504 100644 --- a/dist/react-pikaday-component.min.js +++ b/dist/react-pikaday-component.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("pikaday"),require("react")):"function"==typeof define&&define.amd?define("ReactPikadayComponent",["pikaday","react"],t):"object"==typeof exports?exports.ReactPikadayComponent=t(require("pikaday"),require("react")):e.ReactPikadayComponent=t(e.Pikaday,e.React)}(this,function(e,t){return function(e){function t(a){if(n[a])return n[a].exports;var o=n[a]={exports:{},id:a,loaded:!1};return e[a].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var p=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t (e.target.value === '' ? onChange(undefined) : null)} /> ); }