Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boundless-arrow-key-navigation

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boundless-arrow-key-navigation - npm Package Compare versions

Comparing version 1.0.0-beta.5 to 1.0.0-beta.6

4

build/index.js

@@ -1,2 +0,2 @@

module.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";t.a=function(e){return"function"==typeof e}},function(e,t,n){"use strict";function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).reduce(function(n,o){return t.indexOf(o)===-1&&(n[o]=e[o]),n},{})}t.a=o},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-dom")},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 i(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 a=n(2),s=n.n(a),c=n(3),u=(n.n(c),n(0)),p=n(1),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=function(e){function t(){var e,i,a,c;o(this,t);for(var p=arguments.length,d=Array(p),l=0;l<p;l++)d[l]=arguments[l];return i=a=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(d))),a.state={activeChildIndex:a.props.defaultActiveChildIndex},a.handleKeyDown=function(e){switch(e.key){case"ArrowUp":a.props.mode!==t.mode.VERTICAL&&a.props.mode!==t.mode.BOTH||(e.preventDefault(),a.moveFocus(-1));break;case"ArrowLeft":a.props.mode!==t.mode.HORIZONTAL&&a.props.mode!==t.mode.BOTH||(e.preventDefault(),a.moveFocus(-1));break;case"ArrowDown":a.props.mode!==t.mode.VERTICAL&&a.props.mode!==t.mode.BOTH||(e.preventDefault(),a.moveFocus(1));break;case"ArrowRight":a.props.mode!==t.mode.HORIZONTAL&&a.props.mode!==t.mode.BOTH||(e.preventDefault(),a.moveFocus(1))}n.i(u.a)(a.props.onKeyDown)&&a.props.onKeyDown(e)},a.handleFocus=function(e){if(e.target.hasAttribute("data-focus-index")){var t=parseInt(e.target.getAttribute("data-focus-index"),10),n=s.a.Children.toArray(a.props.children)[t];a.setState({activeChildIndex:t}),n.props.onFocus&&n.props.onFocus(e)}},c=i,r(a,c)}return i(t,e),l(t,[{key:"componentDidUpdate",value:function(e,t){this.state.activeChildIndex!==t.activeChildIndex&&this.setFocus(this.state.activeChildIndex)}},{key:"componentWillReceiveProps",value:function(e){if(0!==this.state.activeChildIndex){var t=e.children?s.a.Children.count(e.children):0;0===t?this.setState({activeChildIndex:0}):this.state.activeChildIndex>=t&&this.setState({activeChildIndex:t-1})}}},{key:"setFocus",value:function(e){var t=(this.refs.wrapper instanceof HTMLElement?this.refs.wrapper:n.i(c.findDOMNode)(this.refs.wrapper)).children[e];t&&t.hasAttribute("data-skip")?this.moveFocus(t.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1):t&&document.activeElement!==t&&t.focus()}},{key:"moveFocus",value:function(e){var t=this.props.children?s.a.Children.count(this.props.children):0,n=this.state.activeChildIndex+e;n>=t?n=0:n<0&&(n=t-1),this.setState({activeChildIndex:n})}},{key:"children",value:function(){var e=this;return s.a.Children.map(this.props.children,function(t,n){return s.a.cloneElement(t,{"data-focus-index":n,"data-skip":parseInt(t.props.tabIndex,10)===-1||void 0,key:t.key||n,tabIndex:e.state.activeChildIndex===n?0:-1})})}},{key:"render",value:function(){return s.a.createElement(this.props.component,d({},n.i(p.a)(this.props,t.internalKeys),{ref:"wrapper",onFocus:this.handleFocus,onKeyDown:this.handleKeyDown}),this.children())}}]),t}(s.a.PureComponent);f.mode={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL",BOTH:"BOTH"},f.propTypes={component:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.func]),defaultActiveChildIndex:a.PropTypes.number,mode:a.PropTypes.oneOf([f.mode.BOTH,f.mode.HORIZONTAL,f.mode.VERTICAL])},f.defaultProps={component:"div",defaultActiveChildIndex:0,mode:f.mode.BOTH},f.internalKeys=Object.keys(f.defaultProps),t.default=f}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIDhkNGI1YmU1YTMzNGY4Y2U0Mzk3Iiwid2VicGFjazovLy8uL3BhY2thZ2VzL2JvdW5kbGVzcy11dGlscy1pcy1mdW5jdGlvbi9pbmRleC5qcyIsIndlYnBhY2s6Ly8vLi9wYWNrYWdlcy9ib3VuZGxlc3MtdXRpbHMtb21pdC1rZXl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uIGV4dGVuZHMgUmVhY3QuUHVyZUNvbXBvbmVudCB7XG4gICAgc3RhdGljIG1vZGUgPSB7XG4gICAgICAgIEhPUklaT05UQUw6ICdIT1JJWk9OVEFMJyxcbiAgICAgICAgVkVSVElDQUw6ICdWRVJUSUNBTCcsXG4gICAgICAgIEJPVEg6ICdCT1RIJyxcbiAgICB9XG5cbiAgICBzdGF0aWMgcHJvcFR5cGVzID0ge1xuICAgICAgICAvKipcbiAgICAgICAgICAgIEFueSB2YWxpZCBIVE1MIHRhZyBuYW1lIG9yIGEgUmVhY3QgY29tcG9uZW50IGZhY3RvcnksIGFueXRoaW5nIHRoYXQgY2FuIGJlIHBhc3NlZCBhcyB0aGUgZmlyc3QgYXJndW1lbnQgdG8gYFJlYWN0LmNyZWF0ZUVsZW1lbnRgXG4gICAgICAgICovXG4gICAgICAgIGNvbXBvbmVudDogUHJvcFR5cGVzLm9uZU9mVHlwZShbXG4gICAgICAgICAgICBQcm9wVHlwZXMuc3RyaW5nLFxuICAgICAgICAgICAgUHJvcFR5cGVzLmZ1bmMsXG4gICAgICAgIF0pLFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgICAgQWxsb3dzIGZvciBhIHBhcnRpY3VsYXIgY2hpbGQgdG8gYmUgaW5pdGlhbGx5IHJlYWNoYWJsZSB2aWEgdGFiYmluZ1xuICAgICAgICAqL1xuICAgICAgICBkZWZhdWx0QWN0aXZlQ2hpbGRJbmRleDogUHJvcFR5cGVzLm51bWJlcixcblxuICAgICAgICAvKipcbiAgICAgICAgICogY29udHJvbHMgd2hpY2ggYXJyb3cga2V5IGV2ZW50cyBhcmUgY2FwdHVyZWQgdG8gbW92ZSBhY3RpdmUgZm9jdXMgd2l0aGluIHRoZSBsaXN0OlxuICAgICAgICAgKlxuICAgICAgICAgKiBNb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBLZXlzXG4gICAgICAgICAqIC0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8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AgICAgIG5leHRJbmRleCA9IG51bUNoaWxkcmVuIC0gMTsgLy8gcmV2ZXJzZSBsb29wXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNldFN0YXRlKHthY3RpdmVDaGlsZEluZGV4OiBuZXh0SW5kZXh9KTtcbiAgICB9XG5cbiAgICBoYW5kbGVLZXlEb3duID0gKGV2ZW50KSA9PiB7XG4gICAgICAgIHN3aXRjaCAoZXZlbnQua2V5KSB7XG4gICAgICAgIGNhc2UgJ0Fycm93VXAnOlxuICAgICAgICAgICAgaWYgKHRoaXMucHJvcHMubW9kZSA9PT0gQXJyb3dLZXlOYXZpZ2F0aW9uLm1vZGUuVkVSVElDQUxcbiAgICAgICAgICAgICAgICB8fCB0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEgpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRoaXMubW92ZUZvY3VzKC0xKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dMZWZ0JzpcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkhPUklaT05UQUxcbiAgICAgICAgICAgICAgICB8fCB0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEgpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRoaXMubW92ZUZvY3VzKC0xKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dEb3duJzpcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLlZFUlRJQ0FMXG4gICAgICAgICAgICAgICAgfHwgdGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5CT1RIKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB0aGlzLm1vdmVGb2N1cygxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dSaWdodCc6XG4gICAgICAgICAgICBpZiAodGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5IT1JJWk9OVEFMXG4gICAgICAgICAgICAgICAgfHwgdGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5CT1RIKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB0aGlzLm1vdmVGb2N1cygxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaXNGdW5jdGlvbih0aGlzLnByb3BzLm9uS2V5RG93bikpIHtcbiAgICAgICAgICAgIHRoaXMucHJvcHMub25LZXlEb3duKGV2ZW50KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGhhbmRsZUZvY3VzID0gKGV2ZW50KSA9PiB7XG4gICAgICAgIGlmIChldmVudC50YXJnZXQuaGFzQXR0cmlidXRlKCdkYXRhLWZvY3VzLWluZGV4JykpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gcGFyc2VJbnQoZXZlbnQudGFyZ2V0LmdldEF0dHJpYnV0ZSgnZGF0YS1mb2N1cy1pbmRleCcpLCAxMCk7XG4gICAgICAgICAgICBjb25zdCBjaGlsZCA9IFJlYWN0LkNoaWxkcmVuLnRvQXJyYXkodGhpcy5wcm9wcy5jaGlsZHJlbilbaW5kZXhdO1xuXG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHthY3RpdmVDaGlsZEluZGV4OiBpbmRleH0pO1xuXG4gICAgICAgICAgICBpZiAoY2hpbGQucHJvcHMub25Gb2N1cykge1xuICAgICAgICAgICAgICAgIGNoaWxkLnByb3BzLm9uRm9jdXMoZXZlbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgY2hpbGRyZW4oKSB7XG4gICAgICAgIHJldHVybiBSZWFjdC5DaGlsZHJlbi5tYXAodGhpcy5wcm9wcy5jaGlsZHJlbiwgKGNoaWxkLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIFJlYWN0LmNsb25lRWxlbWVudChjaGlsZCwge1xuICAgICAgICAgICAgICAgICdkYXRhLWZvY3VzLWluZGV4JzogaW5kZXgsXG4gICAgICAgICAgICAgICAgJ2RhdGEtc2tpcCc6IHBhcnNlSW50KGNoaWxkLnByb3BzLnRhYkluZGV4LCAxMCkgPT09IC0xIHx8IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICBrZXk6IGNoaWxkLmtleSB8fCBpbmRleCxcbiAgICAgICAgICAgICAgICB0YWJJbmRleDogdGhpcy5zdGF0ZS5hY3RpdmVDaGlsZEluZGV4ID09PSBpbmRleCA/IDAgOiAtMSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8dGhpcy5wcm9wcy5jb21wb25lbnRcbiAgICAgICAgICAgICAgICB7Li4ub21pdCh0aGlzLnByb3BzLCBBcnJvd0tleU5hdmlnYXRpb24uaW50ZXJuYWxLZXlzKX1cbiAgICAgICAgICAgICAgICByZWY9J3dyYXBwZXInXG4gICAgICAgICAgICAgICAgb25Gb2N1cz17dGhpcy5oYW5kbGVGb2N1c31cbiAgICAgICAgICAgICAgICBvbktleURvd249e3RoaXMuaGFuZGxlS2V5RG93bn0+XG4gICAgICAgICAgICAgICAge3RoaXMuY2hpbGRyZW4oKX1cbiAgICAgICAgICAgIDwvdGhpcy5wcm9wcy5jb21wb25lbnQ+XG4gICAgICAgICk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWFycm93LWtleS1uYXZpZ2F0aW9uL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==
module.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).reduce(function(n,o){return t.indexOf(o)===-1&&(n[o]=e[o]),n},{})}t.a=o},function(e,t,n){"use strict";function o(){return"b-"+([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^16*Math.random()>>e/4).toString(16)})}t.a=o},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-dom")},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 i(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 a=n(2),c=n.n(a),s=n(3),u=(n.n(s),n(0)),p=n(1),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=function(e){function t(){var e,n,i,a;o(this,t);for(var s=arguments.length,u=Array(s),p=0;p<s;p++)u[p]=arguments[p];return n=i=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={activeChildIndex:i.props.defaultActiveChildIndex},i.handleKeyDown=function(e){switch(e.key){case"ArrowUp":i.props.mode!==t.mode.VERTICAL&&i.props.mode!==t.mode.BOTH||(e.preventDefault(),i.moveFocus(-1));break;case"ArrowLeft":i.props.mode!==t.mode.HORIZONTAL&&i.props.mode!==t.mode.BOTH||(e.preventDefault(),i.moveFocus(-1));break;case"ArrowDown":i.props.mode!==t.mode.VERTICAL&&i.props.mode!==t.mode.BOTH||(e.preventDefault(),i.moveFocus(1));break;case"ArrowRight":i.props.mode!==t.mode.HORIZONTAL&&i.props.mode!==t.mode.BOTH||(e.preventDefault(),i.moveFocus(1))}i.props.onKeyDown&&i.props.onKeyDown(e)},i.handleFocus=function(e){if(e.target.hasAttribute("data-focus-index")){var t=parseInt(e.target.getAttribute("data-focus-index"),10),n=c.a.Children.toArray(i.props.children)[t];i.setState({activeChildIndex:t}),n.props.onFocus&&n.props.onFocus(e)}},a=n,r(i,a)}return i(t,e),l(t,[{key:"componentDidUpdate",value:function(e,t){this.state.activeChildIndex!==t.activeChildIndex&&this.setFocus(this.state.activeChildIndex)}},{key:"componentWillReceiveProps",value:function(e){if(0!==this.state.activeChildIndex){var t=e.children?c.a.Children.count(e.children):0;0===t?this.setState({activeChildIndex:0}):this.state.activeChildIndex>=t&&this.setState({activeChildIndex:t-1})}}},{key:"setFocus",value:function(e){var t=(this.refs.wrapper instanceof HTMLElement?this.refs.wrapper:n.i(s.findDOMNode)(this.refs.wrapper)).children[e];t&&t.hasAttribute("data-skip")?this.moveFocus(t.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1):t&&document.activeElement!==t&&t.focus()}},{key:"moveFocus",value:function(e){var t=this.props.children?c.a.Children.count(this.props.children):0,n=this.state.activeChildIndex+e;n>=t?n=0:n<0&&(n=t-1),this.setState({activeChildIndex:n})}},{key:"children",value:function(){var e=this;return c.a.Children.map(this.props.children,function(t,n){return c.a.cloneElement(t,{"data-focus-index":n,"data-skip":parseInt(t.props.tabIndex,10)===-1||void 0,key:t.key||n,tabIndex:e.state.activeChildIndex===n?0:-1})})}},{key:"render",value:function(){return c.a.createElement(this.props.component,d({},n.i(u.a)(this.props,t.internalKeys),{ref:"wrapper",onFocus:this.handleFocus,onKeyDown:this.handleKeyDown}),this.children())}}]),t}(c.a.PureComponent);f.mode={HORIZONTAL:n.i(p.a)(),VERTICAL:n.i(p.a)(),BOTH:n.i(p.a)()},f.propTypes={component:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.func]),defaultActiveChildIndex:a.PropTypes.number,mode:a.PropTypes.oneOf([f.mode.BOTH,f.mode.HORIZONTAL,f.mode.VERTICAL])},f.defaultProps={component:"div",defaultActiveChildIndex:0,mode:f.mode.BOTH,onKeyDown:function(){}},f.internalKeys=Object.keys(f.defaultProps),t.default=f}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIDIyMTQwMjVlZmNjNGNiZWI2ZDQxIiwid2VicGFjazovLy8uL3BhY2thZ2VzL2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2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBLZXlzXG4gICAgICAgICAqIC0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IC0tLS1cbiAgICAgICAgICogYEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEhgICAgICAgIHwg4qyF77iPIOKeoe+4jyDirIbvuI8g4qyH77iPXG4gICAgICAgICAqIGBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5IT1JJWk9OVEFMYCB8IOKshe+4jyDinqHvuI9cbiAgICAgICAgICogYEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLlZFUlRJQ0FMYCAgIHwg4qyG77iPIOKsh++4j1xuICAgICAgICAgKlxuICAgICAgICAgKiBfTm90ZTogZm9jdXMgbG9vcHMgd2hlbiBhcnJvd2luZyBwYXN0IG9uZSBvZiB0aGUgYm91bmRhcmllczsgdGFiYmluZyBtb3ZlcyB0aGUgdXNlciBhd2F5IGZyb20gdGhlIGxpc3QuX1xuICAgICAgICAqL1xuICAgICAgICBtb2RlOiBQcm9wVHlwZXMub25lT2YoW1xuICAgICAgICAgICAgQXJyb3dLZXlOYXZpZ2F0aW9uLm1vZGUuQk9USCxcbiAgICAgICAgICAgIEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkhPUklaT05UQUwsXG4gICAgICAgICAgICBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5WRVJUSUNBTCxcbiAgICAgICAgXSksXG4gICAgfVxuXG4gICAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICAgICAgY29tcG9uZW50OiAnZGl2JyxcbiAgICAgICAgZGVmYXVsdEFjdGl2ZUNoaWxkSW5kZXg6IDAsXG4gICAgICAgIG1vZGU6IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEgsXG4gICAgICAgIG9uS2V5RG93bjogKCkgPT4ge30sXG4gICAgfVxuXG4gICAgc3RhdGljIGludGVybmFsS2V5cyA9IE9iamVjdC5r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gaWYgKG5leHRJbmRleCA+PSBudW1DaGlsZHJlbikge1xuICAgICAgICAgICAgbmV4dEluZGV4ID0gMDsgLy8gbG9vcFxuICAgICAgICB9IGVsc2UgaWYgKG5leHRJbmRleCA8IDApIHtcbiAgICAgICAgICAgIG5leHRJbmRleCA9IG51bUNoaWxkcmVuIC0gMTsgLy8gcmV2ZXJzZSBsb29wXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNldFN0YXRlKHthY3RpdmVDaGlsZEluZGV4OiBuZXh0SW5kZXh9KTtcbiAgICB9XG5cbiAgICBoYW5kbGVLZXlEb3duID0gKGV2ZW50KSA9PiB7XG4gICAgICAgIHN3aXRjaCAoZXZlbnQua2V5KSB7XG4gICAgICAgIGNhc2UgJ0Fycm93VXAnOlxuICAgICAgICAgICAgaWYgKHRoaXMucHJvcHMubW9kZSA9PT0gQXJyb3dLZXlOYXZpZ2F0aW9uLm1vZGUuVkVSVElDQUxcbiAgICAgICAgICAgICAgICB8fCB0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEgpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRoaXMubW92ZUZvY3VzKC0xKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dMZWZ0JzpcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkhPUklaT05UQUxcbiAgICAgICAgICAgICAgICB8fCB0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLkJPVEgpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHRoaXMubW92ZUZvY3VzKC0xKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dEb3duJzpcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3BzLm1vZGUgPT09IEFycm93S2V5TmF2aWdhdGlvbi5tb2RlLlZFUlRJQ0FMXG4gICAgICAgICAgICAgICAgfHwgdGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5CT1RIKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB0aGlzLm1vdmVGb2N1cygxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQXJyb3dSaWdodCc6XG4gICAgICAgICAgICBpZiAodGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5IT1JJWk9OVEFMXG4gICAgICAgICAgICAgICAgfHwgdGhpcy5wcm9wcy5tb2RlID09PSBBcnJvd0tleU5hdmlnYXRpb24ubW9kZS5CT1RIKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB0aGlzLm1vdmVGb2N1cygxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5wcm9wcy5vbktleURvd24pIHtcbiAgICAgICAgICAgIHRoaXMucHJvcHMub25LZXlEb3duKGV2ZW50KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGhhbmRsZUZvY3VzID0gKGV2ZW50KSA9PiB7XG4gICAgICAgIGlmIChldmVudC50YXJnZXQuaGFzQXR0cmlidXRlKCdkYXRhLWZvY3VzLWluZGV4JykpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gcGFyc2VJbnQoZXZlbnQudGFyZ2V0LmdldEF0dHJpYnV0ZSgnZGF0YS1mb2N1cy1pbmRleCcpLCAxMCk7XG4gICAgICAgICAgICBjb25zdCBjaGlsZCA9IFJlYWN0LkNoaWxkcmVuLnRvQXJyYXkodGhpcy5wcm9wcy5jaGlsZHJlbilbaW5kZXhdO1xuXG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHthY3RpdmVDaGlsZEluZGV4OiBpbmRleH0pO1xuXG4gICAgICAgICAgICBpZiAoY2hpbGQucHJvcHMub25Gb2N1cykge1xuICAgICAgICAgICAgICAgIGNoaWxkLnByb3BzLm9uRm9jdXMoZXZlbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgY2hpbGRyZW4oKSB7XG4gICAgICAgIHJldHVybiBSZWFjdC5DaGlsZHJlbi5tYXAodGhpcy5wcm9wcy5jaGlsZHJlbiwgKGNoaWxkLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIFJlYWN0LmNsb25lRWxlbWVudChjaGlsZCwge1xuICAgICAgICAgICAgICAgICdkYXRhLWZvY3VzLWluZGV4JzogaW5kZXgsXG4gICAgICAgICAgICAgICAgJ2RhdGEtc2tpcCc6IHBhcnNlSW50KGNoaWxkLnByb3BzLnRhYkluZGV4LCAxMCkgPT09IC0xIHx8IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICBrZXk6IGNoaWxkLmtleSB8fCBpbmRleCxcbiAgICAgICAgICAgICAgICB0YWJJbmRleDogdGhpcy5zdGF0ZS5hY3RpdmVDaGlsZEluZGV4ID09PSBpbmRleCA/IDAgOiAtMSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8dGhpcy5wcm9wcy5jb21wb25lbnRcbiAgICAgICAgICAgICAgICB7Li4ub21pdCh0aGlzLnByb3BzLCBBcnJvd0tleU5hdmlnYXRpb24uaW50ZXJuYWxLZXlzKX1cbiAgICAgICAgICAgICAgICByZWY9J3dyYXBwZXInXG4gICAgICAgICAgICAgICAgb25Gb2N1cz17dGhpcy5oYW5kbGVGb2N1c31cbiAgICAgICAgICAgICAgICBvbktleURvd249e3RoaXMuaGFuZGxlS2V5RG93bn0+XG4gICAgICAgICAgICAgICAge3RoaXMuY2hpbGRyZW4oKX1cbiAgICAgICAgICAgIDwvdGhpcy5wcm9wcy5jb21wb25lbnQ+XG4gICAgICAgICk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWFycm93LWtleS1uYXZpZ2F0aW9uL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==
import React, {PropTypes} from 'react';
import {findDOMNode} from 'react-dom';
import isFunction from '../boundless-utils-is-function/index';
import omit from '../boundless-utils-omit-keys/index';
import omit from 'boundless-utils-omit-keys';
import uuid from 'boundless-utils-uuid';

