@progress/kendo-react-dropdowns 9.2.0-develop.1 → 9.2.0-develop.3

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.
Files changed (70) hide show
  1. package/AutoComplete/AutoComplete.js +2 -2
  2. package/AutoComplete/AutoComplete.mjs +282 -219
  3. package/ComboBox/ComboBox.js +2 -2
  4. package/ComboBox/ComboBox.mjs +38 -39
  5. package/DropDownList/DropDownList.js +2 -2
  6. package/DropDownList/DropDownList.mjs +116 -117
  7. package/DropDownTree/DropDownTree.js +2 -2
  8. package/DropDownTree/DropDownTree.mjs +67 -68
  9. package/DropDownTree/ListNoData.js +1 -1
  10. package/DropDownTree/ListNoData.mjs +1 -1
  11. package/DropDownTree/useDropdownWidth.js +1 -1
  12. package/DropDownTree/useDropdownWidth.mjs +1 -1
  13. package/LICENSE.md +1 -1
  14. package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
  15. package/MultiColumnComboBox/MultiColumnComboBox.mjs +1 -1
  16. package/MultiSelect/MultiSelect.js +2 -2
  17. package/MultiSelect/MultiSelect.mjs +42 -43
  18. package/MultiSelect/TagList.js +1 -1
  19. package/MultiSelect/TagList.mjs +1 -1
  20. package/MultiSelectTree/MultiSelectTree.js +2 -2
  21. package/MultiSelectTree/MultiSelectTree.mjs +65 -66
  22. package/MultiSelectTree/utils.js +1 -1
  23. package/MultiSelectTree/utils.mjs +1 -1
  24. package/README.md +1 -1
  25. package/common/AdaptiveMode.js +2 -2
  26. package/common/AdaptiveMode.mjs +44 -42
  27. package/common/ClearButton.js +1 -1
  28. package/common/ClearButton.mjs +1 -1
  29. package/common/DropDownBase.js +1 -1
  30. package/common/DropDownBase.mjs +1 -1
  31. package/common/GroupStickyHeader.js +1 -1
  32. package/common/GroupStickyHeader.mjs +1 -1
  33. package/common/List.js +1 -1
  34. package/common/List.mjs +1 -1
  35. package/common/ListContainer.js +1 -1
  36. package/common/ListContainer.mjs +1 -1
  37. package/common/ListDefaultItem.js +1 -1
  38. package/common/ListDefaultItem.mjs +1 -1
  39. package/common/ListFilter.js +1 -1
  40. package/common/ListFilter.mjs +1 -1
  41. package/common/ListGroupItem.js +1 -1
  42. package/common/ListGroupItem.mjs +1 -1
  43. package/common/ListItem.js +1 -1
  44. package/common/ListItem.mjs +1 -1
  45. package/common/MultiColumnList.js +1 -1
  46. package/common/MultiColumnList.mjs +1 -1
  47. package/common/Navigation.js +1 -1
  48. package/common/Navigation.mjs +1 -1
  49. package/common/SearchBar.js +1 -1
  50. package/common/SearchBar.mjs +1 -1
  51. package/common/VirtualScrollStatic.js +1 -1
  52. package/common/VirtualScrollStatic.mjs +1 -1
  53. package/common/settings.js +1 -1
  54. package/common/settings.mjs +1 -1
  55. package/common/utils.js +1 -1
  56. package/common/utils.mjs +1 -1
  57. package/common/withCustomComponent.js +1 -1
  58. package/common/withCustomComponent.mjs +1 -1
  59. package/dist/cdn/js/kendo-react-dropdowns.js +2 -2
  60. package/index.d.mts +31 -2
  61. package/index.d.ts +31 -2
  62. package/index.js +1 -1
  63. package/index.mjs +1 -1
  64. package/messages/index.js +1 -1
  65. package/messages/index.mjs +1 -1
  66. package/package-metadata.js +1 -1
  67. package/package-metadata.mjs +2 -2
  68. package/package.json +9 -9
  69. package/common/constants.js +0 -8
  70. package/common/constants.mjs +0 -13
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
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 X=require("react"),b=require("prop-types"),N=require("../common/DropDownBase.js"),o=require("@progress/kendo-react-common"),Z=require("@progress/kendo-react-labels"),h=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"),oe=require("../package-metadata.js"),ae=require("../common/ClearButton.js"),K=require("@progress/kendo-react-buttons"),R=require("@progress/kendo-svg-icons"),E=require("../messages/index.js"),q=require("@progress/kendo-react-intl"),P=require("@progress/kendo-react-layout"),k=require("../common/constants.js"),z=require("../common/withCustomComponent.js");function ne(B){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(B){for(const e in B)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(B,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>B[e]})}}return s.default=B,Object.freeze(s)}const g=ne(X),le="Please enter a valid value!",S=class S extends g.Component{constructor(s){super(s),this.state={},this.base=new N(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 i=this.props.data;this.duplicates=h.getPlainDataDuplicates(i),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:i,dataItemKey:l}=this.props,d=h.getFilteredData(this.props),n=i?i.skip:0,p=d[e-n],r=this.hasDuplicates||!h.areSame(p,this.value,l);this.triggerOnChange(p,t),this.state.text!==void 0&&(t.data.text=void 0),r&&this.base.triggerPageChangeCornerItems(p,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{skipDisabledItems:t,textField:i}=this.props,l=h.getFilteredData(this.props),d=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(i,l,d),p=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.base.initState();if(r.syntheticEvent=e,!t&&i&&n&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(r),!p&&this.mobileMode){const a=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(a,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=h.getItemValue(this.value,this.props.textField),i=h.isPresent(e)?e:t;return g.createElement(ie,{value:i,ref:l=>this._adaptiveFilterInput=l&&l.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",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:i}=this.base;t.scrollHandler(e);const{groupField:l}=this.props;let d=h.getFilteredData(this.props);if(!l||!d.length)return;const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:i?i.children[0].offsetHeight:0),r=e.target.scrollTop-t.skip*n;this.props.groupMode==="modern"&&(d=this.base.getGroupedDataModernMode(d,l));let a=d[0][l];for(let m=1;m<d.length&&!(n*m>r);m++)d[m]&&d[m][l]&&(a=d[m][l]);a!==this.state.group&&(this.setState({group:a}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:a}))},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:i}=this.props,l=h.getFilteredData(this.props),d=this.getFocusedIndex(),p=!(d===-1)&&this.getCurrentValueDisabledStatus(i,l,d);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,i&&p&&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,i=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const l=this.base.initState();l.syntheticEvent=e,this.base.togglePopup(l),this.base.filterChanged(i,l),this.applyState(l)}},this.onInputKeyDown=e=>{const{skipDisabledItems:t,textField:i,dataItemKey:l,groupField:d}=this.props,n=h.getFilteredData(this.props),p=this.value,r=Math.max(0,n.findIndex(u=>h.areSame(u,p,l))),a=e.keyCode,m=this.props.opened!==void 0?this.props.opened:this.state.opened,c=this.base.initState();if(c.syntheticEvent=e,!e.altKey&&(a===o.Keys.up||a===o.Keys.down)){if(e.preventDefault(),d!==""&&i)if(!this.props.skipDisabledItems&&m)this.onNavigate(c,a);else{let u=0;if(a===o.Keys.down||a===o.Keys.right){const v=n.slice(r+1<n.length?r+1:r).find(I=>!I.disabled&&I[i]);u=v&&n.findIndex(I=>I[i]===v[i])}else if(a===o.Keys.up||a===o.Keys.left){let v;if(r===0)v=n,u=n.findIndex(I=>!I.disabled&&I[i]);else{v=n.slice(0,r);let I=v.pop();for(;I&&I.disabled;)I=v.pop();u=I&&n.findIndex(D=>D[i]===I[i])}}if(u!==void 0){const v=u-r;this.onNavigate(c,a,v)}else u===void 0&&n.findIndex(v=>v[i]===p[i])===n.length-1&&this.onNavigate(c,a)}else if(!this.props.skipDisabledItems&&m)this.onNavigate(c,a);else{let u=null;if(a===o.Keys.down||a===o.Keys.right)u=n.slice(r+1).find(v=>!v.disabled);else if(a===o.Keys.up||a===o.Keys.left){const v=n.slice(0,r);for(u=v.pop();u&&u.disabled;)u=v.pop()}if(u){const v=u.id-r-1;this.onNavigate(c,a,v)}else this.onNavigate(c,a)}this.applyState(c)}const C=()=>{e.preventDefault(),this.base.togglePopup(c),this.applyState(c)},y=this.getFocusedIndex(),x=y===-1,f=!x&&this.getCurrentValueDisabledStatus(i,n,y);m?a===o.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):a===o.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&a===o.Keys.up?C():a===o.Keys.enter?(e.preventDefault(),(i&&!x&&e.currentTarget.value?n[y][i]:void 0)?!t&&i&&f?this.clearValueOnEnterOrEsc(e):f||this.applyValueOnEnter(e.currentTarget.value,c):this.applyValueOnEnter(e.currentTarget.value,c)):a===o.Keys.esc&&(!t&&i&&f&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,c)):!m&&a===o.Keys.esc?this.clearValueOnEnterOrEsc(e):e.altKey&&a===o.Keys.down&&C()},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const i=this.props.opened!==void 0?this.props.opened:this.state.opened,l=e.currentTarget,d=l.value;if(this.props.suggest){const n=l.selectionEnd===d.length;let p=this.props.filter!==void 0?this.props.filter:this.state.text;h.isPresent(p)||(p=h.getItemValue(this.value,this.props.textField)||"");const r=p&&p===d,a=p&&p.length>d.length;r||a||!n?this._suggested="":this.suggestValue(d)}this.props.filter===void 0&&(t.data.text=d),this.state.focusedItem!==void 0&&(t.data.focusedItem=void 0),i||this.base.togglePopup(t),this.base.filterChanged(d,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)},o.validatePackage(oe.packageMetadata)}get _inputId(){return this.props.id}get document(){if(o.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=k.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{dataItemKey:s}=this.props,e=h.getFilteredData(this.props),t=this.value;return e.findIndex(i=>h.areSame(i,t,s))}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 C;const{dataItemKey:t,virtual:i,groupField:l="",textField:d}=this.props,n=h.getFilteredData(this.props),p=s.virtual?s.virtual.total:0,r=this.props.opened!==void 0?this.props.opened:this.state.opened,a=s.opened!==void 0?s.opened:e.opened;s.data!==n&&this.checkForDuplicatePlainTextRecords();const m=!a&&r,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),i&&i.total!==p)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const y=s.value!==void 0?s.value:e.value;let x=this.hasDuplicates?this.navigationIndex||0:n.findIndex(u=>h.areSame(u,c,t));this.props.groupMode==="modern"&&d&&c&&(x=(C=this.base.getGroupedDataModernMode(n,l))==null?void 0:C.map(u=>u[d]).indexOf(c[d]));const f=!h.areSame(y,c,t);m&&i?this.base.scrollToVirtualItem(i,x):m&&!i?(this.onPopupOpened(),n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][l],this),this.base.scrollToItem(x)):(this.hasDuplicates||r&&a&&c&&f)&&this.base.scrollToItem(x)}m&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var s;this.observerResize=o.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=q.provideLocalizationService(this).toLanguageString(E.comboArrowBtnAriaLabelExpand,E.messages[E.comboArrowBtnAriaLabelExpand]),e=q.provideLocalizationService(this).toLanguageString(E.comboArrowBtnAriaLabelCollapse,E.messages[E.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:i,clearButton:l=S.defaultProps.clearButton,label:d,textField:n,className:p,style:r,loading:a,iconClassName:m,virtual:c,size:C,rounded:y,fillMode:x,opened:f=this.state.opened,placeholder:u,svgIcon:v,unstyled:I}=this.props,D=!this.validityStyles||this.validity.valid,w=this.props.filter!==void 0?this.props.filter:this.state.text,W=h.getItemValue(this.value,n),O=h.isPresent(w)?w:W,j=l&&(!!O||h.isPresent(this.value)),F=this.base.vs,T=this.props.id||this._inputId,_=this.mobileMode,V=I&&I.uComboBox;F.enabled=c!==void 0,c!==void 0&&(F.skip=c.skip,F.total=c.total,F.pageSize=c.pageSize);const[G,$]=z(this.props.prefix||g.Fragment),[Y,J]=z(this.props.suffix||g.Fragment),A=g.createElement(g.Fragment,null,g.createElement("span",{className:o.classNames(o.uComboBox.wrapper({c:V,size:C,rounded:y,fillMode:x,disabled:i,invalid:!D,loading:a,required:this.required}),p),ref:this.componentRef,style:d?{...r,width:void 0}:r,dir:t},this.props.prefix&&g.createElement(G,{...$}),this.renderSearchBar(O||"",T,u),j&&!a&&g.createElement(ae,{onClick:this.clearButtonClick,key:"clearbutton"}),a&&g.createElement(o.IconWrap,{className:o.classNames(o.uComboBox.loadingIcon({c:V})),name:"loading",key:"loading"}),this.props.suffix&&g.createElement(Y,{...J}),g.createElement(K.Button,{tabIndex:-1,type:"button","aria-label":f?e:s,icon:m?void 0:"caret-alt-down",svgIcon:v||R.caretAltDownIcon,iconClass:m,size:C,fillMode:x,rounded:null,themeColor:"base",className:o.classNames(o.uComboBox.inputButton({c:V})),onClick:this.toggleBtnClick,onMouseDown:Q=>Q.preventDefault()}),!_&&this.renderListContainer()),_&&this.renderAdaptiveListContainer());return d?g.createElement(Z.FloatingLabel,{label:d,editorId:T,editorValue:O,editorValid:D,editorDisabled:i,style:{width:r?r.width:void 0},children:A,unstyled:I}):A}onNavigate(s,e,t){const{virtual:i={skip:0}}=this.props,l=h.getFilteredData(this.props),d=this.props.filter?this.props.filter:this.state.text;let n=-1,p;const r=this.base.vs,a=this.value;this._suggested="";const m=this.hasDuplicates&&this.duplicates.indexOf(a)!==-1;if(n=this.getFocusedIndex(m),n!==-1&&!h.isPresent(a))this.handleItemSelect(n,s);else if(d==="")this.handleItemSelect(0,s);else{const c=i.skip+n;p=this.base.navigation.navigate({keyCode:e,current:c,max:(r.enabled?r.total:l.length)-1,min:0,skipItems:t||void 0}),p!==void 0&&this.handleItemSelect(p,s)}this.navigationIndex=p}getCurrentValueDisabledStatus(s,e,t){return s&&e&&e[t]&&e[t].disabled}applyValueOnEnter(s,e){const{textField:t,allowCustom:i}=this.props,l=h.getFilteredData(this.props),d=this.props.opened!==void 0?this.props.opened:this.state.opened,p=h.getItemValue(this.value,t)===s?this.index:h.getItemIndexByText(l,s,t),r=p!==-1;let a;if(this._suggested="",r)a=l[p];else if(i)a=t!==void 0?{[t]:s}:s;else return this.selectFocusedItem(s,e);this.triggerOnChange(a,e),d&&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{textField:t,allowCustom:i}=this.props,l=h.getFilteredData(this.props),d=this.props.opened!==void 0?this.props.opened:this.state.opened,n=h.getItemValue(this.value,t);if(this._suggested="",s===n||s===""&&!h.isPresent(n))return this.closeOpenedApplyStateNonMobileMode(e,d),this.applyState(e);const p=h.getItemIndexByText(l,s,t,!0),r=p!==-1;let a=null;r?a=l[p]:i&&(a=s?t?{[t]:s}:s:null),this.triggerOnChange(a,e),this.state.text!==void 0&&(e.data.text=void 0,this.base.filterChanged("",e)),this.closeOpenedApplyStateNonMobileMode(e,d),this.applyState(e)}selectFocusedItem(s,e){const t=this.props.opened!==void 0?this.props.opened:this.state.opened,{textField:i,virtual:l={skip:0},focusedItemIndex:d=h.itemIndexStartsWith}=this.props,n=h.getFilteredData(this.props),p=l.skip,r=s===""&&p===0?0:d(n,s,i);return r!==-1?this.handleItemSelect(r+p,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:i,groupField:l,groupMode:d,list:n,virtual:p,adaptiveTitle:r,groupStickyHeaderItemRender:a,unstyled:m}=this.props,c=h.getFilteredData(this.props),C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=this.base.getAdaptiveAnimation(),x=m&&m.uComboBox,f=m&&m.uDropDownsActionSheet;let{group:u}=this.state;u===void 0&&l!==void 0&&(u=h.getItemValue(c[0],l));const v={navigatable:!1,navigatableElements:[],expand:C,animation:y,onClose:I=>this.toggleBtnClick(I),animationStyles:s<=k.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c:f,isFullScreen:s<=k.MOBILE_SMALL_DEVISE}))};return g.createElement(P.ActionSheet,{...v},g.createElement(P.ActionSheetHeader,null,g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c:f}))},g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c:f}))},g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.header({c:f}))},r),g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.subtitle({c:f}))})),g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c:f}))},g.createElement(K.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",onClick:this.toggleBtnClick,icon:"x",svgIcon:R.xIcon}))),g.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c:f}))},this.renderMobileListFilter())),g.createElement(P.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:o.classNames(o.uComboBox.listContainer({c:x}))},g.createElement("div",{className:o.classNames(o.uComboBox.list({c:x,list:n,size:"large",tableSize:i,virtual:p}))},e&&g.createElement("div",{className:o.classNames(o.uComboBox.listHeader({c:x}))},e),!n&&u&&c.length!==0&&g.createElement(L,{group:u,groupMode:d,render:a}),this.renderList(),t&&g.createElement("div",{className:o.classNames(o.uComboBox.listFooter({c:x}),this.props.footerClassName)},t)))))}renderListContainer(){const s=this.base,{dir:e,header:t,footer:i,groupField:l,groupMode:d,size:n,list:p,virtual:r,groupStickyHeaderItemRender:a,unstyled:m}=this.props,c=h.getFilteredData(this.props),C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=s.getPopupSettings(),x=y.width!==void 0?y.width:s.popupWidth,f=m&&m.uComboBox;let{group:u}=this.state;return u===void 0&&l!==void 0&&(u=h.getItemValue(c[0],l)),g.createElement(te,{width:x,popupSettings:{...y,anchor:y.anchor||this.element,show:C,popupClass:o.classNames(y.popupClass,o.uComboBox.listContainer({c:f,popup:!0}))},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[c.length]},g.createElement("div",{className:o.classNames(o.uComboBox.list({c:f,list:p,size:n,tableSize:n,virtual:r}))},t&&g.createElement("div",{className:o.classNames(o.uComboBox.listHeader({c:f}))},t),!p&&u&&c.length!==0&&g.createElement(L,{group:u,groupMode:d,render:a}),this.renderList(),i&&g.createElement("div",{className:o.classNames(o.uComboBox.listFooter({c:f}),this.props.footerClassName)},i)))}renderList(){const s=this.base,{textField:e,dataItemKey:t,listNoDataRender:i,itemRender:l,groupHeaderItemRender:d,virtual:n={skip:0,total:void 0},unstyled:p}=this.props,r=h.getFilteredData(this.props),a=s.getPopupSettings(),m=s.vs,c=n.skip,C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=`translateY(${m.translate}px)`,x=C?this.getFocusedIndex(this.hasDuplicates):void 0,f=this.props.filter!==void 0?this.props.filter:this.state.text,u=h.getItemValue(this.value,e),v=h.isPresent(f)&&f!==u?null:this.value,I=this.props.list||se,D=p&&p.uComboBox;return g.createElement(I,{id:s.listBoxId,virtual:!!n,show:C,data:r,focusedIndex:x,value:v,textField:e,valueField:t,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:s.guid,hasDuplicates:this.hasDuplicates,listRef:w=>{m.list=this.base.list=w,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>k.MOBILE_MEDIUM_DEVISE?{maxHeight:a.height}:{},wrapperCssClass:o.classNames(o.uComboBox.listContent({c:D,virtual:n})),listStyle:m.enabled?{transform:y}:void 0,key:"listkey",skip:c,onClick:this.handleItemClick,itemRender:l,groupHeaderItemRender:d,noDataRender:i,onMouseDown:w=>w.preventDefault(),onScroll:this.onScroll,wrapperRef:m.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})}renderSearchBar(s,e,t){const{tabIndex:i,disabled:l,title:d,ariaLabelledBy:n,ariaDescribedBy:p,dataItemKey:r,virtual:a={skip:0},accessKey:m,unstyled:c,inputAttributes:C}=this.props,y=h.getFilteredData(this.props),x=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.value,u=Math.max(0,y.findIndex(v=>h.areSame(v,f,r)));return this._suggested&&!h.areSame(this._valueOnDidUpdate,f,r)&&(this._suggested=""),g.createElement(ee,{id:e,readOnly:x&&this.mobileMode,placeholder:t,tabIndex:i,title:d,value:s+this._suggested,suggestedText:this._suggested,ref:v=>this._input=v&&v.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:l,expanded:x,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${u+a.skip}`,role:"combobox",ariaLabelledBy:n,ariaLabel:this.props.ariaLabel,ariaDescribedBy:p,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:c,inputAttributes:C})}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&&(!h.isPresent(t)&&!h.isPresent(s)||h.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,{textField:t,dataItemKey:i,virtual:l={skip:0},focusedItemIndex:d=h.itemIndexStartsWith,skipDisabledItems:n}=this.props,p=h.getFilteredData(this.props),r=this.props.filter?this.props.filter:this.state.text;return s&&this.navigationIndex!==void 0?this.navigationIndex:h.isPresent(e)&&r===void 0?p.findIndex(a=>h.areSame(a,e,i)):r?d(p,r,t):n&&t&&!r&&l.skip===0?p.findIndex(a=>!a.disabled&&a[t]):l.skip===0?0:-1}suggestValue(s){const{data:e,textField:t}=this.props;this._suggested=h.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={...N.propTypes,size:b.oneOf([null,"small","medium","large"]),rounded:b.oneOf([null,"small","medium","large","full"]),fillMode:b.oneOf([null,"solid","flat","outline"]),dataItemKey:b.string,groupField:b.string,groupMode:b.oneOf([void 0,"classic","modern"]),isMultiColumn:b.bool,suggest:b.bool,placeholder:b.string,title:b.string,allowCustom:b.bool,clearButton:b.bool,iconClassName:b.string,svgIcon:o.svgIconPropType,validationMessage:b.string,required:b.bool,id:b.string,ariaLabelledBy:b.string,ariaLabel:b.string,ariaDescribedBy:b.string,list:b.any,valueRender:b.func,skipDisabledItems:b.bool,inputAttributes:b.object},S.defaultProps={...N.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 M=S;const H=o.createPropsContext(),U=o.withIdHOC(o.withPropsContext(H,o.withUnstyledHOC(M)));U.displayName="KendoReactComboBox";exports.ComboBox=U;exports.ComboBoxPropsContext=H;exports.ComboBoxWithoutContext=M;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("react"),b=require("prop-types"),V=require("../common/DropDownBase.js"),i=require("@progress/kendo-react-common"),X=require("@progress/kendo-react-labels"),h=require("../common/utils.js"),Z=require("../common/SearchBar.js"),ee=require("../common/ListContainer.js"),te=require("../common/List.js"),se=require("../common/ListFilter.js"),_=require("../common/GroupStickyHeader.js"),ie=require("../package-metadata.js"),oe=require("../common/ClearButton.js"),K=require("@progress/kendo-react-buttons"),R=require("@progress/kendo-svg-icons"),B=require("../messages/index.js"),L=require("@progress/kendo-react-intl"),N=require("@progress/kendo-react-layout"),q=require("../common/withCustomComponent.js");function ae(F){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(F){for(const e in F)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(F,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>F[e]})}}return s.default=F,Object.freeze(s)}const g=ae(Q),ne="Please enter a valid value!",S=class S extends g.Component{constructor(s){super(s),this.state={},this.base=new V(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=h.getPlainDataDuplicates(o),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:o,dataItemKey:l}=this.props,d=h.getFilteredData(this.props),n=o?o.skip:0,p=d[e-n],r=this.hasDuplicates||!h.areSame(p,this.value,l);this.triggerOnChange(p,t),this.state.text!==void 0&&(t.data.text=void 0),r&&this.base.triggerPageChangeCornerItems(p,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{skipDisabledItems:t,textField:o}=this.props,l=h.getFilteredData(this.props),d=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(o,l,d),p=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.base.initState();if(r.syntheticEvent=e,!t&&o&&n&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(r),!p&&this.mobileMode){const a=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(a,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=h.getItemValue(this.value,this.props.textField),o=h.isPresent(e)?e:t;return g.createElement(se,{value:o,ref:l=>this._adaptiveFilterInput=l&&l.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",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:l}=this.props;let d=h.getFilteredData(this.props);if(!l||!d.length)return;const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:o?o.children[0].offsetHeight:0),r=e.target.scrollTop-t.skip*n;this.props.groupMode==="modern"&&(d=this.base.getGroupedDataModernMode(d,l));let a=d[0][l];for(let m=1;m<d.length&&!(n*m>r);m++)d[m]&&d[m][l]&&(a=d[m][l]);a!==this.state.group&&(this.setState({group:a}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:a}))},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}=this.props,l=h.getFilteredData(this.props),d=this.getFocusedIndex(),p=!(d===-1)&&this.getCurrentValueDisabledStatus(o,l,d);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,o&&p&&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 l=this.base.initState();l.syntheticEvent=e,this.base.togglePopup(l),this.base.filterChanged(o,l),this.applyState(l)}},this.onInputKeyDown=e=>{const{skipDisabledItems:t,textField:o,dataItemKey:l,groupField:d}=this.props,n=h.getFilteredData(this.props),p=this.value,r=Math.max(0,n.findIndex(u=>h.areSame(u,p,l))),a=e.keyCode,m=this.props.opened!==void 0?this.props.opened:this.state.opened,c=this.base.initState();if(c.syntheticEvent=e,!e.altKey&&(a===i.Keys.up||a===i.Keys.down)){if(e.preventDefault(),d!==""&&o)if(!this.props.skipDisabledItems&&m)this.onNavigate(c,a);else{let u=0;if(a===i.Keys.down||a===i.Keys.right){const v=n.slice(r+1<n.length?r+1:r).find(I=>!I.disabled&&I[o]);u=v&&n.findIndex(I=>I[o]===v[o])}else if(a===i.Keys.up||a===i.Keys.left){let v;if(r===0)v=n,u=n.findIndex(I=>!I.disabled&&I[o]);else{v=n.slice(0,r);let I=v.pop();for(;I&&I.disabled;)I=v.pop();u=I&&n.findIndex(D=>D[o]===I[o])}}if(u!==void 0){const v=u-r;this.onNavigate(c,a,v)}else u===void 0&&n.findIndex(v=>v[o]===p[o])===n.length-1&&this.onNavigate(c,a)}else if(!this.props.skipDisabledItems&&m)this.onNavigate(c,a);else{let u=null;if(a===i.Keys.down||a===i.Keys.right)u=n.slice(r+1).find(v=>!v.disabled);else if(a===i.Keys.up||a===i.Keys.left){const v=n.slice(0,r);for(u=v.pop();u&&u.disabled;)u=v.pop()}if(u){const v=u.id-r-1;this.onNavigate(c,a,v)}else this.onNavigate(c,a)}this.applyState(c)}const C=()=>{e.preventDefault(),this.base.togglePopup(c),this.applyState(c)},y=this.getFocusedIndex(),x=y===-1,f=!x&&this.getCurrentValueDisabledStatus(o,n,y);m?a===i.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):a===i.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&a===i.Keys.up?C():a===i.Keys.enter?(e.preventDefault(),(o&&!x&&e.currentTarget.value?n[y][o]:void 0)?!t&&o&&f?this.clearValueOnEnterOrEsc(e):f||this.applyValueOnEnter(e.currentTarget.value,c):this.applyValueOnEnter(e.currentTarget.value,c)):a===i.Keys.esc&&(!t&&o&&f&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,c)):!m&&a===i.Keys.esc?this.clearValueOnEnterOrEsc(e):e.altKey&&a===i.Keys.down&&C()},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const o=this.props.opened!==void 0?this.props.opened:this.state.opened,l=e.currentTarget,d=l.value;if(this.props.suggest){const n=l.selectionEnd===d.length;let p=this.props.filter!==void 0?this.props.filter:this.state.text;h.isPresent(p)||(p=h.getItemValue(this.value,this.props.textField)||"");const r=p&&p===d,a=p&&p.length>d.length;r||a||!n?this._suggested="":this.suggestValue(d)}this.props.filter===void 0&&(t.data.text=d),this.state.focusedItem!==void 0&&(t.data.focusedItem=void 0),o||this.base.togglePopup(t),this.base.filterChanged(d,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||ne)},i.validatePackage(ie.packageMetadata)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=i.ADAPTIVE_MEDIUM_BREAKPOINT&&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{dataItemKey:s}=this.props,e=h.getFilteredData(this.props),t=this.value;return e.findIndex(o=>h.areSame(o,t,s))}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 C;const{dataItemKey:t,virtual:o,groupField:l="",textField:d}=this.props,n=h.getFilteredData(this.props),p=s.virtual?s.virtual.total:0,r=this.props.opened!==void 0?this.props.opened:this.state.opened,a=s.opened!==void 0?s.opened:e.opened;s.data!==n&&this.checkForDuplicatePlainTextRecords();const m=!a&&r,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),o&&o.total!==p)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const y=s.value!==void 0?s.value:e.value;let x=this.hasDuplicates?this.navigationIndex||0:n.findIndex(u=>h.areSame(u,c,t));this.props.groupMode==="modern"&&d&&c&&(x=(C=this.base.getGroupedDataModernMode(n,l))==null?void 0:C.map(u=>u[d]).indexOf(c[d]));const f=!h.areSame(y,c,t);m&&o?this.base.scrollToVirtualItem(o,x):m&&!o?(this.onPopupOpened(),n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][l],this),this.base.scrollToItem(x)):(this.hasDuplicates||r&&a&&c&&f)&&this.base.scrollToItem(x)}m&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var s;this.observerResize=i.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=L.provideLocalizationService(this).toLanguageString(B.comboArrowBtnAriaLabelExpand,B.messages[B.comboArrowBtnAriaLabelExpand]),e=L.provideLocalizationService(this).toLanguageString(B.comboArrowBtnAriaLabelCollapse,B.messages[B.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:o,clearButton:l=S.defaultProps.clearButton,label:d,textField:n,className:p,style:r,loading:a,iconClassName:m,virtual:c,size:C,rounded:y,fillMode:x,opened:f=this.state.opened,placeholder:u,svgIcon:v,unstyled:I}=this.props,D=!this.validityStyles||this.validity.valid,w=this.props.filter!==void 0?this.props.filter:this.state.text,U=h.getItemValue(this.value,n),M=h.isPresent(w)?w:U,W=l&&(!!M||h.isPresent(this.value)),E=this.base.vs,P=this.props.id||this._inputId,A=this.mobileMode,O=I&&I.uComboBox;E.enabled=c!==void 0,c!==void 0&&(E.skip=c.skip,E.total=c.total,E.pageSize=c.pageSize);const[j,G]=q(this.props.prefix||g.Fragment),[$,Y]=q(this.props.suffix||g.Fragment),T=g.createElement(g.Fragment,null,g.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:O,size:C,rounded:y,fillMode:x,disabled:o,invalid:!D,loading:a,required:this.required}),p),ref:this.componentRef,style:d?{...r,width:void 0}:r,dir:t},this.props.prefix&&g.createElement(j,{...G}),this.renderSearchBar(M||"",P,u),W&&!a&&g.createElement(oe,{onClick:this.clearButtonClick,key:"clearbutton"}),a&&g.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:O})),name:"loading",key:"loading"}),this.props.suffix&&g.createElement($,{...Y}),g.createElement(K.Button,{tabIndex:-1,type:"button","aria-label":f?e:s,icon:m?void 0:"caret-alt-down",svgIcon:v||R.caretAltDownIcon,iconClass:m,size:C,fillMode:x,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:O})),onClick:this.toggleBtnClick,onMouseDown:J=>J.preventDefault()}),!A&&this.renderListContainer()),A&&this.renderAdaptiveListContainer());return d?g.createElement(X.FloatingLabel,{label:d,editorId:P,editorValue:M,editorValid:D,editorDisabled:o,style:{width:r?r.width:void 0},children:T,unstyled:I}):T}onNavigate(s,e,t){const{virtual:o={skip:0}}=this.props,l=h.getFilteredData(this.props),d=this.props.filter?this.props.filter:this.state.text;let n=-1,p;const r=this.base.vs,a=this.value;this._suggested="";const m=this.hasDuplicates&&this.duplicates.indexOf(a)!==-1;if(n=this.getFocusedIndex(m),n!==-1&&!h.isPresent(a))this.handleItemSelect(n,s);else if(d==="")this.handleItemSelect(0,s);else{const c=o.skip+n;p=this.base.navigation.navigate({keyCode:e,current:c,max:(r.enabled?r.total:l.length)-1,min:0,skipItems:t||void 0}),p!==void 0&&this.handleItemSelect(p,s)}this.navigationIndex=p}getCurrentValueDisabledStatus(s,e,t){return s&&e&&e[t]&&e[t].disabled}applyValueOnEnter(s,e){const{textField:t,allowCustom:o}=this.props,l=h.getFilteredData(this.props),d=this.props.opened!==void 0?this.props.opened:this.state.opened,p=h.getItemValue(this.value,t)===s?this.index:h.getItemIndexByText(l,s,t),r=p!==-1;let a;if(this._suggested="",r)a=l[p];else if(o)a=t!==void 0?{[t]:s}:s;else return this.selectFocusedItem(s,e);this.triggerOnChange(a,e),d&&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{textField:t,allowCustom:o}=this.props,l=h.getFilteredData(this.props),d=this.props.opened!==void 0?this.props.opened:this.state.opened,n=h.getItemValue(this.value,t);if(this._suggested="",s===n||s===""&&!h.isPresent(n))return this.closeOpenedApplyStateNonMobileMode(e,d),this.applyState(e);const p=h.getItemIndexByText(l,s,t,!0),r=p!==-1;let a=null;r?a=l[p]:o&&(a=s?t?{[t]:s}:s:null),this.triggerOnChange(a,e),this.state.text!==void 0&&(e.data.text=void 0,this.base.filterChanged("",e)),this.closeOpenedApplyStateNonMobileMode(e,d),this.applyState(e)}selectFocusedItem(s,e){const t=this.props.opened!==void 0?this.props.opened:this.state.opened,{textField:o,virtual:l={skip:0},focusedItemIndex:d=h.itemIndexStartsWith}=this.props,n=h.getFilteredData(this.props),p=l.skip,r=s===""&&p===0?0:d(n,s,o);return r!==-1?this.handleItemSelect(r+p,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,groupField:l,groupMode:d,list:n,virtual:p,adaptiveTitle:r,groupStickyHeaderItemRender:a,unstyled:m}=this.props,c=h.getFilteredData(this.props),C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=this.base.getAdaptiveAnimation(),x=m&&m.uComboBox,f=m&&m.uDropDownsActionSheet;let{group:u}=this.state;u===void 0&&l!==void 0&&(u=h.getItemValue(c[0],l));const v={navigatable:!1,navigatableElements:[],expand:C,animation:y,onClose:I=>this.toggleBtnClick(I),animationStyles:s<=i.ADAPTIVE_SMALL_BREAKPOINT?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:f,isFullScreen:s<=i.ADAPTIVE_SMALL_BREAKPOINT}))};return g.createElement(N.ActionSheet,{...v},g.createElement(N.ActionSheetHeader,null,g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:f}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:f}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:f}))},r),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:f}))})),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:f}))},g.createElement(K.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",onClick:this.toggleBtnClick,icon:"x",svgIcon:R.xIcon}))),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:f}))},this.renderMobileListFilter())),g.createElement(N.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:x}))},g.createElement("div",{className:i.classNames(i.uComboBox.list({c:x,list:n,size:"large",tableSize:o,virtual:p}))},e&&g.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:x}))},e),!n&&u&&c.length!==0&&g.createElement(_,{group:u,groupMode:d,render:a}),this.renderList(),t&&g.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:x}),this.props.footerClassName)},t)))))}renderListContainer(){const s=this.base,{dir:e,header:t,footer:o,groupField:l,groupMode:d,size:n,list:p,virtual:r,groupStickyHeaderItemRender:a,unstyled:m}=this.props,c=h.getFilteredData(this.props),C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=s.getPopupSettings(),x=y.width!==void 0?y.width:s.popupWidth,f=m&&m.uComboBox;let{group:u}=this.state;return u===void 0&&l!==void 0&&(u=h.getItemValue(c[0],l)),g.createElement(ee,{width:x,popupSettings:{...y,anchor:y.anchor||this.element,show:C,popupClass:i.classNames(y.popupClass,i.uComboBox.listContainer({c:f,popup:!0}))},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[c.length]},g.createElement("div",{className:i.classNames(i.uComboBox.list({c:f,list:p,size:n,tableSize:n,virtual:r}))},t&&g.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:f}))},t),!p&&u&&c.length!==0&&g.createElement(_,{group:u,groupMode:d,render:a}),this.renderList(),o&&g.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:f}),this.props.footerClassName)},o)))}renderList(){const s=this.base,{textField:e,dataItemKey:t,listNoDataRender:o,itemRender:l,groupHeaderItemRender:d,virtual:n={skip:0,total:void 0},unstyled:p}=this.props,r=h.getFilteredData(this.props),a=s.getPopupSettings(),m=s.vs,c=n.skip,C=this.props.opened!==void 0?this.props.opened:this.state.opened,y=`translateY(${m.translate}px)`,x=C?this.getFocusedIndex(this.hasDuplicates):void 0,f=this.props.filter!==void 0?this.props.filter:this.state.text,u=h.getItemValue(this.value,e),v=h.isPresent(f)&&f!==u?null:this.value,I=this.props.list||te,D=p&&p.uComboBox;return g.createElement(I,{id:s.listBoxId,virtual:!!n,show:C,data:r,focusedIndex:x,value:v,textField:e,valueField:t,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:s.guid,hasDuplicates:this.hasDuplicates,listRef:w=>{m.list=this.base.list=w,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>i.ADAPTIVE_MEDIUM_BREAKPOINT?{maxHeight:a.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:D,virtual:n})),listStyle:m.enabled?{transform:y}:void 0,key:"listkey",skip:c,onClick:this.handleItemClick,itemRender:l,groupHeaderItemRender:d,noDataRender:o,onMouseDown:w=>w.preventDefault(),onScroll:this.onScroll,wrapperRef:m.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})}renderSearchBar(s,e,t){const{tabIndex:o,disabled:l,title:d,ariaLabelledBy:n,ariaDescribedBy:p,dataItemKey:r,virtual:a={skip:0},accessKey:m,unstyled:c,inputAttributes:C}=this.props,y=h.getFilteredData(this.props),x=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.value,u=Math.max(0,y.findIndex(v=>h.areSame(v,f,r)));return this._suggested&&!h.areSame(this._valueOnDidUpdate,f,r)&&(this._suggested=""),g.createElement(Z,{id:e,readOnly:x&&this.mobileMode,placeholder:t,tabIndex:o,title:d,value:s+this._suggested,suggestedText:this._suggested,ref:v=>this._input=v&&v.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:l,expanded:x,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${u+a.skip}`,role:"combobox",ariaLabelledBy:n,ariaLabel:this.props.ariaLabel,ariaDescribedBy:p,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:c,inputAttributes:C})}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&&(!h.isPresent(t)&&!h.isPresent(s)||h.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,{textField:t,dataItemKey:o,virtual:l={skip:0},focusedItemIndex:d=h.itemIndexStartsWith,skipDisabledItems:n}=this.props,p=h.getFilteredData(this.props),r=this.props.filter?this.props.filter:this.state.text;return s&&this.navigationIndex!==void 0?this.navigationIndex:h.isPresent(e)&&r===void 0?p.findIndex(a=>h.areSame(a,e,o)):r?d(p,r,t):n&&t&&!r&&l.skip===0?p.findIndex(a=>!a.disabled&&a[t]):l.skip===0?0:-1}suggestValue(s){const{data:e,textField:t}=this.props;this._suggested=h.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={...V.propTypes,size:b.oneOf([null,"small","medium","large"]),rounded:b.oneOf([null,"small","medium","large","full"]),fillMode:b.oneOf([null,"solid","flat","outline"]),dataItemKey:b.string,groupField:b.string,groupMode:b.oneOf([void 0,"classic","modern"]),isMultiColumn:b.bool,suggest:b.bool,placeholder:b.string,title:b.string,allowCustom:b.bool,clearButton:b.bool,iconClassName:b.string,svgIcon:i.svgIconPropType,validationMessage:b.string,required:b.bool,id:b.string,ariaLabelledBy:b.string,ariaLabel:b.string,ariaDescribedBy:b.string,list:b.any,valueRender:b.func,skipDisabledItems:b.bool,inputAttributes:b.object},S.defaultProps={...V.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 k=S;const z=i.createPropsContext(),H=i.withIdHOC(i.withPropsContext(z,i.withUnstyledHOC(k)));H.displayName="KendoReactComboBox";exports.ComboBox=H;exports.ComboBoxPropsContext=z;exports.ComboBoxWithoutContext=k;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
@@ -9,22 +9,21 @@
9
9
  import * as c from "react";
10
10
  import v from "prop-types";
11
11
  import N from "../common/DropDownBase.mjs";
12
- import { Keys as C, validatePackage as ae, svgIconPropType as ne, canUseDOM as z, classNames as I, uComboBox as D, IconWrap as le, uDropDownsActionSheet as M, createPropsContext as re, withIdHOC as de, withPropsContext as pe, withUnstyledHOC as he } from "@progress/kendo-react-common";
12
+ import { Keys as C, validatePackage as ae, svgIconPropType as ne, canUseDOM as K, ADAPTIVE_MEDIUM_BREAKPOINT as z, classNames as I, uComboBox as D, IconWrap as le, ADAPTIVE_SMALL_BREAKPOINT as H, uDropDownsActionSheet as M, createPropsContext as re, withIdHOC as de, withPropsContext as pe, withUnstyledHOC as he } from "@progress/kendo-react-common";
13
13
  import { FloatingLabel as ce } from "@progress/kendo-react-labels";
14
- import { getPlainDataDuplicates as ue, getFilteredData as S, areSame as E, getItemValue as k, isPresent as w, getItemIndexByText as K, suggestValue as ge, itemIndexStartsWith as H } from "../common/utils.mjs";
14
+ import { getPlainDataDuplicates as ue, getFilteredData as S, areSame as E, getItemValue as k, isPresent as w, getItemIndexByText as q, suggestValue as ge, itemIndexStartsWith as G } from "../common/utils.mjs";
15
15
  import me from "../common/SearchBar.mjs";
16
16
  import ve from "../common/ListContainer.mjs";
17
17
  import fe from "../common/List.mjs";
18
18
  import be from "../common/ListFilter.mjs";
19
- import q from "../common/GroupStickyHeader.mjs";
19
+ import U from "../common/GroupStickyHeader.mjs";
20
20
  import { packageMetadata as xe } from "../package-metadata.mjs";
21
21
  import Ie from "../common/ClearButton.mjs";
22
- import { Button as G } from "@progress/kendo-react-buttons";
22
+ import { Button as W } from "@progress/kendo-react-buttons";
23
23
  import { caretAltDownIcon as ye, xIcon as Ce } from "@progress/kendo-svg-icons";
24
- import { comboArrowBtnAriaLabelExpand as U, messages as W, comboArrowBtnAriaLabelCollapse as j } from "../messages/index.mjs";
25
- import { provideLocalizationService as $ } from "@progress/kendo-react-intl";
24
+ import { comboArrowBtnAriaLabelExpand as j, messages as $, comboArrowBtnAriaLabelCollapse as Y } from "../messages/index.mjs";
25
+ import { provideLocalizationService as J } from "@progress/kendo-react-intl";
26
26
  import { ActionSheet as Se, ActionSheetHeader as De, ActionSheetContent as we } from "@progress/kendo-react-layout";
27
- import { MOBILE_MEDIUM_DEVISE as Y, MOBILE_SMALL_DEVISE as J } from "../common/constants.mjs";
28
27
  import Q from "../common/withCustomComponent.mjs";
29
28
  const Ee = "Please enter a valid value!", F = class F extends c.Component {
30
29
  constructor(s) {
@@ -188,7 +187,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
188
187
  return this.props.id;
189
188
  }
190
189
  get document() {
191
- if (z)
190
+ if (K)
192
191
  return this.element && this.element.ownerDocument || document;
193
192
  }
194
193
  /** @hidden */
@@ -199,7 +198,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
199
198
  * The mobile mode of the ComboBox.
200
199
  */
201
200
  get mobileMode() {
202
- return !!(this.state.windowWidth && this.state.windowWidth <= Y && this.props.adaptive);
201
+ return !!(this.state.windowWidth && this.state.windowWidth <= z && this.props.adaptive);
203
202
  }
204
203
  /**
205
204
  * The value of the ComboBox.
@@ -265,7 +264,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
265
264
  /** @hidden */
266
265
  componentDidMount() {
267
266
  var s;
268
- this.observerResize = z && 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();
267
+ this.observerResize = K && 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();
269
268
  }
270
269
  /** @hidden */
271
270
  componentWillUnmount() {
@@ -274,12 +273,12 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
274
273
  }
275
274
  /** @hidden */
276
275
  render() {
277
- const s = $(this).toLanguageString(
278
- U,
279
- W[U]
280
- ), e = $(this).toLanguageString(
276
+ const s = J(this).toLanguageString(
281
277
  j,
282
- W[j]
278
+ $[j]
279
+ ), e = J(this).toLanguageString(
280
+ Y,
281
+ $[Y]
283
282
  ), {
284
283
  dir: t,
285
284
  disabled: i,
@@ -298,14 +297,14 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
298
297
  placeholder: h,
299
298
  svgIcon: g,
300
299
  unstyled: b
301
- } = this.props, B = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, X = k(this.value, a), T = w(O) ? O : X, Z = n && (!!T || w(this.value)), V = this.base.vs, A = this.props.id || this._inputId, L = this.mobileMode, _ = b && b.uComboBox;
300
+ } = this.props, B = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, X = k(this.value, a), T = w(O) ? O : X, Z = n && (!!T || w(this.value)), V = this.base.vs, A = this.props.id || this._inputId, R = this.mobileMode, P = b && b.uComboBox;
302
301
  V.enabled = p !== void 0, p !== void 0 && (V.skip = p.skip, V.total = p.total, V.pageSize = p.pageSize);
303
- const [ee, te] = Q(this.props.prefix || c.Fragment), [se, ie] = Q(this.props.suffix || c.Fragment), R = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
302
+ const [ee, te] = Q(this.props.prefix || c.Fragment), [se, ie] = Q(this.props.suffix || c.Fragment), L = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
304
303
  "span",
305
304
  {
306
305
  className: I(
307
306
  D.wrapper({
308
- c: _,
307
+ c: P,
309
308
  size: y,
310
309
  rounded: x,
311
310
  fillMode: f,
@@ -326,14 +325,14 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
326
325
  o && /* @__PURE__ */ c.createElement(
327
326
  le,
328
327
  {
329
- className: I(D.loadingIcon({ c: _ })),
328
+ className: I(D.loadingIcon({ c: P })),
330
329
  name: "loading",
331
330
  key: "loading"
332
331
  }
333
332
  ),
334
333
  this.props.suffix && /* @__PURE__ */ c.createElement(se, { ...ie }),
335
334
  /* @__PURE__ */ c.createElement(
336
- G,
335
+ W,
337
336
  {
338
337
  tabIndex: -1,
339
338
  type: "button",
@@ -345,13 +344,13 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
345
344
  fillMode: f,
346
345
  rounded: null,
347
346
  themeColor: "base",
348
- className: I(D.inputButton({ c: _ })),
347
+ className: I(D.inputButton({ c: P })),
349
348
  onClick: this.toggleBtnClick,
350
349
  onMouseDown: (oe) => oe.preventDefault()
351
350
  }
352
351
  ),
353
- !L && this.renderListContainer()
354
- ), L && this.renderAdaptiveListContainer());
352
+ !R && this.renderListContainer()
353
+ ), R && this.renderAdaptiveListContainer());
355
354
  return r ? /* @__PURE__ */ c.createElement(
356
355
  ce,
357
356
  {
@@ -361,10 +360,10 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
361
360
  editorValid: B,
362
361
  editorDisabled: i,
363
362
  style: { width: l ? l.width : void 0 },
364
- children: R,
363
+ children: L,
365
364
  unstyled: b
366
365
  }
367
- ) : R;
366
+ ) : L;
368
367
  }
369
368
  /** @hidden */
370
369
  onNavigate(s, e, t) {
@@ -393,7 +392,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
393
392
  return s && e && e[t] && e[t].disabled;
394
393
  }
395
394
  applyValueOnEnter(s, e) {
396
- const { textField: t, allowCustom: i } = this.props, n = S(this.props), r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = k(this.value, t) === s ? this.index : K(n, s, t), l = d !== -1;
395
+ const { textField: t, allowCustom: i } = this.props, n = S(this.props), r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = k(this.value, t) === s ? this.index : q(n, s, t), l = d !== -1;
397
396
  let o;
398
397
  if (this._suggested = "", l)
399
398
  o = n[d];
@@ -407,12 +406,12 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
407
406
  const { textField: t, allowCustom: i } = this.props, n = S(this.props), r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = k(this.value, t);
408
407
  if (this._suggested = "", s === a || s === "" && !w(a))
409
408
  return this.closeOpenedApplyStateNonMobileMode(e, r), this.applyState(e);
410
- const d = K(n, s, t, !0), l = d !== -1;
409
+ const d = q(n, s, t, !0), l = d !== -1;
411
410
  let o = null;
412
411
  l ? o = n[d] : i && (o = s ? t ? { [t]: s } : s : null), this.triggerOnChange(o, e), this.state.text !== void 0 && (e.data.text = void 0, this.base.filterChanged("", e)), this.closeOpenedApplyStateNonMobileMode(e, r), this.applyState(e);
413
412
  }
414
413
  selectFocusedItem(s, e) {
415
- const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: n = { skip: 0 }, focusedItemIndex: r = H } = this.props, a = S(this.props), d = n.skip, l = s === "" && d === 0 ? 0 : r(a, s, i);
414
+ const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: n = { skip: 0 }, focusedItemIndex: r = G } = this.props, a = S(this.props), d = n.skip, l = s === "" && d === 0 ? 0 : r(a, s, i);
416
415
  return l !== -1 ? this.handleItemSelect(l + d, e) : (this.triggerOnChange(null, e), this.state.text !== void 0 && (e.data.text = void 0)), t && this.base.togglePopup(e), this.applyState(e);
