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

@blueprintjs/select

Package Overview
Dependencies
Maintainers
1
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/select - npm Package Compare versions

Comparing version 3.12.2 to 3.12.3

2

dist/select.bundle.js

@@ -32,2 +32,2 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("tslib"),require("react"),require("classnames")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","tslib","react","classnames"],t):"object"==typeof exports?exports.Select=t(require("@blueprintjs/core"),require("tslib"),require("react"),require("classnames")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Select=t(e.Blueprint.Core,e.window,e.React,e.classNames))}(window,(function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";n.r(t),n.d(t,"Classes",(function(){return r})),n.d(t,"renderFilteredItems",(function(){return m})),n.d(t,"executeItemsEqual",(function(){return f})),n.d(t,"getCreateNewItem",(function(){return v})),n.d(t,"isCreateNewItem",(function(){return h})),n.d(t,"getActiveItem",(function(){return I})),n.d(t,"Omnibar",(function(){return S})),n.d(t,"QueryList",(function(){return C})),n.d(t,"getFirstEnabledItem",(function(){return L})),n.d(t,"MultiSelect",(function(){return A})),n.d(t,"Select",(function(){return U})),n.d(t,"Suggest",(function(){return w}));var r={};n.r(r),n.d(r,"MULTISELECT",(function(){return o})),n.d(r,"MULTISELECT_POPOVER",(function(){return p})),n.d(r,"MULTISELECT_TAG_INPUT_INPUT",(function(){return a})),n.d(r,"OMNIBAR",(function(){return u})),n.d(r,"OMNIBAR_OVERLAY",(function(){return l})),n.d(r,"SELECT",(function(){return c})),n.d(r,"SELECT_POPOVER",(function(){return d}));var s=n(0),i=s.Classes.getClassNamespace(),o=i+"-multi-select",p=o+"-popover",a=o+"-tag-input-input",u=i+"-omnibar",l=u+"-overlay",c=i+"-select",d=c+"-popover";

