@progress/kendo-react-dropdowns 7.4.0-develop.1 → 7.4.0-develop.11

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 Z=require("react"),I=require("prop-types"),F=require("../common/DropDownBase.js"),g=require("@progress/kendo-react-common"),ee=require("@progress/kendo-react-labels"),u=require("../common/utils.js"),te=require("../common/SearchBar.js"),se=require("../common/ListContainer.js"),ie=require("../common/List.js"),oe=require("../common/ListFilter.js"),R=require("../common/GroupStickyHeader.js"),ae=require("../package-metadata.js"),ne=require("../common/ClearButton.js"),q=require("@progress/kendo-react-buttons"),A=require("@progress/kendo-svg-icons"),C=require("../messages/index.js"),z=require("@progress/kendo-react-intl"),_=require("@progress/kendo-react-layout"),E=require("../common/constants.js"),H=require("../common/withCustomComponent.js");function le(w){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const e in w)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(w,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>w[e]})}}return s.default=w,Object.freeze(s)}const c=le(Z),re="Please enter a valid value!",{sizeMap:D,roundedMap:de}=g.kendoThemeMaps,k=class k extends c.Component{constructor(s){super(s),this.state={},this.base=new F(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{data:n=[],virtual:i,dataItemKey:l}=this.props,d=i?i.skip:0,a=n[e-d],r=!u.areSame(a,this.value,l);this.triggerOnChange(a,t),this.state.text!==void 0&&(t.data.text=void 0),r&&this.base.triggerPageChangeCornerItems(a,t)},this.onPopupOpened=()=>{setTimeout(()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)},300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{data:t=[],skipDisabledItems:n,textField:i}=this.props,l=this.getFocusedIndex(),d=this.getCurrentValueDisabledStatus(i,t,l),a=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.base.initState();if(r.syntheticEvent=e,!n&&i&&d&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(r),!a&&this.mobileMode){const o=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(o,r)}this.applyState(r)},this.renderMobileListFilter=()=>{const e=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text,t=u.getItemValue(this.value,this.props.textField),n=u.isPresent(e)?e:t;return c.createElement(oe,{value:n,ref:i=>this._adaptiveFilterInput=i&&i.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,t.data.text=e.target.value,this.base.filterChanged(e.target.value,t),this.applyState(t)},this.onScroll=e=>{const{vs:t,list:n}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let{data:l=[]}=this.props;if(!i||!l.length)return;const d=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:n?n.children[0].offsetHeight:0),r=e.target.scrollTop-t.skip*d;this.props.groupMode==="modern"&&(l=this.base.getGroupedDataModernMode(l,i));let o=l[0][i];for(let h=1;h<l.length&&!(d*h>r);h++)l[h]&&l[h][i]&&(o=l[h][i]);o!==this.state.group&&(this.setState({group:o}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:o}))},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleBlur=e=>{if(this.state.focused&&!this._skipBlur){const t=this.base.initState(),{textField:n,data:i=[]}=this.props,l=this.getFocusedIndex(),a=!(l===-1)&&this.getCurrentValueDisabledStatus(n,i,l);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,n&&a&&this.clearValueOnBlur(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,t)}},this.onInputClick=e=>{const t=this.props.opened!==void 0?this.props.opened:this.state.opened,n=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const i=this.base.initState();i.syntheticEvent=e,this.base.togglePopup(i),this.base.filterChanged(n,i),this.applyState(i)}},this.onInputKeyDown=e=>{const{data:t=[],skipDisabledItems:n,textField:i,dataItemKey:l,groupField:d}=this.props,a=this.value,r=Math.max(0,t.findIndex(m=>u.areSame(m,a,l))),o=e.keyCode,h=this.props.opened!==void 0?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(o===g.Keys.up||o===g.Keys.down)){if(e.preventDefault(),d!==""&&i)if(!this.props.skipDisabledItems&&h)this.onNavigate(p,o);else{let m=0;if(o===g.Keys.down||o===g.Keys.right){const f=t.slice(r+1<t.length?r+1:r).find(y=>!y.disabled&&y[i]);m=f&&t.findIndex(y=>y[i]===f[i])}else if(o===g.Keys.up||o===g.Keys.left){let f;if(r===0)f=t,m=t.findIndex(y=>!y.disabled&&y[i]);else{f=t.slice(0,r);let y=f.pop();for(;y&&y.disabled;)y=f.pop();m=y&&t.findIndex(O=>O[i]===y[i])}}if(m!==void 0){const f=m-r;this.onNavigate(p,o,f)}else m===void 0&&t.findIndex(f=>f[i]===a[i])===t.length-1&&this.onNavigate(p,o)}else if(!this.props.skipDisabledItems&&h)this.onNavigate(p,o);else{let m=null;if(o===g.Keys.down||o===g.Keys.right)m=t.slice(r+1).find(f=>!f.disabled);else if(o===g.Keys.up||o===g.Keys.left){const f=t.slice(0,r);for(m=f.pop();m&&m.disabled;)m=f.pop()}if(m){const f=m.id-r-1;this.onNavigate(p,o,f)}else this.onNavigate(p,o)}this.applyState(p)}const v=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},x=this.getFocusedIndex(),b=x===-1,S=!b&&this.getCurrentValueDisabledStatus(i,t,x);h?o===g.Keys.pageUp?this.base.scrollPopupByPageSize(-1):o===g.Keys.pageDown?this.base.scrollPopupByPageSize(1):e.altKey&&o===g.Keys.up?v():o===g.Keys.enter?(e.preventDefault(),(i&&!b&&e.currentTarget.value?t[x][i]:void 0)?!n&&i&&S?this.clearValueOnEnterOrEsc(e):S||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):o===g.Keys.esc&&(!n&&i&&S&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):!h&&o===g.Keys.esc?this.clearValueOnEnterOrEsc(e):e.altKey&&o===g.Keys.down&&v()},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const n=this.props.opened!==void 0?this.props.opened:this.state.opened,i=e.currentTarget,l=i.value;if(this.props.suggest){const d=i.selectionEnd===l.length;let a=this.props.filter!==void 0?this.props.filter:this.state.text;u.isPresent(a)||(a=u.getItemValue(this.value,this.props.textField)||"");const r=a&&a===l,o=a&&a.length>l.length;r||o||!d?this._suggested="":this.suggestValue(l)}this.props.filter===void 0&&(t.data.text=l),this.state.focusedItem!==void 0&&(t.data.focusedItem=void 0),n||this.base.togglePopup(t),this.base.filterChanged(l,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnBlur=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||re)},g.validatePackage(ae.packageMetadata)}get _inputId(){return this.props.id}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=E.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get value(){if(this._valueDuringOnChange!==void 0)return this._valueDuringOnChange;if(this.props.value!==void 0)return this.props.value;if(this.state.value!==void 0)return this.state.value;if(this.props.defaultValue!==void 0)return this.props.defaultValue}get index(){const{data:s=[],dataItemKey:e}=this.props,t=this.value;return s.findIndex(n=>u.areSame(n,t,e))}get name(){return this.props.name}get validity(){const s=this.props.validationMessage!==void 0,e=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:s,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:k.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:k.defaultProps.required}componentDidUpdate(s,e){var v;const{dataItemKey:t,virtual:n,groupField:i="",data:l=[],textField:d}=this.props,a=s.virtual?s.virtual.total:0,r=this.props.opened!==void 0?this.props.opened:this.state.opened,o=s.opened!==void 0?s.opened:e.opened,h=!o&&r,p=this.value;if(this._valueOnDidUpdate=p,n&&n.total!==a)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const x=s.value!==void 0?s.value:e.value;let b=l.findIndex(m=>u.areSame(m,p,t));this.props.groupMode==="modern"&&d&&p&&(b=(v=this.base.getGroupedDataModernMode(l,i))==null?void 0:v.map(m=>m[d]).indexOf(p[d]));const S=!u.areSame(x,p,t);h&&n?this.base.scrollToVirtualItem(n,b):h&&!n?(this.onPopupOpened(),l&&l.length!==0&&this.base.resetGroupStickyHeader(l[0][i],this),this.base.scrollToItem(b)):r&&o&&p&&S&&this.base.scrollToItem(b)}h&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var s;this.observerResize=g.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=z.provideLocalizationService(this).toLanguageString(C.comboArrowBtnAriaLabelExpand,C.messages[C.comboArrowBtnAriaLabelExpand]),e=z.provideLocalizationService(this).toLanguageString(C.comboArrowBtnAriaLabelCollapse,C.messages[C.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:n,clearButton:i=k.defaultProps.clearButton,label:l,textField:d,adaptive:a,className:r,style:o,loading:h,iconClassName:p,virtual:v,size:x,rounded:b,fillMode:S,opened:m=this.state.opened,placeholder:f,svgIcon:y}=this.props,{windowWidth:O=0}=this.state,P=!this.validityStyles||this.validity.valid,T=this.props.filter!==void 0?this.props.filter:this.state.text,$=u.getItemValue(this.value,d),B=u.isPresent(T)?T:$,j=i&&(!!B||u.isPresent(this.value)),M=this.base.vs,L=this.props.id||this._inputId,N=O<=E.MOBILE_MEDIUM_DEVISE&&a;M.enabled=v!==void 0,v!==void 0&&(M.skip=v.skip,M.total=v.total,M.pageSize=v.pageSize);const[G,Y]=H(this.props.prefix||c.Fragment),[J,Q]=H(this.props.suffix||c.Fragment),K=c.createElement(c.Fragment,null,c.createElement("span",{className:g.classNames("k-combobox k-input",{[`k-input-${D[x]||x}`]:x,[`k-rounded-${de[b]||b}`]:b,[`k-input-${S}`]:S,"k-invalid":!P,"k-loading":h,"k-required":this.required,"k-disabled":n},r),ref:this.componentRef,style:l?{...o,width:void 0}:o,dir:t},this.props.prefix&&c.createElement(G,{...Y}),this.renderSearchBar(B||"",L,f),j&&!h&&c.createElement(ne,{onClick:this.clearButtonClick,key:"clearbutton"}),h&&c.createElement(g.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&c.createElement(J,{...Q}),c.createElement(q.Button,{tabIndex:-1,type:"button","aria-label":m?e:s,icon:p?void 0:"caret-alt-down",svgIcon:y||A.caretAltDownIcon,iconClass:p,size:x,fillMode:S,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:X=>X.preventDefault()}),!N&&this.renderListContainer()),N&&this.renderAdaptiveListContainer());return l?c.createElement(ee.FloatingLabel,{label:l,editorId:L,editorValue:B,editorValid:P,editorDisabled:n,style:{width:o?o.width:void 0},children:K}):K}onNavigate(s,e,t){const{data:n=[],virtual:i={skip:0}}=this.props,l=this.props.filter?this.props.filter:this.state.text,d=this.getFocusedIndex(),a=this.base.vs,r=this.value;if(this._suggested="",d!==-1&&!u.isPresent(r))this.handleItemSelect(d,s);else if(l==="")this.handleItemSelect(0,s);else{const o=i.skip+d,h=this.base.navigation.navigate({keyCode:e,current:o,max:(a.enabled?a.total:n.length)-1,min:0,skipItems:t||void 0});h!==void 0&&this.handleItemSelect(h,s)}}getCurrentValueDisabledStatus(s,e,t){return s&&e&&e[t]&&e[t].disabled}applyValueOnEnter(s,e){const{data:t=[],textField:n,allowCustom:i}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,a=u.getItemValue(this.value,n)===s?this.index:u.getItemIndexByText(t,s,n),r=a!==-1;let o;if(this._suggested="",r)o=t[a];else if(i)o=n!==void 0?{[n]:s}:s;else return this.selectFocusedItem(s,e);this.triggerOnChange(o,e),l&&this.base.togglePopup(e),this.props.filter===void 0&&this.state.text!==void 0&&(e.data.text=void 0),this.applyState(e)}applyValueOnRejectSuggestions(s,e){const{data:t=[],textField:n,allowCustom:i}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,d=u.getItemValue(this.value,n),a=this.state.windowWidth&&this.state.windowWidth<=E.MOBILE_MEDIUM_DEVISE;if(this._suggested="",s===d||s===""&&!u.isPresent(d))return l&&!a&&this.base.togglePopup(e),this.applyState(e);const r=u.getItemIndexByText(t,s,n,!0),o=r!==-1;let h=null;o?h=t[r]:i&&(h=s?n?{[n]:s}:s:null),this.triggerOnChange(h,e),this.state.text!==void 0&&(e.data.text=void 0,this.base.filterChanged("",e)),l&&!a&&this.base.togglePopup(e),this.applyState(e)}selectFocusedItem(s,e){const t=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:n=[],textField:i,virtual:l={skip:0},focusedItemIndex:d=u.itemIndexStartsWith}=this.props,a=l.skip,r=s===""&&a===0?0:d(n,s,i);return r!==-1?this.handleItemSelect(r+a,e):(this.triggerOnChange(null,e),this.state.text!==void 0&&(e.data.text=void 0)),t&&this.base.togglePopup(e),this.applyState(e)}renderAdaptiveListContainer(){const{windowWidth:s=0}=this.state,{header:e,footer:t,size:n,data:i=[],groupField:l,groupMode:d,list:a,virtual:r,adaptiveTitle:o,groupStickyHeaderItemRender:h}=this.props,p=this.props.opened!==void 0?this.props.opened:this.state.opened;let{group:v}=this.state;v===void 0&&l!==void 0&&(v=u.getItemValue(i[0],l));const x={navigatable:!1,navigatableElements:[],expand:p,animation:!0,onClose:b=>this.toggleBtnClick(b),animationStyles:s<=E.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:s<=E.MOBILE_SMALL_DEVISE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return c.createElement(_.ActionSheet,{...x},c.createElement(_.ActionSheetHeader,{className:"k-text-center"},c.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},c.createElement("div",{className:"k-actionsheet-title"},c.createElement("div",null,o)),c.createElement("div",{className:"k-actionsheet-actions"},c.createElement(q.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:A.xIcon}))),c.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),c.createElement(_.ActionSheetContent,{className:"!k-overflow-hidden"},c.createElement("div",{className:"k-list-container"},c.createElement("div",{className:g.classNames({"k-list":!a,"k-list-lg":!0,"k-virtual-list":r,"k-data-table":a,[`k-table-${D[n]||n}`]:a&&n})},e&&c.createElement("div",{className:"k-table-header"},e),!a&&v&&i.length!==0&&c.createElement(R,{group:v,groupMode:d,render:h}),this.renderList(),t&&c.createElement("div",{className:"k-list-footer"},t)))))}renderListContainer(){const s=this.base,{dir:e,header:t,footer:n,data:i=[],groupField:l,groupMode:d,size:a,list:r,virtual:o,groupStickyHeaderItemRender:h}=this.props,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=s.getPopupSettings(),x=v.width!==void 0?v.width:s.popupWidth;let{group:b}=this.state;return b===void 0&&l!==void 0&&(b=u.getItemValue(i[0],l)),c.createElement(se,{width:x,popupSettings:{...v,anchor:v.anchor||this.element,show:p,popupClass:g.classNames(v.popupClass,"k-list-container","k-combobox-popup")},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[i.length]},c.createElement("div",{className:g.classNames({"k-list":!r,[`k-list-${D[a]||a}`]:!r&&a,"k-virtual-list":o,"k-data-table":r,[`k-table-${D[a]||a}`]:r&&a})},t&&c.createElement("div",{className:"k-table-header"},t),!r&&b&&i.length!==0&&c.createElement(R,{group:b,groupMode:d,render:h}),this.renderList(),n&&c.createElement("div",{className:g.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},n)))}renderList(){const s=this.base,{textField:e,dataItemKey:t,listNoDataRender:n,itemRender:i,groupHeaderItemRender:l,data:d=[],virtual:a={skip:0,total:void 0}}=this.props,r=s.getPopupSettings(),o=s.vs,h=a.skip,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=`translateY(${o.translate}px)`,x=p?this.getFocusedIndex():void 0,b=this.props.filter!==void 0?this.props.filter:this.state.text,S=u.getItemValue(this.value,e),m=u.isPresent(b)&&b!==S?null:this.value,f=this.props.list||ie;return c.createElement(f,{id:s.listBoxId,virtual:!!a,show:p,data:d,focusedIndex:x,value:m,textField:e,valueField:t,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:s.guid,listRef:y=>{o.list=this.base.list=y,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>E.MOBILE_MEDIUM_DEVISE?{maxHeight:r.height}:{},wrapperCssClass:g.classNames("k-list-content",{"k-list-scroller":!a}),listStyle:o.enabled?{transform:v}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:l,noDataRender:n,onMouseDown:y=>y.preventDefault(),onScroll:this.onScroll,wrapperRef:o.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:a.total})}renderSearchBar(s,e,t){const{tabIndex:n,disabled:i,data:l=[],dataItemKey:d,virtual:a={skip:0}}=this.props,r=this.props.opened!==void 0?this.props.opened:this.state.opened,o=this.value,h=Math.max(0,l.findIndex(p=>u.areSame(p,o,d)));return this._suggested&&!u.areSame(this._valueOnDidUpdate,o,d)&&(this._suggested=""),c.createElement(te,{id:e,readOnly:r&&this.mobileMode,placeholder:t,tabIndex:n,title:this.props.title,accessKey:this.props.accessKey,value:s+this._suggested,suggestedText:this._suggested,ref:p=>this._input=p&&p.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:i,expanded:r,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${h+a.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const s=this.base.initState();this._suggested="",this.base.filterChanged("",s),this.props.filter===void 0&&this.state.text!==void 0&&(s.data.text=void 0),this.triggerOnChange(null,s);const e=this.props.opened!==void 0?this.props.opened:this.state.opened,t=this.mobileMode;e&&!t&&this.base.togglePopup(s),this.applyState(s)}triggerOnChange(s,e){const t=this.value;!u.isPresent(t)&&!u.isPresent(s)||u.areSame(t,s,this.props.dataItemKey)||(this.props.value===void 0&&(e.data.value=s),this._valueDuringOnChange=s,e.events.push({type:"onChange"}))}getFocusedIndex(){const s=this.value,{data:e=[],textField:t,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:l=u.itemIndexStartsWith,skipDisabledItems:d}=this.props,a=this.props.filter?this.props.filter:this.state.text;return u.isPresent(s)&&a===void 0?e.findIndex(r=>u.areSame(r,s,n)):a?l(e,a,t):d&&t&&!a&&i.skip===0?e.findIndex(r=>!r.disabled&&r[t]):i.skip===0?0:-1}suggestValue(s){const{data:e,textField:t}=this.props;this._suggested=u.suggestValue(s,e,t)}applyState(s){this.base.applyState(s),this._valueDuringOnChange=void 0}calculateMedia(s){for(const e of s)this.setState({windowWidth:e.target.clientWidth})}};k.displayName="ComboBox",k.propTypes={...F.propTypes,size:I.oneOf([null,"small","medium","large"]),rounded:I.oneOf([null,"small","medium","large","full"]),fillMode:I.oneOf([null,"solid","flat","outline"]),dataItemKey:I.string,groupField:I.string,groupMode:I.oneOf([void 0,"classic","modern"]),isMultiColumn:I.bool,suggest:I.bool,placeholder:I.string,title:I.string,allowCustom:I.bool,clearButton:I.bool,iconClassName:I.string,svgIcon:g.svgIconPropType,validationMessage:I.string,required:I.bool,id:I.string,ariaLabelledBy:I.string,ariaDescribedBy:I.string,list:I.any,valueRender:I.func,skipDisabledItems:I.bool},k.defaultProps={...F.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let V=k;const W=g.createPropsContext(),U=g.withIdHOC(g.withPropsContext(W,V));U.displayName="KendoReactComboBox";exports.ComboBox=U;exports.ComboBoxPropsContext=W;exports.ComboBoxWithoutContext=V;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),I=require("prop-types"),B=require("../common/DropDownBase.js"),u=require("@progress/kendo-react-common"),Z=require("@progress/kendo-react-labels"),c=require("../common/utils.js"),ee=require("../common/SearchBar.js"),te=require("../common/ListContainer.js"),se=require("../common/List.js"),ie=require("../common/ListFilter.js"),L=require("../common/GroupStickyHeader.js"),ae=require("../package-metadata.js"),oe=require("../common/ClearButton.js"),R=require("@progress/kendo-react-buttons"),q=require("@progress/kendo-svg-icons"),C=require("../messages/index.js"),A=require("@progress/kendo-react-intl"),P=require("@progress/kendo-react-layout"),w=require("../common/constants.js"),z=require("../common/withCustomComponent.js");function ne(E){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(E){for(const e in E)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(E,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>E[e]})}}return s.default=E,Object.freeze(s)}const h=ne(X),le="Please enter a valid value!",{sizeMap:O,roundedMap:re}=u.kendoThemeMaps,S=class S extends h.Component{constructor(s){super(s),this.state={},this.base=new B(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.focus=()=>{this._input&&this._input.focus()},this.checkForDuplicatePlainTextRecords=()=>{const e=this.props.textField!==void 0,t=this.props.dataItemKey!==void 0;if(this.props.data&&this.props.data.length>0&&!e&&!t){const o=this.props.data;this.duplicates=c.getPlainDataDuplicates(o),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{data:o=[],virtual:a,dataItemKey:n}=this.props,d=a?a.skip:0,l=o[e-d],r=this.hasDuplicates||!c.areSame(l,this.value,n);this.triggerOnChange(l,t),this.state.text!==void 0&&(t.data.text=void 0),r&&this.base.triggerPageChangeCornerItems(l,t)},this.onPopupOpened=()=>{setTimeout(()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)},300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{data:t=[],skipDisabledItems:o,textField:a}=this.props,n=this.getFocusedIndex(),d=this.getCurrentValueDisabledStatus(a,t,n),l=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.base.initState();if(r.syntheticEvent=e,!o&&a&&d&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(r),!l&&this.mobileMode){const i=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(i,r)}this.applyState(r)},this.closeOpenedApplyStateNonMobileMode=(e,t)=>{t&&!this.mobileMode&&this.base.togglePopup(e)},this.renderMobileListFilter=()=>{const e=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text,t=c.getItemValue(this.value,this.props.textField),o=c.isPresent(e)?e:t;return h.createElement(ie,{value:o,ref:a=>this._adaptiveFilterInput=a&&a.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,t.data.text=e.target.value,this.base.filterChanged(e.target.value,t),this.applyState(t)},this.onScroll=e=>{const{vs:t,list:o}=this.base;t.scrollHandler(e);const{groupField:a}=this.props;let{data:n=[]}=this.props;if(!a||!n.length)return;const d=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:o?o.children[0].offsetHeight:0),r=e.target.scrollTop-t.skip*d;this.props.groupMode==="modern"&&(n=this.base.getGroupedDataModernMode(n,a));let i=n[0][a];for(let g=1;g<n.length&&!(d*g>r);g++)n[g]&&n[g][a]&&(i=n[g][a]);i!==this.state.group&&(this.setState({group:i}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:i}))},this.handleItemClick=(e,t)=>{this.navigationIndex=e,this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleBlur=e=>{if(this.state.focused&&!this._skipBlur){const t=this.base.initState(),{textField:o,data:a=[]}=this.props,n=this.getFocusedIndex(),l=!(n===-1)&&this.getCurrentValueDisabledStatus(o,a,n);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,o&&l&&this.clearValueOnBlur(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,t)}},this.onInputClick=e=>{const t=this.props.opened!==void 0?this.props.opened:this.state.opened,o=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const a=this.base.initState();a.syntheticEvent=e,this.base.togglePopup(a),this.base.filterChanged(o,a),this.applyState(a)}},this.onInputKeyDown=e=>{const{data:t=[],skipDisabledItems:o,textField:a,dataItemKey:n,groupField:d}=this.props,l=this.value,r=Math.max(0,t.findIndex(m=>c.areSame(m,l,n))),i=e.keyCode,g=this.props.opened!==void 0?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(i===u.Keys.up||i===u.Keys.down)){if(e.preventDefault(),d!==""&&a)if(!this.props.skipDisabledItems&&g)this.onNavigate(p,i);else{let m=0;if(i===u.Keys.down||i===u.Keys.right){const f=t.slice(r+1<t.length?r+1:r).find(x=>!x.disabled&&x[a]);m=f&&t.findIndex(x=>x[a]===f[a])}else if(i===u.Keys.up||i===u.Keys.left){let f;if(r===0)f=t,m=t.findIndex(x=>!x.disabled&&x[a]);else{f=t.slice(0,r);let x=f.pop();for(;x&&x.disabled;)x=f.pop();m=x&&t.findIndex(D=>D[a]===x[a])}}if(m!==void 0){const f=m-r;this.onNavigate(p,i,f)}else m===void 0&&t.findIndex(f=>f[a]===l[a])===t.length-1&&this.onNavigate(p,i)}else if(!this.props.skipDisabledItems&&g)this.onNavigate(p,i);else{let m=null;if(i===u.Keys.down||i===u.Keys.right)m=t.slice(r+1).find(f=>!f.disabled);else if(i===u.Keys.up||i===u.Keys.left){const f=t.slice(0,r);for(m=f.pop();m&&m.disabled;)m=f.pop()}if(m){const f=m.id-r-1;this.onNavigate(p,i,f)}else this.onNavigate(p,i)}this.applyState(p)}const v=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},y=this.getFocusedIndex(),b=y===-1,k=!b&&this.getCurrentValueDisabledStatus(a,t,y);g?i===u.Keys.pageUp?this.base.scrollPopupByPageSize(-1):i===u.Keys.pageDown?this.base.scrollPopupByPageSize(1):e.altKey&&i===u.Keys.up?v():i===u.Keys.enter?(e.preventDefault(),(a&&!b&&e.currentTarget.value?t[y][a]:void 0)?!o&&a&&k?this.clearValueOnEnterOrEsc(e):k||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):i===u.Keys.esc&&(!o&&a&&k&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):!g&&i===u.Keys.esc?this.clearValueOnEnterOrEsc(e):e.altKey&&i===u.Keys.down&&v()},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const o=this.props.opened!==void 0?this.props.opened:this.state.opened,a=e.currentTarget,n=a.value;if(this.props.suggest){const d=a.selectionEnd===n.length;let l=this.props.filter!==void 0?this.props.filter:this.state.text;c.isPresent(l)||(l=c.getItemValue(this.value,this.props.textField)||"");const r=l&&l===n,i=l&&l.length>n.length;r||i||!d?this._suggested="":this.suggestValue(n)}this.props.filter===void 0&&(t.data.text=n),this.state.focusedItem!==void 0&&(t.data.focusedItem=void 0),o||this.base.togglePopup(t),this.base.filterChanged(n,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnBlur=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||le)},u.validatePackage(ae.packageMetadata)}get _inputId(){return this.props.id}get document(){if(u.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=w.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get value(){if(this._valueDuringOnChange!==void 0)return this._valueDuringOnChange;if(this.props.value!==void 0)return this.props.value;if(this.state.value!==void 0)return this.state.value;if(this.props.defaultValue!==void 0)return this.props.defaultValue}get index(){const{data:s=[],dataItemKey:e}=this.props,t=this.value;return s.findIndex(o=>c.areSame(o,t,e))}get name(){return this.props.name}get validity(){const s=this.props.validationMessage!==void 0,e=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,t=this.props.valid!==void 0?this.props.valid:e;return{customError:s,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:S.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:S.defaultProps.required}componentDidUpdate(s,e){var v;const{dataItemKey:t,virtual:o,groupField:a="",data:n=[],textField:d}=this.props,l=s.virtual?s.virtual.total:0,r=this.props.opened!==void 0?this.props.opened:this.state.opened,i=s.opened!==void 0?s.opened:e.opened;s.data!==n&&this.checkForDuplicatePlainTextRecords();const g=!i&&r,p=this.value;if(this._valueOnDidUpdate=p,o&&o.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const y=s.value!==void 0?s.value:e.value;let b=this.hasDuplicates?this.navigationIndex||0:n.findIndex(m=>c.areSame(m,p,t));this.props.groupMode==="modern"&&d&&p&&(b=(v=this.base.getGroupedDataModernMode(n,a))==null?void 0:v.map(m=>m[d]).indexOf(p[d]));const k=!c.areSame(y,p,t);g&&o?this.base.scrollToVirtualItem(o,b):g&&!o?(this.onPopupOpened(),n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][a],this),this.base.scrollToItem(b)):(this.hasDuplicates||r&&i&&p&&k)&&this.base.scrollToItem(b)}g&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var s;this.observerResize=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body),this.checkForDuplicatePlainTextRecords()}componentWillUnmount(){var s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=A.provideLocalizationService(this).toLanguageString(C.comboArrowBtnAriaLabelExpand,C.messages[C.comboArrowBtnAriaLabelExpand]),e=A.provideLocalizationService(this).toLanguageString(C.comboArrowBtnAriaLabelCollapse,C.messages[C.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:o,clearButton:a=S.defaultProps.clearButton,label:n,textField:d,adaptive:l,className:r,style:i,loading:g,iconClassName:p,virtual:v,size:y,rounded:b,fillMode:k,opened:m=this.state.opened,placeholder:f,svgIcon:x}=this.props,D=!this.validityStyles||this.validity.valid,T=this.props.filter!==void 0?this.props.filter:this.state.text,U=c.getItemValue(this.value,d),F=c.isPresent(T)?T:U,$=a&&(!!F||c.isPresent(this.value)),M=this.base.vs,_=this.props.id||this._inputId,N=this.mobileMode;M.enabled=v!==void 0,v!==void 0&&(M.skip=v.skip,M.total=v.total,M.pageSize=v.pageSize);const[j,G]=z(this.props.prefix||h.Fragment),[Y,J]=z(this.props.suffix||h.Fragment),K=h.createElement(h.Fragment,null,h.createElement("span",{className:u.classNames("k-combobox k-input",{[`k-input-${O[y]||y}`]:y,[`k-rounded-${re[b]||b}`]:b,[`k-input-${k}`]:k,"k-invalid":!D,"k-loading":g,"k-required":this.required,"k-disabled":o},r),ref:this.componentRef,style:n?{...i,width:void 0}:i,dir:t},this.props.prefix&&h.createElement(j,{...G}),this.renderSearchBar(F||"",_,f),$&&!g&&h.createElement(oe,{onClick:this.clearButtonClick,key:"clearbutton"}),g&&h.createElement(u.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&h.createElement(Y,{...J}),h.createElement(R.Button,{tabIndex:-1,type:"button","aria-label":m?e:s,icon:p?void 0:"caret-alt-down",svgIcon:x||q.caretAltDownIcon,iconClass:p,size:y,fillMode:k,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:Q=>Q.preventDefault()}),!N&&this.renderListContainer()),N&&this.renderAdaptiveListContainer());return n?h.createElement(Z.FloatingLabel,{label:n,editorId:_,editorValue:F,editorValid:D,editorDisabled:o,style:{width:i?i.width:void 0},children:K}):K}onNavigate(s,e,t){const{data:o=[],virtual:a={skip:0}}=this.props,n=this.props.filter?this.props.filter:this.state.text;let d=-1,l;const r=this.base.vs,i=this.value;this._suggested="";const g=this.hasDuplicates&&this.duplicates.indexOf(i)!==-1;if(d=this.getFocusedIndex(g),d!==-1&&!c.isPresent(i))this.handleItemSelect(d,s);else if(n==="")this.handleItemSelect(0,s);else{const p=a.skip+d;l=this.base.navigation.navigate({keyCode:e,current:p,max:(r.enabled?r.total:o.length)-1,min:0,skipItems:t||void 0}),l!==void 0&&this.handleItemSelect(l,s)}this.navigationIndex=l}getCurrentValueDisabledStatus(s,e,t){return s&&e&&e[t]&&e[t].disabled}applyValueOnEnter(s,e){const{data:t=[],textField:o,allowCustom:a}=this.props,n=this.props.opened!==void 0?this.props.opened:this.state.opened,l=c.getItemValue(this.value,o)===s?this.index:c.getItemIndexByText(t,s,o),r=l!==-1;let i;if(this._suggested="",r)i=t[l];else if(a)i=o!==void 0?{[o]:s}:s;else return this.selectFocusedItem(s,e);this.triggerOnChange(i,e),n&&this.base.togglePopup(e),this.props.filter===void 0&&this.state.text!==void 0&&(e.data.text=void 0),this.applyState(e)}applyValueOnRejectSuggestions(s,e){const{data:t=[],textField:o,allowCustom:a}=this.props,n=this.props.opened!==void 0?this.props.opened:this.state.opened,d=c.getItemValue(this.value,o);if(this._suggested="",s===d||s===""&&!c.isPresent(d))return this.closeOpenedApplyStateNonMobileMode(e,n),this.applyState(e);const l=c.getItemIndexByText(t,s,o,!0),r=l!==-1;let i=null;r?i=t[l]:a&&(i=s?o?{[o]:s}:s:null),this.triggerOnChange(i,e),this.state.text!==void 0&&(e.data.text=void 0,this.base.filterChanged("",e)),this.closeOpenedApplyStateNonMobileMode(e,n),this.applyState(e)}selectFocusedItem(s,e){const t=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:o=[],textField:a,virtual:n={skip:0},focusedItemIndex:d=c.itemIndexStartsWith}=this.props,l=n.skip,r=s===""&&l===0?0:d(o,s,a);return r!==-1?this.handleItemSelect(r+l,e):(this.triggerOnChange(null,e),this.state.text!==void 0&&(e.data.text=void 0)),t&&this.base.togglePopup(e),this.applyState(e)}renderAdaptiveListContainer(){const{windowWidth:s=0}=this.state,{header:e,footer:t,size:o,data:a=[],groupField:n,groupMode:d,list:l,virtual:r,adaptiveTitle:i,groupStickyHeaderItemRender:g}=this.props,p=this.props.opened!==void 0?this.props.opened:this.state.opened;let{group:v}=this.state;v===void 0&&n!==void 0&&(v=c.getItemValue(a[0],n));const y={navigatable:!1,navigatableElements:[],expand:p,animation:!0,onClose:b=>this.toggleBtnClick(b),animationStyles:s<=w.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:s<=w.MOBILE_SMALL_DEVISE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return h.createElement(P.ActionSheet,{...y},h.createElement(P.ActionSheetHeader,{className:"k-text-center"},h.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},h.createElement("div",{className:"k-actionsheet-title"},h.createElement("div",null,i)),h.createElement("div",{className:"k-actionsheet-actions"},h.createElement(R.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:q.xIcon}))),h.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),h.createElement(P.ActionSheetContent,{className:"!k-overflow-hidden"},h.createElement("div",{className:"k-list-container"},h.createElement("div",{className:u.classNames({"k-list":!l,"k-list-lg":!0,"k-virtual-list":r,"k-data-table":l,[`k-table-${O[o]||o}`]:l&&o})},e&&h.createElement("div",{className:"k-table-header"},e),!l&&v&&a.length!==0&&h.createElement(L,{group:v,groupMode:d,render:g}),this.renderList(),t&&h.createElement("div",{className:"k-list-footer"},t)))))}renderListContainer(){const s=this.base,{dir:e,header:t,footer:o,data:a=[],groupField:n,groupMode:d,size:l,list:r,virtual:i,groupStickyHeaderItemRender:g}=this.props,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=s.getPopupSettings(),y=v.width!==void 0?v.width:s.popupWidth;let{group:b}=this.state;return b===void 0&&n!==void 0&&(b=c.getItemValue(a[0],n)),h.createElement(te,{width:y,popupSettings:{...v,anchor:v.anchor||this.element,show:p,popupClass:u.classNames(v.popupClass,"k-list-container","k-combobox-popup")},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[a.length]},h.createElement("div",{className:u.classNames({"k-list":!r,[`k-list-${O[l]||l}`]:!r&&l,"k-virtual-list":i,"k-data-table":r,[`k-table-${O[l]||l}`]:r&&l})},t&&h.createElement("div",{className:"k-table-header"},t),!r&&b&&a.length!==0&&h.createElement(L,{group:b,groupMode:d,render:g}),this.renderList(),o&&h.createElement("div",{className:u.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},o)))}renderList(){const s=this.base,{textField:e,dataItemKey:t,listNoDataRender:o,itemRender:a,groupHeaderItemRender:n,data:d=[],virtual:l={skip:0,total:void 0}}=this.props,r=s.getPopupSettings(),i=s.vs,g=l.skip,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=`translateY(${i.translate}px)`,y=p?this.getFocusedIndex(this.hasDuplicates):void 0,b=this.props.filter!==void 0?this.props.filter:this.state.text,k=c.getItemValue(this.value,e),m=c.isPresent(b)&&b!==k?null:this.value,f=this.props.list||se;return h.createElement(f,{id:s.listBoxId,virtual:!!l,show:p,data:d,focusedIndex:y,value:m,textField:e,valueField:t,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:s.guid,hasDuplicates:this.hasDuplicates,listRef:x=>{i.list=this.base.list=x,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>w.MOBILE_MEDIUM_DEVISE?{maxHeight:r.height}:{},wrapperCssClass:u.classNames("k-list-content",{"k-list-scroller":!l}),listStyle:i.enabled?{transform:v}:void 0,key:"listkey",skip:g,onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:n,noDataRender:o,onMouseDown:x=>x.preventDefault(),onScroll:this.onScroll,wrapperRef:i.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:l.total})}renderSearchBar(s,e,t){const{tabIndex:o,disabled:a,data:n=[],dataItemKey:d,virtual:l={skip:0}}=this.props,r=this.props.opened!==void 0?this.props.opened:this.state.opened,i=this.value,g=Math.max(0,n.findIndex(p=>c.areSame(p,i,d)));return this._suggested&&!c.areSame(this._valueOnDidUpdate,i,d)&&(this._suggested=""),h.createElement(ee,{id:e,readOnly:r&&this.mobileMode,placeholder:t,tabIndex:o,title:this.props.title,accessKey:this.props.accessKey,value:s+this._suggested,suggestedText:this._suggested,ref:p=>this._input=p&&p.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:a,expanded:r,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${g+l.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const s=this.base.initState();this._suggested="",this.navigationIndex=void 0,this.base.filterChanged("",s),this.props.filter===void 0&&this.state.text!==void 0&&(s.data.text=void 0),this.triggerOnChange(null,s);const e=this.props.opened!==void 0?this.props.opened:this.state.opened,t=this.mobileMode;e&&!t&&this.base.togglePopup(s),this.applyState(s)}triggerOnChange(s,e){const t=this.value;!this.hasDuplicates&&(!c.isPresent(t)&&!c.isPresent(s)||c.areSame(t,s,this.props.dataItemKey))||(this.props.value===void 0&&(e.data.value=s),this._valueDuringOnChange=s,e.events.push({type:"onChange"}))}getFocusedIndex(s){const e=this.value,{data:t=[],textField:o,dataItemKey:a,virtual:n={skip:0},focusedItemIndex:d=c.itemIndexStartsWith,skipDisabledItems:l}=this.props,r=this.props.filter?this.props.filter:this.state.text;return s&&this.navigationIndex!==void 0?this.navigationIndex:c.isPresent(e)&&r===void 0?t.findIndex(i=>c.areSame(i,e,a)):r?d(t,r,o):l&&o&&!r&&n.skip===0?t.findIndex(i=>!i.disabled&&i[o]):n.skip===0?0:-1}suggestValue(s){const{data:e,textField:t}=this.props;this._suggested=c.suggestValue(s,e,t)}applyState(s){this.base.applyState(s),this._valueDuringOnChange=void 0}calculateMedia(s){for(const e of s)this.setState({windowWidth:e.target.clientWidth})}};S.displayName="ComboBox",S.propTypes={...B.propTypes,size:I.oneOf([null,"small","medium","large"]),rounded:I.oneOf([null,"small","medium","large","full"]),fillMode:I.oneOf([null,"solid","flat","outline"]),dataItemKey:I.string,groupField:I.string,groupMode:I.oneOf([void 0,"classic","modern"]),isMultiColumn:I.bool,suggest:I.bool,placeholder:I.string,title:I.string,allowCustom:I.bool,clearButton:I.bool,iconClassName:I.string,svgIcon:u.svgIconPropType,validationMessage:I.string,required:I.bool,id:I.string,ariaLabelledBy:I.string,ariaDescribedBy:I.string,list:I.any,valueRender:I.func,skipDisabledItems:I.bool},S.defaultProps={...B.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let V=S;const H=u.createPropsContext(),W=u.withIdHOC(u.withPropsContext(H,V));W.displayName="KendoReactComboBox";exports.ComboBox=W;exports.ComboBoxPropsContext=H;exports.ComboBoxWithoutContext=V;