boundless-dialog
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}var n={};return o.m=e,o.c=n,o.i=function(e){return e},o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="",o(o.s=4)}([function(e,o){e.exports=require("boundless-portal")},function(e,o){e.exports=require("boundless-utils-omit-keys")},function(e,o){e.exports=require("classnames")},function(e,o){e.exports=require("react")},function(e,o,n){"use strict";function t(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function r(e,o){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?e:o}function s(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(e,o):e.__proto__=o)}Object.defineProperty(o,"__esModule",{value:!0});var i=n(3),l=n.n(i),u=n(2),c=n.n(u),p=n(0),a=n.n(p),d=n(1),f=n.n(d),y=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},h=function(){function e(e,o){for(var n=0;n<o.length;n++){var t=o[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(o,n,t){return n&&e(o.prototype,n),t&&e(o,t),o}}(),O=function(e){return"function"==typeof e},w=function(){},T=Array.prototype.slice,v=function(e){function o(){var e,n,s,i;t(this,o);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=s=r(this,(e=o.__proto__||Object.getPrototypeOf(o)).call.apply(e,[this].concat(u))),s.mounted=!1,s.handleFocus=function(e){if(s.props.captureFocus){var o=e.explicitOriginalTarget||e.relatedTarget;s.isPartOfDialog(o)&&!s.isPartOfDialog(e.target)&&(e.preventDefault(),o.focus())}else if(s.shouldDialogCloseOnEvent("closeOnOutsideFocus",e)&&!s.isPartOfDialog(e.target))return window.setTimeout(s.props.onClose,0)},s.handleKeyDown=function(e){"Escape"===e.key&&s.shouldDialogCloseOnEvent("closeOnEscKey",e)&&window.setTimeout(s.props.onClose,0),s.props.onKeyDown&&s.props.onKeyDown(e)},s.handleInsideClick=function(e){s.shouldDialogCloseOnEvent("closeOnInsideClick",e)&&window.setTimeout(s.props.onClose,0)},s.handleOutsideClick=function(e){s.shouldDialogCloseOnEvent("closeOnOutsideClick",e)&&!s.isPartOfDialog(e.target)&&window.setTimeout(s.props.onClose,0)},s.handleOutsideScrollWheel=function(e){s.shouldDialogCloseOnEvent("closeOnOutsideScroll",e)&&!s.isPartOfDialog(e.target)&&window.setTimeout(s.props.onClose,0)},i=n,r(s,i)}return s(o,e),h(o,[{key:"isPartOfDialog",value:function(e){if(!e||e===window)return!1;var o=[this.$wrapper].concat(T.call(this.$wrapper.querySelectorAll("["+a.a.PORTAL_DATA_ATTRIBUTE+"]")).map(function(e){return document.getElementById(e.getAttribute(a.a.PORTAL_DATA_ATTRIBUTE))})),n=e.nodeType!==Node.ELEMENT_NODE?e.parentNode:e;return o.some(function(e){return e.contains(n)})}},{key:"componentDidMount",value:function(){window.addEventListener("click",this.handleOutsideClick,!0),window.addEventListener("contextmenu",this.handleOutsideClick,!0),window.addEventListener("focus",this.handleFocus,!0),window.addEventListener("scroll",this.handleOutsideScrollWheel,!0),window.addEventListener("wheel",this.handleOutsideScrollWheel,!0),this.props.captureFocus&&!this.isPartOfDialog(document.activeElement)&&this.$dialog.focus()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("click",this.handleOutsideClick,!0),window.removeEventListener("contextmenu",this.handleOutsideClick,!0),window.removeEventListener("focus",this.handleFocus,!0),window.removeEventListener("scroll",this.handleOutsideScrollWheel,!0),window.removeEventListener("wheel",this.handleOutsideScrollWheel,!0)}},{key:"shouldDialogCloseOnEvent",value:function(e,o){return O(this.props[e])?this.props[e](o):this.props[e]}},{key:"renderFocusBoundary",value:function(){if(this.props.captureFocus)return l.a.createElement("div",{className:"b-offscreen",tabIndex:"0","aria-hidden":"true"}," ")}},{key:"render",value:function(){var e=this;return l.a.createElement(this.props.component,y({},f()(this.props,o.internalKeys),{ref:function(o){return e.$wrapper=o},className:c()("b-dialog-wrapper",this.props.className)}),this.renderFocusBoundary(),this.props.before,l.a.createElement(this.props.dialogComponent,y({},this.dialogProps,{ref:function(o){return e.$dialog=o},className:c()("b-dialog",this.props.dialogProps.className),onClick:this.handleInsideClick,onKeyDown:this.handleKeyDown,role:"dialog",tabIndex:"0"}),this.props.children),this.props.after,this.renderFocusBoundary())}}]),o}(l.a.PureComponent);v.propTypes={"*":i.PropTypes.any,after:i.PropTypes.node,before:i.PropTypes.node,captureFocus:i.PropTypes.bool,closeOnEscKey:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnInsideClick:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideClick:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideFocus:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideScroll:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),component:i.PropTypes.string,dialogComponent:i.PropTypes.string,dialogProps:i.PropTypes.shape({"*":i.PropTypes.any}),onClose:i.PropTypes.func},v.defaultProps={after:null,before:null,captureFocus:!0,children:null,closeOnEscKey:!1,closeOnInsideClick:!1,closeOnOutsideClick:!1,closeOnOutsideFocus:!1,closeOnOutsideScroll:!1,component:"div",dialogComponent:"div",dialogProps:{},onClose:w,onKeyDown:w},v.internalKeys=Object.keys(v.defaultProps),o.default=v}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIGYxZjc0OWNhMzNjZDE0ZDdjN2M2Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcImJvdW5kbGVzcy1wb3J0YWxcIn0iLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwiYm91bmRsZXNzLXV0aWxzLW9taXQta2V5c1wifSIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wiY29tbW9uanMyXCI6XCJjbGFzc25hbWVzXCJ9Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcInJlYWN0XCJ9Iiwid2VicGFjazovLy8uL3BhY2thZ2VzL2JvdW5kbGVzcy1kaWFsb2cvaW5kZXguanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1vZHVsZXMiLCJfX3dlYnBhY2tfcmVxdWlyZV9fIiwibW9kdWxlSWQiLCJpbnN0YWxsZWRNb2R1bGVzIiwiaSIsImwiLCJjYWxsIiwibSIsImMiLCJ2YWx1ZSIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiY29uZmlndXJhYmxlIiwiZW51bWVyYWJsZSIsImdldCIsIm4iLCJfX2VzTW9kdWxlIiwib2JqZWN0IiwicHJvcGVydHkiLCJwcm90b3R5cGUiLCJoYXNPd25Qcm9wZXJ0eSIsInAiLCJzIiwicmVxdWlyZSIsIl9fd2VicGFja19leHBvcnRzX18iLCJfY2xhc3NDYWxsQ2hlY2siLCJpbnN0YW5jZSIsIkNvbnN0cnVjd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b3dufVxuICAgICAgICAgICAgICAgICAgICByb2xlPSdkaWFsb2cnXG4gICAgICAgICAgICAgICAgICAgIHRhYkluZGV4PScwJz5cbiAgICAgICAgICAgICAgICAgICAge3RoaXMucHJvcHMuY2hpbGRyZW59XG4gICAgICAgICAgICAgICAgPC90aGlzLnByb3BzLmRpYWxvZ0NvbXBvbmVudD5cblxuICAgICAgICAgICAgICAgIHt0aGlzLnByb3BzLmFmdGVyfVxuXG4gICAgICAgICAgICAgICAge3RoaXMucmVuZGVyRm9jdXNCb3VuZGFyeSgpfVxuICAgICAgICAgICAgPC90aGlzLnByb3BzLmNvbXBvbmVudD5cbiAgICAgICAgKTtcbiAgICB9XG59XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9wYWNrYWdlcy9ib3VuZGxlc3MtZGlhbG9nL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ== | ||
module.exports=function(e){function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}var n={};return o.m=e,o.c=n,o.i=function(e){return e},o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="",o(o.s=4)}([function(e,o){e.exports=require("boundless-portal")},function(e,o){e.exports=require("boundless-utils-omit-keys")},function(e,o){e.exports=require("classnames")},function(e,o){e.exports=require("react")},function(e,o,n){"use strict";function t(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function r(e,o){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?e:o}function s(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(e,o):e.__proto__=o)}Object.defineProperty(o,"__esModule",{value:!0});var i=n(3),l=(n.n(i),n(2)),u=n.n(l),c=n(0),p=n.n(c),a=n(1),d=n.n(a),f=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},h=function(){function e(e,o){for(var n=0;n<o.length;n++){var t=o[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(o,n,t){return n&&e(o.prototype,n),t&&e(o,t),o}}(),y=function(e){return"function"==typeof e},O=function(){},w=Array.prototype.slice,T=function(e){function o(){var e,n,s,i;t(this,o);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=s=r(this,(e=o.__proto__||Object.getPrototypeOf(o)).call.apply(e,[this].concat(u))),s.mounted=!1,s.handleFocus=function(e){if(s.props.captureFocus){var o=e.explicitOriginalTarget||e.relatedTarget;s.isPartOfDialog(o)&&!s.isPartOfDialog(e.target)&&(e.preventDefault(),o.focus())}else if(s.shouldDialogCloseOnEvent("closeOnOutsideFocus",e)&&!s.isPartOfDialog(e.target))return window.setTimeout(s.props.onClose,0)},s.handleKeyDown=function(e){"Escape"===e.key&&s.shouldDialogCloseOnEvent("closeOnEscKey",e)&&window.setTimeout(s.props.onClose,0),s.props.onKeyDown&&s.props.onKeyDown(e)},s.handleInsideClick=function(e){s.shouldDialogCloseOnEvent("closeOnInsideClick",e)&&window.setTimeout(s.props.onClose,0)},s.handleOutsideClick=function(e){s.shouldDialogCloseOnEvent("closeOnOutsideClick",e)&&!s.isPartOfDialog(e.target)&&window.setTimeout(s.props.onClose,0)},s.handleOutsideScrollWheel=function(e){s.shouldDialogCloseOnEvent("closeOnOutsideScroll",e)&&!s.isPartOfDialog(e.target)&&window.setTimeout(s.props.onClose,0)},i=n,r(s,i)}return s(o,e),h(o,[{key:"isPartOfDialog",value:function(e){if(!e||e===window)return!1;var o=[this.$wrapper].concat(w.call(this.$wrapper.querySelectorAll("["+p.a.PORTAL_DATA_ATTRIBUTE+"]")).map(function(e){return document.getElementById(e.getAttribute(p.a.PORTAL_DATA_ATTRIBUTE))})),n=e.nodeType!==Node.ELEMENT_NODE?e.parentNode:e;return o.some(function(e){return e.contains(n)})}},{key:"componentDidMount",value:function(){window.addEventListener("click",this.handleOutsideClick,!0),window.addEventListener("contextmenu",this.handleOutsideClick,!0),window.addEventListener("focus",this.handleFocus,!0),window.addEventListener("scroll",this.handleOutsideScrollWheel,!0),window.addEventListener("wheel",this.handleOutsideScrollWheel,!0),this.props.captureFocus&&!this.isPartOfDialog(document.activeElement)&&this.$dialog.focus()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("click",this.handleOutsideClick,!0),window.removeEventListener("contextmenu",this.handleOutsideClick,!0),window.removeEventListener("focus",this.handleFocus,!0),window.removeEventListener("scroll",this.handleOutsideScrollWheel,!0),window.removeEventListener("wheel",this.handleOutsideScrollWheel,!0)}},{key:"shouldDialogCloseOnEvent",value:function(e,o){return y(this.props[e])?this.props[e](o):this.props[e]}},{key:"renderFocusBoundary",value:function(){if(this.props.captureFocus)return n.i(i.createElement)("div",{className:"b-offscreen",tabIndex:"0","aria-hidden":"true"}," ")}},{key:"render",value:function(){var e=this;return n.i(i.createElement)(this.props.component,f({},d()(this.props,o.internalKeys),{ref:function(o){return e.$wrapper=o},className:u()("b-dialog-wrapper",this.props.className)}),this.renderFocusBoundary(),this.props.before,n.i(i.createElement)(this.props.dialogComponent,f({},this.dialogProps,{ref:function(o){return e.$dialog=o},className:u()("b-dialog",this.props.dialogProps.className),onClick:this.handleInsideClick,onKeyDown:this.handleKeyDown,role:this.props.captureFocus?"alertdialog":"dialog",tabIndex:"0"}),this.props.children),this.props.after,this.renderFocusBoundary())}}]),o}(i.PureComponent);T.propTypes={"*":i.PropTypes.any,after:i.PropTypes.node,before:i.PropTypes.node,captureFocus:i.PropTypes.bool,closeOnEscKey:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnInsideClick:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideClick:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideFocus:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),closeOnOutsideScroll:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.func]),component:i.PropTypes.string,dialogComponent:i.PropTypes.string,dialogProps:i.PropTypes.shape({"*":i.PropTypes.any}),onClose:i.PropTypes.func},T.defaultProps={after:null,before:null,captureFocus:!0,children:null,closeOnEscKey:!1,closeOnInsideClick:!1,closeOnOutsideClick:!1,closeOnOutsideFocus:!1,closeOnOutsideScroll:!1,component:"div",dialogComponent:"div",dialogProps:{},onClose:O,onKeyDown:O},T.internalKeys=Object.keys(T.defaultProps),o.default=T}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIDJkMGUyNjM4MThjODViYzk0OTM0Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcImJvdW5kbGVzcy1wb3J0YWxcIn0iLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwiYm91bmRsZXNzLXV0aWxzLW9taXQta2V5c1wifSIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wiY29tbW9uanMyXCI6XCJjbGFzc25hbWVzXCJ9Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcInJlYWN0XCJ9Iiwid2VicGFjazovLy8uL3BhY2thZ2VzL2JvdW5kbGVzcy1kaWFsb2cvaW5kZXguanMiXSwibmF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gICAgICAgICAgIDx0aGlzLnByb3BzLmRpYWxvZ0NvbXBvbmVudFxuICAgICAgICAgICAgICAgICAgICB7Li4udGhpcy5kaWFsb2dQcm9wc31cbiAgICAgICAgICAgICAgICAgICAgcmVmPXsobm9kZSkgPT4gKHRoaXMuJGRpYWxvZyA9IG5vZGUpfVxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2N4KCdiLWRpYWxvZycsIHRoaXMucHJvcHMuZGlhbG9nUHJvcHMuY2xhc3NOYW1lKX1cbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5oYW5kbGVJbnNpZGVDbGlja31cbiAgICAgICAgICAgICAgICAgICAgb25LZXlEb3duPXt0aGlzLmhhbmRsZUtleURvd259XG4gICAgICAgICAgICAgICAgICAgIHJvbGU9e3RoaXMucHJvcHMuY2FwdHVyZUZvY3VzID8gJ2FsZXJ0ZGlhbG9nJyA6ICdkaWFsb2cnfVxuICAgICAgICAgICAgICAgICAgICB0YWJJbmRleD0nMCc+XG4gICAgICAgICAgICAgICAgICAgIHt0aGlzLnByb3BzLmNoaWxkcmVufVxuICAgICAgICAgICAgICAgIDwvdGhpcy5wcm9wcy5kaWFsb2dDb21wb25lbnQ+XG5cbiAgICAgICAgICAgICAgICB7dGhpcy5wcm9wcy5hZnRlcn1cblxuICAgICAgICAgICAgICAgIHt0aGlzLnJlbmRlckZvY3VzQm91bmRhcnkoKX1cbiAgICAgICAgICAgIDwvdGhpcy5wcm9wcy5jb21wb25lbnQ+XG4gICAgICAgICk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWRpYWxvZy9pbmRleC5qcyJdLCJzb3VyY2VSb290IjoiIn0= |
@@ -1,7 +0,7 @@ | ||
import React from 'react'; | ||
import {createElement, PureComponent} from 'react'; | ||
import {findDOMNode} from 'react-dom'; | ||
import Button from '../../boundless-button/index'; | ||
import Dialog from '../index'; | ||
import Dialog from '../'; | ||
export default class DialogDemo extends React.PureComponent { | ||
export default class DialogDemo extends PureComponent { | ||
state = { | ||
@@ -41,2 +41,3 @@ showDialog: false, | ||
frameBorder='0' | ||
title='A youtube video showcasing the relative size of celestial objects.' | ||
allowFullScreen /> | ||
@@ -43,0 +44,0 @@ <Button |
10
index.js
@@ -1,2 +0,2 @@ | ||
import React, {PropTypes} from 'react'; | ||
import {createElement, PropTypes, PureComponent} from 'react'; | ||
import cx from 'classnames'; | ||
@@ -12,4 +12,2 @@ | ||
/** | ||
__A non-blocking, focus-stealing container.__ | ||
A dialog differs from a modal in that it does not come with a masking layer (to obscure the rest of the page) | ||
@@ -20,3 +18,3 @@ and the user can choose to shift focus away from the dialog contents via mouse click or a keyboard shortcut. | ||
*/ | ||
export default class Dialog extends React.PureComponent { | ||
export default class Dialog extends PureComponent { | ||
static propTypes = { | ||
@@ -80,3 +78,3 @@ /** | ||
/** | ||
* enable detection of scroll and mousewheel events outside the dialog area to trigger `props.onClose`; if a functio | ||
* enable detection of scroll and mousewheel events outside the dialog area to trigger `props.onClose`; if a function | ||
* is provided, the return value determines if the dialog will be closed | ||
@@ -243,3 +241,3 @@ */ | ||
onKeyDown={this.handleKeyDown} | ||
role='dialog' | ||
role={this.props.captureFocus ? 'alertdialog' : 'dialog'} | ||
tabIndex='0'> | ||
@@ -246,0 +244,0 @@ {this.props.children} |
/* eslint no-unused-expressions:0 */ | ||
import React from 'react'; | ||
import {createElement, PureComponent} from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
@@ -52,2 +52,12 @@ import sinon from 'sinon'; | ||
it('uses the "alertdialog" aria role if props.captureFocus is true', () => { | ||
render(<Dialog captureFocus={true} />); | ||
expect($('.b-dialog[role="alertdialog"]')).not.toBeNull(); | ||
}); | ||
it('uses the "dialog" aria role if props.captureFocus is false', () => { | ||
render(<Dialog captureFocus={false} />); | ||
expect($('.b-dialog[role="dialog"]')).not.toBeNull(); | ||
}); | ||
it('renders focus boundary nodes if props.captureFocus is true', () => { | ||
@@ -337,3 +347,3 @@ render(<Dialog captureFocus={true} />); | ||
describe('nested portal components', () => { | ||
class NestedPortalDemo extends React.PureComponent { | ||
class NestedPortalDemo extends PureComponent { | ||
state = { | ||
@@ -340,0 +350,0 @@ outerPopoverRendered: false, |
{ | ||
"name": "boundless-dialog", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A non-blocking, focus-stealing container.", | ||
@@ -17,3 +17,3 @@ "main": "build/index.js", | ||
"contributors": [ | ||
"Evan Scott <glitterbyte@gmail.com> (http://yaycmyk.com)", | ||
"Evan Scott <probablyup@gmail.com> (http://yaycmyk.com)", | ||
"Abe Rubenstein <abe.rubenstein@enigma.io>", | ||
@@ -26,6 +26,6 @@ "Jenn Creighton <jenn.creighton@enigma.io>" | ||
}, | ||
"homepage": "http://boundless.js.org/Dialog", | ||
"homepage": "https://boundless.js.org/Dialog", | ||
"dependencies": { | ||
"boundless-portal": "^1.0.3", | ||
"boundless-utils-omit-keys": "^1.0.3", | ||
"boundless-portal": "^1.0.4", | ||
"boundless-utils-omit-keys": "^1.0.4", | ||
"classnames": "^2.1.5" | ||
@@ -32,0 +32,0 @@ }, |
@@ -6,4 +6,2 @@ <!--- | ||
__A non-blocking, focus-stealing container.__ | ||
A dialog differs from a modal in that it does not come with a masking layer (to obscure the rest of the page) | ||
@@ -24,3 +22,5 @@ and the user can choose to shift focus away from the dialog contents via mouse click or a keyboard shortcut. | ||
```jsx | ||
import React from 'react'; | ||
/** @jsx createElement */ | ||
import {createElement, PureComponent} from 'react'; | ||
import {findDOMNode} from 'react-dom'; | ||
@@ -30,3 +30,3 @@ import Button from 'boundless-button'; | ||
export default class DialogDemo extends React.PureComponent { | ||
export default class DialogDemo extends PureComponent { | ||
state = { | ||
@@ -66,2 +66,3 @@ showDialog: false, | ||
frameBorder='0' | ||
title='A youtube video showcasing the relative size of celestial objects.' | ||
allowFullScreen /> | ||
@@ -106,3 +107,3 @@ <Button | ||
> Note: only top-level props are in the README, for the full list check out the [website](http://boundless.js.org/Dialog). | ||
> Note: only top-level props are in the README, for the full list check out the [website](https://boundless.js.org/Dialog). | ||
@@ -116,71 +117,71 @@ ### Required Props | ||
- __`*`__ ・ any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes) | ||
- __`*`__ · any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes) | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`any` | `n/a` | ||
- __`after`__ ・ arbitrary content to be rendered after the dialog in the DOM | ||
- __`after`__ · arbitrary content to be rendered after the dialog in the DOM | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`any renderable` | `null` | ||
- __`before`__ ・ arbitrary content to be rendered before the dialog in the DOM | ||
- __`before`__ · arbitrary content to be rendered before the dialog in the DOM | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`any renderable` | `null` | ||
- __`captureFocus`__ ・ determines if focus is allowed to move away from the dialog | ||
- __`captureFocus`__ · determines if focus is allowed to move away from the dialog | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool` | `true` | ||
- __`closeOnEscKey`__ ・ enable detection of "Escape" keypresses to trigger `props.onClose`; if a function is provided, the return | ||
- __`closeOnEscKey`__ · enable detection of "Escape" keypresses to trigger `props.onClose`; if a function is provided, the return | ||
value determines if the dialog will be closed | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool or function` | `false` | ||
- __`closeOnInsideClick`__ ・ enable detection of clicks inside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
- __`closeOnInsideClick`__ · enable detection of clicks inside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
value determines if the dialog will be closed | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool or function` | `false` | ||
- __`closeOnOutsideClick`__ ・ enable detection of clicks outside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
- __`closeOnOutsideClick`__ · enable detection of clicks outside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
value determines if the dialog will be closed | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool or function` | `false` | ||
- __`closeOnOutsideFocus`__ ・ enable detection of focus outside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
- __`closeOnOutsideFocus`__ · enable detection of focus outside the dialog area to trigger `props.onClose`; if a function is provided, the return | ||
value determines if the dialog will be closed | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool or function` | `false` | ||
- __`closeOnOutsideScroll`__ ・ enable detection of scroll and mousewheel events outside the dialog area to trigger `props.onClose`; if a functio | ||
- __`closeOnOutsideScroll`__ · enable detection of scroll and mousewheel events outside the dialog area to trigger `props.onClose`; if a function | ||
is provided, the return value determines if the dialog will be closed | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`bool or function` | `false` | ||
- __`component`__ ・ override the type of `.b-dialog-wrapper` HTML element | ||
- __`component`__ · override the type of `.b-dialog-wrapper` HTML element | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`string` | `'div'` | ||
- __`dialogComponent`__ ・ override the type of `.b-dialog` HTML element | ||
- __`dialogComponent`__ · override the type of `.b-dialog` HTML element | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`string` | `'div'` | ||
@@ -191,9 +192,9 @@ | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`object` | `{}` | ||
- __`onClose`__ ・ a custom event handler that is called to indicate that the dialog should be unrendered by its parent; the event occurs if one or more of the "closeOn" props (`closeOnEscKey`, `closeOnOutsideClick`, etc.) are passed as `true` and the dismissal criteria are satisfied | ||
- __`onClose`__ · a custom event handler that is called to indicate that the dialog should be unrendered by its parent; the event occurs if one or more of the "closeOn" props (`closeOnEscKey`, `closeOnOutsideClick`, etc.) are passed as `true` and the dismissal criteria are satisfied | ||
Expects | Default Value | ||
- | - | ||
--- | --- | ||
`function` | `() => {}` | ||
@@ -204,7 +205,6 @@ | ||
### Stylus | ||
You can see what variables are available to override in [variables.styl](https://github.com/enigma-io/boundless/blob/master/variables.styl). | ||
```stylus | ||
// Bring in Boundless's base Stylus variables | ||
@require "node_modules/boundless-dialog/variables" | ||
// Redefine any variables as desired, e.g. | ||
// Redefine any variables as desired, e.g: | ||
color-accent = royalblue | ||
@@ -211,0 +211,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88236
644
1
Updatedboundless-portal@^1.0.4