* limitations under the License.
*/function v(){return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"}}function h(e){if(null==e)return!1;var t=Object.keys(e);return 1===t.length&&"__blueprintCreateNewItemBrand"===t[0]&&"blueprint-create-new-item"===e.__blueprintCreateNewItemBrand}function I(e){return null==e||h(e)?null:e}var y=n(1),O=n(3),P=n.n(O),g=n(2),C=function(e){function t(t,n){var r,i=e.call(this,t,n)||this;i.refHandlers={itemsParent:function(e){return i.itemsParentRef=e}},i.shouldCheckActiveItemInViewport=!1,i.expectedNextActiveItem=null,i.renderItemList=function(e){var t=i.props,n=t.initialContent,r=t.noResults,o=m(e,i.isCreateItemRendered()?null:r,n),p=i.isCreateItemRendered()?i.renderCreateItemMenuItem(i.state.query.trim()):null;return null==o&&null==p?null:g.createElement(s.Menu,{ulRef:e.itemsParentRef},o,p)},i.renderItem=function(e,t){if(!0!==i.props.disabled){var n=i.state,r=n.activeItem,s=n.query,o=i.state.filteredItems.indexOf(e)>=0,p={active:f(i.props.itemsEqual,I(r),e),disabled:T(e,t,i.props.itemDisabled),matchesPredicate:o};return i.props.itemRenderer(e,{handleClick:function(t){return i.handleItemSelect(e,t)},index:t,modifiers:p,query:s})}return null},i.renderCreateItemMenuItem=function(e){var t=h(i.state.activeItem);return s.Utils.safeInvoke(i.props.createNewItemRenderer,e,t,(function(t){i.handleItemCreate(e,t)}))},i.handleItemCreate=function(e,t){var n=s.Utils.safeInvoke(i.props.createNewItemFromQuery,e);null!=n&&(s.Utils.safeInvoke(i.props.onItemSelect,n,t),i.setQuery("",!0))},i.handleItemSelect=function(e,t){i.setActiveItem(e),s.Utils.safeInvoke(i.props.onItemSelect,e,t),i.props.resetOnSelect&&i.setQuery("",!0)},i.handlePaste=function(e){for(var t,n=i.props,r=n.createNewItemFromQuery,o=n.onItemsPaste,p=[],a=[],u=0,l=e;u<l.length;u++){var c=l[u],d=b(c,i.props);if(void 0!==d)t=d,a.push(d);else if(i.canCreateItems()){var m=s.Utils.safeInvoke(r,c);void 0!==m&&a.push(m)}else p.push(c)}i.setQuery(p.join(", "),!1),void 0!==t&&i.setActiveItem(t),s.Utils.safeInvoke(o,a)},i.handleKeyDown=function(e){var t=e.keyCode;if(t===s.Keys.ARROW_UP||t===s.Keys.ARROW_DOWN){e.preventDefault();var n=i.getNextActiveItem(t===s.Keys.ARROW_UP?-1:1);null!=n&&i.setActiveItem(n)}s.Utils.safeInvoke(i.props.onKeyDown,e)},i.handleKeyUp=function(e){var t=i.props.onKeyUp,n=i.state.activeItem;e.keyCode===s.Keys.ENTER&&(e.preventDefault(),null==n||h(n)?i.handleItemCreate(i.state.query,e):i.handleItemSelect(n,e)),s.Utils.safeInvoke(t,e)},i.handleInputQueryChange=function(e){var t=null==e?"":e.target.value;i.setQuery(t),s.Utils.safeInvoke(i.props.onQueryChange,t,e)};var o=t.query,p=void 0===o?"":o,a=s.Utils.safeInvoke(t.createNewItemFromQuery,p),u=E(p,t);return i.state={activeItem:void 0!==t.activeItem?t.activeItem:(r=t.initialActiveItem,null!=r?r:L(u,t.itemDisabled)),createNewItem:a,filteredItems:u,query:p},i}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=e.className,n=e.items,r=e.renderer,s=e.itemListRenderer,i=void 0===s?this.renderItemList:s,o=this.state,p=(o.createNewItem,Object(y.__rest)(o,["createNewItem"]));return r(Object(y.__assign)(Object(y.__assign)({},p),{className:t,handleItemSelect:this.handleItemSelect,handleKeyDown:this.handleKeyDown,handleKeyUp:this.handleKeyUp,handlePaste:this.handlePaste,handleQueryChange:this.handleInputQueryChange,itemList:i(Object(y.__assign)(Object(y.__assign)({},p),{items:n,itemsParentRef:this.refHandlers.itemsParent,renderItem:this.renderItem}))}))},t.prototype.componentDidUpdate=function(e){var t=this;void 0!==this.props.activeItem&&this.props.activeItem!==this.state.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:this.props.activeItem})),null!=this.props.query&&this.props.query!==e.query?this.setQuery(this.props.query,this.props.resetOnQuery,this.props):s.Utils.shallowCompareKeys(this.props,e,{include:["items","itemListPredicate","itemPredicate"]})||this.setQuery(this.state.query),this.shouldCheckActiveItemInViewport&&(requestAnimationFrame((function(){return t.scrollActiveItemIntoView()})),this.shouldCheckActiveItemInViewport=!1)},t.prototype.scrollActiveItemIntoView=function(){var e=!1!==this.props.scrollToActiveItem,t=!f(this.props.itemsEqual,I(this.expectedNextActiveItem),I(this.props.activeItem));if(this.expectedNextActiveItem=null,e||!t){var n=this.getActiveElement();if(null!=this.itemsParentRef&&null!=n){var r=n.offsetTop,s=n.offsetHeight,i=this.itemsParentRef,o=i.offsetTop,p=i.scrollTop,a=i.clientHeight,u=this.getItemsParentPadding(),l=u.paddingTop,c=r+s+u.paddingBottom-o,d=r-l-o;c>=p+a?this.itemsParentRef.scrollTop=c+s-a:d<=p&&(this.itemsParentRef.scrollTop=d-s)}}},t.prototype.setQuery=function(e,t,n){void 0===t&&(t=this.props.resetOnQuery),void 0===n&&(n=this.props);var r=n.createNewItemFromQuery;this.shouldCheckActiveItemInViewport=!0,e!==this.state.query&&s.Utils.safeInvoke(n.onQueryChange,e);var i=e.trim(),o=E(i,n),p=null!=r&&""!==i?r(i):void 0;this.setState({createNewItem:p,filteredItems:o,query:e});var a=this.getActiveIndex(o);(t||a<0||T(I(this.state.activeItem),a,n.itemDisabled))&&this.setActiveItem(L(o,n.itemDisabled))},t.prototype.setActiveItem=function(e){this.expectedNextActiveItem=e,void 0===this.props.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:e})),h(e)?s.Utils.safeInvoke(this.props.onActiveItemChange,null,!0):s.Utils.safeInvoke(this.props.onActiveItemChange,e,!1)},t.prototype.getActiveElement=function(){var e=this.state.activeItem;if(null!=this.itemsParentRef){if(h(e))return this.itemsParentRef.children.item(this.state.filteredItems.length);var t=this.getActiveIndex();return this.itemsParentRef.children.item(t)}},t.prototype.getActiveIndex=function(e){void 0===e&&(e=this.state.filteredItems);var t=this.state.activeItem;if(null==t||h(t))return-1;for(var n=0;n<e.length;++n)if(f(this.props.itemsEqual,e[n],t))return n;return-1},t.prototype.getItemsParentPadding=function(){var e=getComputedStyle(this.itemsParentRef),t=e.paddingTop;return{paddingBottom:_(e.paddingBottom),paddingTop:_(t)}},t.prototype.getNextActiveItem=function(e,t){if((void 0===t&&(t=this.getActiveIndex()),this.isCreateItemRendered())&&(0===t&&-1===e||t===this.state.filteredItems.length-1&&1===e))return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"};return L(this.state.filteredItems,this.props.itemDisabled,e,t)},t.prototype.isCreateItemRendered=function(){return this.canCreateItems()&&""!==this.state.query&&!this.wouldCreatedItemMatchSomeExistingItem()},t.prototype.canCreateItems=function(){return null!=this.props.createNewItemFromQuery&&null!=this.props.createNewItemRenderer},t.prototype.wouldCreatedItemMatchSomeExistingItem=function(){var e=this;return this.state.filteredItems.some((function(t){return f(e.props.itemsEqual,t,e.state.createNewItem)}))},t.displayName=s.DISPLAYNAME_PREFIX+".QueryList",t.defaultProps={disabled:!1,resetOnQuery:!0},t}(s.AbstractComponent2);function _(e){return null==e?0:parseInt(e.slice(0,-2),10)}function b(e,t){var n=t.items,r=t.itemPredicate;if(s.Utils.isFunction(r))for(var i=0;i<n.length;i++){var o=n[i];if(r(e,o,i,!0))return o}}function E(e,t){var n=t.items,r=t.itemPredicate,i=t.itemListPredicate;return s.Utils.isFunction(i)?i(e,n):s.Utils.isFunction(r)?n.filter((function(t,n){return r(e,t,n)})):n}function T(e,t,n){return null!=n&&null!=e&&(s.Utils.isFunction(n)?n(e,t):!!e[n])}function L(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r=e.length-1),0===e.length)return null;var s,i,o,p=r,a=e.length-1;do{if(o=a,!T(e[p=(s=p+n)<(i=0)?o:s>o?i:s],p,t))return e[p]}while(p!==r&&-1!==r);return null}var S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.TypedQueryList=C.ofType(),t.renderQueryList=function(e){var n=t.props,i=n.inputProps,o=void 0===i?{}:i,p=n.isOpen,a=n.overlayProps,u=void 0===a?{}:a,l=e.handleKeyDown,c=e.handleKeyUp,d=p?{onKeyDown:l,onKeyUp:c}:{};return g.createElement(s.Overlay,Object(y.__assign)({hasBackdrop:!0},u,{isOpen:p,className:P()(r.OMNIBAR_OVERLAY,u.className),onClose:t.handleOverlayClose}),g.createElement("div",Object(y.__assign)({className:P()(r.OMNIBAR,e.className)},d),g.createElement(s.InputGroup,Object(y.__assign)({autoFocus:!0,large:!0,leftIcon:"search",placeholder:"Search..."},o,{onChange:e.handleQueryChange,value:e.query})),e.itemList))},t.handleOverlayClose=function(e){s.Utils.safeInvokeMember(t.props.overlayProps,"onClose",e),s.Utils.safeInvoke(t.props.onClose,e)},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=e.initialContent,n=void 0===t?null:t,r=(e.isOpen,e.inputProps,e.overlayProps,Object(y.__rest)(e,["initialContent","isOpen","inputProps","overlayProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},r,{initialContent:n,renderer:this.renderQueryList}))},t.displayName=s.DISPLAYNAME_PREFIX+".Omnibar",t}(g.PureComponent),A=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:t.props.popoverProps&&t.props.popoverProps.isOpen||!1},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.tagInputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n,i=t.props,o=i.fill,p=i.tagInputProps,a=void 0===p?{}:p,u=i.popoverProps,l=void 0===u?{}:u,c=i.selectedItems,d=void 0===c?[]:c,m=i.placeholder,f=e.handlePaste,v=e.handleKeyDown,h=e.handleKeyUp;o&&(l.fill=!0,a.fill=!0);var I=Object(y.__assign)(Object(y.__assign)({},a.inputProps),{className:P()(null===(n=a.inputProps)||void 0===n?void 0:n.className,r.MULTISELECT_TAG_INPUT_INPUT)});return g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,canEscapeKeyClose:!0,enforceFocus:!1,isOpen:t.state.isOpen,position:s.Position.BOTTOM_LEFT},l,{className:P()(e.className,l.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.MULTISELECT_POPOVER,l.popoverClassName),onOpened:t.handlePopoverOpened}),g.createElement("div",{onKeyDown:t.getTagInputKeyDownHandler(v),onKeyUp:t.getTagInputKeyUpHandler(h)},g.createElement(s.TagInput,Object(y.__assign)({placeholder:m},a,{className:P()(r.MULTISELECT,a.className),inputRef:t.refHandlers.input,inputProps:I,inputValue:e.query,onAdd:function(e,t){"paste"===t&&f(e)},onInputChange:e.handleQueryChange,values:d.map(t.props.tagRenderer)}))),g.createElement("div",{onKeyDown:v,onKeyUp:h},e.itemList))},t.handleItemSelect=function(e,n){null!=t.input&&t.input.focus(),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handleQueryChange=function(e,n){t.setState({isOpen:e.length>0||!t.props.openOnKeyDown}),s.Utils.safeInvoke(t.props.onQueryChange,e,n)},t.handlePopoverInteraction=function(e){return requestAnimationFrame((function(){null!=t.input&&t.input!==document.activeElement?t.setState({isOpen:!1}):t.props.openOnKeyDown||t.setState({isOpen:!0}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)}))},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.getTagInputKeyDownHandler=function(e){return function(n){var r=n.which;r===s.Keys.ESCAPE||r===s.Keys.TAB?(null!=t.input&&t.input.blur(),t.setState({isOpen:!1})):r!==s.Keys.BACKSPACE&&r!==s.Keys.ARROW_LEFT&&r!==s.Keys.ARROW_RIGHT&&t.setState({isOpen:!0});var i=null!=n.target.closest("."+s.Classes.TAG_REMOVE);t.state.isOpen&&!i&&s.Utils.safeInvoke(e,n)}},t.getTagInputKeyUpHandler=function(e){return function(n){var i=n.target.classList.contains(r.MULTISELECT_TAG_INPUT_INPUT);t.state.isOpen&&i&&s.Utils.safeInvoke(e,n)}},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=(e.openOnKeyDown,e.popoverProps,e.tagInputProps,Object(y.__rest)(e,["openOnKeyDown","popoverProps","tagInputProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},t,{onItemSelect:this.handleItemSelect,onQueryChange:this.handleQueryChange,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.displayName=s.DISPLAYNAME_PREFIX+".MultiSelect",t.defaultProps={fill:!1,placeholder:"Search..."},t}(g.PureComponent),U=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:!1},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.inputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n=t.props,i=n.filterable,o=void 0===i||i,p=n.disabled,a=void 0!==p&&p,u=n.inputProps,l=void 0===u?{}:u,c=n.popoverProps,d=void 0===c?{}:c,m=g.createElement(s.InputGroup,Object(y.__assign)({leftIcon:"search",placeholder:"Filter...",rightElement:t.maybeRenderClearButton(e.query)},l,{inputRef:t.refHandlers.input,onChange:e.handleQueryChange,value:e.query})),f=e.handleKeyDown,v=e.handleKeyUp;return g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,enforceFocus:!1,isOpen:t.state.isOpen,disabled:a,position:s.Position.BOTTOM_LEFT},d,{className:P()(e.className,d.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.SELECT_POPOVER,d.popoverClassName),onOpening:t.handlePopoverOpening,onOpened:t.handlePopoverOpened,onClosing:t.handlePopoverClosing}),g.createElement("div",{onKeyDown:t.state.isOpen?f:t.handleTargetKeyDown,onKeyUp:t.state.isOpen?v:void 0},t.props.children),g.createElement("div",{onKeyDown:f,onKeyUp:v},o?m:void 0,e.itemList))},t.handleTargetKeyDown=function(e){e.which!==s.Keys.ARROW_UP&&e.which!==s.Keys.ARROW_DOWN||(e.preventDefault(),t.setState({isOpen:!0}))},t.handleItemSelect=function(e,n){t.setState({isOpen:!1}),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handlePopoverInteraction=function(e){t.setState({isOpen:e}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)},t.handlePopoverOpening=function(e){t.previousFocusedElement=document.activeElement,t.props.resetOnClose&&t.resetQuery(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpening",e)},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),requestAnimationFrame((function(){var e=t.props.inputProps;!1!==(void 0===e?{}:e).autoFocus&&null!=t.input&&t.input.focus()})),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.handlePopoverClosing=function(e){requestAnimationFrame((function(){void 0!==t.previousFocusedElement&&(t.previousFocusedElement.focus(),t.previousFocusedElement=void 0)})),s.Utils.safeInvokeMember(t.props.popoverProps,"onClosing",e)},t.resetQuery=function(){return t.queryList&&t.queryList.setQuery("",!0)},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=(e.filterable,e.inputProps,e.popoverProps,Object(y.__rest)(e,["filterable","inputProps","popoverProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},t,{onItemSelect:this.handleItemSelect,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.prototype.componentDidUpdate=function(e,t){this.state.isOpen&&!t.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()},t.prototype.maybeRenderClearButton=function(e){return e.length>0?g.createElement(s.Button,{icon:"cross",minimal:!0,onClick:this.resetQuery}):void 0},t.displayName=s.DISPLAYNAME_PREFIX+".Select",t}(g.PureComponent),w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:null!=t.props.popoverProps&&t.props.popoverProps.isOpen||!1,selectedItem:t.getInitialSelectedItem()},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.inputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n=t.props,i=n.fill,o=n.inputProps,p=void 0===o?{}:o,a=n.popoverProps,u=void 0===a?{}:a,l=t.state,c=l.isOpen,d=l.selectedItem,m=e.handleKeyDown,f=e.handleKeyUp,v=p.autoComplete,h=void 0===v?"off":v,I=p.placeholder,O=void 0===I?"Search...":I,C=d?t.props.inputValueRenderer(d):"",_=c&&C?C:O,b=c?e.query:C||(t.props.resetOnClose?"":e.query);return i&&(u.fill=!0,p.fill=!0),g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,enforceFocus:!1,isOpen:c,position:s.Position.BOTTOM_LEFT},u,{className:P()(e.className,u.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.SELECT_POPOVER,u.popoverClassName),onOpening:t.handlePopoverOpening,onOpened:t.handlePopoverOpened}),g.createElement(s.InputGroup,Object(y.__assign)({autoComplete:h,disabled:t.props.disabled},p,{inputRef:t.refHandlers.input,onChange:e.handleQueryChange,onFocus:t.handleInputFocus,onKeyDown:t.getTargetKeyDownHandler(m),onKeyUp:t.getTargetKeyUpHandler(f),placeholder:_,value:b})),g.createElement("div",{onKeyDown:m,onKeyUp:f},e.itemList))},t.selectText=function(){requestAnimationFrame((function(){null!=t.input&&t.input.setSelectionRange(0,t.input.value.length)}))},t.handleInputFocus=function(e){t.selectText(),t.props.openOnKeyDown||t.setState({isOpen:!0}),s.Utils.safeInvokeMember(t.props.inputProps,"onFocus",e)},t.handleItemSelect=function(e,n){var r;t.props.closeOnSelect?(null!=t.input&&t.input.blur(),r=!1):(null!=t.input&&t.input.focus(),t.selectText(),r=!0),void 0===t.props.selectedItem?t.setState({isOpen:r,selectedItem:e}):t.setState({isOpen:r}),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handlePopoverInteraction=function(e){return requestAnimationFrame((function(){null!=t.input&&t.input!==document.activeElement&&t.setState({isOpen:!1}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)}))},t.handlePopoverOpening=function(e){t.props.resetOnClose&&t.queryList&&t.queryList.setQuery("",!0),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpening",e)},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.getTargetKeyDownHandler=function(e){return function(n){var r=n.which;r===s.Keys.ESCAPE||r===s.Keys.TAB?(null!=t.input&&t.input.blur(),t.setState({isOpen:!1})):t.props.openOnKeyDown&&r!==s.Keys.BACKSPACE&&r!==s.Keys.ARROW_LEFT&&r!==s.Keys.ARROW_RIGHT&&t.setState({isOpen:!0}),t.state.isOpen&&s.Utils.safeInvoke(e,n),s.Utils.safeInvokeMember(t.props.inputProps,"onKeyDown",n)}},t.getTargetKeyUpHandler=function(e){return function(n){t.state.isOpen&&s.Utils.safeInvoke(e,n),s.Utils.safeInvokeMember(t.props.inputProps,"onKeyUp",n)}},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e,t=this.props,n=(t.disabled,t.inputProps,t.popoverProps,Object(y.__rest)(t,["disabled","inputProps","popoverProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},n,{initialActiveItem:(e=this.props.selectedItem,null!=e?e:void 0),onItemSelect:this.handleItemSelect,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.prototype.componentDidUpdate=function(e,t){var n,r,i=this;void 0!==this.props.selectedItem&&this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem}),!1===this.state.isOpen&&!0===t.isOpen&&setTimeout((function(){i.maybeResetActiveItemToSelectedItem()}),null!=(r=null===(n=this.props.popoverProps)||void 0===n?void 0:n.transitionDuration)?r:s.Popover.defaultProps.transitionDuration),this.state.isOpen&&!t.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()},t.prototype.getInitialSelectedItem=function(){return void 0!==this.props.selectedItem?this.props.selectedItem:void 0!==this.props.defaultSelectedItem?this.props.defaultSelectedItem:null},t.prototype.maybeResetActiveItemToSelectedItem=function(){var e,t=void 0===this.props.activeItem&&null!==this.state.selectedItem&&!this.props.resetOnSelect;null!==this.queryList&&t&&this.queryList.setActiveItem(null!=(e=this.props.selectedItem)?e:this.state.selectedItem)},t.displayName=s.DISPLAYNAME_PREFIX+".Suggest",t.defaultProps={closeOnSelect:!0,fill:!1,openOnKeyDown:!1,resetOnClose:!1},t}(g.PureComponent)}])}));
*/function v(){return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"}}function h(e){if(null==e)return!1;var t=Object.keys(e);return 1===t.length&&"__blueprintCreateNewItemBrand"===t[0]&&"blueprint-create-new-item"===e.__blueprintCreateNewItemBrand}function I(e){return null==e||h(e)?null:e}var y=n(1),O=n(3),P=n.n(O),g=n(2),C=function(e){function t(t,n){var r,i=e.call(this,t,n)||this;i.refHandlers={itemsParent:function(e){return i.itemsParentRef=e}},i.shouldCheckActiveItemInViewport=!1,i.expectedNextActiveItem=null,i.renderItemList=function(e){var t=i.props,n=t.initialContent,r=t.noResults,o=m(e,i.isCreateItemRendered()?null:r,n),p=i.isCreateItemRendered()?i.renderCreateItemMenuItem(i.state.query.trim()):null;return null==o&&null==p?null:g.createElement(s.Menu,{ulRef:e.itemsParentRef},o,p)},i.renderItem=function(e,t){if(!0!==i.props.disabled){var n=i.state,r=n.activeItem,s=n.query,o=i.state.filteredItems.indexOf(e)>=0,p={active:f(i.props.itemsEqual,I(r),e),disabled:T(e,t,i.props.itemDisabled),matchesPredicate:o};return i.props.itemRenderer(e,{handleClick:function(t){return i.handleItemSelect(e,t)},index:t,modifiers:p,query:s})}return null},i.renderCreateItemMenuItem=function(e){var t=h(i.state.activeItem);return s.Utils.safeInvoke(i.props.createNewItemRenderer,e,t,(function(t){i.handleItemCreate(e,t)}))},i.handleItemCreate=function(e,t){var n=s.Utils.safeInvoke(i.props.createNewItemFromQuery,e);null!=n&&(s.Utils.safeInvoke(i.props.onItemSelect,n,t),i.setQuery("",!0))},i.handleItemSelect=function(e,t){i.setActiveItem(e),s.Utils.safeInvoke(i.props.onItemSelect,e,t),i.props.resetOnSelect&&i.setQuery("",!0)},i.handlePaste=function(e){for(var t,n=i.props,r=n.createNewItemFromQuery,o=n.onItemsPaste,p=[],a=[],u=0,l=e;u<l.length;u++){var c=l[u],d=b(c,i.props);if(void 0!==d)t=d,a.push(d);else if(i.canCreateItems()){var m=s.Utils.safeInvoke(r,c);void 0!==m&&a.push(m)}else p.push(c)}i.setQuery(p.join(", "),!1),void 0!==t&&i.setActiveItem(t),s.Utils.safeInvoke(o,a)},i.handleKeyDown=function(e){var t=e.keyCode;if(t===s.Keys.ARROW_UP||t===s.Keys.ARROW_DOWN){e.preventDefault();var n=i.getNextActiveItem(t===s.Keys.ARROW_UP?-1:1);null!=n&&i.setActiveItem(n)}s.Utils.safeInvoke(i.props.onKeyDown,e)},i.handleKeyUp=function(e){var t=i.props.onKeyUp,n=i.state.activeItem;e.keyCode===s.Keys.ENTER&&(e.preventDefault(),null==n||h(n)?i.handleItemCreate(i.state.query,e):i.handleItemSelect(n,e)),s.Utils.safeInvoke(t,e)},i.handleInputQueryChange=function(e){var t=null==e?"":e.target.value;i.setQuery(t),s.Utils.safeInvoke(i.props.onQueryChange,t,e)};var o=t.query,p=void 0===o?"":o,a=s.Utils.safeInvoke(t.createNewItemFromQuery,p),u=E(p,t);return i.state={activeItem:void 0!==t.activeItem?t.activeItem:null!==(r=t.initialActiveItem)&&void 0!==r?r:L(u,t.itemDisabled),createNewItem:a,filteredItems:u,query:p},i}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=e.className,n=e.items,r=e.renderer,s=e.itemListRenderer,i=void 0===s?this.renderItemList:s,o=this.state,p=(o.createNewItem,Object(y.__rest)(o,["createNewItem"]));return r(Object(y.__assign)(Object(y.__assign)({},p),{className:t,handleItemSelect:this.handleItemSelect,handleKeyDown:this.handleKeyDown,handleKeyUp:this.handleKeyUp,handlePaste:this.handlePaste,handleQueryChange:this.handleInputQueryChange,itemList:i(Object(y.__assign)(Object(y.__assign)({},p),{items:n,itemsParentRef:this.refHandlers.itemsParent,renderItem:this.renderItem}))}))},t.prototype.componentDidUpdate=function(e){var t=this;void 0!==this.props.activeItem&&this.props.activeItem!==this.state.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:this.props.activeItem})),null!=this.props.query&&this.props.query!==e.query?this.setQuery(this.props.query,this.props.resetOnQuery,this.props):s.Utils.shallowCompareKeys(this.props,e,{include:["items","itemListPredicate","itemPredicate"]})||this.setQuery(this.state.query),this.shouldCheckActiveItemInViewport&&(requestAnimationFrame((function(){return t.scrollActiveItemIntoView()})),this.shouldCheckActiveItemInViewport=!1)},t.prototype.scrollActiveItemIntoView=function(){var e=!1!==this.props.scrollToActiveItem,t=!f(this.props.itemsEqual,I(this.expectedNextActiveItem),I(this.props.activeItem));if(this.expectedNextActiveItem=null,e||!t){var n=this.getActiveElement();if(null!=this.itemsParentRef&&null!=n){var r=n.offsetTop,s=n.offsetHeight,i=this.itemsParentRef,o=i.offsetTop,p=i.scrollTop,a=i.clientHeight,u=this.getItemsParentPadding(),l=u.paddingTop,c=r+s+u.paddingBottom-o,d=r-l-o;c>=p+a?this.itemsParentRef.scrollTop=c+s-a:d<=p&&(this.itemsParentRef.scrollTop=d-s)}}},t.prototype.setQuery=function(e,t,n){void 0===t&&(t=this.props.resetOnQuery),void 0===n&&(n=this.props);var r=n.createNewItemFromQuery;this.shouldCheckActiveItemInViewport=!0,e!==this.state.query&&s.Utils.safeInvoke(n.onQueryChange,e);var i=e.trim(),o=E(i,n),p=null!=r&&""!==i?r(i):void 0;this.setState({createNewItem:p,filteredItems:o,query:e});var a=this.getActiveIndex(o);(t||a<0||T(I(this.state.activeItem),a,n.itemDisabled))&&this.setActiveItem(L(o,n.itemDisabled))},t.prototype.setActiveItem=function(e){this.expectedNextActiveItem=e,void 0===this.props.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:e})),h(e)?s.Utils.safeInvoke(this.props.onActiveItemChange,null,!0):s.Utils.safeInvoke(this.props.onActiveItemChange,e,!1)},t.prototype.getActiveElement=function(){var e=this.state.activeItem;if(null!=this.itemsParentRef){if(h(e))return this.itemsParentRef.children.item(this.state.filteredItems.length);var t=this.getActiveIndex();return this.itemsParentRef.children.item(t)}},t.prototype.getActiveIndex=function(e){void 0===e&&(e=this.state.filteredItems);var t=this.state.activeItem;if(null==t||h(t))return-1;for(var n=0;n<e.length;++n)if(f(this.props.itemsEqual,e[n],t))return n;return-1},t.prototype.getItemsParentPadding=function(){var e=getComputedStyle(this.itemsParentRef),t=e.paddingTop;return{paddingBottom:_(e.paddingBottom),paddingTop:_(t)}},t.prototype.getNextActiveItem=function(e,t){if((void 0===t&&(t=this.getActiveIndex()),this.isCreateItemRendered())&&(0===t&&-1===e||t===this.state.filteredItems.length-1&&1===e))return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"};return L(this.state.filteredItems,this.props.itemDisabled,e,t)},t.prototype.isCreateItemRendered=function(){return this.canCreateItems()&&""!==this.state.query&&!this.wouldCreatedItemMatchSomeExistingItem()},t.prototype.canCreateItems=function(){return null!=this.props.createNewItemFromQuery&&null!=this.props.createNewItemRenderer},t.prototype.wouldCreatedItemMatchSomeExistingItem=function(){var e=this;return this.state.filteredItems.some((function(t){return f(e.props.itemsEqual,t,e.state.createNewItem)}))},t.displayName=s.DISPLAYNAME_PREFIX+".QueryList",t.defaultProps={disabled:!1,resetOnQuery:!0},t}(s.AbstractComponent2);function _(e){return null==e?0:parseInt(e.slice(0,-2),10)}function b(e,t){var n=t.items,r=t.itemPredicate;if(s.Utils.isFunction(r))for(var i=0;i<n.length;i++){var o=n[i];if(r(e,o,i,!0))return o}}function E(e,t){var n=t.items,r=t.itemPredicate,i=t.itemListPredicate;return s.Utils.isFunction(i)?i(e,n):s.Utils.isFunction(r)?n.filter((function(t,n){return r(e,t,n)})):n}function T(e,t,n){return null!=n&&null!=e&&(s.Utils.isFunction(n)?n(e,t):!!e[n])}function L(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r=e.length-1),0===e.length)return null;var s,i,o,p=r,a=e.length-1;do{if(o=a,!T(e[p=(s=p+n)<(i=0)?o:s>o?i:s],p,t))return e[p]}while(p!==r&&-1!==r);return null}var S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.TypedQueryList=C.ofType(),t.renderQueryList=function(e){var n=t.props,i=n.inputProps,o=void 0===i?{}:i,p=n.isOpen,a=n.overlayProps,u=void 0===a?{}:a,l=e.handleKeyDown,c=e.handleKeyUp,d=p?{onKeyDown:l,onKeyUp:c}:{};return g.createElement(s.Overlay,Object(y.__assign)({hasBackdrop:!0},u,{isOpen:p,className:P()(r.OMNIBAR_OVERLAY,u.className),onClose:t.handleOverlayClose}),g.createElement("div",Object(y.__assign)({className:P()(r.OMNIBAR,e.className)},d),g.createElement(s.InputGroup,Object(y.__assign)({autoFocus:!0,large:!0,leftIcon:"search",placeholder:"Search..."},o,{onChange:e.handleQueryChange,value:e.query})),e.itemList))},t.handleOverlayClose=function(e){s.Utils.safeInvokeMember(t.props.overlayProps,"onClose",e),s.Utils.safeInvoke(t.props.onClose,e)},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=e.initialContent,n=void 0===t?null:t,r=(e.isOpen,e.inputProps,e.overlayProps,Object(y.__rest)(e,["initialContent","isOpen","inputProps","overlayProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},r,{initialContent:n,renderer:this.renderQueryList}))},t.displayName=s.DISPLAYNAME_PREFIX+".Omnibar",t}(g.PureComponent),A=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:t.props.popoverProps&&t.props.popoverProps.isOpen||!1},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.tagInputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n,i=t.props,o=i.fill,p=i.tagInputProps,a=void 0===p?{}:p,u=i.popoverProps,l=void 0===u?{}:u,c=i.selectedItems,d=void 0===c?[]:c,m=i.placeholder,f=e.handlePaste,v=e.handleKeyDown,h=e.handleKeyUp;o&&(l.fill=!0,a.fill=!0);var I=Object(y.__assign)(Object(y.__assign)({},a.inputProps),{className:P()(null===(n=a.inputProps)||void 0===n?void 0:n.className,r.MULTISELECT_TAG_INPUT_INPUT)});return g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,canEscapeKeyClose:!0,enforceFocus:!1,isOpen:t.state.isOpen,position:s.Position.BOTTOM_LEFT},l,{className:P()(e.className,l.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.MULTISELECT_POPOVER,l.popoverClassName),onOpened:t.handlePopoverOpened}),g.createElement("div",{onKeyDown:t.getTagInputKeyDownHandler(v),onKeyUp:t.getTagInputKeyUpHandler(h)},g.createElement(s.TagInput,Object(y.__assign)({placeholder:m},a,{className:P()(r.MULTISELECT,a.className),inputRef:t.refHandlers.input,inputProps:I,inputValue:e.query,onAdd:function(e,t){"paste"===t&&f(e)},onInputChange:e.handleQueryChange,values:d.map(t.props.tagRenderer)}))),g.createElement("div",{onKeyDown:v,onKeyUp:h},e.itemList))},t.handleItemSelect=function(e,n){null!=t.input&&t.input.focus(),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handleQueryChange=function(e,n){t.setState({isOpen:e.length>0||!t.props.openOnKeyDown}),s.Utils.safeInvoke(t.props.onQueryChange,e,n)},t.handlePopoverInteraction=function(e){return requestAnimationFrame((function(){null!=t.input&&t.input!==document.activeElement?t.setState({isOpen:!1}):t.props.openOnKeyDown||t.setState({isOpen:!0}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)}))},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.getTagInputKeyDownHandler=function(e){return function(n){var r=n.which;r===s.Keys.ESCAPE||r===s.Keys.TAB?(null!=t.input&&t.input.blur(),t.setState({isOpen:!1})):r!==s.Keys.BACKSPACE&&r!==s.Keys.ARROW_LEFT&&r!==s.Keys.ARROW_RIGHT&&t.setState({isOpen:!0});var i=null!=n.target.closest("."+s.Classes.TAG_REMOVE);t.state.isOpen&&!i&&s.Utils.safeInvoke(e,n)}},t.getTagInputKeyUpHandler=function(e){return function(n){var i=n.target.classList.contains(r.MULTISELECT_TAG_INPUT_INPUT);t.state.isOpen&&i&&s.Utils.safeInvoke(e,n)}},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=(e.openOnKeyDown,e.popoverProps,e.tagInputProps,Object(y.__rest)(e,["openOnKeyDown","popoverProps","tagInputProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},t,{onItemSelect:this.handleItemSelect,onQueryChange:this.handleQueryChange,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.displayName=s.DISPLAYNAME_PREFIX+".MultiSelect",t.defaultProps={fill:!1,placeholder:"Search..."},t}(g.PureComponent),U=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:!1},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.inputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n=t.props,i=n.filterable,o=void 0===i||i,p=n.disabled,a=void 0!==p&&p,u=n.inputProps,l=void 0===u?{}:u,c=n.popoverProps,d=void 0===c?{}:c,m=g.createElement(s.InputGroup,Object(y.__assign)({leftIcon:"search",placeholder:"Filter...",rightElement:t.maybeRenderClearButton(e.query)},l,{inputRef:t.refHandlers.input,onChange:e.handleQueryChange,value:e.query})),f=e.handleKeyDown,v=e.handleKeyUp;return g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,enforceFocus:!1,isOpen:t.state.isOpen,disabled:a,position:s.Position.BOTTOM_LEFT},d,{className:P()(e.className,d.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.SELECT_POPOVER,d.popoverClassName),onOpening:t.handlePopoverOpening,onOpened:t.handlePopoverOpened,onClosing:t.handlePopoverClosing}),g.createElement("div",{onKeyDown:t.state.isOpen?f:t.handleTargetKeyDown,onKeyUp:t.state.isOpen?v:void 0},t.props.children),g.createElement("div",{onKeyDown:f,onKeyUp:v},o?m:void 0,e.itemList))},t.handleTargetKeyDown=function(e){e.which!==s.Keys.ARROW_UP&&e.which!==s.Keys.ARROW_DOWN||(e.preventDefault(),t.setState({isOpen:!0}))},t.handleItemSelect=function(e,n){t.setState({isOpen:!1}),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handlePopoverInteraction=function(e){t.setState({isOpen:e}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)},t.handlePopoverOpening=function(e){t.previousFocusedElement=document.activeElement,t.props.resetOnClose&&t.resetQuery(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpening",e)},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),requestAnimationFrame((function(){var e=t.props.inputProps;!1!==(void 0===e?{}:e).autoFocus&&null!=t.input&&t.input.focus()})),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.handlePopoverClosing=function(e){requestAnimationFrame((function(){void 0!==t.previousFocusedElement&&(t.previousFocusedElement.focus(),t.previousFocusedElement=void 0)})),s.Utils.safeInvokeMember(t.props.popoverProps,"onClosing",e)},t.resetQuery=function(){return t.queryList&&t.queryList.setQuery("",!0)},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=(e.filterable,e.inputProps,e.popoverProps,Object(y.__rest)(e,["filterable","inputProps","popoverProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},t,{onItemSelect:this.handleItemSelect,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.prototype.componentDidUpdate=function(e,t){this.state.isOpen&&!t.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()},t.prototype.maybeRenderClearButton=function(e){return e.length>0?g.createElement(s.Button,{icon:"cross",minimal:!0,onClick:this.resetQuery}):void 0},t.displayName=s.DISPLAYNAME_PREFIX+".Select",t}(g.PureComponent),w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isOpen:null!=t.props.popoverProps&&t.props.popoverProps.isOpen||!1,selectedItem:t.getInitialSelectedItem()},t.TypedQueryList=C.ofType(),t.input=null,t.queryList=null,t.refHandlers={input:function(e){t.input=e,s.Utils.safeInvokeMember(t.props.inputProps,"inputRef",e)},queryList:function(e){return t.queryList=e}},t.renderQueryList=function(e){var n=t.props,i=n.fill,o=n.inputProps,p=void 0===o?{}:o,a=n.popoverProps,u=void 0===a?{}:a,l=t.state,c=l.isOpen,d=l.selectedItem,m=e.handleKeyDown,f=e.handleKeyUp,v=p.autoComplete,h=void 0===v?"off":v,I=p.placeholder,O=void 0===I?"Search...":I,C=d?t.props.inputValueRenderer(d):"",_=c&&C?C:O,b=c?e.query:C||(t.props.resetOnClose?"":e.query);return i&&(u.fill=!0,p.fill=!0),g.createElement(s.Popover,Object(y.__assign)({autoFocus:!1,enforceFocus:!1,isOpen:c,position:s.Position.BOTTOM_LEFT},u,{className:P()(e.className,u.className),onInteraction:t.handlePopoverInteraction,popoverClassName:P()(r.SELECT_POPOVER,u.popoverClassName),onOpening:t.handlePopoverOpening,onOpened:t.handlePopoverOpened}),g.createElement(s.InputGroup,Object(y.__assign)({autoComplete:h,disabled:t.props.disabled},p,{inputRef:t.refHandlers.input,onChange:e.handleQueryChange,onFocus:t.handleInputFocus,onKeyDown:t.getTargetKeyDownHandler(m),onKeyUp:t.getTargetKeyUpHandler(f),placeholder:_,value:b})),g.createElement("div",{onKeyDown:m,onKeyUp:f},e.itemList))},t.selectText=function(){requestAnimationFrame((function(){null!=t.input&&t.input.setSelectionRange(0,t.input.value.length)}))},t.handleInputFocus=function(e){t.selectText(),t.props.openOnKeyDown||t.setState({isOpen:!0}),s.Utils.safeInvokeMember(t.props.inputProps,"onFocus",e)},t.handleItemSelect=function(e,n){var r;t.props.closeOnSelect?(null!=t.input&&t.input.blur(),r=!1):(null!=t.input&&t.input.focus(),t.selectText(),r=!0),void 0===t.props.selectedItem?t.setState({isOpen:r,selectedItem:e}):t.setState({isOpen:r}),s.Utils.safeInvoke(t.props.onItemSelect,e,n)},t.handlePopoverInteraction=function(e){return requestAnimationFrame((function(){null!=t.input&&t.input!==document.activeElement&&t.setState({isOpen:!1}),s.Utils.safeInvokeMember(t.props.popoverProps,"onInteraction",e)}))},t.handlePopoverOpening=function(e){t.props.resetOnClose&&t.queryList&&t.queryList.setQuery("",!0),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpening",e)},t.handlePopoverOpened=function(e){null!=t.queryList&&t.queryList.scrollActiveItemIntoView(),s.Utils.safeInvokeMember(t.props.popoverProps,"onOpened",e)},t.getTargetKeyDownHandler=function(e){return function(n){var r=n.which;r===s.Keys.ESCAPE||r===s.Keys.TAB?(null!=t.input&&t.input.blur(),t.setState({isOpen:!1})):t.props.openOnKeyDown&&r!==s.Keys.BACKSPACE&&r!==s.Keys.ARROW_LEFT&&r!==s.Keys.ARROW_RIGHT&&t.setState({isOpen:!0}),t.state.isOpen&&s.Utils.safeInvoke(e,n),s.Utils.safeInvokeMember(t.props.inputProps,"onKeyDown",n)}},t.getTargetKeyUpHandler=function(e){return function(n){t.state.isOpen&&s.Utils.safeInvoke(e,n),s.Utils.safeInvokeMember(t.props.inputProps,"onKeyUp",n)}},t}return Object(y.__extends)(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e,t=this.props,n=(t.disabled,t.inputProps,t.popoverProps,Object(y.__rest)(t,["disabled","inputProps","popoverProps"]));return g.createElement(this.TypedQueryList,Object(y.__assign)({},n,{initialActiveItem:null!==(e=this.props.selectedItem)&&void 0!==e?e:void 0,onItemSelect:this.handleItemSelect,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))},t.prototype.componentDidUpdate=function(e,t){var n,r,i=this;void 0!==this.props.selectedItem&&this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem}),!1===this.state.isOpen&&!0===t.isOpen&&setTimeout((function(){i.maybeResetActiveItemToSelectedItem()}),null!==(r=null===(n=this.props.popoverProps)||void 0===n?void 0:n.transitionDuration)&&void 0!==r?r:s.Popover.defaultProps.transitionDuration),this.state.isOpen&&!t.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()},t.prototype.getInitialSelectedItem=function(){return void 0!==this.props.selectedItem?this.props.selectedItem:void 0!==this.props.defaultSelectedItem?this.props.defaultSelectedItem:null},t.prototype.maybeResetActiveItemToSelectedItem=function(){var e,t=void 0===this.props.activeItem&&null!==this.state.selectedItem&&!this.props.resetOnSelect;null!==this.queryList&&t&&this.queryList.setActiveItem(null!==(e=this.props.selectedItem)&&void 0!==e?e:this.state.selectedItem)},t.displayName=s.DISPLAYNAME_PREFIX+".Suggest",t.defaultProps={closeOnSelect:!0,fill:!1,openOnKeyDown:!1,resetOnClose:!1},t}(g.PureComponent)}])}));

@@ -176,3 +176,3 @@ "use strict";

? props.activeItem
: (_a = props.initialActiveItem, (_a !== null && _a !== void 0 ? _a : getFirstEnabledItem(filteredItems, props.itemDisabled))),
: (_a = props.initialActiveItem) !== null && _a !== void 0 ? _a : getFirstEnabledItem(filteredItems, props.itemDisabled),
createNewItem: createNewItem,

@@ -179,0 +179,0 @@ filteredItems: filteredItems,

@@ -169,3 +169,3 @@ "use strict";

var _b = this.props, disabled = _b.disabled, inputProps = _b.inputProps, popoverProps = _b.popoverProps, restProps = tslib_1.__rest(_b, ["disabled", "inputProps", "popoverProps"]);
return (React.createElement(this.TypedQueryList, tslib_1.__assign({}, restProps, { initialActiveItem: (_a = this.props.selectedItem, (_a !== null && _a !== void 0 ? _a : undefined)), onItemSelect: this.handleItemSelect, ref: this.refHandlers.queryList, renderer: this.renderQueryList })));
return (React.createElement(this.TypedQueryList, tslib_1.__assign({}, restProps, { initialActiveItem: (_a = this.props.selectedItem) !== null && _a !== void 0 ? _a : undefined, onItemSelect: this.handleItemSelect, ref: this.refHandlers.queryList, renderer: this.renderQueryList })));
};

@@ -184,3 +184,3 @@ Suggest.prototype.componentDidUpdate = function (_prevProps, prevState) {

_this.maybeResetActiveItemToSelectedItem();
}, (_b = (_a = this.props.popoverProps) === null || _a === void 0 ? void 0 : _a.transitionDuration, (_b !== null && _b !== void 0 ? _b : core_1.Popover.defaultProps.transitionDuration)));
}, (_b = (_a = this.props.popoverProps) === null || _a === void 0 ? void 0 : _a.transitionDuration) !== null && _b !== void 0 ? _b : core_1.Popover.defaultProps.transitionDuration);
}

