@entur/dropdown
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.5.4](https://bitbucket.org/enturas/design-system/compare/@entur/dropdown@0.5.3...@entur/dropdown@0.5.4) (2020-01-27) | ||
### Bug Fixes | ||
- **Dropdown:** make dropdowns controllable ([38e503e](https://bitbucket.org/enturas/design-system/commits/38e503edf6cee98ec7e086a6f836c8bf899adb75)) | ||
- **Dropdown:** make long choices overflow into an ellipsis ([c936358](https://bitbucket.org/enturas/design-system/commits/c9363585f316936b8eac2d100b90d28f1f30f760)) | ||
- **Dropdown:** make styles spreadable to the input group ([8ef9a24](https://bitbucket.org/enturas/design-system/commits/8ef9a244de17cad1c4fd63c13127527f02be103c)) | ||
- **Dropdown:** remove unnecessary classNames call ([97cf52c](https://bitbucket.org/enturas/design-system/commits/97cf52c42f419f042a3fc93ab493417c2baae7af)) | ||
- **DropdownList:** only show scrollbar if necessary ([09b25e9](https://bitbucket.org/enturas/design-system/commits/09b25e9558fe6aff6de9a695c37b67a2da98cdad)) | ||
- **types:** place types in the correct place ([acace09](https://bitbucket.org/enturas/design-system/commits/acace09ec0e258c5cff3a65e13ab29d6603780d9)) | ||
## [0.5.3](https://bitbucket.org/enturas/design-system/compare/@entur/dropdown@0.5.2...@entur/dropdown@0.5.3) (2020-01-20) | ||
@@ -8,0 +19,0 @@ |
@@ -197,3 +197,3 @@ 'use strict'; | ||
}, rest), React.createElement("button", Object.assign({}, getToggleButtonProps({ | ||
className: 'eds-form-control', | ||
className: 'eds-form-control eds-dropdown__selected-item', | ||
style: { | ||
@@ -279,3 +279,4 @@ textAlign: 'left' | ||
variant = _ref.variant, | ||
className = _ref.className; | ||
className = _ref.className, | ||
style = _ref.style; | ||
@@ -288,3 +289,4 @@ var _useDownshift = useDownshift(), | ||
}, React.createElement("div", { | ||
className: classNames(className) | ||
className: className, | ||
style: style | ||
}, label && React.createElement(typography.Label, Object.assign({}, getLabelProps(), { | ||
@@ -320,16 +322,2 @@ style: { | ||
function debounce(fn, delay) { | ||
var id; | ||
return function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
clearTimeout(id); | ||
id = setTimeout(function () { | ||
return fn.apply(void 0, args); | ||
}, delay); | ||
}; | ||
} | ||
var useIsMounted = function useIsMounted() { | ||
@@ -425,3 +413,3 @@ var isMountedRef = React.useRef(true); | ||
loading: isItemsFunction ? loading : false, | ||
fetchItems: debounce(fetchItems, debounceTimeout) | ||
fetchItems: utils.debounce(fetchItems, debounceTimeout) | ||
}; | ||
@@ -448,3 +436,4 @@ }; | ||
className = _ref.className, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["debounceTimeout", "disabled", "feedback", "items", "label", "loadingText", "onChange", "placeholder", "prepend", "readOnly", "searchable", "selectOnTab", "openOnFocus", "variant", "value", "className"]); | ||
style = _ref.style, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["debounceTimeout", "disabled", "feedback", "items", "label", "loadingText", "onChange", "placeholder", "prepend", "readOnly", "searchable", "selectOnTab", "openOnFocus", "variant", "value", "className", "style"]); | ||
@@ -456,3 +445,3 @@ var _useResolvedItems = useResolvedItems(items, debounceTimeout), | ||
var initialSelectedItem = normalizedItems.find(function (item) { | ||
var selectedItem = normalizedItems.find(function (item) { | ||
return value === item.value; | ||
@@ -462,10 +451,12 @@ }); | ||
return React.createElement(DownshiftProvider, Object.assign({ | ||
initialSelectedItem: initialSelectedItem, | ||
selectedItem: selectedItem, | ||
onInputValueChange: fetchItems, | ||
onChange: onChange | ||
onChange: onChange, | ||
value: value | ||
}, rest), React.createElement(DropdownInputGroup, { | ||
className: classNames(className), | ||
className: className, | ||
label: label, | ||
feedback: feedback, | ||
variant: variant | ||
variant: variant, | ||
style: style | ||
}, React.createElement(RenderedDropdown, { | ||
@@ -472,0 +463,0 @@ items: normalizedItems, |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@entur/utils"),t=e(require("react")),a=e(require("downshift")),r=require("@entur/form"),l=e(require("classnames")),i=require("@entur/icons"),o=require("@entur/a11y"),s=require("@entur/typography");function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}function d(e,n){if(null==e)return{};var t,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n.indexOf(t=l[a])>=0||(r[t]=e[t]);return r}var u=t.createContext(null),m=function(e){var n=e.children,r=e.onChange,l=void 0===r?function(){}:r,i=e.onInputValueChange,o=void 0===i?function(){}:i,s=d(e,["children","onChange","onInputValueChange"]);return t.createElement(a,Object.assign({itemToString:function(e){return e?e.label:""},onStateChange:function(e,n){"selectedItem"in e?l(e.selectedItem,n):"inputValue"in e&&o(e.inputValue)}},s),(function(e){return t.createElement("div",{className:"eds-input-group"},t.createElement(u.Provider,{value:e},n))}))},p=function(){var e=t.useContext(u);if(!e)throw new Error("You need to wrap your component in a DownshiftProvider");return e},f=function(e){var n=e.items,a=d(e,["items"]),r=p(),i=r.highlightedIndex,o=r.isOpen,s=r.selectedItem,u=r.getItemProps,m=r.getMenuProps;return t.createElement("ul",Object.assign({className:l("eds-dropdown-list",{"eds-dropdown-list--open":o})},m(c({},a))),o?n.map((function(e,n){return t.createElement("li",Object.assign({className:l("eds-dropdown-list__item",{"eds-dropdown-list__item--highlighted":i===n,"eds-dropdown-list__item--selected":s===e})},u({key:e.value,item:e,index:n})),t.createElement("span",null,e.label),e.icons&&t.createElement("span",null,e.icons.map((function(e,n){return t.createElement(e,{key:n,inline:!0,className:"eds-dropdown-list__item-icon"})}))))})):null)},g=function(){var e=p();return t.createElement("button",Object.assign({},(0,e.getToggleButtonProps)({className:l("eds-dropdown__toggle-button",{"eds-dropdown__toggle-button--open":e.isOpen})}),{tabIndex:"-1"}),t.createElement(i.DownArrowIcon,{inline:!0}))},b=function(e){var n=e.children,a=d(e,["className","children"]);return t.createElement("div",Object.assign({className:l("eds-inline-spinner",l)},a),t.createElement("span",{className:"eds-inline-spinner__twirly-part"}),t.createElement(o.VisuallyHidden,null,n))},v=function(e){var n=e.children,a=e.className,l=e.items,i=e.loading,o=e.loadingText,s=void 0===o?"Loading...":o,u=e.style,m=d(e,["children","className","items","loading","loadingText","placeholder","style"]);return t.createElement("div",{className:"eds-dropdown-wrapper"},t.createElement(r.BaseFormControl,Object.assign({append:i?t.createElement(b,null,s):t.createElement(g,null),className:a,dark:!0},m),n),t.createElement(f,Object.assign({items:l,style:c({position:"absolute",top:"100%"},u)},m)))},y=function(e){var n=e.disabled,a=e.placeholder,r=void 0===a?"Vennligst velg":a,l=e.selectOnTab,i=void 0!==l&&l,o=e.openOnFocus,s=void 0!==o&&o,c=d(e,["disabled","placeholder","selectOnTab","openOnFocus"]),u=p(),m=u.getToggleButtonProps,f=u.selectedItem,g=u.selectHighlightedItem,b=u.openMenu;return t.createElement(v,Object.assign({disabled:n},c),t.createElement("button",Object.assign({},m({className:"eds-form-control",style:{textAlign:"left"},disabled:n,type:"button",onKeyDown:function(e){i&&"Tab"===e.key&&g()},onFocus:function(){s&&b()}})),f?f.label:r))},h=function(e){var n=e.disabled,a=void 0!==n&&n,r=e.className,l=e.items,i=e.loading,o=e.loadingText,s=e.readOnly,u=void 0!==s&&s,m=e.prepend,f=e.selectOnTab,g=void 0!==f&&f,b=e.openOnFocus,y=void 0!==b&&b,h=d(e,["disabled","className","items","loading","loadingText","readOnly","prepend","selectOnTab","openOnFocus"]),O=p(),E=O.getInputProps,w=O.inputValue,N=O.selectHighlightedItem,T=O.openMenu,x=t.useMemo((function(){if(!w)return l;var e=new RegExp(w,"i");return l.filter((function(n){return e.test(n.label)}))}),[w,l]);return t.createElement(v,{items:x,disabled:a,readOnly:u,className:r,loading:i,loadingText:o,prepend:m},t.createElement("input",Object.assign({},E(c({disabled:a,readOnly:u,className:"eds-form-control eds-dropdown__input",onKeyDown:function(e){g&&"Tab"===e.key&&N()},onFocus:function(){y&&T()}},h)))))},O=function(e){var n=e.children,a=e.label,i=e.feedback,o=e.variant,c=e.className,d=p().getLabelProps;return t.createElement(r.VariantProvider,{variant:o},t.createElement("div",{className:l(c)},a&&t.createElement(s.Label,Object.assign({},d(),{style:{display:"block"}}),a),n,i&&o&&t.createElement(r.FeedbackText,{variant:o},i)))},E=function(e,n){switch(n.type){case"request results":return{items:[],loading:!0};case"received results":return{items:n.payload,loading:!1}}},w=function(e,n){void 0===n&&(n=250);var a,r,l,i,o="function"==typeof e,s=t.useMemo((function(){return o?e:function(){return Promise.resolve(e)}}),[e,o]),d=t.useReducer(E,{items:o?[]:e,loading:!1}),u=d[0],m=u.items,p=u.loading,f=d[1],g=(a=t.useRef(!0),t.useEffect((function(){return function(){a.current=!1}}),[]),a.current),b=t.useCallback((function(e){try{return g?(f({type:"request results"}),Promise.resolve(s(e)).then((function(e){g&&f({type:"received results",payload:e})}))):Promise.resolve()}catch(e){return Promise.reject(e)}}),[s,g]),v=function(e){return t.useMemo((function(){return e.map((function(e){return"string"==typeof e?{value:e,label:e}:"value"in e?e:c({},e,{value:e.label})}))}),[e])}(m);return t.useEffect((function(){o&&b("")}),[o,b]),{items:v,loading:!!o&&p,fetchItems:(r=b,l=n,function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];clearTimeout(i),i=setTimeout((function(){return r.apply(void 0,n)}),l)})}};n.warnAboutMissingStyles("dropdown","form","a11y"),exports.Dropdown=function(e){var n=e.debounceTimeout,a=e.disabled,r=e.feedback,i=e.items,o=e.label,s=e.loadingText,c=e.onChange,u=void 0===c?function(){}:c,p=e.placeholder,f=e.prepend,g=e.readOnly,b=e.searchable,v=e.selectOnTab,E=e.openOnFocus,N=e.variant,T=e.value,x=e.className,j=d(e,["debounceTimeout","disabled","feedback","items","label","loadingText","onChange","placeholder","prepend","readOnly","searchable","selectOnTab","openOnFocus","variant","value","className"]),I=w(i,n),k=I.items,_=I.loading,P=I.fetchItems,C=k.find((function(e){return T===e.value})),F=b?h:y;return t.createElement(m,Object.assign({initialSelectedItem:C,onInputValueChange:P,onChange:u},j),t.createElement(O,{className:l(x),label:o,feedback:r,variant:N},t.createElement(F,{items:k,loading:_,loadingText:s,disabled:a,readOnly:g,placeholder:p,prepend:f,selectOnTab:v,openOnFocus:E})))},exports.NativeDropdown=function(e){var n=e.className,a=e.disabled,l=void 0!==a&&a,o=e.readOnly,s=void 0!==o&&o,c=e.items,u=e.loadingText,m=e.prepend,p=e.style,f=e.label,g=e.variant,v=e.feedback,y=d(e,["className","disabled","readOnly","items","loadingText","prepend","style","label","variant","feedback"]),h=w(c),O=h.items,E=h.loading,N=t.createElement(i.DownArrowIcon,{inline:!0});return l||s?N=null:E&&(N=t.createElement(b,null,u)),t.createElement(r.InputGroup,{label:f,feedback:v,variant:g},t.createElement(r.BaseFormControl,{dark:!0,disabled:l,readOnly:s,prepend:m,append:N,className:n,style:p},t.createElement("select",Object.assign({"aria-invalid":"error"===g,className:"eds-form-control eds-dropdown",disabled:l||s},y),O.map((function(e){return t.createElement("option",{key:e.value,value:e.value},e.label)})))))}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@entur/utils"),t=e(require("react")),a=e(require("downshift")),r=require("@entur/form"),l=e(require("classnames")),o=require("@entur/icons"),i=require("@entur/a11y"),s=require("@entur/typography");function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}function d(e,n){if(null==e)return{};var t,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n.indexOf(t=l[a])>=0||(r[t]=e[t]);return r}var u=t.createContext(null),m=function(e){var n=e.children,r=e.onChange,l=void 0===r?function(){}:r,o=e.onInputValueChange,i=void 0===o?function(){}:o,s=d(e,["children","onChange","onInputValueChange"]);return t.createElement(a,Object.assign({itemToString:function(e){return e?e.label:""},onStateChange:function(e,n){"selectedItem"in e?l(e.selectedItem,n):"inputValue"in e&&i(e.inputValue)}},s),(function(e){return t.createElement("div",{className:"eds-input-group"},t.createElement(u.Provider,{value:e},n))}))},p=function(){var e=t.useContext(u);if(!e)throw new Error("You need to wrap your component in a DownshiftProvider");return e},b=function(e){var n=e.items,a=d(e,["items"]),r=p(),o=r.highlightedIndex,i=r.isOpen,s=r.selectedItem,u=r.getItemProps,m=r.getMenuProps;return t.createElement("ul",Object.assign({className:l("eds-dropdown-list",{"eds-dropdown-list--open":i})},m(c({},a))),i?n.map((function(e,n){return t.createElement("li",Object.assign({className:l("eds-dropdown-list__item",{"eds-dropdown-list__item--highlighted":o===n,"eds-dropdown-list__item--selected":s===e})},u({key:e.value,item:e,index:n})),t.createElement("span",null,e.label),e.icons&&t.createElement("span",null,e.icons.map((function(e,n){return t.createElement(e,{key:n,inline:!0,className:"eds-dropdown-list__item-icon"})}))))})):null)},f=function(){var e=p();return t.createElement("button",Object.assign({},(0,e.getToggleButtonProps)({className:l("eds-dropdown__toggle-button",{"eds-dropdown__toggle-button--open":e.isOpen})}),{tabIndex:"-1"}),t.createElement(o.DownArrowIcon,{inline:!0}))},g=function(e){var n=e.children,a=d(e,["className","children"]);return t.createElement("div",Object.assign({className:l("eds-inline-spinner",l)},a),t.createElement("span",{className:"eds-inline-spinner__twirly-part"}),t.createElement(i.VisuallyHidden,null,n))},v=function(e){var n=e.children,a=e.className,l=e.items,o=e.loading,i=e.loadingText,s=void 0===i?"Loading...":i,u=e.style,m=d(e,["children","className","items","loading","loadingText","placeholder","style"]);return t.createElement("div",{className:"eds-dropdown-wrapper"},t.createElement(r.BaseFormControl,Object.assign({append:o?t.createElement(g,null,s):t.createElement(f,null),className:a,dark:!0},m),n),t.createElement(b,Object.assign({items:l,style:c({position:"absolute",top:"100%"},u)},m)))},y=function(e){var n=e.disabled,a=e.placeholder,r=void 0===a?"Vennligst velg":a,l=e.selectOnTab,o=void 0!==l&&l,i=e.openOnFocus,s=void 0!==i&&i,c=d(e,["disabled","placeholder","selectOnTab","openOnFocus"]),u=p(),m=u.getToggleButtonProps,b=u.selectedItem,f=u.selectHighlightedItem,g=u.openMenu;return t.createElement(v,Object.assign({disabled:n},c),t.createElement("button",Object.assign({},m({className:"eds-form-control eds-dropdown__selected-item",style:{textAlign:"left"},disabled:n,type:"button",onKeyDown:function(e){o&&"Tab"===e.key&&f()},onFocus:function(){s&&g()}})),b?b.label:r))},h=function(e){var n=e.disabled,a=void 0!==n&&n,r=e.className,l=e.items,o=e.loading,i=e.loadingText,s=e.readOnly,u=void 0!==s&&s,m=e.prepend,b=e.selectOnTab,f=void 0!==b&&b,g=e.openOnFocus,y=void 0!==g&&g,h=d(e,["disabled","className","items","loading","loadingText","readOnly","prepend","selectOnTab","openOnFocus"]),O=p(),E=O.getInputProps,w=O.inputValue,N=O.selectHighlightedItem,T=O.openMenu,x=t.useMemo((function(){if(!w)return l;var e=new RegExp(w,"i");return l.filter((function(n){return e.test(n.label)}))}),[w,l]);return t.createElement(v,{items:x,disabled:a,readOnly:u,className:r,loading:o,loadingText:i,prepend:m},t.createElement("input",Object.assign({},E(c({disabled:a,readOnly:u,className:"eds-form-control eds-dropdown__input",onKeyDown:function(e){f&&"Tab"===e.key&&N()},onFocus:function(){y&&T()}},h)))))},O=function(e){var n=e.children,a=e.label,l=e.feedback,o=e.variant,i=e.className,c=e.style,d=p();return t.createElement(r.VariantProvider,{variant:o},t.createElement("div",{className:i,style:c},a&&t.createElement(s.Label,Object.assign({},(0,d.getLabelProps)(),{style:{display:"block"}}),a),n,l&&o&&t.createElement(r.FeedbackText,{variant:o},l)))},E=function(e,n){switch(n.type){case"request results":return{items:[],loading:!0};case"received results":return{items:n.payload,loading:!1}}},w=function(e,a){void 0===a&&(a=250);var r,l="function"==typeof e,o=t.useMemo((function(){return l?e:function(){return Promise.resolve(e)}}),[e,l]),i=t.useReducer(E,{items:l?[]:e,loading:!1}),s=i[0],d=s.items,u=s.loading,m=i[1],p=(r=t.useRef(!0),t.useEffect((function(){return function(){r.current=!1}}),[]),r.current),b=t.useCallback((function(e){try{return p?(m({type:"request results"}),Promise.resolve(o(e)).then((function(e){p&&m({type:"received results",payload:e})}))):Promise.resolve()}catch(e){return Promise.reject(e)}}),[o,p]),f=function(e){return t.useMemo((function(){return e.map((function(e){return"string"==typeof e?{value:e,label:e}:"value"in e?e:c({},e,{value:e.label})}))}),[e])}(d);return t.useEffect((function(){l&&b("")}),[l,b]),{items:f,loading:!!l&&u,fetchItems:n.debounce(b,a)}};n.warnAboutMissingStyles("dropdown","form","a11y"),exports.Dropdown=function(e){var n=e.debounceTimeout,a=e.disabled,r=e.feedback,l=e.items,o=e.label,i=e.loadingText,s=e.onChange,c=void 0===s?function(){}:s,u=e.placeholder,p=e.prepend,b=e.readOnly,f=e.searchable,g=e.selectOnTab,v=e.openOnFocus,E=e.variant,N=e.value,T=e.className,x=e.style,_=d(e,["debounceTimeout","disabled","feedback","items","label","loadingText","onChange","placeholder","prepend","readOnly","searchable","selectOnTab","openOnFocus","variant","value","className","style"]),j=w(l,n),I=j.items,k=j.loading,P=j.fetchItems,C=I.find((function(e){return N===e.value})),F=f?h:y;return t.createElement(m,Object.assign({selectedItem:C,onInputValueChange:P,onChange:c,value:N},_),t.createElement(O,{className:T,label:o,feedback:r,variant:E,style:x},t.createElement(F,{items:I,loading:k,loadingText:i,disabled:a,readOnly:b,placeholder:u,prepend:p,selectOnTab:g,openOnFocus:v})))},exports.NativeDropdown=function(e){var n=e.className,a=e.disabled,l=void 0!==a&&a,i=e.readOnly,s=void 0!==i&&i,c=e.items,u=e.loadingText,m=e.prepend,p=e.style,b=e.label,f=e.variant,v=e.feedback,y=d(e,["className","disabled","readOnly","items","loadingText","prepend","style","label","variant","feedback"]),h=w(c),O=h.items,E=h.loading,N=t.createElement(o.DownArrowIcon,{inline:!0});return l||s?N=null:E&&(N=t.createElement(g,null,u)),t.createElement(r.InputGroup,{label:b,feedback:v,variant:f},t.createElement(r.BaseFormControl,{dark:!0,disabled:l,readOnly:s,prepend:m,append:N,className:n,style:p},t.createElement("select",Object.assign({"aria-invalid":"error"===f,className:"eds-form-control eds-dropdown",disabled:l||s},y),O.map((function(e){return t.createElement("option",{key:e.value,value:e.value},e.label)})))))}; | ||
//# sourceMappingURL=dropdown.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
import { warnAboutMissingStyles } from '@entur/utils'; | ||
import { debounce, warnAboutMissingStyles } from '@entur/utils'; | ||
import React from 'react'; | ||
@@ -191,3 +191,3 @@ import Downshift from 'downshift'; | ||
}, rest), React.createElement("button", Object.assign({}, getToggleButtonProps({ | ||
className: 'eds-form-control', | ||
className: 'eds-form-control eds-dropdown__selected-item', | ||
style: { | ||
@@ -273,3 +273,4 @@ textAlign: 'left' | ||
variant = _ref.variant, | ||
className = _ref.className; | ||
className = _ref.className, | ||
style = _ref.style; | ||
@@ -282,3 +283,4 @@ var _useDownshift = useDownshift(), | ||
}, React.createElement("div", { | ||
className: classNames(className) | ||
className: className, | ||
style: style | ||
}, label && React.createElement(Label, Object.assign({}, getLabelProps(), { | ||
@@ -314,16 +316,2 @@ style: { | ||
function debounce(fn, delay) { | ||
var id; | ||
return function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
clearTimeout(id); | ||
id = setTimeout(function () { | ||
return fn.apply(void 0, args); | ||
}, delay); | ||
}; | ||
} | ||
var useIsMounted = function useIsMounted() { | ||
@@ -441,3 +429,4 @@ var isMountedRef = React.useRef(true); | ||
className = _ref.className, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["debounceTimeout", "disabled", "feedback", "items", "label", "loadingText", "onChange", "placeholder", "prepend", "readOnly", "searchable", "selectOnTab", "openOnFocus", "variant", "value", "className"]); | ||
style = _ref.style, | ||
rest = _objectWithoutPropertiesLoose(_ref, ["debounceTimeout", "disabled", "feedback", "items", "label", "loadingText", "onChange", "placeholder", "prepend", "readOnly", "searchable", "selectOnTab", "openOnFocus", "variant", "value", "className", "style"]); | ||
@@ -449,3 +438,3 @@ var _useResolvedItems = useResolvedItems(items, debounceTimeout), | ||
var initialSelectedItem = normalizedItems.find(function (item) { | ||
var selectedItem = normalizedItems.find(function (item) { | ||
return value === item.value; | ||
@@ -455,10 +444,12 @@ }); | ||
return React.createElement(DownshiftProvider, Object.assign({ | ||
initialSelectedItem: initialSelectedItem, | ||
selectedItem: selectedItem, | ||
onInputValueChange: fetchItems, | ||
onChange: onChange | ||
onChange: onChange, | ||
value: value | ||
}, rest), React.createElement(DropdownInputGroup, { | ||
className: classNames(className), | ||
className: className, | ||
label: label, | ||
feedback: feedback, | ||
variant: variant | ||
variant: variant, | ||
style: style | ||
}, React.createElement(RenderedDropdown, { | ||
@@ -465,0 +456,0 @@ items: normalizedItems, |
{ | ||
"name": "@entur/dropdown", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"license": "EUPL-1.2", | ||
@@ -30,10 +30,10 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@entur/a11y": "^0.2.9", | ||
"@entur/form": "^2.2.3", | ||
"@entur/tokens": "^1.1.2", | ||
"@entur/utils": "^0.2.1", | ||
"@entur/a11y": "^0.2.10", | ||
"@entur/form": "^2.2.4", | ||
"@entur/tokens": "^1.1.3", | ||
"@entur/utils": "^0.2.2", | ||
"classnames": "^2.2.6", | ||
"downshift": "^4.0.1" | ||
}, | ||
"gitHead": "4e5dd73656a73309e6b1b02a5279e5dbcb86c234" | ||
"gitHead": "a0c928bf8497bee3271fa0ee886fb7c311777b0e" | ||
} |
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
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
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
167674
26
1276
Updated@entur/a11y@^0.2.10
Updated@entur/form@^2.2.4
Updated@entur/tokens@^1.1.3
Updated@entur/utils@^0.2.2