From 462dfbce3bc569a41b28a5b6f683e306d8c64bd5 Mon Sep 17 00:00:00 2001 From: Clay Diffrient Date: Fri, 8 Jul 2016 16:00:48 -0600 Subject: [PATCH] release v1.0.1 --- CHANGELOG.md | 6 ++++++ dist/react-tray.js | 2 +- dist/react-tray.min.js | 2 +- package.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 352fd9f..5a45be8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v1.0.1 - Fri, 08 Jul 2016 22:00:48 GMT +-------------------------------------- + +- [a374410](../../commit/a374410) [fixed] make default maintainFocus prob actually be true + + v1.0.0 - Fri, 08 Jul 2016 21:20:29 GMT -------------------------------------- diff --git a/dist/react-tray.js b/dist/react-tray.js index 482cfa5..fe6f6c1 100644 --- a/dist/react-tray.js +++ b/dist/react-tray.js @@ -100,7 +100,7 @@ return /******/ (function(modules) { // webpackBootstrap isOpen: false, closeTimeoutMS: 0, closeOnBlur: true, - maintainFocus: false + maintainFocus: true }; }, diff --git a/dist/react-tray.min.js b/dist/react-tray.min.js index ffec9ba..def5e34 100644 --- a/dist/react-tray.min.js +++ b/dist/react-tray.min.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.ReactTray=t(require("React"),require("ReactDOM")):e.ReactTray=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";e.exports=o(1)},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),u=o(3),i=n(u),a=o(4),l=n(a),c=i["default"].unstable_renderSubtreeIntoContainer;t["default"]=s["default"].createClass({displayName:"Tray",propTypes:{isOpen:s["default"].PropTypes.bool,onBlur:s["default"].PropTypes.func,closeTimeoutMS:s["default"].PropTypes.number,closeOnBlur:s["default"].PropTypes.bool,maintainFocus:s["default"].PropTypes.bool},getDefaultProps:function(){return{isOpen:!1,closeTimeoutMS:0,closeOnBlur:!0,maintainFocus:!1}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className="ReactTrayPortal",document.body.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){this.renderPortal(e)},componentWillUnmount:function(){i["default"].unmountComponentAtNode(this.node),document.body.removeChild(this.node)},renderPortal:function(e){delete e.ref,c(this,s["default"].createElement(l["default"],e),this.node)},render:function(){return null}}),e.exports=t["default"]},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(e===t)return!0;for(var o=t;o=o.parentNode;)if(o===e)return!0;return!1}Object.defineProperty(t,"__esModule",{value:!0});var s=o(2),u=n(s),i=o(5),a=n(i),l=o(6),c=n(l),f=o(7),p=n(f),d=o(8),h=n(d),y={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0},content:{position:"absolute",background:"#fff"}},m={overlay:{base:"ReactTray__Overlay",afterOpen:"ReactTray__Overlay--after-open",beforeClose:"ReactTray__Overlay--before-close"},content:{base:"ReactTray__Content",afterOpen:"ReactTray__Content--after-open",beforeClose:"ReactTray__Content--before-close"}};t["default"]=u["default"].createClass({displayName:"TrayPortal",propTypes:{className:s.PropTypes.string,overlayClassName:s.PropTypes.string,isOpen:s.PropTypes.bool,onBlur:s.PropTypes.func,closeOnBlur:s.PropTypes.bool,closeTimeoutMS:s.PropTypes.number,children:s.PropTypes.any,maintainFocus:s.PropTypes.bool},getInitialState:function(){return{afterOpen:!1,beforeClose:!1}},componentDidMount:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())},componentWillReceiveProps:function(e){e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()},componentDidUpdate:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))},setFocusAfterRender:function(e){this.focusAfterRender=e},focusContent:function(){this.refs.content.focus()},handleOverlayClick:function(e){r(this.refs.content,e.target)||this.props.onBlur()},handleContentKeyDown:function(e){if(27===e.keyCode&&this.props.onBlur(),9===e.keyCode&&this.props.maintainFocus&&p["default"](this.refs.content,e)){e.preventDefault();var t=h["default"](this.refs.content),o=t[e.shiftKey?t.length-1:0];return void o.focus()}9===e.keyCode&&this.props.closeOnBlur&&p["default"](this.refs.content,e)&&(e.preventDefault(),this.props.onBlur())},open:function(){var e=this;c["default"].markForFocusLater(),this.setState({isOpen:!0},function(){e.setState({afterOpen:!0})})},close:function(){this.props.closeTimeoutMS>0?this.closeWithTimeout():this.closeWithoutTimeout()},closeWithTimeout:function(){var e=this;this.setState({beforeClose:!0},function(){setTimeout(e.closeWithoutTimeout,e.props.closeTimeoutMS)})},closeWithoutTimeout:function(){this.setState({afterOpen:!1,beforeClose:!1},this.afterClose)},afterClose:function(){c["default"].returnFocus()},shouldBeClosed:function(){return!this.props.isOpen&&!this.state.beforeClose},buildClassName:function(e){var t=m[e].base;return this.state.afterOpen&&(t+=" "+m[e].afterOpen),this.state.beforeClose&&(t+=" "+m[e].beforeClose),t},render:function(){return this.shouldBeClosed()?u["default"].createElement("div",null):u["default"].createElement("div",{ref:"overlay",style:y.overlay,className:a["default"](this.buildClassName("overlay"),this.props.overlayClassName),onClick:this.handleOverlayClick},u["default"].createElement("div",{ref:"content",style:y.content,className:a["default"](this.buildClassName("content"),this.props.className),onKeyDown:this.handleContentKeyDown,tabIndex:"-1"},this.props.children))}}),e.exports=t["default"]},function(e,t,o){var n,r;/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.ReactTray=t(require("React"),require("ReactDOM")):e.ReactTray=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";e.exports=o(1)},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),u=o(3),i=n(u),a=o(4),l=n(a),c=i["default"].unstable_renderSubtreeIntoContainer;t["default"]=s["default"].createClass({displayName:"Tray",propTypes:{isOpen:s["default"].PropTypes.bool,onBlur:s["default"].PropTypes.func,closeTimeoutMS:s["default"].PropTypes.number,closeOnBlur:s["default"].PropTypes.bool,maintainFocus:s["default"].PropTypes.bool},getDefaultProps:function(){return{isOpen:!1,closeTimeoutMS:0,closeOnBlur:!0,maintainFocus:!0}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className="ReactTrayPortal",document.body.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){this.renderPortal(e)},componentWillUnmount:function(){i["default"].unmountComponentAtNode(this.node),document.body.removeChild(this.node)},renderPortal:function(e){delete e.ref,c(this,s["default"].createElement(l["default"],e),this.node)},render:function(){return null}}),e.exports=t["default"]},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(e===t)return!0;for(var o=t;o=o.parentNode;)if(o===e)return!0;return!1}Object.defineProperty(t,"__esModule",{value:!0});var s=o(2),u=n(s),i=o(5),a=n(i),l=o(6),c=n(l),f=o(7),p=n(f),d=o(8),h=n(d),y={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0},content:{position:"absolute",background:"#fff"}},m={overlay:{base:"ReactTray__Overlay",afterOpen:"ReactTray__Overlay--after-open",beforeClose:"ReactTray__Overlay--before-close"},content:{base:"ReactTray__Content",afterOpen:"ReactTray__Content--after-open",beforeClose:"ReactTray__Content--before-close"}};t["default"]=u["default"].createClass({displayName:"TrayPortal",propTypes:{className:s.PropTypes.string,overlayClassName:s.PropTypes.string,isOpen:s.PropTypes.bool,onBlur:s.PropTypes.func,closeOnBlur:s.PropTypes.bool,closeTimeoutMS:s.PropTypes.number,children:s.PropTypes.any,maintainFocus:s.PropTypes.bool},getInitialState:function(){return{afterOpen:!1,beforeClose:!1}},componentDidMount:function(){this.props.isOpen&&(this.setFocusAfterRender(!0),this.open())},componentWillReceiveProps:function(e){e.isOpen?(this.setFocusAfterRender(!0),this.open()):this.props.isOpen&&!e.isOpen&&this.close()},componentDidUpdate:function(){this.focusAfterRender&&(this.focusContent(),this.setFocusAfterRender(!1))},setFocusAfterRender:function(e){this.focusAfterRender=e},focusContent:function(){this.refs.content.focus()},handleOverlayClick:function(e){r(this.refs.content,e.target)||this.props.onBlur()},handleContentKeyDown:function(e){if(27===e.keyCode&&this.props.onBlur(),9===e.keyCode&&this.props.maintainFocus&&p["default"](this.refs.content,e)){e.preventDefault();var t=h["default"](this.refs.content),o=t[e.shiftKey?t.length-1:0];return void o.focus()}9===e.keyCode&&this.props.closeOnBlur&&p["default"](this.refs.content,e)&&(e.preventDefault(),this.props.onBlur())},open:function(){var e=this;c["default"].markForFocusLater(),this.setState({isOpen:!0},function(){e.setState({afterOpen:!0})})},close:function(){this.props.closeTimeoutMS>0?this.closeWithTimeout():this.closeWithoutTimeout()},closeWithTimeout:function(){var e=this;this.setState({beforeClose:!0},function(){setTimeout(e.closeWithoutTimeout,e.props.closeTimeoutMS)})},closeWithoutTimeout:function(){this.setState({afterOpen:!1,beforeClose:!1},this.afterClose)},afterClose:function(){c["default"].returnFocus()},shouldBeClosed:function(){return!this.props.isOpen&&!this.state.beforeClose},buildClassName:function(e){var t=m[e].base;return this.state.afterOpen&&(t+=" "+m[e].afterOpen),this.state.beforeClose&&(t+=" "+m[e].beforeClose),t},render:function(){return this.shouldBeClosed()?u["default"].createElement("div",null):u["default"].createElement("div",{ref:"overlay",style:y.overlay,className:a["default"](this.buildClassName("overlay"),this.props.overlayClassName),onClick:this.handleOverlayClick},u["default"].createElement("div",{ref:"content",style:y.content,className:a["default"](this.buildClassName("content"),this.props.className),onKeyDown:this.handleContentKeyDown,tabIndex:"-1"},this.props.children))}}),e.exports=t["default"]},function(e,t,o){var n,r;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames diff --git a/package.json b/package.json index 3ae1b82..e2f69d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-tray", - "version": "1.0.0", + "version": "1.0.1", "description": "An accessible tray component useful for navigation menus", "main": "lib/main.js", "directories": {