@@ -207,3 +207,3 @@ if (this.state.isOpen && !prevState.isOpen && this.queryList != null) {

if (this.queryList !== null && shouldResetActiveItemToSelectedItem) {
this.queryList.setActiveItem((_a = this.props.selectedItem, (_a !== null && _a !== void 0 ? _a : this.state.selectedItem)));
this.queryList.setActiveItem((_a = this.props.selectedItem) !== null && _a !== void 0 ? _a : this.state.selectedItem);
}

@@ -210,0 +210,0 @@ };

@@ -174,3 +174,3 @@ /*

? props.activeItem
: (_a = props.initialActiveItem, (_a !== null && _a !== void 0 ? _a : getFirstEnabledItem(filteredItems, props.itemDisabled))),
: (_a = props.initialActiveItem) !== null && _a !== void 0 ? _a : getFirstEnabledItem(filteredItems, props.itemDisabled),
createNewItem: createNewItem,

@@ -177,0 +177,0 @@ filteredItems: filteredItems,

@@ -167,3 +167,3 @@ /*

var _b = this.props, disabled = _b.disabled, inputProps = _b.inputProps, popoverProps = _b.popoverProps, restProps = __rest(_b, ["disabled", "inputProps", "popoverProps"]);
return (React.createElement(this.TypedQueryList, __assign({}, restProps, { initialActiveItem: (_a = this.props.selectedItem, (_a !== null && _a !== void 0 ? _a : undefined)), onItemSelect: this.handleItemSelect, ref: this.refHandlers.queryList, renderer: this.renderQueryList })));
return (React.createElement(this.TypedQueryList, __assign({}, restProps, { initialActiveItem: (_a = this.props.selectedItem) !== null && _a !== void 0 ? _a : undefined, onItemSelect: this.handleItemSelect, ref: this.refHandlers.queryList, renderer: this.renderQueryList })));
};

@@ -182,3 +182,3 @@ Suggest.prototype.componentDidUpdate = function (_prevProps, prevState) {

_this.maybeResetActiveItemToSelectedItem();
}, (_b = (_a = this.props.popoverProps) === null || _a === void 0 ? void 0 : _a.transitionDuration, (_b !== null && _b !== void 0 ? _b : Popover.defaultProps.transitionDuration)));
}, (_b = (_a = this.props.popoverProps) === null || _a === void 0 ? void 0 : _a.transitionDuration) !== null && _b !== void 0 ? _b : Popover.defaultProps.transitionDuration);
}

@@ -205,3 +205,3 @@ if (this.state.isOpen && !prevState.isOpen && this.queryList != null) {

if (this.queryList !== null && shouldResetActiveItemToSelectedItem) {
this.queryList.setActiveItem((_a = this.props.selectedItem, (_a !== null && _a !== void 0 ? _a : this.state.selectedItem)));
this.queryList.setActiveItem((_a = this.props.selectedItem) !== null && _a !== void 0 ? _a : this.state.selectedItem);
}

@@ -208,0 +208,0 @@ };

{
"name": "@blueprintjs/select",
"version": "3.12.2",
"version": "3.12.3",
"description": "Components related to selecting items from a list",

@@ -38,3 +38,3 @@ "main": "lib/cjs/index.js",

"dependencies": {
"@blueprintjs/core": "^3.26.0",
"@blueprintjs/core": "^3.26.1",
"classnames": "^2.2",

@@ -49,3 +49,3 @@ "tslib": "~1.10.0"

"@blueprintjs/karma-build-scripts": "^1.0.0",
"@blueprintjs/node-build-scripts": "^1.3.0",
"@blueprintjs/node-build-scripts": "^1.3.1",
"enzyme": "^3.11.0",

@@ -58,3 +58,3 @@ "karma": "^5.0.2",

"react-test-renderer": "^16.8.6",
"typescript": "~3.7.5",
"typescript": "~3.8.3",
"webpack-cli": "^3.3.11"

@@ -61,0 +61,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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