417
416
  }
418
417
  renderAdaptiveListContainer() {
@@ -436,16 +435,16 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
436
435
  expand: y,
437
436
  animation: x,
438
437
  onClose: (b) => this.toggleBtnClick(b),
439
- animationStyles: s <= J ? { top: 0, width: "100%", height: "100%" } : void 0,
438
+ animationStyles: s <= H ? { top: 0, width: "100%", height: "100%" } : void 0,
440
439
  className: I(
441
440
  M.wrapper({
442
441
  c: m,
443
- isFullScreen: s <= J
442
+ isFullScreen: s <= H
444
443
  })
445
444
  )
446
445
  };
447
446
  return /* @__PURE__ */ c.createElement(Se, { ...g }, /* @__PURE__ */ c.createElement(De, null, /* @__PURE__ */ c.createElement("div", { className: I(M.titleBar({ c: m })) }, /* @__PURE__ */ c.createElement("div", { className: I(M.title({ c: m })) }, /* @__PURE__ */ c.createElement("div", { className: I(M.header({ c: m })) }, l), /* @__PURE__ */ c.createElement("div", { className: I(M.subtitle({ c: m })) })), /* @__PURE__ */ c.createElement("div", { className: I(M.actions({ c: m })) }, /* @__PURE__ */ c.createElement(
448
- G,
447
+ W,
449
448
  {
450
449
  tabIndex: 0,
451
450
  "aria-label": "Cancel",
@@ -482,7 +481,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
482
481
  },
483
482
  e && /* @__PURE__ */ c.createElement("div", { className: I(D.listHeader({ c: f })) }, e),
484
483
  !a && h && p.length !== 0 && /* @__PURE__ */ c.createElement(
485
- q,
484
+ U,
486
485
  {
487
486
  group: h,
488
487
  groupMode: r,
@@ -550,7 +549,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
550
549
  )
551
550
  },
552
551
  t && /* @__PURE__ */ c.createElement("div", { className: I(D.listHeader({ c: m })) }, t),
553
- !d && h && p.length !== 0 && /* @__PURE__ */ c.createElement(q, { group: h, groupMode: r, render: o }),
552
+ !d && h && p.length !== 0 && /* @__PURE__ */ c.createElement(U, { group: h, groupMode: r, render: o }),
554
553
  this.renderList(),
555
554
  i && /* @__PURE__ */ c.createElement(
556
555
  "div",
@@ -594,7 +593,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
594
593
  listRef: (O) => {
595
594
  u.list = this.base.list = O, this.itemHeight = 0;
596
595
  },
597
- wrapperStyle: this.state.windowWidth && this.state.windowWidth > Y ? { maxHeight: o.height } : {},
596
+ wrapperStyle: this.state.windowWidth && this.state.windowWidth > z ? { maxHeight: o.height } : {},
598
597
  wrapperCssClass: I(
599
598
  D.listContent({
600
599
  c: B,
@@ -679,7 +678,7 @@ const Ee = "Please enter a valid value!", F = class F extends c.Component {
679
678
  textField: t,
680
679
  dataItemKey: i,
681
680
  virtual: n = { skip: 0 },
682
- focusedItemIndex: r = H,
681
+ focusedItemIndex: r = G,
683
682
  skipDisabledItems: a
684
683
  } = this.props, d = S(this.props), l = this.props.filter ? this.props.filter : this.state.text;
685
684
  return s && this.navigationIndex !== void 0 ? this.navigationIndex : w(e) && l === void 0 ? d.findIndex((o) => E(o, e, i)) : l ? r(d, l, t) : a && t && !l && n.skip === 0 ? d.findIndex((o) => !o.disabled && o[t]) : n.skip === 0 ? 0 : -1;
@@ -736,16 +735,16 @@ F.displayName = "ComboBox", F.propTypes = {
736
735
  prefix: void 0,
737
736
  suffix: void 0
738
737
  };
739
- let P = F;
738
+ let _ = F;
740
739
  const ke = re(), Fe = de(
741
740
  pe(
742
741
  ke,
743
- he(P)
742
+ he(_)
744
743
  )
745
744
  );
746
745
  Fe.displayName = "KendoReactComboBox";
747
746
  export {
748
747
  Fe as ComboBox,
749
748
  ke as ComboBoxPropsContext,
750
- P as ComboBoxWithoutContext
749
+ _ as ComboBoxWithoutContext
751
750
  };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
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 Bt=require("react"),C=require("prop-types"),o=require("@progress/kendo-react-common"),_t=require("@progress/kendo-react-labels"),et=require("@progress/kendo-svg-icons"),Ht=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),tt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),rt=require("../common/DropDownBase.js"),p=require("../common/utils.js"),jt=require("../package-metadata.js"),nt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Ke=require("../messages/index.js"),pe=require("../common/constants.js"),Me=require("@progress/kendo-react-layout");function $t(h){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const k in h)if(k!=="default"){const B=Object.getOwnPropertyDescriptor(h,k);Object.defineProperty(Y,k,B.get?B:{enumerable:!0,get:()=>h[k]})}}return Y.default=h,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",me=s.forwardRef((h,Y)=>{o.validatePackage(jt.packageMetadata);const k=o.useUnstyled(),B=o.useId(h.id),r=o.usePropsContext(ot,h),{delay:at=P.delay,tabIndex:st=P.tabIndex,ignoreCase:ge=P.ignoreCase,size:$=P.size,rounded:be=P.rounded,fillMode:fe=P.fillMode,groupMode:Qt=P.groupMode}=r,ve=()=>{if(o.canUseDOM)return H.current&&H.current.ownerDocument||window.document},it=()=>{var e,n;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((n=t==null?void 0:t.current)==null||n.wrapper.focus({preventScroll:!0}))},N=()=>{let e;return T.current!==void 0&&T.current!==null?e=T.current:r.value!==void 0?e=r.value:f.value!==void 0&&f.value!==null?e=f.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!p.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},lt=()=>{const{dataItemKey:e}=r,n=p.getFilteredData(h),i=N();return n.findIndex(u=>p.areSame(u,i,e))},De=()=>r.required!==void 0?r.required:P.required,we=()=>{const e=r.validationMessage!==void 0,n=N(),i=!De()||n!==null&&n!==""&&n!==void 0,u=r.valid!==void 0?r.valid:i;return{customError:e,valid:u,valueMissing:n===null}},ct=()=>r.validityStyles!==void 0?r.validityStyles:P.validityStyles,ee=e=>{ne.current=!0,e.focus(),window.setTimeout(()=>ne.current=!1,30)},Ie=()=>{Q.current&&ee(Q.current),r.adaptive&&setTimeout(()=>{Q.current&&ee(Q.current)},300)},dt=e=>{for(const n of e)n.target.clientWidth!==re.current.windowWidth&&U({windowWidth:n.target.clientWidth})},Pe=()=>{te.current&&te.current.setCustomValidity&&te.current.setCustomValidity(we().valid?"":r.validationMessage||Jt)},_=(e,n)=>{const i=N();p.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),T.current=e,n.events.push({type:"onChange"}))},M=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),T.current=void 0},J=(e,n)=>{var c;const{virtual:i,dataItemKey:u,defaultItem:d}=r,m=p.getFilteredData(h),I=i?i.skip:0,v=N(),a=e===-1&&d!==void 0?d:m[e-I],g=!p.areSame(a,v,u);_(a,n),g&&((c=t==null?void 0:t.current)==null||c.triggerPageChangeCornerItems(a,n))},O=(e,n,i)=>{var x,D;const{defaultItem:u,dataItemKey:d,virtual:m={skip:0,total:0,pageSize:0}}=r,I=N(),v=p.getFilteredData(h),a=(x=t==null?void 0:t.current)==null?void 0:x.vs,g=v.findIndex(y=>p.areSame(y,I,d)),c=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:m.skip+g,max:(a!=null&&a.enabled?m.total:v.length)-1,min:u!==void 0?-1:0,keyCode:n,skipItems:i||void 0});c!==void 0&&J(c,e),M(e)},ut=e=>{H.current=e,t.current.wrapper=e},pt=e=>s.createElement("select",{name:r.name,ref:n=>{te.current=n},tabIndex:-1,"aria-hidden":!0,title:r.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:r.valueMap?r.valueMap.call(void 0,e):e})),ye=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:u=p.itemIndexStartsWith,filterable:d,skipDisabledItems:m=!0}=r,I=N(),v=p.getFilteredData(h),a=r.filter?r.filter:f.text;return m&&e&&!a&&!I?v.findIndex(g=>!g.disabled&&g[e]):p.isPresent(I)&&a===void 0||d&&a===""?v.findIndex(g=>p.areSame(g,I,n)):a?xe.current?u(v,a,e):v.findIndex(g=>p.areSame(g,I,n)):i.skip===0?0:-1},Fe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=p.getFilteredData(h),n=t.current.initState(),i=ye();Fe(e,i)&&(_(null,n),M(n))},Se=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,f.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),M(n)},Oe=e=>{var F,de,z,ue,j,Ze,Re;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:u,leftRightKeysNavigation:d=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:v="",textField:a,skipDisabledItems:g=!0}=r,c=p.getFilteredData(h),x=N(),D=c.findIndex(L=>p.areSame(L,x,I)),y=r.opened!==void 0?r.opened:f.opened,l=e.keyCode,b=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!y&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),R=y&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=d&&(l===o.Keys.left||l===o.Keys.right),ce=K||le&&!n||b,E=t.current.initState();if(E.syntheticEvent=e,!i){if(b&&((F=t==null?void 0:t.current)!=null&&F.vs.enabled))l===o.Keys.home?m.skip!==0?((de=t==null?void 0:t.current)==null||de.triggerOnPageChange(E,0,m.pageSize),A.current=!0):_(c[0],E):m.skip<m.total-m.pageSize?((z=t==null?void 0:t.current)==null||z.triggerOnPageChange(E,m.total-m.pageSize,m.pageSize),A.current=!0):_(c[c.length-1],E);else if(y&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(y&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(y&&l===o.Keys.enter){const L=ye();Fe(c,L)?(_(null,E),M(E)):J(L,E),(Ze=t==null?void 0:t.current)==null||Ze.togglePopup(E),e.preventDefault()}else if(G||R)R&&he(),(Re=t==null?void 0:t.current)==null||Re.togglePopup(E),e.preventDefault();else if(ce){if(xe.current=!1,v!==""&&a)if(!g&&y)O(E,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.findIndex(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else if(!g&&y||b)O(E,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.find(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else O(E,l);e.preventDefault()}M(E)}},mt=e=>{const n=t.current.initState();n.syntheticEvent=e.syntheticEvent,r.filter===void 0&&(n.data.text=e.target.value),t.current.filterChanged(e.target.value,n),xe.current=!0,M(n),U({group:void 0,text:String(e.target.value)})},Te=()=>{const e=r.filter!==void 0?r.filter:f.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>Q.current=n&&n.element,onChange:mt,onKeyDown:Oe,size:$,rounded:be,fillMode:fe,renderListFilterWrapper:!0})},gt=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),_(r.defaultItem,n),M(n)},Ae=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,u=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:p.areSame(u,n,i),key:"defaultitemkey",onClick:gt})},ft=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),T.current=void 0},vt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:u}=r;let d=p.getFilteredData(h);if(!(!u||!d.length)&&u){const m=Be.current=Be.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*m;d=t.current.getGroupedDataModernMode(d,u);let a=d[0][u];for(let g=1;g<d.length&&!(m*g>v);g++)d[g]&&d[g][u]&&(a=d[g][u]);a!==f.group&&U({group:a})}},qe=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:d,itemRender:m}=r,I=p.getFilteredData(h),v=k&&k.uDropDownList,a=t.current.vs,g=i.skip,c=r.opened!==void 0?r.opened:f.opened,x=t.current.getPopupSettings(),D=`translateY(${a.translate}px)`,y=N();return s.createElement(Gt,{id:Ee,show:c,data:I.slice(),focusedIndex:ye(),value:y,textField:e,valueField:n,optionsGuid:We,groupField:r.groupField,groupMode:"modern",listRef:b=>a.list=t.current.list=b,wrapperStyle:{maxHeight:x.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:ft,itemRender:m,groupHeaderItemRender:u,noDataRender:d,onScroll:vt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},Dt=()=>{var y;const{windowWidth:e=0}=f,{header:n,footer:i,adaptiveTitle:u,groupField:d,groupStickyHeaderItemRender:m,list:I}=r,v=p.getFilteredData(h),a=r.opened!==void 0?r.opened:f.opened,g=k&&k.uDropDownList,c=k&&k.uDropDownsActionSheet,x={navigatable:!1,navigatableElements:[],expand:a,animation:!0,onClose:l=>Se(l),animationStyles:e<=pe.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c,isFullScreen:e<=pe.MOBILE_SMALL_DEVISE}))};let{group:D}=f;return D===void 0&&d!==void 0&&(D=p.getItemValue(v[0],d)),s.createElement(Me.ActionSheet,{...x},s.createElement(Me.ActionSheetHeader,{className:o.classNames(o.uDropDownsActionSheet.header({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c}))},s.createElement("div",null,u)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c}))},s.createElement(nt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Se,icon:"x",svgIcon:et.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c}))},Te())),s.createElement(Me.ActionSheetContent,{overflowHidden:!0},n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},n),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:g,size:$,virtual:(y=t==null?void 0:t.current)==null?void 0:y.vs.enabled}))},Ae(),!I&&D&&v.length!==0&&s.createElement(tt,{group:D,groupMode:"modern",render:m}),qe()),i&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:g}))},i)))},wt=()=>{f.focused&&window.setTimeout(()=>{f.focused&&t.current.wrapper&&ee(t.current.wrapper)})},It=e=>{var n;(n=r.popupSettings)!=null&&n.onMouseDownOutside&&r.popupSettings.onMouseDownOutside.call(void 0,e)},yt=()=>{const{header:e,footer:n,dir:i,groupField:u,groupStickyHeaderItemRender:d,list:m}=r,I=p.getFilteredData(h),v=t.current,a=v.getPopupSettings(),g=r.opened!==void 0?r.opened:f.opened,c=a.width!==void 0?a.width:v.popupWidth,x=k&&k.uDropDownList,D={dir:i!==void 0?i:v.dirCalculated,width:c,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:x})),anchor:a.anchor||H.current,show:g,onOpen:Ie,onClose:wt,onMouseDownOutside:It},itemsCount:[I.length]};let{group:y}=f;return y===void 0&&u!==void 0&&(y=p.getItemValue(I[0],u)),s.createElement(Ht,{...D},Te(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:x}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:x,size:$,virtual:t.current.vs.enabled}))},Ae(),!m&&y&&I.length!==0&&s.createElement(tt,{group:y,groupMode:"modern",render:d}),qe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:x}))},n))},ht=e=>{const{dataItemKey:n}=r,i=p.getFilteredData(h),u=N();let d=i.map((K,G)=>({item:K,itemIndex:G}));const m=W.current.word,I=W.current.last,v=p.sameCharsOnly(m,I);let a=d.length,g=Math.max(0,i.findIndex(K=>p.areSame(K,u,n))),c;r.defaultItem&&(c={item:r.defaultItem,itemIndex:-1},a+=1,g+=1),g+=v?1:0,d=p.shuffleData(d,g,c);let x,D,y,l=0;const{textField:b}=r;for(;l<a;l++)if(x=p.getItemValue(d[l].item,b),D=v&&p.matchText(x,I,ge),y=p.matchText(x,m,ge),D||y){l=d[l].itemIndex;break}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),M(K),T.current=void 0}},St=e=>{clearTimeout(ze.current),r.filterable||(ze.current=window.setTimeout(()=>W.current.word="",at),ht(e))},xt=e=>{ne.current||t.current.handleFocus(e)},Et=e=>{if(ne.current||!f.focused)return;const n=r.opened!==void 0?r.opened:f.opened,{adaptive:i}=r,{windowWidth:u=0}=f,d=u<=pe.MOBILE_MEDIUM_DEVISE&&i,m=t.current.initState();m.syntheticEvent=e,m.data.focused=!1,m.events.push({type:"onBlur"}),n&&he(),n&&!d&&t.current.togglePopup(m),M(m)},Lt=e=>{if(r.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);ge&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),W.current={word:W.current.word+n,last:W.current.last+n},St(e)},Ct=()=>{const e=t.current.initState();e.data.opened=f.opened,t.current.togglePopup(e),M(e)},Ve=s.useRef(null),H=s.useRef(null),te=s.useRef(),Q=s.useRef(null);s.useImperativeHandle(Ve,()=>({get element(){return H.current},get index(){return lt()},get name(){return r.name},get validity(){return we()},get value(){return N()},get focused(){return f.focused},get opened(){return f.opened},focus:it,props:r,togglePopup:Ct})),s.useImperativeHandle(Y,()=>Ve.current);const ze=s.useRef(null),W=s.useRef({word:"",last:""}),ne=s.useRef(!1),T=s.useRef(null),A=s.useRef(!1),xe=s.useRef(!1),q=s.useRef({}),re=s.useRef({}),t=s.useRef(new rt({props:h,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Be=s.useRef(0),X=s.useRef(null),[f,kt]=s.useState({}),[,_e]=s.useReducer(e=>e,!0),Nt=Yt.useLocalization(),U=e=>{kt({...f,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:h,setState:U,state:f,forceUpdate:_e,element:H.current,handleItemSelect:J,value:N()})},[U,f,_e,J,N]),s.useEffect(()=>{var g,c,x,D,y,l,b,K,G,R,le,ce,E;const{dataItemKey:e,virtual:n,groupField:i="",textField:u}=r,d=p.getFilteredData(h),m=q.current.virtual?q.current.virtual.total:0,I=r.opened!==void 0?r.opened:f.opened,v=q.current.opened!==void 0?q.current.opened:re.current.opened,a=!v&&I;if((g=t==null?void 0:t.current)==null||g.didUpdate(),(c=t==null?void 0:t.current)!=null&&c.getPopupSettings().animate||a&&Ie(),n&&n.total!==m)(x=t==null?void 0:t.current)==null||x.vs.calcScrollElementHeight(),(D=t==null?void 0:t.current)==null||D.vs.reset();else{const F=N(),de=q.current.value!==void 0?q.current.value:re.current.value;let z=d.findIndex(j=>p.areSame(j,F,e));i!==""&&F&&u&&(z=(l=(y=t==null?void 0:t.current)==null?void 0:y.getGroupedDataModernMode(d,i))==null?void 0:l.map(j=>j[u]).indexOf(F[u]));const ue=!p.areSame(de,F,e);a&&n?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(n,z):a&&!n?(Ie(),d&&d.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(d[0][i],{setState:U,group:f.group,state:f})),(G=t==null?void 0:t.current)==null||G.scrollToItem(z)):I&&v&&F&&ue&&!A.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(z,(R=t==null?void 0:t.current)==null?void 0:R.vs.enabled):I&&v&&A.current&&(A.current&&n&&n.skip===0?(ce=t==null?void 0:t.current)==null||ce.vs.reset():A.current&&n&&n.skip===n.total-n.pageSize&&((E=t==null?void 0:t.current)==null||E.vs.scrollToEnd()))}A.current=!1,re.current=f,q.current=r,Pe()}),s.useEffect(()=>{var e,n;return X.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(i=>dt(i)),(e=t==null?void 0:t.current)==null||e.didMount(),Pe(),(n=ve())!=null&&n.body&&X.current&&X.current.observe(ve().body),()=>{var i;(i=ve())!=null&&i.body&&X.current&&X.current.disconnect()}},[]);const He=B+"-accessibility-id",Ee=B+"-listbox-id",We=B+"-guid",Kt=Nt.toLanguageString(Ke.dropDownListArrowBtnAriaLabel,Ke.messages[Ke.dropDownListArrowBtnAriaLabel]),{style:oe,className:Mt,label:Le,dir:bt,virtual:V,adaptive:Pt,dataItemKey:Ft,disabled:ae,loading:Ue,iconClassName:Ge,svgIcon:je,valueRender:Ye}=r,{windowWidth:Ot=0}=f,Ce=r.opened!==void 0?r.opened:f.opened,se=N(),ke=p.getItemValue(se,r.textField),$e=!ct()||we().valid,ie=t.current,Tt=ie.vs,Je=Ot<=pe.MOBILE_MEDIUM_DEVISE&&Pt,Z=k&&k.uDropDownList;Tt.enabled=V!==void 0,V!==void 0&&(ie.vs.skip=V.skip,ie.vs.total=V.total,ie.vs.pageSize=V.pageSize);const At=p.getFilteredData(h),{focused:qt}=f,Vt=At.findIndex(e=>p.areSame(e,se,Ft)),Qe=s.createElement("span",{id:He,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},ke&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},ke)),zt=Ye!==void 0?Ye.call(void 0,Qe,se):Qe,Xe=s.createElement(s.Fragment,null,s.createElement("span",{ref:ut,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:$,rounded:be,fillMode:fe,focused:qt,disabled:ae,invalid:!$e,loading:Ue,required:De()}),Mt),style:Le?{...oe,width:void 0}:oe,dir:bt,onMouseDown:Ce?e=>{e.target.nodeName!=="INPUT"&&(ee(t.current.wrapper),e.preventDefault())}:void 0,onFocus:xt,onBlur:Et,tabIndex:o.getTabIndex(st,ae),accessKey:r.accessKey,onKeyDown:Oe,onKeyPress:Lt,onClick:ae?void 0:Se,role:"combobox","aria-required":De(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ce||!1,"aria-owns":Ee,"aria-activedescendant":Ce?"option-"+We+"-"+(Vt+(V?V.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||He,"aria-controls":Ee,id:r.id,title:r.title},zt,Ue&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),s.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":Kt,size:$,fillMode:fe,iconClass:Ge,className:o.classNames(o.uDropDownList.inputButton({c:Z})),rounded:null,themeColor:"base",icon:Ge?void 0:"caret-alt-down",svgIcon:je||et.caretAltDownIcon,onMouseDown:e=>f.focused&&e.preventDefault()}),pt(se),!Je&&yt()),Je&&Dt());return Le?s.createElement(_t.FloatingLabel,{label:Le,editorValue:ke,editorValid:$e,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Xe}):Xe});me.propTypes={delay:C.number,ignoreCase:C.bool,iconClassName:C.string,svgIcon:o.svgIconPropType,defaultItem:C.any,valueRender:C.func,valueMap:C.func,validationMessage:C.string,required:C.bool,id:C.string,ariaLabelledBy:C.string,ariaDescribedBy:C.string,ariaLabel:C.string,leftRightKeysNavigation:C.bool,title:C.string,groupField:C.string,list:C.any,skipDisabledItems:C.bool};const P={delay:500,tabIndex:0,ignoreCase:!0,...rt.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};me.displayName="KendoReactDropDownList";const ot=o.createPropsContext();me.displayName="KendoReactDropDownList";exports.DropDownList=me;exports.DropDownListPropsContext=ot;exports.dropDownListDefaultProps=P;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=require("react"),L=require("prop-types"),o=require("@progress/kendo-react-common"),Bt=require("@progress/kendo-react-labels"),Ze=require("@progress/kendo-svg-icons"),_t=require("../common/ListContainer.js"),Ht=require("../common/ListFilter.js"),et=require("../common/GroupStickyHeader.js"),Wt=require("../common/ListDefaultItem.js"),Ut=require("../common/List.js"),nt=require("../common/DropDownBase.js"),p=require("../common/utils.js"),Gt=require("../package-metadata.js"),tt=require("@progress/kendo-react-buttons"),jt=require("@progress/kendo-react-intl"),Ke=require("../messages/index.js"),ke=require("@progress/kendo-react-layout");function Rt(h){const R=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const N in h)if(N!=="default"){const B=Object.getOwnPropertyDescriptor(h,N);Object.defineProperty(R,N,B.get?B:{enumerable:!0,get:()=>h[N]})}}return R.default=h,Object.freeze(R)}const s=Rt(zt),Yt="Please select a value from the list!",pe=s.forwardRef((h,R)=>{o.validatePackage(Gt.packageMetadata);const N=o.useUnstyled(),B=o.useId(h.id),r=o.usePropsContext(rt,h),{delay:ot=F.delay,tabIndex:at=F.tabIndex,ignoreCase:me=F.ignoreCase,size:Y=F.size,rounded:Pe=F.rounded,fillMode:ge=F.fillMode,groupMode:$t=F.groupMode}=r,fe=()=>{if(o.canUseDOM)return H.current&&H.current.ownerDocument||window.document},st=()=>{var e,n;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((n=t==null?void 0:t.current)==null||n.wrapper.focus({preventScroll:!0}))},K=()=>{let e;return T.current!==void 0&&T.current!==null?e=T.current:r.value!==void 0?e=r.value:f.value!==void 0&&f.value!==null?e=f.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!p.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},it=()=>{const{dataItemKey:e}=r,n=p.getFilteredData(h),i=K();return n.findIndex(u=>p.areSame(u,i,e))},ve=()=>r.required!==void 0?r.required:F.required,De=()=>{const e=r.validationMessage!==void 0,n=K(),i=!ve()||n!==null&&n!==""&&n!==void 0,u=r.valid!==void 0?r.valid:i;return{customError:e,valid:u,valueMissing:n===null}},lt=()=>r.validityStyles!==void 0?r.validityStyles:F.validityStyles,ee=e=>{ne.current=!0,e.focus(),window.setTimeout(()=>ne.current=!1,30)},we=()=>{J.current&&ee(J.current),r.adaptive&&setTimeout(()=>{J.current&&ee(J.current)},300)},dt=e=>{for(const n of e)n.target.clientWidth!==re.current.windowWidth&&U({windowWidth:n.target.clientWidth})},be=()=>{te.current&&te.current.setCustomValidity&&te.current.setCustomValidity(De().valid?"":r.validationMessage||Yt)},_=(e,n)=>{const i=K();p.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),T.current=e,n.events.push({type:"onChange"}))},P=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),T.current=void 0},$=(e,n)=>{var d;const{virtual:i,dataItemKey:u,defaultItem:c}=r,m=p.getFilteredData(h),I=i?i.skip:0,v=K(),a=e===-1&&c!==void 0?c:m[e-I],g=!p.areSame(a,v,u);_(a,n),g&&((d=t==null?void 0:t.current)==null||d.triggerPageChangeCornerItems(a,n))},A=(e,n,i)=>{var x,D;const{defaultItem:u,dataItemKey:c,virtual:m={skip:0,total:0,pageSize:0}}=r,I=K(),v=p.getFilteredData(h),a=(x=t==null?void 0:t.current)==null?void 0:x.vs,g=v.findIndex(y=>p.areSame(y,I,c)),d=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:m.skip+g,max:(a!=null&&a.enabled?m.total:v.length)-1,min:u!==void 0?-1:0,keyCode:n,skipItems:i||void 0});d!==void 0&&$(d,e),P(e)},ct=e=>{H.current=e,t.current.wrapper=e},ut=e=>s.createElement("select",{name:r.name,ref:n=>{te.current=n},tabIndex:-1,"aria-hidden":!0,title:r.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:r.valueMap?r.valueMap.call(void 0,e):e})),Ie=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:u=p.itemIndexStartsWith,filterable:c,skipDisabledItems:m=!0}=r,I=K(),v=p.getFilteredData(h),a=r.filter?r.filter:f.text;return m&&e&&!a&&!I?v.findIndex(g=>!g.disabled&&g[e]):p.isPresent(I)&&a===void 0||c&&a===""?v.findIndex(g=>p.areSame(g,I,n)):a?Se.current?u(v,a,e):v.findIndex(g=>p.areSame(g,I,n)):i.skip===0?0:-1},Fe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,ye=()=>{const e=p.getFilteredData(h),n=t.current.initState(),i=Ie();Fe(e,i)&&(_(null,n),P(n))},he=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,f.focused||(n.data.focused=!0),ye(),t.current.togglePopup(n),P(n)},Me=e=>{var M,ce,z,ue,j,Qe,Xe;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:u,leftRightKeysNavigation:c=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:v="",textField:a,skipDisabledItems:g=!0}=r,d=p.getFilteredData(h),x=K(),D=d.findIndex(E=>p.areSame(E,x,I)),y=r.opened!==void 0?r.opened:f.opened,l=e.keyCode,b=l===o.Keys.home||l===o.Keys.end,k=l===o.Keys.up||l===o.Keys.down,G=!y&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),Z=y&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=c&&(l===o.Keys.left||l===o.Keys.right),de=k||le&&!n||b,C=t.current.initState();if(C.syntheticEvent=e,!i){if(b&&((M=t==null?void 0:t.current)!=null&&M.vs.enabled))l===o.Keys.home?m.skip!==0?((ce=t==null?void 0:t.current)==null||ce.triggerOnPageChange(C,0,m.pageSize),O.current=!0):_(d[0],C):m.skip<m.total-m.pageSize?((z=t==null?void 0:t.current)==null||z.triggerOnPageChange(C,m.total-m.pageSize,m.pageSize),O.current=!0):_(d[d.length-1],C);else if(y&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(y&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(y&&l===o.Keys.enter){const E=Ie();Fe(d,E)?(_(null,C),P(C)):$(E,C),(Qe=t==null?void 0:t.current)==null||Qe.togglePopup(C),e.preventDefault()}else if(G||Z)Z&&ye(),(Xe=t==null?void 0:t.current)==null||Xe.togglePopup(C),e.preventDefault();else if(de){if(Se.current=!1,v!==""&&a)if(!g&&y)A(C,l);else{let E;if(l===o.Keys.down||l===o.Keys.right){const S=d.slice(D+1).find(w=>!w.disabled&&w[a]);E=S&&d.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)E=-1;else if(D===-1)S=d,E=d.findIndex(w=>!w.disabled&&w[a]);else{S=d.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();E=w&&d.findIndex(Ne=>Ne[a]===w[a])}}if(E!==void 0){const S=E-D;A(C,l,S)}else E===void 0&&d.findIndex(S=>S[a]===x[a])===d.length-1&&A(C,l)}else if(!g&&y||b)A(C,l);else if(a){let E;if(l===o.Keys.down||l===o.Keys.right){const S=d.slice(D+1).find(w=>!w.disabled&&w[a]);E=S&&d.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)E=-1;else if(D===-1)S=d,E=d.find(w=>!w.disabled&&w[a]);else{S=d.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();E=w&&d.findIndex(Ne=>Ne[a]===w[a])}}if(E!==void 0){const S=E-D;A(C,l,S)}else E===void 0&&d.findIndex(S=>S[a]===x[a])===d.length-1&&A(C,l)}else A(C,l);e.preventDefault()}P(C)}},pt=e=>{const n=t.current.initState();n.syntheticEvent=e.syntheticEvent,r.filter===void 0&&(n.data.text=e.target.value),t.current.filterChanged(e.target.value,n),Se.current=!0,P(n),U({group:void 0,text:String(e.target.value)})},Ae=()=>{const e=r.filter!==void 0?r.filter:f.text;return r.filterable&&s.createElement(Ht,{value:e,ref:n=>J.current=n&&n.element,onChange:pt,onKeyDown:Me,size:Y,rounded:Pe,fillMode:ge,renderListFilterWrapper:!0})},mt=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),_(r.defaultItem,n),P(n)},Te=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,u=K();return n!==void 0&&s.createElement(Wt,{defaultItem:n,textField:e,selected:p.areSame(u,n,i),key:"defaultitemkey",onClick:mt})},gt=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),T.current=void 0},ft=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:u}=r;let c=p.getFilteredData(h);if(!(!u||!c.length)&&u){const m=ze.current=ze.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*m;c=t.current.getGroupedDataModernMode(c,u);let a=c[0][u];for(let g=1;g<c.length&&!(m*g>v);g++)c[g]&&c[g][u]&&(a=c[g][u]);a!==f.group&&U({group:a})}},Oe=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:c,itemRender:m}=r,I=p.getFilteredData(h),v=N&&N.uDropDownList,a=t.current.vs,g=i.skip,d=r.opened!==void 0?r.opened:f.opened,x=t.current.getPopupSettings(),D=`translateY(${a.translate}px)`,y=K();return s.createElement(Ut,{id:xe,show:d,data:I.slice(),focusedIndex:Ie(),value:y,textField:e,valueField:n,optionsGuid:He,groupField:r.groupField,groupMode:"modern",listRef:b=>a.list=t.current.list=b,wrapperStyle:{maxHeight:x.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:gt,itemRender:m,groupHeaderItemRender:u,noDataRender:c,onScroll:ft,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},vt=()=>{var y;const{windowWidth:e=0}=f,{header:n,footer:i,adaptiveTitle:u,groupField:c,groupStickyHeaderItemRender:m,list:I}=r,v=p.getFilteredData(h),a=r.opened!==void 0?r.opened:f.opened,g=N&&N.uDropDownList,d=N&&N.uDropDownsActionSheet,x={navigatable:!1,navigatableElements:[],expand:a,animation:!0,onClose:l=>he(l),animationStyles:e<=o.ADAPTIVE_SMALL_BREAKPOINT?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c:d,isFullScreen:e<=o.ADAPTIVE_SMALL_BREAKPOINT}))};let{group:D}=f;return D===void 0&&c!==void 0&&(D=p.getItemValue(v[0],c)),s.createElement(ke.ActionSheet,{...x},s.createElement(ke.ActionSheetHeader,{className:o.classNames(o.uDropDownsActionSheet.header({c:d}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c:d}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c:d}))},s.createElement("div",null,u)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c:d}))},s.createElement(tt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:he,icon:"x",svgIcon:Ze.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c:d}))},Ae())),s.createElement(ke.ActionSheetContent,{overflowHidden:!0},n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},n),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:g,size:Y,virtual:(y=t==null?void 0:t.current)==null?void 0:y.vs.enabled}))},Te(),!I&&D&&v.length!==0&&s.createElement(et,{group:D,groupMode:"modern",render:m}),Oe()),i&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:g}))},i)))},Dt=()=>{f.focused&&window.setTimeout(()=>{f.focused&&t.current.wrapper&&ee(t.current.wrapper)})},wt=e=>{var n;(n=r.popupSettings)!=null&&n.onMouseDownOutside&&r.popupSettings.onMouseDownOutside.call(void 0,e)},It=()=>{const{header:e,footer:n,dir:i,groupField:u,groupStickyHeaderItemRender:c,list:m}=r,I=p.getFilteredData(h),v=t.current,a=v.getPopupSettings(),g=r.opened!==void 0?r.opened:f.opened,d=a.width!==void 0?a.width:v.popupWidth,x=N&&N.uDropDownList,D={dir:i!==void 0?i:v.dirCalculated,width:d,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:x})),anchor:a.anchor||H.current,show:g,onOpen:we,onClose:Dt,onMouseDownOutside:wt},itemsCount:[I.length]};let{group:y}=f;return y===void 0&&u!==void 0&&(y=p.getItemValue(I[0],u)),s.createElement(_t,{...D},Ae(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:x}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:x,size:Y,virtual:t.current.vs.enabled}))},Te(),!m&&y&&I.length!==0&&s.createElement(et,{group:y,groupMode:"modern",render:c}),Oe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:x}))},n))},yt=e=>{const{dataItemKey:n}=r,i=p.getFilteredData(h),u=K();let c=i.map((k,G)=>({item:k,itemIndex:G}));const m=W.current.word,I=W.current.last,v=p.sameCharsOnly(m,I);let a=c.length,g=Math.max(0,i.findIndex(k=>p.areSame(k,u,n))),d;r.defaultItem&&(d={item:r.defaultItem,itemIndex:-1},a+=1,g+=1),g+=v?1:0,c=p.shuffleData(c,g,d);let x,D,y,l=0;const{textField:b}=r;for(;l<a;l++)if(x=p.getItemValue(c[l].item,b),D=v&&p.matchText(x,I,me),y=p.matchText(x,m,me),D||y){l=c[l].itemIndex;break}if(l!==a){const k=t.current.initState();k.syntheticEvent=e,$(l,k),P(k),T.current=void 0}},ht=e=>{clearTimeout(Ve.current),r.filterable||(Ve.current=window.setTimeout(()=>W.current.word="",ot),yt(e))},St=e=>{ne.current||t.current.handleFocus(e)},xt=e=>{if(ne.current||!f.focused)return;const n=r.opened!==void 0?r.opened:f.opened,{adaptive:i}=r,{windowWidth:u=0}=f,c=u<=o.ADAPTIVE_MEDIUM_BREAKPOINT&&i,m=t.current.initState();m.syntheticEvent=e,m.data.focused=!1,m.events.push({type:"onBlur"}),n&&ye(),n&&!c&&t.current.togglePopup(m),P(m)},Ct=e=>{if(r.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);me&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),W.current={word:W.current.word+n,last:W.current.last+n},ht(e)},Et=()=>{const e=t.current.initState();e.data.opened=f.opened,t.current.togglePopup(e),P(e)},qe=s.useRef(null),H=s.useRef(null),te=s.useRef(),J=s.useRef(null);s.useImperativeHandle(qe,()=>({get element(){return H.current},get index(){return it()},get name(){return r.name},get validity(){return De()},get value(){return K()},get focused(){return f.focused},get opened(){return f.opened},focus:st,props:r,togglePopup:Et})),s.useImperativeHandle(R,()=>qe.current);const Ve=s.useRef(null),W=s.useRef({word:"",last:""}),ne=s.useRef(!1),T=s.useRef(null),O=s.useRef(!1),Se=s.useRef(!1),q=s.useRef({}),re=s.useRef({}),t=s.useRef(new nt({props:h,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),ze=s.useRef(0),Q=s.useRef(null),[f,Lt]=s.useState({}),[,Be]=s.useReducer(e=>e,!0),Nt=jt.useLocalization(),U=e=>{Lt({...f,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:h,setState:U,state:f,forceUpdate:Be,element:H.current,handleItemSelect:$,value:K()})},[U,f,Be,$,K]),s.useEffect(()=>{var g,d,x,D,y,l,b,k,G,Z,le,de,C;const{dataItemKey:e,virtual:n,groupField:i="",textField:u}=r,c=p.getFilteredData(h),m=q.current.virtual?q.current.virtual.total:0,I=r.opened!==void 0?r.opened:f.opened,v=q.current.opened!==void 0?q.current.opened:re.current.opened,a=!v&&I;if((g=t==null?void 0:t.current)==null||g.didUpdate(),(d=t==null?void 0:t.current)!=null&&d.getPopupSettings().animate||a&&we(),n&&n.total!==m)(x=t==null?void 0:t.current)==null||x.vs.calcScrollElementHeight(),(D=t==null?void 0:t.current)==null||D.vs.reset();else{const M=K(),ce=q.current.value!==void 0?q.current.value:re.current.value;let z=c.findIndex(j=>p.areSame(j,M,e));i!==""&&M&&u&&(z=(l=(y=t==null?void 0:t.current)==null?void 0:y.getGroupedDataModernMode(c,i))==null?void 0:l.map(j=>j[u]).indexOf(M[u]));const ue=!p.areSame(ce,M,e);a&&n?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(n,z):a&&!n?(we(),c&&c.length!==0&&((k=t==null?void 0:t.current)==null||k.resetGroupStickyHeader(c[0][i],{setState:U,group:f.group,state:f})),(G=t==null?void 0:t.current)==null||G.scrollToItem(z)):I&&v&&M&&ue&&!O.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(z,(Z=t==null?void 0:t.current)==null?void 0:Z.vs.enabled):I&&v&&O.current&&(O.current&&n&&n.skip===0?(de=t==null?void 0:t.current)==null||de.vs.reset():O.current&&n&&n.skip===n.total-n.pageSize&&((C=t==null?void 0:t.current)==null||C.vs.scrollToEnd()))}O.current=!1,re.current=f,q.current=r,be()}),s.useEffect(()=>{var e,n;return Q.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(i=>dt(i)),(e=t==null?void 0:t.current)==null||e.didMount(),be(),(n=fe())!=null&&n.body&&Q.current&&Q.current.observe(fe().body),()=>{var i;(i=fe())!=null&&i.body&&Q.current&&Q.current.disconnect()}},[]);const _e=B+"-accessibility-id",xe=B+"-listbox-id",He=B+"-guid",Kt=Nt.toLanguageString(Ke.dropDownListArrowBtnAriaLabel,Ke.messages[Ke.dropDownListArrowBtnAriaLabel]),{style:oe,className:kt,label:Ce,dir:Pt,virtual:V,adaptive:bt,dataItemKey:Ft,disabled:ae,loading:We,iconClassName:Ue,svgIcon:Ge,valueRender:je}=r,{windowWidth:Mt=0}=f,Ee=r.opened!==void 0?r.opened:f.opened,se=K(),Le=p.getItemValue(se,r.textField),Re=!lt()||De().valid,ie=t.current,At=ie.vs,Ye=Mt<=o.ADAPTIVE_MEDIUM_BREAKPOINT&&bt,X=N&&N.uDropDownList;At.enabled=V!==void 0,V!==void 0&&(ie.vs.skip=V.skip,ie.vs.total=V.total,ie.vs.pageSize=V.pageSize);const Tt=p.getFilteredData(h),{focused:Ot}=f,qt=Tt.findIndex(e=>p.areSame(e,se,Ft)),$e=s.createElement("span",{id:_e,className:o.classNames(o.uDropDownList.inputInner({c:X}))},Le&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:X}))},Le)),Vt=je!==void 0?je.call(void 0,$e,se):$e,Je=s.createElement(s.Fragment,null,s.createElement("span",{ref:ct,className:o.classNames(o.uDropDownList.wrapper({c:X,size:Y,rounded:Pe,fillMode:ge,focused:Ot,disabled:ae,invalid:!Re,loading:We,required:ve()}),kt),style:Ce?{...oe,width:void 0}:oe,dir:Pt,onMouseDown:Ee?e=>{e.target.nodeName!=="INPUT"&&(ee(t.current.wrapper),e.preventDefault())}:void 0,onFocus:St,onBlur:xt,tabIndex:o.getTabIndex(at,ae),accessKey:r.accessKey,onKeyDown:Me,onKeyPress:Ct,onClick:ae?void 0:he,role:"combobox","aria-required":ve(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ee||!1,"aria-owns":xe,"aria-activedescendant":Ee?"option-"+He+"-"+(qt+(V?V.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||_e,"aria-controls":xe,id:r.id,title:r.title},Vt,We&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:X})),name:"loading"}),s.createElement(tt.Button,{tabIndex:-1,type:"button","aria-label":Kt,size:Y,fillMode:ge,iconClass:Ue,className:o.classNames(o.uDropDownList.inputButton({c:X})),rounded:null,themeColor:"base",icon:Ue?void 0:"caret-alt-down",svgIcon:Ge||Ze.caretAltDownIcon,onMouseDown:e=>f.focused&&e.preventDefault()}),ut(se),!Ye&&It()),Ye&&vt());return Ce?s.createElement(Bt.FloatingLabel,{label:Ce,editorValue:Le,editorValid:Re,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Je}):Je});pe.propTypes={delay:L.number,ignoreCase:L.bool,iconClassName:L.string,svgIcon:o.svgIconPropType,defaultItem:L.any,valueRender:L.func,valueMap:L.func,validationMessage:L.string,required:L.bool,id:L.string,ariaLabelledBy:L.string,ariaDescribedBy:L.string,ariaLabel:L.string,leftRightKeysNavigation:L.bool,title:L.string,groupField:L.string,list:L.any,skipDisabledItems:L.bool};const F={delay:500,tabIndex:0,ignoreCase:!0,...nt.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};pe.displayName="KendoReactDropDownList";const rt=o.createPropsContext();pe.displayName="KendoReactDropDownList";exports.DropDownList=pe;exports.DropDownListPropsContext=rt;exports.dropDownListDefaultProps=F;