@progress/kendo-react-dropdowns 8.2.0-develop.9 → 8.2.1-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),g=require("prop-types"),q=require("../common/SearchBar.js"),E=require("../common/ListContainer.js"),T=require("../common/List.js"),k=require("../common/DropDownBase.js"),N=require("../common/GroupStickyHeader.js"),I=require("../common/utils.js"),l=require("@progress/kendo-react-common"),L=require("@progress/kendo-react-labels"),R=require("../package-metadata.js"),H=require("../common/ClearButton.js"),_=require("../common/withCustomComponent.js");function z(x){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(x){for(const t in x)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(x,t);Object.defineProperty(a,t,e.get?e:{enumerable:!0,get:()=>x[t]})}}return a.default=x,Object.freeze(a)}const y=z(B),A="Please enter a valid value!",{sizeMap:O,roundedMap:G}=l.kendoThemeMaps,b=class b extends y.Component{constructor(a){super(a),this.state={},this.base=new k(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[]}=this.props,n=I.getItemValue(s[t],this.props.textField);this.triggerOnChange(n,e)},this.itemFocus=(t,e)=>{const{data:s=[],textField:n}=this.props,i=s[t];I.areSame(this.state.focusedItem,i,n)||(e.data.focusedItem=i)},this.togglePopup=t=>{this.base.togglePopup(t)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||A)},this.onScroll=t=>{this._isScrolling=!0;const{list:e}=this.base,{groupField:s}=this.props;let{data:n=[]}=this.props;if(!s||!n.length)return;const i=this.itemHeight||(e?e.children[0].offsetHeight:0),p=t.target.scrollTop;s&&(n=this.base.getGroupedDataModernMode(n,s));let o=n[0][s];for(let d=1;d<n.length&&!(i*d>p);d++)n[d]&&n[d][s]&&(o=n[d][s]);o!==this.state.group&&this.setState({group:o})},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.onChangeHandler=t=>{const s=this.base.initState(),n=t.currentTarget,i=n.value,r=n.selectionEnd===i.length;s.syntheticEvent=t;const p=this._suggested,o=this.value,d=o&&o.substring(0,o.length-p.length),m=d&&d===i,h=d&&d.length>i.length,{suggest:f}=this.props,u=this.props.opened!==void 0?this.props.opened:this.state.opened;if(f!==void 0&&f!==!1){m||h||!r?this._suggested="":this.suggestValue(i);const c=i+this._suggested,v={userInput:i,value:this._suggested};this.triggerOnChange(c,s,{suggestion:v})}else this._suggested="",this.triggerOnChange(i,s);(!u&&i||u&&!i)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=t=>{const s=this.base.initState(),n=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=t;const i="";this._suggested="",this.triggerOnChange(i,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),n&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,groupField:n,textField:i}=this.props;this._isScrolling&&(this._isScrolling=!1);const r=this.focusedIndex(),p=e[r],o=t.keyCode,d=t.altKey,m=this.props.opened!==void 0?this.props.opened:this.state.opened,h=this.base.initState();h.syntheticEvent=t;const f=()=>{m&&t.preventDefault()};if(d&&o===l.Keys.down)this.setState({opened:!0});else if(d&&o===l.Keys.up)this.setState({opened:!1});else if(m&&o===l.Keys.pageUp)f(),this.base.scrollPopupByPageSize(-1);else if(m&&o===l.Keys.pageDown)f(),this.base.scrollPopupByPageSize(1);else if(m&&(o===l.Keys.enter||o===l.Keys.esc))f(),s===!1&&p&&p.disabled?(m&&this.togglePopup(h),this.applyState(h)):this.applyInputValue(t.currentTarget.value,h,t.keyCode);else if(!m&&o===l.Keys.esc){const u="";this._suggested="",this.triggerOnChange(u,h),this.state.focusedItem!==void 0&&(h.data.focusedItem=void 0),this.applyState(h)}else if(o===l.Keys.up||o===l.Keys.down){if(n!==""&&i)if(!this.props.skipDisabledItems&&m)this.onNavigate(h,o);else{let u=0;if(o===l.Keys.down||o===l.Keys.right){const c=e.slice(r+1).find(v=>!v.disabled&&v[i]);u=c&&e.findIndex(v=>v[i]===c[i])}else if(o===l.Keys.up||o===l.Keys.left){let c;if(r===-1)c=e,u=e.findIndex(v=>!v.disabled&&v[i]);else{c=e.slice(0,r);let v=c.pop();for(;v&&v.disabled;)v=c.pop();u=v&&e.findIndex(C=>C[i]===v[i])}}if(u!==void 0){const c=u-r;this.onNavigate(h,o,c)}else u===void 0&&e.findIndex(c=>c[i])===e.length-1&&this.onNavigate(h,o)}else if(!this.props.skipDisabledItems&&m)this.onNavigate(h,o);else{let u=null;if(o===l.Keys.down||o===l.Keys.right)u=e.slice(r+1).find(c=>!c.disabled);else if(o===l.Keys.up||o===l.Keys.left){const c=e.slice(0,r);for(u=c.pop();u&&u.disabled;)u=c.pop()}if(u){const c=u.id-r-1;this.onNavigate(h,o,c)}else this.onNavigate(h,o)}this.applyState(h),f()}},this.handleBlur=t=>{if(this.state.focused){const e=this.base.initState();e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,this.applyInputValue(t.currentTarget.value,e)}},l.validatePackage(R.packageMetadata)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,t=!this.required||this.value!=="",e=this.props.valid!==void 0?this.props.valid:t;return{customError:a,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:b.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:b.defaultProps.required}componentDidUpdate(a,t){var f;const{groupField:e="",data:s=[]}=this.props,{data:n=[]}=a,i=this.focusedIndex(),r=s[i],p=n!==s,o=r!==void 0&&t.focusedItem!==r,d=this.props.opened!==void 0?this.props.opened:this.state.opened,m=a.opened!==void 0?a.opened:t.opened,h=!m&&d;if(e==="")(d&&(o||p)||h)&&this.base.scrollToItem(i);else if(!this._isScrolling){const u=(f=this.base.getGroupedDataModernMode(s,e))==null?void 0:f.indexOf(r);h&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][e],this),this.base.scrollToItem(u)),d&&m&&o&&this.base.scrollToItem(u)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:a,disabled:t,label:e,className:s,style:n,loading:i,suggest:r,size:p,rounded:o,fillMode:d}=this.props,m=!this.validityStyles||this.validity.valid,h=this.base,f=this.value,u=this.props.clearButton!==!1&&!i&&!!f,c=this.props.id||this._inputId,v=this.state.focused;typeof r=="string"&&(this._suggested=r);const[C,K]=_(this.props.prefix||y.Fragment),[V,M]=_(this.props.suffix||y.Fragment),w=y.createElement("span",{className:l.classNames("k-autocomplete k-input",s,{[`k-input-${O[p]||p}`]:p,[`k-rounded-${G[o]||o}`]:o,[`k-input-${d}`]:d,"k-invalid":!m,"k-focus":v&&!t,"k-loading":i,"k-required":this.required,"k-disabled":t}),ref:D=>{this._element=D,h.wrapper=D},style:e?{...n,width:void 0}:n,dir:a},this.props.prefix&&y.createElement(C,{...K}),this.renderSearchBar(f||"",c),i&&y.createElement(l.IconWrap,{className:"k-input-loading-icon",name:"loading"}),u&&!i&&y.createElement(H,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&y.createElement(V,{...M}),this.renderListContainer());return e?y.createElement(L.FloatingLabel,{label:e,editorId:c,editorValue:f,editorValid:m,editorDisabled:t,style:{width:n?n.width:void 0},children:w}):w}onNavigate(a,t,e){const s=this.value,{data:n=[],textField:i,focusedItemIndex:r}=this.props,p=this.state.focusedItem!==void 0?n.findIndex(d=>I.areSame(d,this.state.focusedItem,i)):r?r(n,s,i):n.indexOf(I.getFocusedItem(n,s,i)),o=this.base.navigation.navigate({keyCode:t,current:p,max:n.length-1,min:0,skipItems:e||void 0});o!==void 0&&this.itemFocus(o,a),this.applyState(a)}applyInputValue(a,t,e){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:n=[],textField:i}=this.props,r=this.focusedIndex(),p=n[r];if(this._suggested="",s&&e===l.Keys.enter&&p&&!p.disabled){const o=I.getItemValue(n[this.focusedIndex(a)],i);this.triggerOnChange(o,t)}s&&this.togglePopup(t),this.applyState(t)}renderSearchBar(a,t){const e=this.base,{placeholder:s,tabIndex:n,disabled:i,readonly:r}=this.props,{focused:p}=this.state,o=this.props.opened!==void 0?this.props.opened:this.state.opened;return y.createElement(q,{id:t,placeholder:s,tabIndex:n,accessKey:this.props.accessKey,value:a,suggestedText:this._suggested,focused:p,name:this.props.name,ref:d=>this._input=d&&d.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:e.handleFocus,onBlur:this.handleBlur,disabled:i,readOnly:r,expanded:o,owns:e.listBoxId,activedescendant:"option-"+e.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const a=this.base,{dir:t,header:e,footer:s,data:n=[],size:i,groupField:r,list:p,groupStickyHeaderItemRender:o}=this.props,d=a.getPopupSettings(),m=this.props.opened!==void 0?this.props.opened:this.state.opened,h=d.width!==void 0?d.width:a.popupWidth;let{group:f}=this.state;return f===void 0&&r!==void 0&&(f=I.getItemValue(n[0],r)),y.createElement(E,{width:h,popupSettings:{...d,anchor:d.anchor||this.element,show:m,popupClass:l.classNames(d.popupClass,"k-list-container","k-autocomplete-popup")},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},e&&y.createElement("div",{className:"k-list-header"},e),y.createElement("div",{className:l.classNames("k-list",{[`k-list-${O[i]||i}`]:i})},!p&&f&&n.length!==0&&y.createElement(N,{group:f,groupMode:"modern",render:o}),this.renderList()),s&&y.createElement("div",{className:"k-list-footer"},s))}renderList(){const a=this.base,t=a.getPopupSettings(),{textField:e,data:s=[],listNoDataRender:n,itemRender:i,groupHeaderItemRender:r}=this.props,p=this.value,o=this.props.opened!==void 0?this.props.opened:this.state.opened;return y.createElement(T,{id:a.listBoxId,show:o,data:s.slice(),focusedIndex:this.focusedIndex(),value:p,textField:e,valueField:e,highlightSelected:!1,optionsGuid:a.guid,groupField:this.props.groupField,groupMode:"modern",listRef:d=>a.list=d,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:r,noDataRender:n,onMouseDown:d=>d.preventDefault(),onScroll:this.onScroll})}triggerOnChange(a,t,e){this.value===a&&!e||(t.data.value=a,this._valueDuringOnChange=a,t.events.push({type:"onChange",...e||{}}))}applyState(a){this.base.applyState(a),this._valueDuringOnChange=void 0}suggestValue(a){if(this._suggested="",a){const{data:t=[],textField:e}=this.props,s=t[I.itemIndexStartsWith(t,a,e)];if(s){const n=I.getItemValue(s,e);a.toLowerCase()!==n.toLowerCase()&&(this._suggested=n.substring(a.length))}}}focusedIndex(a){const{data:t=[],textField:e,focusedItemIndex:s,skipDisabledItems:n}=this.props,i=a!==void 0?a:this.value;if(this.state.focusedItem!==void 0)return t.findIndex(r=>I.areSame(r,this.state.focusedItem,e));if(s)return s(t,i,e);{const r=t.indexOf(I.getFocusedItem(t,i,e));return n&&e&&r===-1?t.findIndex(p=>!p.disabled&&p[e]):Math.max(0,r)}}};b.displayName="AutoComplete",b.propTypes={...k.basicPropTypes,size:g.oneOf([null,"small","medium","large"]),rounded:g.oneOf([null,"small","medium","large","full"]),fillMode:g.oneOf([null,"solid","flat","outline"]),groupField:g.string,suggest:g.oneOfType([g.bool,g.string]),placeholder:g.string,value:g.string,defaultValue:g.string,validationMessage:g.string,required:g.bool,readonly:g.bool,clearButton:g.bool,valueRender:g.func,id:g.string,ariaLabelledBy:g.string,ariaDescribedBy:g.string,list:g.any,skipDisabledItems:g.bool},b.defaultProps={...k.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let S=b;const P=l.createPropsContext(),F=l.withIdHOC(l.withPropsContext(P,S));F.displayName="KendoReactAutoComplete";exports.AutoComplete=F;exports.AutoCompletePropsContext=P;exports.AutoCompleteWithoutContext=S;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),f=require("prop-types"),q=require("../common/SearchBar.js"),E=require("../common/ListContainer.js"),T=require("../common/List.js"),k=require("../common/DropDownBase.js"),N=require("../common/GroupStickyHeader.js"),g=require("../common/utils.js"),l=require("@progress/kendo-react-common"),L=require("@progress/kendo-react-labels"),R=require("../package-metadata.js"),H=require("../common/ClearButton.js"),F=require("../common/withCustomComponent.js");function z(x){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(x){for(const e in x)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(x,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>x[e]})}}return a.default=x,Object.freeze(a)}const I=z(B),A="Please enter a valid value!",{sizeMap:_,roundedMap:G}=l.kendoThemeMaps,b=class b extends I.Component{constructor(a){super(a),this.state={},this.base=new k(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,s)=>{const i=g.getFilteredData(this.props),t=g.getItemValue(i[e],this.props.textField);this.triggerOnChange(t,s)},this.itemFocus=(e,s)=>{const{textField:i}=this.props,o=g.getFilteredData(this.props)[e];g.areSame(this.state.focusedItem,o,i)||(s.data.focusedItem=o)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||A)},this.onScroll=e=>{this._isScrolling=!0;const{list:s}=this.base,{groupField:i}=this.props;let t=g.getFilteredData(this.props);if(!i||!t.length)return;const o=this.itemHeight||(s?s.children[0].offsetHeight:0),p=e.target.scrollTop;i&&(t=this.base.getGroupedDataModernMode(t,i));let n=t[0][i];for(let r=1;r<t.length&&!(o*r>p);r++)t[r]&&t[r][i]&&(n=t[r][i]);n!==this.state.group&&this.setState({group:n})},this.handleItemClick=(e,s)=>{this.base.handleItemClick(e,s),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const i=this.base.initState(),t=e.currentTarget,o=t.value,d=t.selectionEnd===o.length;i.syntheticEvent=e;const p=this._suggested,n=this.value,r=n&&n.substring(0,n.length-p.length),v=r&&r===o,h=r&&r.length>o.length,{suggest:m}=this.props,u=this.props.opened!==void 0?this.props.opened:this.state.opened;if(m!==void 0&&m!==!1){v||h||!d?this._suggested="":this.suggestValue(o);const c=o+this._suggested,y={userInput:o,value:this._suggested};this.triggerOnChange(c,i,{suggestion:y})}else this._suggested="",this.triggerOnChange(o,i);(!u&&o||u&&!o)&&this.togglePopup(i),i.data.focusedItem=void 0,this.applyState(i),this.setState({group:void 0})},this.clearButtonClick=e=>{const i=this.base.initState(),t=this.props.opened!==void 0?this.props.opened:this.state.opened;i.syntheticEvent=e;const o="";this._suggested="",this.triggerOnChange(o,i),this.state.focusedItem!==void 0&&(i.data.focusedItem=void 0),t&&this.togglePopup(i),this.applyState(i)},this.onInputKeyDown=e=>{const{skipDisabledItems:s,groupField:i,textField:t}=this.props,o=g.getFilteredData(this.props);this._isScrolling&&(this._isScrolling=!1);const d=this.focusedIndex(),p=o[d],n=e.keyCode,r=e.altKey,v=this.props.opened!==void 0?this.props.opened:this.state.opened,h=this.base.initState();h.syntheticEvent=e;const m=()=>{v&&e.preventDefault()};if(r&&n===l.Keys.down)this.setState({opened:!0});else if(r&&n===l.Keys.up)this.setState({opened:!1});else if(v&&n===l.Keys.pageUp)m(),this.base.scrollPopupByPageSize(-1);else if(v&&n===l.Keys.pageDown)m(),this.base.scrollPopupByPageSize(1);else if(v&&(n===l.Keys.enter||n===l.Keys.esc))m(),s===!1&&p&&p.disabled?(v&&this.togglePopup(h),this.applyState(h)):this.applyInputValue(e.currentTarget.value,h,e.keyCode);else if(!v&&n===l.Keys.esc){const u="";this._suggested="",this.triggerOnChange(u,h),this.state.focusedItem!==void 0&&(h.data.focusedItem=void 0),this.applyState(h)}else if(n===l.Keys.up||n===l.Keys.down){if(i!==""&&t)if(!this.props.skipDisabledItems&&v)this.onNavigate(h,n);else{let u=0;if(n===l.Keys.down||n===l.Keys.right){const c=o.slice(d+1).find(y=>!y.disabled&&y[t]);u=c&&o.findIndex(y=>y[t]===c[t])}else if(n===l.Keys.up||n===l.Keys.left){let c;if(d===-1)c=o,u=o.findIndex(y=>!y.disabled&&y[t]);else{c=o.slice(0,d);let y=c.pop();for(;y&&y.disabled;)y=c.pop();u=y&&o.findIndex(C=>C[t]===y[t])}}if(u!==void 0){const c=u-d;this.onNavigate(h,n,c)}else u===void 0&&o.findIndex(c=>c[t])===o.length-1&&this.onNavigate(h,n)}else if(!this.props.skipDisabledItems&&v)this.onNavigate(h,n);else{let u=null;if(n===l.Keys.down||n===l.Keys.right)u=o.slice(d+1).find(c=>!c.disabled);else if(n===l.Keys.up||n===l.Keys.left){const c=o.slice(0,d);for(u=c.pop();u&&u.disabled;)u=c.pop()}if(u){const c=u.id-d-1;this.onNavigate(h,n,c)}else this.onNavigate(h,n)}this.applyState(h),m()}},this.handleBlur=e=>{if(this.state.focused){const s=this.base.initState();s.data.focused=!1,s.events.push({type:"onBlur"}),s.syntheticEvent=e,this.applyInputValue(e.currentTarget.value,s)}},l.validatePackage(R.packageMetadata)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=!this.required||this.value!=="",s=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:s,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:b.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:b.defaultProps.required}componentDidUpdate(a,e){var m;const{groupField:s=""}=this.props,i=g.getFilteredData(this.props),{data:t=[]}=a,o=this.focusedIndex(),d=i[o],p=t!==i,n=d!==void 0&&e.focusedItem!==d,r=this.props.opened!==void 0?this.props.opened:this.state.opened,v=a.opened!==void 0?a.opened:e.opened,h=!v&&r;if(s==="")(r&&(n||p)||h)&&this.base.scrollToItem(o);else if(!this._isScrolling){const u=(m=this.base.getGroupedDataModernMode(i,s))==null?void 0:m.indexOf(d);h&&(i&&i.length!==0&&this.base.resetGroupStickyHeader(i[0][s],this),this.base.scrollToItem(u)),r&&v&&n&&this.base.scrollToItem(u)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:a,disabled:e,label:s,className:i,style:t,loading:o,suggest:d,size:p,rounded:n,fillMode:r}=this.props,v=!this.validityStyles||this.validity.valid,h=this.base,m=this.value,u=this.props.clearButton!==!1&&!o&&!!m,c=this.props.id||this._inputId,y=this.state.focused;typeof d=="string"&&(this._suggested=d);const[C,K]=F(this.props.prefix||I.Fragment),[V,M]=F(this.props.suffix||I.Fragment),D=I.createElement("span",{className:l.classNames("k-autocomplete k-input",i,{[`k-input-${_[p]||p}`]:p,[`k-rounded-${G[n]||n}`]:n,[`k-input-${r}`]:r,"k-invalid":!v,"k-focus":y&&!e,"k-loading":o,"k-required":this.required,"k-disabled":e}),ref:w=>{this._element=w,h.wrapper=w},style:s?{...t,width:void 0}:t,dir:a},this.props.prefix&&I.createElement(C,{...K}),this.renderSearchBar(m||"",c),o&&I.createElement(l.IconWrap,{className:"k-input-loading-icon",name:"loading"}),u&&!o&&I.createElement(H,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&I.createElement(V,{...M}),this.renderListContainer());return s?I.createElement(L.FloatingLabel,{label:s,editorId:c,editorValue:m,editorValid:v,editorDisabled:e,style:{width:t?t.width:void 0},children:D}):D}onNavigate(a,e,s){const i=this.value,{textField:t,focusedItemIndex:o}=this.props,d=g.getFilteredData(this.props),p=this.state.focusedItem!==void 0?d.findIndex(r=>g.areSame(r,this.state.focusedItem,t)):o?o(d,i,t):d.indexOf(g.getFocusedItem(d,i,t)),n=this.base.navigation.navigate({keyCode:e,current:p,max:d.length-1,min:0,skipItems:s||void 0});n!==void 0&&this.itemFocus(n,a),this.applyState(a)}applyInputValue(a,e,s){const i=this.props.opened!==void 0?this.props.opened:this.state.opened,{textField:t}=this.props,o=g.getFilteredData(this.props),d=this.focusedIndex(),p=o[d];if(this._suggested="",i&&s===l.Keys.enter&&p&&!p.disabled){const n=g.getItemValue(o[this.focusedIndex(a)],t);this.triggerOnChange(n,e)}i&&this.togglePopup(e),this.applyState(e)}renderSearchBar(a,e){const s=this.base,{placeholder:i,tabIndex:t,disabled:o,readonly:d}=this.props,{focused:p}=this.state,n=this.props.opened!==void 0?this.props.opened:this.state.opened;return I.createElement(q,{id:e,placeholder:i,tabIndex:t,accessKey:this.props.accessKey,value:a,suggestedText:this._suggested,focused:p,name:this.props.name,ref:r=>this._input=r&&r.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:o,readOnly:d,expanded:n,owns:s.listBoxId,activedescendant:"option-"+s.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const a=this.base,{dir:e,header:s,footer:i,size:t,groupField:o,list:d,groupStickyHeaderItemRender:p}=this.props,n=g.getFilteredData(this.props),r=a.getPopupSettings(),v=this.props.opened!==void 0?this.props.opened:this.state.opened,h=r.width!==void 0?r.width:a.popupWidth;let{group:m}=this.state;return m===void 0&&o!==void 0&&(m=g.getItemValue(n[0],o)),I.createElement(E,{width:h,popupSettings:{...r,anchor:r.anchor||this.element,show:v,popupClass:l.classNames(r.popupClass,"k-list-container","k-autocomplete-popup")},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[n.length]},s&&I.createElement("div",{className:"k-list-header"},s),I.createElement("div",{className:l.classNames("k-list",{[`k-list-${_[t]||t}`]:t})},!d&&m&&n.length!==0&&I.createElement(N,{group:m,groupMode:"modern",render:p}),this.renderList()),i&&I.createElement("div",{className:"k-list-footer"},i))}renderList(){const a=this.base,e=a.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:t,groupHeaderItemRender:o}=this.props,d=g.getFilteredData(this.props),p=this.value,n=this.props.opened!==void 0?this.props.opened:this.state.opened;return I.createElement(T,{id:a.listBoxId,show:n,data:d.slice(),focusedIndex:this.focusedIndex(),value:p,textField:s,valueField:s,highlightSelected:!1,optionsGuid:a.guid,groupField:this.props.groupField,groupMode:"modern",listRef:r=>a.list=r,wrapperStyle:{maxHeight:e.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:t,groupHeaderItemRender:o,noDataRender:i,onMouseDown:r=>r.preventDefault(),onScroll:this.onScroll})}triggerOnChange(a,e,s){this.value===a&&!s||(e.data.value=a,this._valueDuringOnChange=a,e.events.push({type:"onChange",...s||{}}))}applyState(a){this.base.applyState(a),this._valueDuringOnChange=void 0}suggestValue(a){if(this._suggested="",a){const{textField:e}=this.props,s=g.getFilteredData(this.props),i=s[g.itemIndexStartsWith(s,a,e)];if(i){const t=g.getItemValue(i,e);a.toLowerCase()!==t.toLowerCase()&&(this._suggested=t.substring(a.length))}}}focusedIndex(a){const{textField:e,focusedItemIndex:s,skipDisabledItems:i}=this.props,t=g.getFilteredData(this.props),o=a!==void 0?a:this.value;if(this.state.focusedItem!==void 0)return t.findIndex(d=>g.areSame(d,this.state.focusedItem,e));if(s)return s(t,o,e);{const d=t.indexOf(g.getFocusedItem(t,o,e));return i&&e&&d===-1?t.findIndex(p=>!p.disabled&&p[e]):Math.max(0,d)}}};b.displayName="AutoComplete",b.propTypes={...k.basicPropTypes,size:f.oneOf([null,"small","medium","large"]),rounded:f.oneOf([null,"small","medium","large","full"]),fillMode:f.oneOf([null,"solid","flat","outline"]),groupField:f.string,suggest:f.oneOfType([f.bool,f.string]),placeholder:f.string,value:f.string,defaultValue:f.string,validationMessage:f.string,required:f.bool,readonly:f.bool,clearButton:f.bool,valueRender:f.func,id:f.string,ariaLabelledBy:f.string,ariaDescribedBy:f.string,list:f.any,skipDisabledItems:f.bool},b.defaultProps={...k.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let S=b;const O=l.createPropsContext(),P=l.withIdHOC(l.withPropsContext(O,S));P.displayName="KendoReactAutoComplete";exports.AutoComplete=P;exports.AutoCompletePropsContext=O;exports.AutoCompleteWithoutContext=S;