@@ -19,5 +19,5 @@ /**

static mode = {
HORIZONTAL: 'HORIZONTAL',
VERTICAL: 'VERTICAL',
BOTH: 'BOTH',
HORIZONTAL: uuid(),
VERTICAL: uuid(),
BOTH: uuid(),
}

@@ -61,2 +61,3 @@

mode: ArrowKeyNavigation.mode.BOTH,
onKeyDown: () => {},
}

@@ -161,3 +162,3 @@

if (isFunction(this.props.onKeyDown)) {
if (this.props.onKeyDown) {
this.props.onKeyDown(event);

@@ -164,0 +165,0 @@ }

{
"name": "boundless-arrow-key-navigation",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"description": "A higher-order component for arrow key navigation on a grouping of children.",
"browser": "build/index.js",
"main": "build/index.js",
"module": "index.js",
"repository": {

@@ -26,5 +27,5 @@ "type": "git",

"homepage": "https://github.com/enigma-io/boundless#readme",
"devDependencies": {
"boundless-utils-is-function": "^1.0.0",
"boundless-utils-omit-keys": "^1.0.0-beta.3"
"dependencies": {
"boundless-utils-omit-keys": "^1.0.0-beta.6",
"boundless-utils-uuid": "^1.0.0-beta.5"
},

@@ -31,0 +32,0 @@ "peerDependencies": {

@@ -64,1 +64,2 @@ THIS IS AN AUTOGENERATED FILE. EDIT INDEX.JS INSTEAD.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc