@progress/kendo-react-dropdowns 9.4.0-develop.23 → 9.4.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 (65) hide show
  1. package/AutoComplete/AutoComplete.js +1 -1
  2. package/AutoComplete/AutoComplete.mjs +1 -0
  3. package/ComboBox/ComboBox.js +1 -1
  4. package/ComboBox/ComboBox.mjs +1 -0
  5. package/DropDownList/DropDownList.js +1 -1
  6. package/DropDownList/DropDownList.mjs +1 -0
  7. package/DropDownTree/DropDownTree.js +1 -1
  8. package/DropDownTree/DropDownTree.mjs +1 -0
  9. package/DropDownTree/ListNoData.js +1 -1
  10. package/DropDownTree/ListNoData.mjs +1 -0
  11. package/DropDownTree/useDropdownWidth.js +1 -1
  12. package/DropDownTree/useDropdownWidth.mjs +8 -7
  13. package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
  14. package/MultiColumnComboBox/MultiColumnComboBox.mjs +1 -0
  15. package/MultiSelect/MultiSelect.js +1 -1
  16. package/MultiSelect/MultiSelect.mjs +1 -0
  17. package/MultiSelect/TagList.js +1 -1
  18. package/MultiSelect/TagList.mjs +9 -8
  19. package/MultiSelectTree/MultiSelectTree.js +1 -1
  20. package/MultiSelectTree/MultiSelectTree.mjs +1 -0
  21. package/MultiSelectTree/utils.js +1 -1
  22. package/MultiSelectTree/utils.mjs +17 -16
  23. package/NOTICE.txt +51 -40
  24. package/common/AdaptiveMode.js +1 -1
  25. package/common/AdaptiveMode.mjs +8 -7
  26. package/common/ClearButton.js +1 -1
  27. package/common/ClearButton.mjs +6 -5
  28. package/common/DropDownBase.js +1 -1
  29. package/common/DropDownBase.mjs +1 -0
  30. package/common/GroupStickyHeader.js +1 -1
  31. package/common/GroupStickyHeader.mjs +5 -4
  32. package/common/List.js +1 -1
  33. package/common/List.mjs +1 -0
  34. package/common/ListContainer.js +1 -1
  35. package/common/ListContainer.mjs +8 -7
  36. package/common/ListDefaultItem.js +1 -1
  37. package/common/ListDefaultItem.mjs +10 -9
  38. package/common/ListFilter.js +1 -1
  39. package/common/ListFilter.mjs +5 -4
  40. package/common/ListGroupItem.js +1 -1
  41. package/common/ListGroupItem.mjs +6 -5
  42. package/common/ListItem.js +1 -1
  43. package/common/ListItem.mjs +1 -0
  44. package/common/MultiColumnList.js +1 -1
  45. package/common/MultiColumnList.mjs +5 -4
  46. package/common/Navigation.js +1 -1
  47. package/common/Navigation.mjs +1 -0
  48. package/common/SearchBar.js +1 -1
  49. package/common/SearchBar.mjs +4 -3
  50. package/common/VirtualScrollStatic.js +1 -1
  51. package/common/VirtualScrollStatic.mjs +1 -0
  52. package/common/settings.js +1 -1
  53. package/common/settings.mjs +1 -0
  54. package/common/utils.js +1 -1
  55. package/common/utils.mjs +25 -24
  56. package/common/withCustomComponent.js +1 -1
  57. package/common/withCustomComponent.mjs +3 -2
  58. package/dist/cdn/js/kendo-react-dropdowns.js +1 -8
  59. package/index.js +1 -2
  60. package/index.mjs +2 -2
  61. package/messages/index.js +1 -1
  62. package/messages/index.mjs +5 -4
  63. package/package-metadata.js +1 -1
  64. package/package-metadata.mjs +3 -2
  65. package/package.json +11 -11
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),u=require("prop-types"),B=require("../common/SearchBar.js"),V=require("../common/ListContainer.js"),T=require("../common/List.js"),w=require("../common/DropDownBase.js"),N=require("../common/GroupStickyHeader.js"),c=require("../common/utils.js"),l=require("@progress/kendo-react-common"),R=require("@progress/kendo-react-labels"),L=require("../package-metadata.js"),A=require("../common/ClearButton.js"),z=require("../common/AdaptiveMode.js"),D=require("../common/withCustomComponent.js"),H=require("@progress/kendo-react-layout"),W=require("../common/ListFilter.js");function j(C){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const e in C)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(C,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>C[e]})}}return a.default=C,Object.freeze(a)}const g=j(q),G="Please enter a valid value!",{sizeMap:_,roundedMap:U}=l.kendoThemeMaps,I=class I extends g.Component{constructor(a){super(a),this.state={},this.base=new w(this),this._element=null,this._suggested="",this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=c.getFilteredData(this.props),i=c.getItemValue(s[e],this.props.textField);this.state.text&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,o=c.getFilteredData(this.props)[e];c.areSame(this.state.focusedItem,o,s)||(t.data.focusedItem=o)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||G)},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e}=this.props,{windowWidth:t=0}=this.state,s=g.createElement(W,{value:this.value,ref:o=>this._adaptiveInput=o&&o.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}),i={title:e,expand:this.opened,onClose:o=>this.onCancel(o),windowWidth:t,mobileFilter:s};return g.createElement(z.AdaptiveMode,{...i},g.createElement(H.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=this.state.text;c.isPresent(s)&&s!==""&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:i,groupField:o,list:d}=this.props,r=c.getFilteredData(this.props);let{group:n}=this.state;return n===void 0&&o!==void 0&&(n=c.getItemValue(r[0],o)),g.createElement(g.Fragment,null,e&&g.createElement("div",{className:"k-list-header"},e),g.createElement("div",{className:l.classNames("k-list",{[`k-list-${this.mobileMode?"lg":_[s]||s}`]:s})},!d&&n&&r.length!==0&&g.createElement(N,{group:n,groupMode:"modern",render:i}),this.renderList()),t&&g.createElement("div",{className:"k-list-footer"},t))},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=c.getFilteredData(this.props);if(!s||!i.length)return;const o=this.itemHeight||(t?t.children[0].offsetHeight:0),r=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let n=i[0][s];for(let p=1;p<i.length&&!(o*p>r);p++)i[p]&&i[p][s]&&(n=i[p][s]);n!==this.state.group&&this.setState({group:n})},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const s=this.base.initState(),i=this.mobileMode?e.target.element:e.currentTarget,o=i.value,d=i.selectionEnd===o.length;s.syntheticEvent=e;const r=this._suggested,n=this.value,p=n&&n.substring(0,n.length-r.length),v=p&&p===o,m=p&&p.length>o.length,{suggest:y}=this.props,h=this.props.opened!==void 0?this.props.opened:this.state.opened;if(y!==void 0&&y!==!1){v||m||!d?this._suggested="":this.suggestValue(o);const f=o+this._suggested,b={userInput:o,value:this._suggested};this.triggerOnChange(f,s,{suggestion:b})}else this._suggested="",this.triggerOnChange(o,s);(!h&&o||h&&!o)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=e=>{const s=this.base.initState(),i=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=e;const o="";this._suggested="",this.triggerOnChange(o,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),i&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=e=>{const{skipDisabledItems:t,groupField:s,textField:i}=this.props,o=c.getFilteredData(this.props);this._isScrolling&&(this._isScrolling=!1);const d=this.focusedIndex(),r=o[d],n=e.keyCode,p=e.altKey,v=this.props.opened!==void 0?this.props.opened:this.state.opened,m=this.base.initState();m.syntheticEvent=e;const y=()=>{v&&e.preventDefault()};if(p&&n===l.Keys.down)this.setState({opened:!0});else if(p&&n===l.Keys.up)this.setState({opened:!1});else if(v&&n===l.Keys.pageUp)y(),this.base.scrollPopupByPageSize(-1);else if(v&&n===l.Keys.pageDown)y(),this.base.scrollPopupByPageSize(1);else if(v&&(n===l.Keys.enter||n===l.Keys.esc))y(),t===!1&&r&&r.disabled?(v&&this.togglePopup(m),this.applyState(m)):this.applyInputValue(e.currentTarget.value,m,e.keyCode);else if(!v&&n===l.Keys.esc){const h="";this._suggested="",this.triggerOnChange(h,m),this.state.focusedItem!==void 0&&(m.data.focusedItem=void 0),this.applyState(m)}else if(n===l.Keys.up||n===l.Keys.down){if(s!==""&&i)if(!this.props.skipDisabledItems&&v)this.onNavigate(m,n);else{let h=0;if(n===l.Keys.down||n===l.Keys.right){const f=o.slice(d+1).find(b=>!b.disabled&&b[i]);h=f&&o.findIndex(b=>b[i]===f[i])}else if(n===l.Keys.up||n===l.Keys.left){let f;if(d===-1)f=o,h=o.findIndex(b=>!b.disabled&&b[i]);else{f=o.slice(0,d);let b=f.pop();for(;b&&b.disabled;)b=f.pop();h=b&&o.findIndex(S=>S[i]===b[i])}}if(h!==void 0){const f=h-d;this.onNavigate(m,n,f)}else h===void 0&&o.findIndex(f=>f[i])===o.length-1&&this.onNavigate(m,n)}else if(!this.props.skipDisabledItems&&v)this.onNavigate(m,n);else{let h=null;if(n===l.Keys.down||n===l.Keys.right)h=o.slice(d+1).find(f=>!f.disabled);else if(n===l.Keys.up||n===l.Keys.left){const f=o.slice(0,d);for(h=f.pop();h&&h.disabled;)h=f.pop()}if(h){const f=h.id-d-1;this.onNavigate(m,n,f)}else this.onNavigate(m,n)}this.applyState(m),y()}},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{const t=this.base.initState();!this.state.focused||this._skipFocusEvent||(t.syntheticEvent=e,t.data.focused=!1,t.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(t.data.opened=!1),t.events.push({type:"onClose"})),this.applyState(t))},this.handleWrapperClick=e=>{const t=this._input;!this.opened&&t&&this.focusElement(t);const s=this.base.initState();s.syntheticEvent=e,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300),this.base.togglePopup(s),this.applyState(s)},l.validatePackage(L.packageMetadata)}get _inputId(){return this.props.id+"-accessibility-id"}get document(){if(l.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=!this.required||this.value!=="",t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}get opened(){return!!(this.props.opened!==void 0?this.props.opened:this.state.opened)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:I.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:I.defaultProps.required}componentDidUpdate(a,e){var y;const{groupField:t=""}=this.props,s=c.getFilteredData(this.props),{data:i=[]}=a,o=this.focusedIndex(),d=s[o],r=i!==s,n=d!==void 0&&e.focusedItem!==d,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=a.opened!==void 0?a.opened:e.opened,m=!v&&p;if(t==="")(p&&(n||r)||m)&&this.base.scrollToItem(o);else if(!this._isScrolling){const h=(y=this.base.getGroupedDataModernMode(s,t))==null?void 0:y.indexOf(d);m&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][t],this),this.base.scrollToItem(h)),p&&v&&n&&this.base.scrollToItem(h)}this.setValidity()}componentDidMount(){var a;this.observerResize=l.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.observe(this.document.body)}render(){const{dir:a,disabled:e,label:t,className:s,style:i,loading:o,suggest:d,size:r,rounded:n,fillMode:p}=this.props,v=!this.validityStyles||this.validity.valid,m=this.base,y=this.value,h=this.props.clearButton!==!1&&!o&&!!y,f=this.props.id||this._inputId,b=this.state.focused;typeof d=="string"&&(this._suggested=d);const[S,O]=D(this.props.prefix||g.Fragment),[P,K]=D(this.props.suffix||g.Fragment),k=g.createElement(g.Fragment,null,g.createElement("span",{className:l.classNames("k-autocomplete k-input",s,{[`k-input-${_[r]||r}`]:r,[`k-rounded-${U[n]||n}`]:n,[`k-input-${p}`]:p,"k-invalid":!v,"k-focus":b&&!e,"k-loading":o,"k-required":this.required,"k-disabled":e}),ref:F=>{this._element=F,m.wrapper=F},style:t?{...i,width:void 0}:i,dir:a,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick},this.props.prefix&&g.createElement(S,{...O}),this.renderSearchBar(y||"",f),o&&g.createElement(l.IconWrap,{className:"k-input-loading-icon",name:"loading"}),h&&!o&&g.createElement(A,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&g.createElement(P,{...K}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return t?g.createElement(R.FloatingLabel,{label:t,editorId:f,editorValue:y,editorValid:v,editorDisabled:e,style:{width:i?i.width:void 0},children:k}):k}onNavigate(a,e,t){const s=this.value,{textField:i,focusedItemIndex:o}=this.props,d=c.getFilteredData(this.props),r=this.state.focusedItem!==void 0?d.findIndex(p=>c.areSame(p,this.state.focusedItem,i)):o?o(d,s,i):d.indexOf(c.getFocusedItem(d,s,i)),n=this.base.navigation.navigate({keyCode:e,current:r,max:d.length-1,min:0,skipItems:t||void 0});n!==void 0&&this.itemFocus(n,a),this.applyState(a)}applyInputValue(a,e,t){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{textField:i}=this.props,o=c.getFilteredData(this.props),d=this.focusedIndex(),r=o[d];if(this._suggested="",s&&t===l.Keys.enter&&r&&!r.disabled){const n=c.getItemValue(o[this.focusedIndex(a)],i);this.triggerOnChange(n,e)}s&&this.togglePopup(e),this.applyState(e)}renderSearchBar(a,e){const t=this.base,{placeholder:s,tabIndex:i,disabled:o,readonly:d,inputAttributes:r}=this.props,{focused:n}=this.state,p=this.props.opened!==void 0?this.props.opened:this.state.opened;return g.createElement(B,{id:e,placeholder:s,tabIndex:i,accessKey:this.props.accessKey,value:a,suggestedText:this._suggested,focused:n,name:this.props.name,ref:v=>this._input=v&&v.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:t.handleFocus,onBlur:this.handleBlur,disabled:o,readOnly:d,expanded:p,owns:t.listBoxId,activedescendant:"option-"+t.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender,inputAttributes:r})}renderListContainer(){const a=this.base,{dir:e,groupField:t}=this.props,s=c.getFilteredData(this.props),i=a.getPopupSettings(),o=this.props.opened!==void 0?this.props.opened:this.state.opened,d=i.width!==void 0?i.width:a.popupWidth;let{group:r}=this.state;return r===void 0&&t!==void 0&&(r=c.getItemValue(s[0],t)),g.createElement(V,{width:d,popupSettings:{...i,anchor:i.anchor||this.element,show:o,popupClass:l.classNames(i.popupClass,"k-list-container","k-autocomplete-popup")},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[s.length]},this.listContainerContent())}renderList(){const a=this.base,e=a.getPopupSettings(),{textField:t,listNoDataRender:s,itemRender:i,groupHeaderItemRender:o}=this.props,d=c.getFilteredData(this.props),r=this.value,n=this.props.opened!==void 0?this.props.opened:this.state.opened;return g.createElement(T,{id:a.listBoxId,show:n,data:d.slice(),focusedIndex:this.focusedIndex(),value:r,textField:t,valueField:t,highlightSelected:!1,optionsGuid:a.guid,groupField:this.props.groupField,groupMode:"modern",listRef:p=>a.list=p,wrapperStyle:this.mobileMode?{}:{maxHeight:e.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:o,noDataRender:s,onMouseDown:p=>p.preventDefault(),onScroll:this.onScroll})}triggerOnChange(a,e,t){this.value===a&&!t||(e.data.value=a,this._valueDuringOnChange=a,e.events.push({type:"onChange",...t||{}}))}focusElement(a){this._skipFocusEvent=!0,a.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(a){this.base.applyState(a),this._valueDuringOnChange=void 0}suggestValue(a){if(this._suggested="",a){const{textField:e}=this.props,t=c.getFilteredData(this.props),s=t[c.itemIndexStartsWith(t,a,e)];if(s){const i=c.getItemValue(s,e);a.toLowerCase()!==i.toLowerCase()&&(this._suggested=i.substring(a.length))}}}focusedIndex(a){const{textField:e,focusedItemIndex:t,skipDisabledItems:s}=this.props,i=c.getFilteredData(this.props),o=a!==void 0?a:this.value;if(this.state.focusedItem!==void 0)return i.findIndex(r=>c.areSame(r,this.state.focusedItem,e));if(t)return t(i,o,e);const d=i.indexOf(c.getFocusedItem(i,o,e));return s&&e&&d===-1?i.findIndex(r=>!r.disabled&&r[e]):Math.max(0,d)}calculateMedia(a){for(const e of a)this.setState({windowWidth:e.target.clientWidth})}};I.displayName="AutoComplete",I.propTypes={...w.basicPropTypes,size:u.oneOf([null,"small","medium","large"]),rounded:u.oneOf([null,"small","medium","large","full"]),fillMode:u.oneOf([null,"solid","flat","outline"]),groupField:u.string,suggest:u.oneOfType([u.bool,u.string]),placeholder:u.string,value:u.string,defaultValue:u.string,validationMessage:u.string,required:u.bool,readonly:u.bool,clearButton:u.bool,valueRender:u.func,id:u.string,ariaLabelledBy:u.string,ariaDescribedBy:u.string,list:u.any,adaptive:u.bool,adaptiveTitle:u.string,onCancel:u.func,skipDisabledItems:u.bool,inputAttributes:u.object},I.defaultProps={...w.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let x=I;const M=l.createPropsContext(),E=l.withIdHOC(l.withPropsContext(M,l.withAdaptiveModeContext(x)));E.displayName="KendoReactAutoComplete";exports.AutoComplete=E;exports.AutoCompletePropsContext=M;exports.AutoCompleteWithoutContext=x;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),u=require("prop-types"),B=require("../common/SearchBar.js"),V=require("../common/ListContainer.js"),T=require("../common/List.js"),w=require("../common/DropDownBase.js"),N=require("../common/GroupStickyHeader.js"),c=require("../common/utils.js"),l=require("@progress/kendo-react-common"),R=require("@progress/kendo-react-labels"),L=require("../package-metadata.js"),A=require("../common/ClearButton.js"),z=require("../common/AdaptiveMode.js"),D=require("../common/withCustomComponent.js"),H=require("@progress/kendo-react-layout"),W=require("../common/ListFilter.js");function j(C){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const e in C)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(C,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>C[e]})}}return a.default=C,Object.freeze(a)}const g=j(q),G="Please enter a valid value!",{sizeMap:_,roundedMap:U}=l.kendoThemeMaps,I=class I extends g.Component{constructor(a){super(a),this.state={},this.base=new w(this),this._element=null,this._suggested="",this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=c.getFilteredData(this.props),i=c.getItemValue(s[e],this.props.textField);this.state.text&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,o=c.getFilteredData(this.props)[e];c.areSame(this.state.focusedItem,o,s)||(t.data.focusedItem=o)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||G)},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e}=this.props,{windowWidth:t=0}=this.state,s=g.createElement(W,{value:this.value,ref:o=>this._adaptiveInput=o&&o.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}),i={title:e,expand:this.opened,onClose:o=>this.onCancel(o),windowWidth:t,mobileFilter:s};return g.createElement(z.AdaptiveMode,{...i},g.createElement(H.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=this.state.text;c.isPresent(s)&&s!==""&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:i,groupField:o,list:d}=this.props,r=c.getFilteredData(this.props);let{group:n}=this.state;return n===void 0&&o!==void 0&&(n=c.getItemValue(r[0],o)),g.createElement(g.Fragment,null,e&&g.createElement("div",{className:"k-list-header"},e),g.createElement("div",{className:l.classNames("k-list",{[`k-list-${this.mobileMode?"lg":_[s]||s}`]:s})},!d&&n&&r.length!==0&&g.createElement(N,{group:n,groupMode:"modern",render:i}),this.renderList()),t&&g.createElement("div",{className:"k-list-footer"},t))},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=c.getFilteredData(this.props);if(!s||!i.length)return;const o=this.itemHeight||(t?t.children[0].offsetHeight:0),r=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let n=i[0][s];for(let p=1;p<i.length&&!(o*p>r);p++)i[p]&&i[p][s]&&(n=i[p][s]);n!==this.state.group&&this.setState({group:n})},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const s=this.base.initState(),i=this.mobileMode?e.target.element:e.currentTarget,o=i.value,d=i.selectionEnd===o.length;s.syntheticEvent=e;const r=this._suggested,n=this.value,p=n&&n.substring(0,n.length-r.length),v=p&&p===o,m=p&&p.length>o.length,{suggest:y}=this.props,h=this.props.opened!==void 0?this.props.opened:this.state.opened;if(y!==void 0&&y!==!1){v||m||!d?this._suggested="":this.suggestValue(o);const f=o+this._suggested,b={userInput:o,value:this._suggested};this.triggerOnChange(f,s,{suggestion:b})}else this._suggested="",this.triggerOnChange(o,s);(!h&&o||h&&!o)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=e=>{const s=this.base.initState(),i=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=e;const o="";this._suggested="",this.triggerOnChange(o,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),i&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=e=>{const{skipDisabledItems:t,groupField:s,textField:i}=this.props,o=c.getFilteredData(this.props);this._isScrolling&&(this._isScrolling=!1);const d=this.focusedIndex(),r=o[d],n=e.keyCode,p=e.altKey,v=this.props.opened!==void 0?this.props.opened:this.state.opened,m=this.base.initState();m.syntheticEvent=e;const y=()=>{v&&e.preventDefault()};if(p&&n===l.Keys.down)this.setState({opened:!0});else if(p&&n===l.Keys.up)this.setState({opened:!1});else if(v&&n===l.Keys.pageUp)y(),this.base.scrollPopupByPageSize(-1);else if(v&&n===l.Keys.pageDown)y(),this.base.scrollPopupByPageSize(1);else if(v&&(n===l.Keys.enter||n===l.Keys.esc))y(),t===!1&&r&&r.disabled?(v&&this.togglePopup(m),this.applyState(m)):this.applyInputValue(e.currentTarget.value,m,e.keyCode);else if(!v&&n===l.Keys.esc){const h="";this._suggested="",this.triggerOnChange(h,m),this.state.focusedItem!==void 0&&(m.data.focusedItem=void 0),this.applyState(m)}else if(n===l.Keys.up||n===l.Keys.down){if(s!==""&&i)if(!this.props.skipDisabledItems&&v)this.onNavigate(m,n);else{let h=0;if(n===l.Keys.down||n===l.Keys.right){const f=o.slice(d+1).find(b=>!b.disabled&&b[i]);h=f&&o.findIndex(b=>b[i]===f[i])}else if(n===l.Keys.up||n===l.Keys.left){let f;if(d===-1)f=o,h=o.findIndex(b=>!b.disabled&&b[i]);else{f=o.slice(0,d);let b=f.pop();for(;b&&b.disabled;)b=f.pop();h=b&&o.findIndex(S=>S[i]===b[i])}}if(h!==void 0){const f=h-d;this.onNavigate(m,n,f)}else h===void 0&&o.findIndex(f=>f[i])===o.length-1&&this.onNavigate(m,n)}else if(!this.props.skipDisabledItems&&v)this.onNavigate(m,n);else{let h=null;if(n===l.Keys.down||n===l.Keys.right)h=o.slice(d+1).find(f=>!f.disabled);else if(n===l.Keys.up||n===l.Keys.left){const f=o.slice(0,d);for(h=f.pop();h&&h.disabled;)h=f.pop()}if(h){const f=h.id-d-1;this.onNavigate(m,n,f)}else this.onNavigate(m,n)}this.applyState(m),y()}},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{const t=this.base.initState();!this.state.focused||this._skipFocusEvent||(t.syntheticEvent=e,t.data.focused=!1,t.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(t.data.opened=!1),t.events.push({type:"onClose"})),this.applyState(t))},this.handleWrapperClick=e=>{const t=this._input;!this.opened&&t&&this.focusElement(t);const s=this.base.initState();s.syntheticEvent=e,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300),this.base.togglePopup(s),this.applyState(s)},l.validatePackage(L.packageMetadata)}get _inputId(){return this.props.id+"-accessibility-id"}get document(){if(l.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const a=this.props.validationMessage!==void 0,e=!this.required||this.value!=="",t=this.props.valid!==void 0?this.props.valid:e;return{customError:a,valid:t,valueMissing:this.value===null}}get opened(){return!!(this.props.opened!==void 0?this.props.opened:this.state.opened)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:I.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:I.defaultProps.required}componentDidUpdate(a,e){var y;const{groupField:t=""}=this.props,s=c.getFilteredData(this.props),{data:i=[]}=a,o=this.focusedIndex(),d=s[o],r=i!==s,n=d!==void 0&&e.focusedItem!==d,p=this.props.opened!==void 0?this.props.opened:this.state.opened,v=a.opened!==void 0?a.opened:e.opened,m=!v&&p;if(t==="")(p&&(n||r)||m)&&this.base.scrollToItem(o);else if(!this._isScrolling){const h=(y=this.base.getGroupedDataModernMode(s,t))==null?void 0:y.indexOf(d);m&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][t],this),this.base.scrollToItem(h)),p&&v&&n&&this.base.scrollToItem(h)}this.setValidity()}componentDidMount(){var a;this.observerResize=l.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.observe(this.document.body)}render(){const{dir:a,disabled:e,label:t,className:s,style:i,loading:o,suggest:d,size:r,rounded:n,fillMode:p}=this.props,v=!this.validityStyles||this.validity.valid,m=this.base,y=this.value,h=this.props.clearButton!==!1&&!o&&!!y,f=this.props.id||this._inputId,b=this.state.focused;typeof d=="string"&&(this._suggested=d);const[S,O]=D(this.props.prefix||g.Fragment),[P,K]=D(this.props.suffix||g.Fragment),k=g.createElement(g.Fragment,null,g.createElement("span",{className:l.classNames("k-autocomplete k-input",s,{[`k-input-${_[r]||r}`]:r,[`k-rounded-${U[n]||n}`]:n,[`k-input-${p}`]:p,"k-invalid":!v,"k-focus":b&&!e,"k-loading":o,"k-required":this.required,"k-disabled":e}),ref:F=>{this._element=F,m.wrapper=F},style:t?{...i,width:void 0}:i,dir:a,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick},this.props.prefix&&g.createElement(S,{...O}),this.renderSearchBar(y||"",f),o&&g.createElement(l.IconWrap,{className:"k-input-loading-icon",name:"loading"}),h&&!o&&g.createElement(A,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&g.createElement(P,{...K}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return t?g.createElement(R.FloatingLabel,{label:t,editorId:f,editorValue:y,editorValid:v,editorDisabled:e,style:{width:i?i.width:void 0},children:k}):k}onNavigate(a,e,t){const s=this.value,{textField:i,focusedItemIndex:o}=this.props,d=c.getFilteredData(this.props),r=this.state.focusedItem!==void 0?d.findIndex(p=>c.areSame(p,this.state.focusedItem,i)):o?o(d,s,i):d.indexOf(c.getFocusedItem(d,s,i)),n=this.base.navigation.navigate({keyCode:e,current:r,max:d.length-1,min:0,skipItems:t||void 0});n!==void 0&&this.itemFocus(n,a),this.applyState(a)}applyInputValue(a,e,t){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{textField:i}=this.props,o=c.getFilteredData(this.props),d=this.focusedIndex(),r=o[d];if(this._suggested="",s&&t===l.Keys.enter&&r&&!r.disabled){const n=c.getItemValue(o[this.focusedIndex(a)],i);this.triggerOnChange(n,e)}s&&this.togglePopup(e),this.applyState(e)}renderSearchBar(a,e){const t=this.base,{placeholder:s,tabIndex:i,disabled:o,readonly:d,inputAttributes:r}=this.props,{focused:n}=this.state,p=this.props.opened!==void 0?this.props.opened:this.state.opened;return g.createElement(B,{id:e,placeholder:s,tabIndex:i,accessKey:this.props.accessKey,value:a,suggestedText:this._suggested,focused:n,name:this.props.name,ref:v=>this._input=v&&v.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:t.handleFocus,onBlur:this.handleBlur,disabled:o,readOnly:d,expanded:p,owns:t.listBoxId,activedescendant:"option-"+t.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender,inputAttributes:r})}renderListContainer(){const a=this.base,{dir:e,groupField:t}=this.props,s=c.getFilteredData(this.props),i=a.getPopupSettings(),o=this.props.opened!==void 0?this.props.opened:this.state.opened,d=i.width!==void 0?i.width:a.popupWidth;let{group:r}=this.state;return r===void 0&&t!==void 0&&(r=c.getItemValue(s[0],t)),g.createElement(V,{width:d,popupSettings:{...i,anchor:i.anchor||this.element,show:o,popupClass:l.classNames(i.popupClass,"k-list-container","k-autocomplete-popup")},dir:e!==void 0?e:this.base.dirCalculated,itemsCount:[s.length]},this.listContainerContent())}renderList(){const a=this.base,e=a.getPopupSettings(),{textField:t,listNoDataRender:s,itemRender:i,groupHeaderItemRender:o}=this.props,d=c.getFilteredData(this.props),r=this.value,n=this.props.opened!==void 0?this.props.opened:this.state.opened;return g.createElement(T,{id:a.listBoxId,show:n,data:d.slice(),focusedIndex:this.focusedIndex(),value:r,textField:t,valueField:t,highlightSelected:!1,optionsGuid:a.guid,groupField:this.props.groupField,groupMode:"modern",listRef:p=>a.list=p,wrapperStyle:this.mobileMode?{}:{maxHeight:e.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:o,noDataRender:s,onMouseDown:p=>p.preventDefault(),onScroll:this.onScroll})}triggerOnChange(a,e,t){this.value===a&&!t||(e.data.value=a,this._valueDuringOnChange=a,e.events.push({type:"onChange",...t||{}}))}focusElement(a){this._skipFocusEvent=!0,a.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(a){this.base.applyState(a),this._valueDuringOnChange=void 0}suggestValue(a){if(this._suggested="",a){const{textField:e}=this.props,t=c.getFilteredData(this.props),s=t[c.itemIndexStartsWith(t,a,e)];if(s){const i=c.getItemValue(s,e);a.toLowerCase()!==i.toLowerCase()&&(this._suggested=i.substring(a.length))}}}focusedIndex(a){const{textField:e,focusedItemIndex:t,skipDisabledItems:s}=this.props,i=c.getFilteredData(this.props),o=a!==void 0?a:this.value;if(this.state.focusedItem!==void 0)return i.findIndex(r=>c.areSame(r,this.state.focusedItem,e));if(t)return t(i,o,e);const d=i.indexOf(c.getFocusedItem(i,o,e));return s&&e&&d===-1?i.findIndex(r=>!r.disabled&&r[e]):Math.max(0,d)}calculateMedia(a){for(const e of a)this.setState({windowWidth:e.target.clientWidth})}};I.displayName="AutoComplete",I.propTypes={...w.basicPropTypes,size:u.oneOf([null,"small","medium","large"]),rounded:u.oneOf([null,"small","medium","large","full"]),fillMode:u.oneOf([null,"solid","flat","outline"]),groupField:u.string,suggest:u.oneOfType([u.bool,u.string]),placeholder:u.string,value:u.string,defaultValue:u.string,validationMessage:u.string,required:u.bool,readonly:u.bool,clearButton:u.bool,valueRender:u.func,id:u.string,ariaLabelledBy:u.string,ariaDescribedBy:u.string,list:u.any,adaptive:u.bool,adaptiveTitle:u.string,onCancel:u.func,skipDisabledItems:u.bool,inputAttributes:u.object},I.defaultProps={...w.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let x=I;const M=l.createPropsContext(),E=l.withIdHOC(l.withPropsContext(M,l.withAdaptiveModeContext(x)));E.displayName="KendoReactAutoComplete";exports.AutoComplete=E;exports.AutoCompletePropsContext=M;exports.AutoCompleteWithoutContext=x;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as h from "react";
9
10
  import u from "prop-types";
10
11
  import N from "../common/SearchBar.mjs";
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use 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"),A=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"),k=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!",D=class D 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(x=>!x.disabled&&x[o]);u=v&&n.findIndex(x=>x[o]===v[o])}else if(a===i.Keys.up||a===i.Keys.left){let v;if(r===0)v=n,u=n.findIndex(x=>!x.disabled&&x[o]);else{v=n.slice(0,r);let x=v.pop();for(;x&&x.disabled;)x=v.pop();u=x&&n.findIndex(S=>S[o]===x[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(),I=y===-1,f=!I&&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&&!I&&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(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&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:D.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:D.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 I=this.hasDuplicates?this.navigationIndex||0:n.findIndex(u=>h.areSame(u,c,t));this.props.groupMode==="modern"&&d&&c&&(I=(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,I):m&&!o?(this.onPopupOpened(),n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][l],this),this.base.scrollToItem(I)):(this.hasDuplicates||r&&a&&c&&f)&&this.base.scrollToItem(I)}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(k.comboArrowBtnAriaLabelExpand,k.messages[k.comboArrowBtnAriaLabelExpand]),e=L.provideLocalizationService(this).toLanguageString(k.comboArrowBtnAriaLabelCollapse,k.messages[k.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:o,clearButton:l=D.defaultProps.clearButton,label:d,textField:n,className:p,style:r,loading:a,iconClassName:m,virtual:c,size:C,rounded:y,fillMode:I,opened:f=this.state.opened,placeholder:u,svgIcon:v,unstyled:x}=this.props,S=!this.validityStyles||this.validity.valid,w=this.props.filter!==void 0?this.props.filter:this.state.text,W=h.getItemValue(this.value,n),E=h.isPresent(w)?w:W,j=l&&(!!E||h.isPresent(this.value)),B=this.base.vs,P=this.props.id||this._inputId,T=this.mobileMode,O=x&&x.uComboBox;B.enabled=c!==void 0,c!==void 0&&(B.skip=c.skip,B.total=c.total,B.pageSize=c.pageSize);const[G,U]=q(this.props.prefix||g.Fragment),[$,Y]=q(this.props.suffix||g.Fragment),_=g.createElement(g.Fragment,null,g.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:O,size:C,rounded:y,fillMode:I,disabled:o,invalid:!S,loading:a,required:this.required}),p),ref:this.componentRef,style:d?{...r,width:void 0}:r,dir:t},this.props.prefix&&g.createElement(G,{...U}),this.renderSearchBar(E||"",P,u),j&&!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:I,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:O})),onClick:this.toggleBtnClick,onMouseDown:J=>J.preventDefault()}),!T&&this.renderListContainer()),T&&this.renderAdaptiveListContainer());return d?g.createElement(X.FloatingLabel,{label:d,editorId:P,editorValue:E,editorValid:S,editorDisabled:o,style:{width:r?r.width:void 0},children:_,unstyled:x}):_}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,_adaptiveMode:c}=this.props,C=h.getFilteredData(this.props),y=this.props.opened!==void 0?this.props.opened:this.state.opened,I=this.base.getAdaptiveAnimation(),f=m&&m.uComboBox,u=m&&m.uDropDownsActionSheet;let{group:v}=this.state;v===void 0&&l!==void 0&&(v=h.getItemValue(C[0],l));const x={navigatable:!1,navigatableElements:[],expand:y,animation:I,onClose:S=>this.toggleBtnClick(S),className:i.classNames(i.uDropDownsActionSheet.wrapper({c:u}),"k-adaptive-actionsheet"),animationStyles:s&&c&&s<=c.small?{top:0,width:"100%",height:"100%"}:void 0,position:s&&c&&s<=c.small?"fullscreen":void 0};return g.createElement(N.ActionSheet,{...x},g.createElement(N.ActionSheetHeader,null,g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:u}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:u}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:u}))},r),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:u}))})),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:u}))},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:u}))},this.renderMobileListFilter())),g.createElement(N.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:f}))},g.createElement("div",{className:i.classNames(i.uComboBox.list({c:f,list:n,size:"large",tableSize:o,virtual:p}))},e&&g.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:f}))},e),!n&&v&&C.length!==0&&g.createElement(A,{group:v,groupMode:d,render:a}),this.renderList(),t&&g.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:f}),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(),I=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:I,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(A,{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)`,I=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,x=this.props.list||te,S=p&&p.uComboBox;return g.createElement(x,{id:s.listBoxId,virtual:!!n,show:C,data:r,focusedIndex:I,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.props._adaptiveMode&&this.state.windowWidth>this.props._adaptiveMode.medium?{maxHeight:a.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:S,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),I=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:I&&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:I,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})}};D.displayName="ComboBox",D.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},D.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 M=D;const z=i.createPropsContext(),H=i.withIdHOC(i.withPropsContext(z,i.withUnstyledHOC(i.withAdaptiveModeContext(M))));H.displayName="KendoReactComboBox";exports.ComboBox=H;exports.ComboBoxPropsContext=z;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"),A=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"),k=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!",D=class D 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(x=>!x.disabled&&x[o]);u=v&&n.findIndex(x=>x[o]===v[o])}else if(a===i.Keys.up||a===i.Keys.left){let v;if(r===0)v=n,u=n.findIndex(x=>!x.disabled&&x[o]);else{v=n.slice(0,r);let x=v.pop();for(;x&&x.disabled;)x=v.pop();u=x&&n.findIndex(S=>S[o]===x[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(),I=y===-1,f=!I&&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&&!I&&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(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=((e=this.props._adaptiveMode)==null?void 0:e.medium)&&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:D.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:D.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 I=this.hasDuplicates?this.navigationIndex||0:n.findIndex(u=>h.areSame(u,c,t));this.props.groupMode==="modern"&&d&&c&&(I=(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,I):m&&!o?(this.onPopupOpened(),n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][l],this),this.base.scrollToItem(I)):(this.hasDuplicates||r&&a&&c&&f)&&this.base.scrollToItem(I)}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(k.comboArrowBtnAriaLabelExpand,k.messages[k.comboArrowBtnAriaLabelExpand]),e=L.provideLocalizationService(this).toLanguageString(k.comboArrowBtnAriaLabelCollapse,k.messages[k.comboArrowBtnAriaLabelCollapse]),{dir:t,disabled:o,clearButton:l=D.defaultProps.clearButton,label:d,textField:n,className:p,style:r,loading:a,iconClassName:m,virtual:c,size:C,rounded:y,fillMode:I,opened:f=this.state.opened,placeholder:u,svgIcon:v,unstyled:x}=this.props,S=!this.validityStyles||this.validity.valid,w=this.props.filter!==void 0?this.props.filter:this.state.text,W=h.getItemValue(this.value,n),E=h.isPresent(w)?w:W,j=l&&(!!E||h.isPresent(this.value)),B=this.base.vs,P=this.props.id||this._inputId,T=this.mobileMode,O=x&&x.uComboBox;B.enabled=c!==void 0,c!==void 0&&(B.skip=c.skip,B.total=c.total,B.pageSize=c.pageSize);const[G,U]=q(this.props.prefix||g.Fragment),[$,Y]=q(this.props.suffix||g.Fragment),_=g.createElement(g.Fragment,null,g.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:O,size:C,rounded:y,fillMode:I,disabled:o,invalid:!S,loading:a,required:this.required}),p),ref:this.componentRef,style:d?{...r,width:void 0}:r,dir:t},this.props.prefix&&g.createElement(G,{...U}),this.renderSearchBar(E||"",P,u),j&&!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:I,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:O})),onClick:this.toggleBtnClick,onMouseDown:J=>J.preventDefault()}),!T&&this.renderListContainer()),T&&this.renderAdaptiveListContainer());return d?g.createElement(X.FloatingLabel,{label:d,editorId:P,editorValue:E,editorValid:S,editorDisabled:o,style:{width:r?r.width:void 0},children:_,unstyled:x}):_}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,_adaptiveMode:c}=this.props,C=h.getFilteredData(this.props),y=this.props.opened!==void 0?this.props.opened:this.state.opened,I=this.base.getAdaptiveAnimation(),f=m&&m.uComboBox,u=m&&m.uDropDownsActionSheet;let{group:v}=this.state;v===void 0&&l!==void 0&&(v=h.getItemValue(C[0],l));const x={navigatable:!1,navigatableElements:[],expand:y,animation:I,onClose:S=>this.toggleBtnClick(S),className:i.classNames(i.uDropDownsActionSheet.wrapper({c:u}),"k-adaptive-actionsheet"),animationStyles:s&&c&&s<=c.small?{top:0,width:"100%",height:"100%"}:void 0,position:s&&c&&s<=c.small?"fullscreen":void 0};return g.createElement(N.ActionSheet,{...x},g.createElement(N.ActionSheetHeader,null,g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:u}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:u}))},g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:u}))},r),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:u}))})),g.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:u}))},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:u}))},this.renderMobileListFilter())),g.createElement(N.ActionSheetContent,{overflowHidden:!0},g.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:f}))},g.createElement("div",{className:i.classNames(i.uComboBox.list({c:f,list:n,size:"large",tableSize:o,virtual:p}))},e&&g.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:f}))},e),!n&&v&&C.length!==0&&g.createElement(A,{group:v,groupMode:d,render:a}),this.renderList(),t&&g.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:f}),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(),I=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:I,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(A,{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)`,I=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,x=this.props.list||te,S=p&&p.uComboBox;return g.createElement(x,{id:s.listBoxId,virtual:!!n,show:C,data:r,focusedIndex:I,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.props._adaptiveMode&&this.state.windowWidth>this.props._adaptiveMode.medium?{maxHeight:a.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:S,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),I=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:I&&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:I,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})}};D.displayName="ComboBox",D.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},D.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 M=D;const z=i.createPropsContext(),H=i.withIdHOC(i.withPropsContext(z,i.withUnstyledHOC(i.withAdaptiveModeContext(M))));H.displayName="KendoReactComboBox";exports.ComboBox=H;exports.ComboBoxPropsContext=z;exports.ComboBoxWithoutContext=M;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as c from "react";
9
10
  import v from "prop-types";
10
11
  import N from "../common/DropDownBase.mjs";
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Bt=require("react"),k=require("prop-types"),o=require("@progress/kendo-react-common"),Ht=require("@progress/kendo-react-labels"),tt=require("@progress/kendo-svg-icons"),_t=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),nt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),ot=require("../common/DropDownBase.js"),u=require("../common/utils.js"),jt=require("../package-metadata.js"),rt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Pe=require("../messages/index.js"),Fe=require("@progress/kendo-react-layout");function $t(I){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(I){for(const E in I)if(E!=="default"){const B=Object.getOwnPropertyDescriptor(I,E);Object.defineProperty(Y,E,B.get?B:{enumerable:!0,get:()=>I[E]})}}return Y.default=I,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",pe=s.forwardRef((I,Y)=>{o.validatePackage(jt.packageMetadata);const E=o.useUnstyled(),B=o.useId(I.id),r=o.usePropsContext(at,I),{delay:st=F.delay,tabIndex:it=F.tabIndex,ignoreCase:me=F.ignoreCase,size:$=F.size,rounded:Me=F.rounded,fillMode:ge=F.fillMode,groupMode:Qt=F.groupMode}=r,fe=()=>{var e;if(o.canUseDOM)return((e=Q.current)==null?void 0:e.ownerDocument)||window.document},lt=()=>{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 O.current!==void 0&&O.current!==null?e=O.current:r.value!==void 0?e=r.value:g.value!==void 0&&g.value!==null?e=g.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!u.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},dt=()=>{const{dataItemKey:e}=r,n=u.getFilteredData(I),i=N();return n.findIndex(p=>u.areSame(p,i,e))},ve=()=>r.required!==void 0?r.required:F.required,De=()=>{const e=r.validationMessage!==void 0,n=N(),i=!ve()||n!==null&&n!==""&&n!==void 0,p=r.valid!==void 0?r.valid:i;return{customError:e,valid:p,valueMissing:n===null}},ct=()=>r.validityStyles!==void 0?r.validityStyles:F.validityStyles,ne=e=>{re.current=!0,e.focus(),window.setTimeout(()=>re.current=!1,30)},ye=()=>{X.current&&ne(X.current),r.adaptive&&setTimeout(()=>{X.current&&ne(X.current)},300)},ut=s.useCallback(e=>{for(const n of e)Kt(n.target.clientWidth)},[]),Te=()=>{var e;(e=Se.current)!=null&&e.setCustomValidity&&Se.current.setCustomValidity(De().valid?"":r.validationMessage||Jt)},H=(e,n)=>{const i=N();u.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),O.current=e,n.events.push({type:"onChange"}))},b=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),O.current=void 0},J=(e,n)=>{var d;const{virtual:i,dataItemKey:p,defaultItem:m}=r,f=u.getFilteredData(I),D=i?i.skip:0,v=N(),a=e===-1&&m!==void 0?m:f[e-D],c=!u.areSame(a,v,p);H(a,n),c&&((d=t==null?void 0:t.current)==null||d.triggerPageChangeCornerItems(a,n))},T=(e,n,i)=>{var h,w;const{defaultItem:p,dataItemKey:m,virtual:f={skip:0,total:0,pageSize:0}}=r,D=N(),v=u.getFilteredData(I),a=(h=t==null?void 0:t.current)==null?void 0:h.vs,c=v.findIndex(S=>u.areSame(S,D,m)),d=(w=t==null?void 0:t.current)==null?void 0:w.navigation.navigate({current:f.skip+c,max:(a!=null&&a.enabled?f.total:v.length)-1,min:p!==void 0?-1:0,keyCode:n,skipItems:i||void 0});d!==void 0&&J(d,e),b(e)},pt=e=>{Q.current=e,t.current.wrapper=e},mt=e=>s.createElement("select",{name:r.name,ref:n=>{Se.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})),we=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:p=u.itemIndexStartsWith,filterable:m,skipDisabledItems:f=!0}=r,D=N(),v=u.getFilteredData(I),a=r.filter?r.filter:g.text;return f&&e&&!a&&!D?v.findIndex(c=>!c.disabled&&c[e]):u.isPresent(D)&&a===void 0||m&&a===""?v.findIndex(c=>u.areSame(c,D,n)):a?xe.current?p(v,a,e):v.findIndex(c=>u.areSame(c,D,n)):i.skip===0?0:-1},Oe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=u.getFilteredData(I),n=t.current.initState(),i=we();Oe(e,i)&&(H(null,n),b(n))},Ie=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,g.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),b(n)},qe=e=>{var M,ce,V,ue,j,Re,et;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:p,leftRightKeysNavigation:m=!0,virtual:f={skip:0,total:0,pageSize:0},dataItemKey:D,groupField:v="",textField:a,skipDisabledItems:c=!0}=r,d=u.getFilteredData(I),h=N(),w=d.findIndex(L=>u.areSame(L,h,D)),S=r.opened!==void 0?r.opened:g.opened,l=e.keyCode,P=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!S&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),te=S&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=m&&(l===o.Keys.left||l===o.Keys.right),de=K||le&&!n||P,C=t.current.initState();if(C.syntheticEvent=e,!i){if(P&&((M=t==null?void 0:t.current)!=null&&M.vs.enabled))l===o.Keys.home?f.skip!==0?((ce=t==null?void 0:t.current)==null||ce.triggerOnPageChange(C,0,f.pageSize),q.current=!0):H(d[0],C):f.skip<f.total-f.pageSize?((V=t==null?void 0:t.current)==null||V.triggerOnPageChange(C,f.total-f.pageSize,f.pageSize),q.current=!0):H(d[d.length-1],C);else if(S&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(S&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(S&&l===o.Keys.enter){const L=we();Oe(d,L)?(H(null,C),b(C)):J(L,C),(Re=t==null?void 0:t.current)==null||Re.togglePopup(C),e.preventDefault()}else if(G||te)te&&he(),(et=t==null?void 0:t.current)==null||et.togglePopup(C),e.preventDefault();else if(de){if(xe.current=!1,v!==""&&a)if(!c&&S)T(C,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const x=d.slice(w+1).find(y=>!y.disabled&&y[a]);L=x&&d.findIndex(y=>y[a]===x[a])}else if(l===o.Keys.up||l===o.Keys.left){let x;if(w===0&&p)L=-1;else if(w===-1)x=d,L=d.findIndex(y=>!y.disabled&&y[a]);else{x=d.slice(0,w);let y=x.pop();for(;y&&y.disabled;)y=x.pop();L=y&&d.findIndex(be=>be[a]===y[a])}}if(L!==void 0){const x=L-w;T(C,l,x)}else L===void 0&&d.findIndex(x=>x[a]===h[a])===d.length-1&&T(C,l)}else if(!c&&S||P)T(C,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const x=d.slice(w+1).find(y=>!y.disabled&&y[a]);L=x&&d.findIndex(y=>y[a]===x[a])}else if(l===o.Keys.up||l===o.Keys.left){let x;if(w===0&&p)L=-1;else if(w===-1)x=d,L=d.find(y=>!y.disabled&&y[a]);else{x=d.slice(0,w);let y=x.pop();for(;y&&y.disabled;)y=x.pop();L=y&&d.findIndex(be=>be[a]===y[a])}}if(L!==void 0){const x=L-w;T(C,l,x)}else L===void 0&&d.findIndex(x=>x[a]===h[a])===d.length-1&&T(C,l)}else T(C,l);e.preventDefault()}b(C)}},gt=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,b(n),R({group:void 0,text:String(e.target.value)})},Ae=()=>{const e=r.filter!==void 0?r.filter:g.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>X.current=n&&n.element,onChange:gt,onKeyDown:qe,size:$,rounded:Me,fillMode:ge,renderListFilterWrapper:!0})},ft=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),H(r.defaultItem,n),b(n)},ze=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,p=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:u.areSame(p,n,i),key:"defaultitemkey",onClick:ft})},vt=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),O.current=void 0},Dt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:p}=r;let m=u.getFilteredData(I);if(!(!p||!m.length)&&p){const f=_e.current=_e.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*f;m=t.current.getGroupedDataModernMode(m,p);let a=m[0][p];for(let c=1;c<m.length&&!(f*c>v);c++)m[c]&&m[c][p]&&(a=m[c][p]);a!==g.group&&R({group:a})}},Ve=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:p,listNoDataRender:m,itemRender:f}=r,D=u.getFilteredData(I),v=E&&E.uDropDownList,a=t.current.vs,c=i.skip,d=r.opened!==void 0?r.opened:g.opened,h=t.current.getPopupSettings(),w=`translateY(${a.translate}px)`,S=N();return s.createElement(Gt,{id:Le,show:d,data:D.slice(),focusedIndex:we(),value:S,textField:e,valueField:n,optionsGuid:Ge,groupField:r.groupField,groupMode:"modern",listRef:P=>a.list=t.current.list=P,wrapperStyle:{maxHeight:h.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:w}:void 0,key:"listkey",skip:c,onClick:vt,itemRender:f,groupHeaderItemRender:p,noDataRender:m,onScroll:Dt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},yt=()=>{var w;const{header:e,footer:n,adaptiveTitle:i,groupField:p,groupStickyHeaderItemRender:m,list:f}=r,D=u.getFilteredData(I),v=r.opened!==void 0?r.opened:g.opened,a=E&&E.uDropDownList,c=E&&E.uDropDownsActionSheet,d={navigatable:!1,navigatableElements:[],expand:v,animation:!0,onClose:S=>Ie(S),className:o.classNames(o.uDropDownsActionSheet.wrapper({c}),"k-adaptive-actionsheet"),animationStyles:W&&U&&W<=U.small?{top:0,width:"100%",height:"100%"}:void 0,position:W&&U&&W<=U.small?"fullscreen":void 0};let{group:h}=g;return h===void 0&&p!==void 0&&(h=u.getItemValue(D[0],p)),s.createElement(Fe.ActionSheet,{...d},s.createElement(Fe.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,i)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c}))},s.createElement(rt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Ie,icon:"x",svgIcon:tt.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c}))},Ae())),s.createElement(Fe.ActionSheetContent,{overflowHidden:!0},e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:a}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:a,size:$,virtual:(w=t==null?void 0:t.current)==null?void 0:w.vs.enabled}))},ze(),!f&&h&&D.length!==0&&s.createElement(nt,{group:h,groupMode:"modern",render:m}),Ve()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:a}))},n)))},wt=()=>{g.focused&&window.setTimeout(()=>{g.focused&&t.current.wrapper&&ne(t.current.wrapper)})},ht=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:p,groupStickyHeaderItemRender:m,list:f}=r,D=u.getFilteredData(I),v=t.current,a=v.getPopupSettings(),c=r.opened!==void 0?r.opened:g.opened,d=a.width!==void 0?a.width:v.popupWidth,h=E&&E.uDropDownList,w={dir:i!==void 0?i:v.dirCalculated,width:d,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:h})),anchor:a.anchor||Q.current,show:c,onOpen:ye,onClose:wt,onMouseDownOutside:ht},itemsCount:[D.length]};let{group:S}=g;return S===void 0&&p!==void 0&&(S=u.getItemValue(D[0],p)),s.createElement(_t,{...w},Ae(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:h}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:h,size:$,virtual:t.current.vs.enabled}))},ze(),!f&&S&&D.length!==0&&s.createElement(nt,{group:S,groupMode:"modern",render:m}),Ve()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:h}))},n))},St=e=>{const{dataItemKey:n}=r,i=u.getFilteredData(I),p=N();let m=i.map((K,G)=>({item:K,itemIndex:G}));const f=_.current.word,D=_.current.last,v=u.sameCharsOnly(f,D);let a=m.length,c=Math.max(0,i.findIndex(K=>u.areSame(K,p,n))),d;r.defaultItem&&(d={item:r.defaultItem,itemIndex:-1},a+=1,c+=1),c+=v?1:0,m=u.shuffleData(m,c,d);let h,w,S,l=0;const{textField:P}=r;for(;l<a;){if(h=u.getItemValue(m[l].item,P),w=v&&u.matchText(h,D,me),S=u.matchText(h,f,me),w||S){l=m[l].itemIndex;break}l++}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),b(K),O.current=void 0}},xt=e=>{clearTimeout(He.current),r.filterable||(He.current=window.setTimeout(()=>_.current.word="",st),St(e))},Ct=e=>{re.current||t.current.handleFocus(e)},Lt=e=>{if(re.current||!g.focused)return;const n=r.opened!==void 0?r.opened:g.opened,i=t.current.initState();i.syntheticEvent=e,i.data.focused=!1,i.events.push({type:"onBlur"}),n&&he(),n&&!Ke&&t.current.togglePopup(i),b(i)},kt=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(),_.current={word:_.current.word+n,last:_.current.last+n},xt(e)},Et=()=>{const e=t.current.initState();e.data.opened=g.opened,t.current.togglePopup(e),b(e)},Be=s.useRef(null),Q=s.useRef(null),Se=s.useRef(),X=s.useRef(null);s.useImperativeHandle(Be,()=>({get element(){return Q.current},get index(){return dt()},get name(){return r.name},get validity(){return De()},get value(){return N()},get focused(){return g.focused},get opened(){return g.opened},focus:lt,props:r,togglePopup:Et})),s.useImperativeHandle(Y,()=>Be.current);const He=s.useRef(null),_=s.useRef({word:"",last:""}),re=s.useRef(!1),O=s.useRef(null),q=s.useRef(!1),xe=s.useRef(!1),A=s.useRef({}),Ce=s.useRef({}),t=s.useRef(new ot({props:I,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),_e=s.useRef(0),Z=s.useRef(null),[g,Nt]=s.useState({}),[W,Kt]=s.useState(),[,We]=s.useReducer(e=>e,!0),bt=Yt.useLocalization(),R=e=>{Nt({...g,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:I,setState:R,state:g,forceUpdate:We,element:Q.current,handleItemSelect:J,value:N()})},[R,g,We,J,N]),s.useEffect(()=>{var c,d,h,w,S,l,P,K,G,te,le,de,C;const{dataItemKey:e,virtual:n,groupField:i="",textField:p}=r,m=u.getFilteredData(I),f=A.current.virtual?A.current.virtual.total:0,D=r.opened!==void 0?r.opened:g.opened,v=A.current.opened!==void 0?A.current.opened:Ce.current.opened,a=!v&&D;if((c=t==null?void 0:t.current)==null||c.didUpdate(),(d=t==null?void 0:t.current)!=null&&d.getPopupSettings().animate||a&&ye(),n&&n.total!==f)(h=t==null?void 0:t.current)==null||h.vs.calcScrollElementHeight(),(w=t==null?void 0:t.current)==null||w.vs.reset();else{const M=N(),ce=A.current.value!==void 0?A.current.value:Ce.current.value;let V=m.findIndex(j=>u.areSame(j,M,e));i!==""&&M&&p&&(V=(l=(S=t==null?void 0:t.current)==null?void 0:S.getGroupedDataModernMode(m,i))==null?void 0:l.map(j=>j[p]).indexOf(M[p]));const ue=!u.areSame(ce,M,e);a&&n?(P=t==null?void 0:t.current)==null||P.scrollToVirtualItem(n,V):a&&!n?(ye(),m&&m.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(m[0][i],{setState:R,group:g.group,state:g})),(G=t==null?void 0:t.current)==null||G.scrollToItem(V)):D&&v&&M&&ue&&!q.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(V,(te=t==null?void 0:t.current)==null?void 0:te.vs.enabled):D&&v&&q.current&&(q.current&&n&&n.skip===0?(de=t==null?void 0:t.current)==null||de.vs.reset():q.current&&n&&n.skip===n.total-n.pageSize&&((C=t==null?void 0:t.current)==null||C.vs.scrollToEnd()))}q.current=!1,Ce.current=g,A.current=r,Te()}),s.useEffect(()=>{var e,n;return Z.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(ut.bind(void 0)),(e=t==null?void 0:t.current)==null||e.didMount(),Te(),(n=fe())!=null&&n.body&&Z.current&&Z.current.observe(fe().body),()=>{var i;(i=fe())!=null&&i.body&&Z.current&&Z.current.disconnect()}},[]);const Ue=B+"-accessibility-id",Le=B+"-listbox-id",Ge=B+"-guid",Pt=bt.toLanguageString(Pe.dropDownListArrowBtnAriaLabel,Pe.messages[Pe.dropDownListArrowBtnAriaLabel]),{style:oe,className:Ft,label:ke,dir:Mt,virtual:z,adaptive:Xt,dataItemKey:Tt,disabled:ae,loading:je,iconClassName:Ye,svgIcon:$e,valueRender:Je}=r,Ee=r.opened!==void 0?r.opened:g.opened,se=N(),Ne=u.getItemValue(se,r.textField),Qe=!ct()||De().valid,ie=t.current,Ot=ie.vs,ee=E&&E.uDropDownList;Ot.enabled=z!==void 0;const U=o.useAdaptiveModeContext(),Ke=!!(W&&U&&W<=U.medium&&I.adaptive);z!==void 0&&(ie.vs.skip=z.skip,ie.vs.total=z.total,ie.vs.pageSize=z.pageSize);const qt=u.getFilteredData(I),{focused:At}=g,zt=qt.findIndex(e=>u.areSame(e,se,Tt)),Xe=s.createElement("span",{id:Ue,className:o.classNames(o.uDropDownList.inputInner({c:ee}))},Ne&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:ee}))},Ne)),Vt=Je!==void 0?Je.call(void 0,Xe,se):Xe,Ze=s.createElement(s.Fragment,null,s.createElement("span",{ref:pt,className:o.classNames(o.uDropDownList.wrapper({c:ee,size:$,rounded:Me,fillMode:ge,focused:At,disabled:ae,invalid:!Qe,loading:je,required:ve()}),Ft),style:ke?{...oe,width:void 0}:oe,dir:Mt,onMouseDown:Ee?e=>{e.target.nodeName!=="INPUT"&&(ne(t.current.wrapper),e.preventDefault())}:void 0,onFocus:Ct,onBlur:Lt,tabIndex:o.getTabIndex(it,ae),accessKey:r.accessKey,onKeyDown:qe,onKeyPress:kt,onClick:ae?void 0:Ie,role:"combobox","aria-required":ve(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ee||!1,"aria-owns":Le,"aria-activedescendant":Ee?"option-"+Ge+"-"+(zt+(z?z.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||Ue,"aria-controls":Le,id:r.id,title:r.title},Vt,je&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:ee})),name:"loading"}),s.createElement(rt.Button,{tabIndex:-1,type:"button","aria-label":Pt,size:$,fillMode:ge,iconClass:Ye,className:o.classNames(o.uDropDownList.inputButton({c:ee})),rounded:null,themeColor:"base",icon:Ye?void 0:"caret-alt-down",svgIcon:$e||tt.caretAltDownIcon,onMouseDown:e=>g.focused&&e.preventDefault()}),mt(se),!Ke&&It()),Ke&&yt());return ke?s.createElement(Ht.FloatingLabel,{label:ke,editorValue:Ne,editorValid:Qe,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Ze}):Ze});pe.propTypes={delay:k.number,ignoreCase:k.bool,iconClassName:k.string,svgIcon:o.svgIconPropType,defaultItem:k.any,valueRender:k.func,valueMap:k.func,validationMessage:k.string,required:k.bool,id:k.string,ariaLabelledBy:k.string,ariaDescribedBy:k.string,ariaLabel:k.string,leftRightKeysNavigation:k.bool,title:k.string,groupField:k.string,list:k.any,skipDisabledItems:k.bool};const F={delay:500,tabIndex:0,ignoreCase:!0,...ot.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};pe.displayName="KendoReactDropDownList";const at=o.createPropsContext();pe.displayName="KendoReactDropDownList";exports.DropDownList=pe;exports.DropDownListPropsContext=at;exports.dropDownListDefaultProps=F;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Bt=require("react"),k=require("prop-types"),o=require("@progress/kendo-react-common"),Ht=require("@progress/kendo-react-labels"),tt=require("@progress/kendo-svg-icons"),_t=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),nt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),ot=require("../common/DropDownBase.js"),u=require("../common/utils.js"),jt=require("../package-metadata.js"),rt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Pe=require("../messages/index.js"),Fe=require("@progress/kendo-react-layout");function $t(I){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(I){for(const E in I)if(E!=="default"){const B=Object.getOwnPropertyDescriptor(I,E);Object.defineProperty(Y,E,B.get?B:{enumerable:!0,get:()=>I[E]})}}return Y.default=I,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",pe=s.forwardRef((I,Y)=>{o.validatePackage(jt.packageMetadata);const E=o.useUnstyled(),B=o.useId(I.id),r=o.usePropsContext(at,I),{delay:st=F.delay,tabIndex:it=F.tabIndex,ignoreCase:me=F.ignoreCase,size:$=F.size,rounded:Me=F.rounded,fillMode:ge=F.fillMode,groupMode:Qt=F.groupMode}=r,fe=()=>{var e;if(o.canUseDOM)return((e=Q.current)==null?void 0:e.ownerDocument)||window.document},lt=()=>{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 O.current!==void 0&&O.current!==null?e=O.current:r.value!==void 0?e=r.value:g.value!==void 0&&g.value!==null?e=g.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!u.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},ct=()=>{const{dataItemKey:e}=r,n=u.getFilteredData(I),i=N();return n.findIndex(p=>u.areSame(p,i,e))},ve=()=>r.required!==void 0?r.required:F.required,De=()=>{const e=r.validationMessage!==void 0,n=N(),i=!ve()||n!==null&&n!==""&&n!==void 0,p=r.valid!==void 0?r.valid:i;return{customError:e,valid:p,valueMissing:n===null}},dt=()=>r.validityStyles!==void 0?r.validityStyles:F.validityStyles,ne=e=>{re.current=!0,e.focus(),window.setTimeout(()=>re.current=!1,30)},ye=()=>{X.current&&ne(X.current),r.adaptive&&setTimeout(()=>{X.current&&ne(X.current)},300)},ut=s.useCallback(e=>{for(const n of e)Kt(n.target.clientWidth)},[]),Te=()=>{var e;(e=Se.current)!=null&&e.setCustomValidity&&Se.current.setCustomValidity(De().valid?"":r.validationMessage||Jt)},H=(e,n)=>{const i=N();u.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),O.current=e,n.events.push({type:"onChange"}))},b=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),O.current=void 0},J=(e,n)=>{var c;const{virtual:i,dataItemKey:p,defaultItem:m}=r,f=u.getFilteredData(I),D=i?i.skip:0,v=N(),a=e===-1&&m!==void 0?m:f[e-D],d=!u.areSame(a,v,p);H(a,n),d&&((c=t==null?void 0:t.current)==null||c.triggerPageChangeCornerItems(a,n))},T=(e,n,i)=>{var h,w;const{defaultItem:p,dataItemKey:m,virtual:f={skip:0,total:0,pageSize:0}}=r,D=N(),v=u.getFilteredData(I),a=(h=t==null?void 0:t.current)==null?void 0:h.vs,d=v.findIndex(S=>u.areSame(S,D,m)),c=(w=t==null?void 0:t.current)==null?void 0:w.navigation.navigate({current:f.skip+d,max:(a!=null&&a.enabled?f.total:v.length)-1,min:p!==void 0?-1:0,keyCode:n,skipItems:i||void 0});c!==void 0&&J(c,e),b(e)},pt=e=>{Q.current=e,t.current.wrapper=e},mt=e=>s.createElement("select",{name:r.name,ref:n=>{Se.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})),we=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:p=u.itemIndexStartsWith,filterable:m,skipDisabledItems:f=!0}=r,D=N(),v=u.getFilteredData(I),a=r.filter?r.filter:g.text;return f&&e&&!a&&!D?v.findIndex(d=>!d.disabled&&d[e]):u.isPresent(D)&&a===void 0||m&&a===""?v.findIndex(d=>u.areSame(d,D,n)):a?xe.current?p(v,a,e):v.findIndex(d=>u.areSame(d,D,n)):i.skip===0?0:-1},Oe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=u.getFilteredData(I),n=t.current.initState(),i=we();Oe(e,i)&&(H(null,n),b(n))},Ie=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,g.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),b(n)},qe=e=>{var M,de,V,ue,j,Re,et;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:p,leftRightKeysNavigation:m=!0,virtual:f={skip:0,total:0,pageSize:0},dataItemKey:D,groupField:v="",textField:a,skipDisabledItems:d=!0}=r,c=u.getFilteredData(I),h=N(),w=c.findIndex(L=>u.areSame(L,h,D)),S=r.opened!==void 0?r.opened:g.opened,l=e.keyCode,P=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!S&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),te=S&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=m&&(l===o.Keys.left||l===o.Keys.right),ce=K||le&&!n||P,C=t.current.initState();if(C.syntheticEvent=e,!i){if(P&&((M=t==null?void 0:t.current)!=null&&M.vs.enabled))l===o.Keys.home?f.skip!==0?((de=t==null?void 0:t.current)==null||de.triggerOnPageChange(C,0,f.pageSize),q.current=!0):H(c[0],C):f.skip<f.total-f.pageSize?((V=t==null?void 0:t.current)==null||V.triggerOnPageChange(C,f.total-f.pageSize,f.pageSize),q.current=!0):H(c[c.length-1],C);else if(S&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(S&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(S&&l===o.Keys.enter){const L=we();Oe(c,L)?(H(null,C),b(C)):J(L,C),(Re=t==null?void 0:t.current)==null||Re.togglePopup(C),e.preventDefault()}else if(G||te)te&&he(),(et=t==null?void 0:t.current)==null||et.togglePopup(C),e.preventDefault();else if(ce){if(xe.current=!1,v!==""&&a)if(!d&&S)T(C,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const x=c.slice(w+1).find(y=>!y.disabled&&y[a]);L=x&&c.findIndex(y=>y[a]===x[a])}else if(l===o.Keys.up||l===o.Keys.left){let x;if(w===0&&p)L=-1;else if(w===-1)x=c,L=c.findIndex(y=>!y.disabled&&y[a]);else{x=c.slice(0,w);let y=x.pop();for(;y&&y.disabled;)y=x.pop();L=y&&c.findIndex(be=>be[a]===y[a])}}if(L!==void 0){const x=L-w;T(C,l,x)}else L===void 0&&c.findIndex(x=>x[a]===h[a])===c.length-1&&T(C,l)}else if(!d&&S||P)T(C,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const x=c.slice(w+1).find(y=>!y.disabled&&y[a]);L=x&&c.findIndex(y=>y[a]===x[a])}else if(l===o.Keys.up||l===o.Keys.left){let x;if(w===0&&p)L=-1;else if(w===-1)x=c,L=c.find(y=>!y.disabled&&y[a]);else{x=c.slice(0,w);let y=x.pop();for(;y&&y.disabled;)y=x.pop();L=y&&c.findIndex(be=>be[a]===y[a])}}if(L!==void 0){const x=L-w;T(C,l,x)}else L===void 0&&c.findIndex(x=>x[a]===h[a])===c.length-1&&T(C,l)}else T(C,l);e.preventDefault()}b(C)}},gt=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,b(n),R({group:void 0,text:String(e.target.value)})},Ae=()=>{const e=r.filter!==void 0?r.filter:g.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>X.current=n&&n.element,onChange:gt,onKeyDown:qe,size:$,rounded:Me,fillMode:ge,renderListFilterWrapper:!0})},ft=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),H(r.defaultItem,n),b(n)},ze=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,p=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:u.areSame(p,n,i),key:"defaultitemkey",onClick:ft})},vt=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),O.current=void 0},Dt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:p}=r;let m=u.getFilteredData(I);if(!(!p||!m.length)&&p){const f=_e.current=_e.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*f;m=t.current.getGroupedDataModernMode(m,p);let a=m[0][p];for(let d=1;d<m.length&&!(f*d>v);d++)m[d]&&m[d][p]&&(a=m[d][p]);a!==g.group&&R({group:a})}},Ve=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:p,listNoDataRender:m,itemRender:f}=r,D=u.getFilteredData(I),v=E&&E.uDropDownList,a=t.current.vs,d=i.skip,c=r.opened!==void 0?r.opened:g.opened,h=t.current.getPopupSettings(),w=`translateY(${a.translate}px)`,S=N();return s.createElement(Gt,{id:Le,show:c,data:D.slice(),focusedIndex:we(),value:S,textField:e,valueField:n,optionsGuid:Ge,groupField:r.groupField,groupMode:"modern",listRef:P=>a.list=t.current.list=P,wrapperStyle:{maxHeight:h.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:w}:void 0,key:"listkey",skip:d,onClick:vt,itemRender:f,groupHeaderItemRender:p,noDataRender:m,onScroll:Dt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},yt=()=>{var w;const{header:e,footer:n,adaptiveTitle:i,groupField:p,groupStickyHeaderItemRender:m,list:f}=r,D=u.getFilteredData(I),v=r.opened!==void 0?r.opened:g.opened,a=E&&E.uDropDownList,d=E&&E.uDropDownsActionSheet,c={navigatable:!1,navigatableElements:[],expand:v,animation:!0,onClose:S=>Ie(S),className:o.classNames(o.uDropDownsActionSheet.wrapper({c:d}),"k-adaptive-actionsheet"),animationStyles:W&&U&&W<=U.small?{top:0,width:"100%",height:"100%"}:void 0,position:W&&U&&W<=U.small?"fullscreen":void 0};let{group:h}=g;return h===void 0&&p!==void 0&&(h=u.getItemValue(D[0],p)),s.createElement(Fe.ActionSheet,{...c},s.createElement(Fe.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,i)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c:d}))},s.createElement(rt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Ie,icon:"x",svgIcon:tt.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c:d}))},Ae())),s.createElement(Fe.ActionSheetContent,{overflowHidden:!0},e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:a}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:a,size:$,virtual:(w=t==null?void 0:t.current)==null?void 0:w.vs.enabled}))},ze(),!f&&h&&D.length!==0&&s.createElement(nt,{group:h,groupMode:"modern",render:m}),Ve()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:a}))},n)))},wt=()=>{g.focused&&window.setTimeout(()=>{g.focused&&t.current.wrapper&&ne(t.current.wrapper)})},ht=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:p,groupStickyHeaderItemRender:m,list:f}=r,D=u.getFilteredData(I),v=t.current,a=v.getPopupSettings(),d=r.opened!==void 0?r.opened:g.opened,c=a.width!==void 0?a.width:v.popupWidth,h=E&&E.uDropDownList,w={dir:i!==void 0?i:v.dirCalculated,width:c,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:h})),anchor:a.anchor||Q.current,show:d,onOpen:ye,onClose:wt,onMouseDownOutside:ht},itemsCount:[D.length]};let{group:S}=g;return S===void 0&&p!==void 0&&(S=u.getItemValue(D[0],p)),s.createElement(_t,{...w},Ae(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:h}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:h,size:$,virtual:t.current.vs.enabled}))},ze(),!f&&S&&D.length!==0&&s.createElement(nt,{group:S,groupMode:"modern",render:m}),Ve()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:h}))},n))},St=e=>{const{dataItemKey:n}=r,i=u.getFilteredData(I),p=N();let m=i.map((K,G)=>({item:K,itemIndex:G}));const f=_.current.word,D=_.current.last,v=u.sameCharsOnly(f,D);let a=m.length,d=Math.max(0,i.findIndex(K=>u.areSame(K,p,n))),c;r.defaultItem&&(c={item:r.defaultItem,itemIndex:-1},a+=1,d+=1),d+=v?1:0,m=u.shuffleData(m,d,c);let h,w,S,l=0;const{textField:P}=r;for(;l<a;){if(h=u.getItemValue(m[l].item,P),w=v&&u.matchText(h,D,me),S=u.matchText(h,f,me),w||S){l=m[l].itemIndex;break}l++}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),b(K),O.current=void 0}},xt=e=>{clearTimeout(He.current),r.filterable||(He.current=window.setTimeout(()=>_.current.word="",st),St(e))},Ct=e=>{re.current||t.current.handleFocus(e)},Lt=e=>{if(re.current||!g.focused)return;const n=r.opened!==void 0?r.opened:g.opened,i=t.current.initState();i.syntheticEvent=e,i.data.focused=!1,i.events.push({type:"onBlur"}),n&&he(),n&&!Ke&&t.current.togglePopup(i),b(i)},kt=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(),_.current={word:_.current.word+n,last:_.current.last+n},xt(e)},Et=()=>{const e=t.current.initState();e.data.opened=g.opened,t.current.togglePopup(e),b(e)},Be=s.useRef(null),Q=s.useRef(null),Se=s.useRef(),X=s.useRef(null);s.useImperativeHandle(Be,()=>({get element(){return Q.current},get index(){return ct()},get name(){return r.name},get validity(){return De()},get value(){return N()},get focused(){return g.focused},get opened(){return g.opened},focus:lt,props:r,togglePopup:Et})),s.useImperativeHandle(Y,()=>Be.current);const He=s.useRef(null),_=s.useRef({word:"",last:""}),re=s.useRef(!1),O=s.useRef(null),q=s.useRef(!1),xe=s.useRef(!1),A=s.useRef({}),Ce=s.useRef({}),t=s.useRef(new ot({props:I,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),_e=s.useRef(0),Z=s.useRef(null),[g,Nt]=s.useState({}),[W,Kt]=s.useState(),[,We]=s.useReducer(e=>e,!0),bt=Yt.useLocalization(),R=e=>{Nt({...g,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:I,setState:R,state:g,forceUpdate:We,element:Q.current,handleItemSelect:J,value:N()})},[R,g,We,J,N]),s.useEffect(()=>{var d,c,h,w,S,l,P,K,G,te,le,ce,C;const{dataItemKey:e,virtual:n,groupField:i="",textField:p}=r,m=u.getFilteredData(I),f=A.current.virtual?A.current.virtual.total:0,D=r.opened!==void 0?r.opened:g.opened,v=A.current.opened!==void 0?A.current.opened:Ce.current.opened,a=!v&&D;if((d=t==null?void 0:t.current)==null||d.didUpdate(),(c=t==null?void 0:t.current)!=null&&c.getPopupSettings().animate||a&&ye(),n&&n.total!==f)(h=t==null?void 0:t.current)==null||h.vs.calcScrollElementHeight(),(w=t==null?void 0:t.current)==null||w.vs.reset();else{const M=N(),de=A.current.value!==void 0?A.current.value:Ce.current.value;let V=m.findIndex(j=>u.areSame(j,M,e));i!==""&&M&&p&&(V=(l=(S=t==null?void 0:t.current)==null?void 0:S.getGroupedDataModernMode(m,i))==null?void 0:l.map(j=>j[p]).indexOf(M[p]));const ue=!u.areSame(de,M,e);a&&n?(P=t==null?void 0:t.current)==null||P.scrollToVirtualItem(n,V):a&&!n?(ye(),m&&m.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(m[0][i],{setState:R,group:g.group,state:g})),(G=t==null?void 0:t.current)==null||G.scrollToItem(V)):D&&v&&M&&ue&&!q.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(V,(te=t==null?void 0:t.current)==null?void 0:te.vs.enabled):D&&v&&q.current&&(q.current&&n&&n.skip===0?(ce=t==null?void 0:t.current)==null||ce.vs.reset():q.current&&n&&n.skip===n.total-n.pageSize&&((C=t==null?void 0:t.current)==null||C.vs.scrollToEnd()))}q.current=!1,Ce.current=g,A.current=r,Te()}),s.useEffect(()=>{var e,n;return Z.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(ut.bind(void 0)),(e=t==null?void 0:t.current)==null||e.didMount(),Te(),(n=fe())!=null&&n.body&&Z.current&&Z.current.observe(fe().body),()=>{var i;(i=fe())!=null&&i.body&&Z.current&&Z.current.disconnect()}},[]);const Ue=B+"-accessibility-id",Le=B+"-listbox-id",Ge=B+"-guid",Pt=bt.toLanguageString(Pe.dropDownListArrowBtnAriaLabel,Pe.messages[Pe.dropDownListArrowBtnAriaLabel]),{style:oe,className:Ft,label:ke,dir:Mt,virtual:z,adaptive:Xt,dataItemKey:Tt,disabled:ae,loading:je,iconClassName:Ye,svgIcon:$e,valueRender:Je}=r,Ee=r.opened!==void 0?r.opened:g.opened,se=N(),Ne=u.getItemValue(se,r.textField),Qe=!dt()||De().valid,ie=t.current,Ot=ie.vs,ee=E&&E.uDropDownList;Ot.enabled=z!==void 0;const U=o.useAdaptiveModeContext(),Ke=!!(W&&U&&W<=U.medium&&I.adaptive);z!==void 0&&(ie.vs.skip=z.skip,ie.vs.total=z.total,ie.vs.pageSize=z.pageSize);const qt=u.getFilteredData(I),{focused:At}=g,zt=qt.findIndex(e=>u.areSame(e,se,Tt)),Xe=s.createElement("span",{id:Ue,className:o.classNames(o.uDropDownList.inputInner({c:ee}))},Ne&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:ee}))},Ne)),Vt=Je!==void 0?Je.call(void 0,Xe,se):Xe,Ze=s.createElement(s.Fragment,null,s.createElement("span",{ref:pt,className:o.classNames(o.uDropDownList.wrapper({c:ee,size:$,rounded:Me,fillMode:ge,focused:At,disabled:ae,invalid:!Qe,loading:je,required:ve()}),Ft),style:ke?{...oe,width:void 0}:oe,dir:Mt,onMouseDown:Ee?e=>{e.target.nodeName!=="INPUT"&&(ne(t.current.wrapper),e.preventDefault())}:void 0,onFocus:Ct,onBlur:Lt,tabIndex:o.getTabIndex(it,ae),accessKey:r.accessKey,onKeyDown:qe,onKeyPress:kt,onClick:ae?void 0:Ie,role:"combobox","aria-required":ve(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ee||!1,"aria-owns":Le,"aria-activedescendant":Ee?"option-"+Ge+"-"+(zt+(z?z.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||Ue,"aria-controls":Le,id:r.id,title:r.title},Vt,je&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:ee})),name:"loading"}),s.createElement(rt.Button,{tabIndex:-1,type:"button","aria-label":Pt,size:$,fillMode:ge,iconClass:Ye,className:o.classNames(o.uDropDownList.inputButton({c:ee})),rounded:null,themeColor:"base",icon:Ye?void 0:"caret-alt-down",svgIcon:$e||tt.caretAltDownIcon,onMouseDown:e=>g.focused&&e.preventDefault()}),mt(se),!Ke&&It()),Ke&&yt());return ke?s.createElement(Ht.FloatingLabel,{label:ke,editorValue:Ne,editorValid:Qe,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Ze}):Ze});pe.propTypes={delay:k.number,ignoreCase:k.bool,iconClassName:k.string,svgIcon:o.svgIconPropType,defaultItem:k.any,valueRender:k.func,valueMap:k.func,validationMessage:k.string,required:k.bool,id:k.string,ariaLabelledBy:k.string,ariaDescribedBy:k.string,ariaLabel:k.string,leftRightKeysNavigation:k.bool,title:k.string,groupField:k.string,list:k.any,skipDisabledItems:k.bool};const F={delay:500,tabIndex:0,ignoreCase:!0,...ot.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};pe.displayName="KendoReactDropDownList";const at=o.createPropsContext();pe.displayName="KendoReactDropDownList";exports.DropDownList=pe;exports.DropDownListPropsContext=at;exports.dropDownListDefaultProps=F;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as i from "react";
9
10
  import k from "prop-types";
10
11
  import { validatePackage as Gt, useUnstyled as Yt, useId as $t, usePropsContext as jt, canUseDOM as rt, useAdaptiveModeContext as Jt, classNames as C, uDropDownList as b, getTabIndex as Qt, IconWrap as Xt, svgIconPropType as Zt, createPropsContext as Rt, Keys as w, uDropDownsActionSheet as J } from "@progress/kendo-react-common";
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Je=require("react"),n=require("prop-types"),r=require("@progress/kendo-react-common"),Qe=require("@progress/kendo-react-popup"),Xe=require("@progress/kendo-react-intl"),xe=require("@progress/kendo-react-treeview"),Ye=require("../package-metadata.js"),G=require("../common/utils.js"),Ze=require("./useDropdownWidth.js"),et=require("./ListNoData.js"),h=require("../messages/index.js"),tt=require("@progress/kendo-react-labels"),De=require("../common/ListFilter.js"),nt=require("@progress/kendo-react-buttons"),Fe=require("@progress/kendo-svg-icons"),at=require("../common/AdaptiveMode.js"),ot=require("@progress/kendo-react-layout");function rt(u){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const s in u)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(f,s,o.get?o:{enumerable:!0,get:()=>u[s]})}}return f.default=u,Object.freeze(f)}const t=rt(Je),{sizeMap:st,roundedMap:it}=r.kendoThemeMaps,lt="Please select a value from the list!",ct=u=>t.createElement("span",{className:"k-input-value-text"},u.children),Ie=u=>u.split("_").map(f=>parseInt(f,10)),ut=(u,f)=>{const{validationMessage:s,valid:o,required:U}=u;return{customError:s!==void 0,valid:!!(o!==void 0?o:!U||f),valueMissing:!f}},oe={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},Se=r.createPropsContext(),re=t.forwardRef((u,f)=>{r.validatePackage(Ye.packageMetadata);const s=r.usePropsContext(Se,u),o={...oe,...s},U=r.useId(),se=o.id||U,{data:M,dataItemKey:T,popupSettings:k={},style:P,opened:d,disabled:S,onOpen:N=r.noop,onClose:v=r.noop,placeholder:J,label:O,name:Re,selectField:H,subItemsField:V,validationMessage:j,valid:qe,required:Q,validityStyles:Ke}=o,X=r.getTabIndex(o.tabIndex,S),i=t.useRef(null),g=t.useRef(null),R=t.useRef(null),Y=t.useRef(null),_=t.useRef(null),C=t.useRef(null),$=t.useRef(!1),[ie,Me]=t.useState(void 0),w=o.value!==void 0,b=w?o.value:ie!==void 0?ie:o.defaultValue,L=G.isPresent(b),Z=L?G.getItemValue(b,o.textField):"",ee=ut({validationMessage:j,valid:qe,required:Q},L),Te=t.useCallback(()=>g.current&&g.current.focus(),[]);t.useImperativeHandle(i,()=>({props:o,element:g.current,focus:Te})),t.useImperativeHandle(f,()=>i.current);const x=r.useRtl(g,o.dir),Pe={width:Ze.useDropdownWidth(g,oe,{...oe.popupSettings,...k},P),...x!==void 0?{direction:x}:{}},[Ne,le]=t.useState(!1),l=d!==void 0?d:Ne,[p,te]=t.useState(!1),[ne,Oe]=t.useState(),[ce,Ve]=t.useState(""),ue=r.useAdaptiveModeContext(),D=!!(ne&&ue&&ne<=ue.medium&&o.adaptive),Le=t.useCallback(()=>{_.current&&_.current.setCustomValidity&&_.current.setCustomValidity(ee.valid?"":j===void 0?lt:j)},[j,ee]);t.useEffect(Le),t.useEffect(()=>{const e=r.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ge.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const de=t.useCallback(e=>{if(!l){if(N){const a={...e};N.call(void 0,a)}d===void 0&&le(!0)}},[l,d,N]),F=t.useCallback(e=>{if(l){if(v){const a={...e};v.call(void 0,a)}d===void 0&&(le(!1),D&&setTimeout(()=>{var a;y((a=Y.current)==null?void 0:a.element)},300))}},[l,d,v,D]),We=t.useCallback(e=>{if(!e.isDefaultPrevented()&&i.current){te(!0);const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};(l?F:de)(a)}},[l,d,N,v]),q=t.useCallback(e=>{$.current=!0,e(),window.setTimeout(()=>$.current=!1,0)},[]),Be=t.useCallback(e=>{var I,Ee;const{keyCode:a,altKey:c}=e,m=C.current&&C.current.element;if(!i.current||e.isDefaultPrevented()&&((I=R.current)==null?void 0:I.element)===e.target)return;const K={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(l)if(a===r.Keys.esc||c&&a===r.Keys.up)e.preventDefault(),F(K);else if(m&&m.querySelector(".k-focus")&&(a===r.Keys.up||a===r.Keys.down||a===r.Keys.left||a===r.Keys.right||a===r.Keys.home||a===r.Keys.end)){if(a===r.Keys.up&&((Ee=R.current)!=null&&Ee.element)){const A=Array.from(m.querySelectorAll(".k-treeview-item")),we=[...A].reverse().find(z=>!!(z&&z.querySelector(".k-focus")));if(we&&A.indexOf(we)===0)return q(()=>{var z;y((z=R.current)==null?void 0:z.element)})}q(r.noop)}else a===r.Keys.down&&q(()=>{var A;y(((A=R.current)==null?void 0:A.element)||m)});else c&&a===r.Keys.down?(e.preventDefault(),de(K)):l||a===r.Keys.esc&&ve(e)},[l,d,N,v]),pe=t.useCallback(e=>{const{keyCode:a,altKey:c}=e;c||a!==r.Keys.up&&a!==r.Keys.down||(e.preventDefault(),q(a===r.Keys.up?()=>{y(g.current)}:()=>{y(C.current&&C.current.element)}))},[]),y=t.useCallback(e=>{e&&q(()=>e.focus())},[]),Ae=t.useCallback(()=>{var e;!p&&l&&!d?F({target:i.current}):s.filterable?y((e=R.current)==null?void 0:e.element):y(C.current&&C.current.element)},[v,s.filterable,p,d,l]),ze=t.useCallback(()=>{p&&y(g.current)},[p]),He=t.useCallback(e=>{if(!p&&!$.current&&(te(!0),s.onFocus&&i.current)){const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};s.onFocus.call(void 0,a)}},[p,s.onFocus]),je=t.useCallback(e=>{if(p&&!$.current&&i.current){te(!1);const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(s.onBlur){const c={...a};s.onBlur.call(void 0,c)}D||F(a)}},[p,s.onBlur,l,d,v]),_e=t.useCallback(()=>{p&&q(r.noop),D&&setTimeout(()=>{var e;y((e=Y.current)==null?void 0:e.element)},300)},[p,D]),fe=t.useCallback((e,a,c)=>{if(s.onChange){const m={value:a,level:c?Ie(c):[],...e};s.onChange.call(void 0,m)}w||Me(a)},[s.onChange,w]),me=t.useCallback(e=>{if(G.areSame(e.item,b,T)||!i.current)return;const{item:a,itemHierarchicalIndex:c,nativeEvent:m,syntheticEvent:K}=e,I={syntheticEvent:K,nativeEvent:m,target:i.current};fe(I,a,c),F(I)},[w,b,s.onChange,T,l,d,v]),ve=t.useCallback(e=>{if(!i.current)return;const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};fe(a,null),F(a),e.preventDefault()},[w,s.onChange,l,d,v]),ge=t.useCallback(e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&i.current){const{item:a,itemHierarchicalIndex:c,nativeEvent:m,syntheticEvent:K}=e,I={level:Ie(c),item:a,nativeEvent:m,syntheticEvent:K,target:i.current};s.onExpandChange.call(void 0,I)}},[s.onExpandChange]),be=t.useCallback(e=>{if(s.onFilterChange&&i.current){const c={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:i.current};s.onFilterChange.call(void 0,c),s.filter===void 0&&Ve(e.target.value)}},[s.onFilterChange,s.filter,s.textField]),$e=()=>{const e=o.filterable?t.createElement(De,{value:o.filter===void 0?ce:o.filter,ref:Y,onChange:be,onKeyDown:pe,size:E,rounded:W,fillMode:B}):null,a={title:o.adaptiveTitle,expand:l,onClose:c=>F(c),windowWidth:ne,mobileFilter:e};return t.createElement(at.AdaptiveMode,{...a},t.createElement(ot.ActionSheetContent,{overflowHidden:!0},t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},M.length>0?t.createElement(xe.TreeView,{ref:C,tabIndex:X,data:ye,focusIdField:T,textField:o.textField,selectField:H,expandField:o.expandField,childrenField:V,expandIcons:!0,onItemClick:me,onExpandChange:ge,size:E,item:o.item,dir:x,animate:k.animate}):t.createElement(he,null,ae.toLanguageString(h.nodata,h.messages[h.nodata]))))))},Ge=t.useCallback(e=>{for(const a of e)Oe(a.target.clientWidth)},[]),ye=t.useMemo(()=>w||!L?M:r.mapTree(M,V,e=>r.extendDataItem(e,V,{[H]:G.areSame(e,b,T)})),[M,b,w,L,H,V]),he=o.listNoData||et.ListNoData,Ue=o.valueHolder||ct,ae=Xe.useLocalization(),ke=!Ke||ee.valid,{size:E,rounded:W,fillMode:B}=o,Ce=t.createElement(t.Fragment,null,t.createElement("span",{className:r.classNames("k-dropdowntree k-picker",o.className,{[`k-picker-${st[E]||E}`]:E,[`k-rounded-${it[W]||W}`]:W,[`k-picker-${B}`]:B,"k-focus":p,"k-invalid":!ke,"k-loading":o.loading,"k-required":Q,"k-disabled":o.disabled}),tabIndex:X,accessKey:o.accessKey,id:se,style:O?{...P,width:void 0}:P,dir:x,ref:g,onKeyDown:S?void 0:Be,onMouseDown:_e,onClick:S?void 0:We,onFocus:He,onBlur:je,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":S,"aria-label":O,"aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,"aria-required":Q},t.createElement("span",{className:"k-input-inner"},(Z||J)&&t.createElement(Ue,{item:b},Z||J)),o.loading&&t.createElement(r.IconWrap,{className:"k-input-loading-icon",name:"loading"}),L&&!S&&t.createElement("span",{onClick:ve,className:"k-clear-value",title:ae.toLanguageString(h.clear,h.messages[h.clear]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},t.createElement(r.IconWrap,{name:"x",icon:Fe.xIcon})),t.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:E,fillMode:B,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:Fe.caretAltDownIcon}),t.createElement("select",{name:Re,ref:_,tabIndex:-1,"aria-hidden":!0,title:O,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},t.createElement("option",{value:o.valueMap?o.valueMap.call(void 0,b):b})),!D&&t.createElement(Qe.Popup,{...k,className:r.classNames(k.className,{"k-rtl":x==="rtl"}),popupClass:r.classNames(k.popupClass,"k-dropdowntree-popup k-list-container"),style:Pe,anchor:k.anchor||g.current,show:l,onOpen:Ae,onClose:ze},o.filterable&&t.createElement(De,{value:o.filter===void 0?ce:o.filter,ref:R,onChange:be,onKeyDown:pe,size:E,rounded:W,fillMode:B,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),M.length>0?t.createElement(xe.TreeView,{style:{height:k.height},ref:C,tabIndex:X,data:ye,focusIdField:T,textField:o.textField,selectField:H,expandField:o.expandField,childrenField:V,expandIcons:!0,onItemClick:me,onExpandChange:ge,size:E,item:o.item,dir:x,animate:k.animate}):t.createElement(he,null,ae.toLanguageString(h.nodata,h.messages[h.nodata])))),D&&$e());return O?t.createElement(tt.FloatingLabel,{label:O,editorValue:Z,editorPlaceholder:J,editorValid:ke,editorDisabled:S,editorId:se,style:{width:P?P.width:void 0},children:Ce,dir:x}):Ce}),dt={opened:n.bool,disabled:n.bool,dir:n.string,tabIndex:n.number,accessKey:n.string,data:n.array,value:n.any,valueMap:n.func,placeholder:n.string,dataItemKey:n.string.isRequired,textField:n.string.isRequired,selectField:n.string,expandField:n.string,subItemsField:n.string,className:n.string,style:n.object,label:n.string,validationMessage:n.string,validityStyles:n.bool,valid:n.bool,required:n.bool,name:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,filterable:n.bool,filter:n.string,loading:n.bool,popupSettings:n.shape({animate:n.oneOfType([n.bool,n.shape({openDuration:n.number,closeDuration:n.number})]),popupClass:n.string,className:n.string,appendTo:n.any,width:n.oneOfType([n.string,n.number]),height:n.oneOfType([n.string,n.number])}),onOpen:n.func,onClose:n.func,onFocus:n.func,onBlur:n.func,onChange:n.func,onFilterChange:n.func,onExpandChange:n.func,item:n.func,valueHolder:n.func,listNoData:n.func,adaptiveTitle:n.string,adaptive:n.bool};re.displayName="KendoReactDropDownTree";re.propTypes=dt;exports.DropDownTree=re;exports.DropDownTreePropsContext=Se;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Je=require("react"),n=require("prop-types"),r=require("@progress/kendo-react-common"),Qe=require("@progress/kendo-react-popup"),Xe=require("@progress/kendo-react-intl"),xe=require("@progress/kendo-react-treeview"),Ye=require("../package-metadata.js"),G=require("../common/utils.js"),Ze=require("./useDropdownWidth.js"),et=require("./ListNoData.js"),h=require("../messages/index.js"),tt=require("@progress/kendo-react-labels"),De=require("../common/ListFilter.js"),nt=require("@progress/kendo-react-buttons"),Fe=require("@progress/kendo-svg-icons"),at=require("../common/AdaptiveMode.js"),ot=require("@progress/kendo-react-layout");function rt(u){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const s in u)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(u,s);Object.defineProperty(f,s,o.get?o:{enumerable:!0,get:()=>u[s]})}}return f.default=u,Object.freeze(f)}const t=rt(Je),{sizeMap:st,roundedMap:it}=r.kendoThemeMaps,lt="Please select a value from the list!",ct=u=>t.createElement("span",{className:"k-input-value-text"},u.children),Ie=u=>u.split("_").map(f=>parseInt(f,10)),ut=(u,f)=>{const{validationMessage:s,valid:o,required:U}=u;return{customError:s!==void 0,valid:!!(o!==void 0?o:!U||f),valueMissing:!f}},oe={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},Se=r.createPropsContext(),re=t.forwardRef((u,f)=>{r.validatePackage(Ye.packageMetadata);const s=r.usePropsContext(Se,u),o={...oe,...s},U=r.useId(),se=o.id||U,{data:M,dataItemKey:T,popupSettings:k={},style:P,opened:d,disabled:S,onOpen:N=r.noop,onClose:v=r.noop,placeholder:J,label:O,name:Re,selectField:H,subItemsField:V,validationMessage:j,valid:qe,required:Q,validityStyles:Ke}=o,X=r.getTabIndex(o.tabIndex,S),i=t.useRef(null),g=t.useRef(null),R=t.useRef(null),Y=t.useRef(null),_=t.useRef(null),C=t.useRef(null),$=t.useRef(!1),[ie,Me]=t.useState(void 0),w=o.value!==void 0,b=w?o.value:ie!==void 0?ie:o.defaultValue,L=G.isPresent(b),Z=L?G.getItemValue(b,o.textField):"",ee=ut({validationMessage:j,valid:qe,required:Q},L),Te=t.useCallback(()=>g.current&&g.current.focus(),[]);t.useImperativeHandle(i,()=>({props:o,element:g.current,focus:Te})),t.useImperativeHandle(f,()=>i.current);const x=r.useRtl(g,o.dir),Pe={width:Ze.useDropdownWidth(g,oe,{...oe.popupSettings,...k},P),...x!==void 0?{direction:x}:{}},[Ne,le]=t.useState(!1),l=d!==void 0?d:Ne,[p,te]=t.useState(!1),[ne,Oe]=t.useState(),[ce,Ve]=t.useState(""),ue=r.useAdaptiveModeContext(),D=!!(ne&&ue&&ne<=ue.medium&&o.adaptive),Le=t.useCallback(()=>{_.current&&_.current.setCustomValidity&&_.current.setCustomValidity(ee.valid?"":j===void 0?lt:j)},[j,ee]);t.useEffect(Le),t.useEffect(()=>{const e=r.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ge.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const de=t.useCallback(e=>{if(!l){if(N){const a={...e};N.call(void 0,a)}d===void 0&&le(!0)}},[l,d,N]),F=t.useCallback(e=>{if(l){if(v){const a={...e};v.call(void 0,a)}d===void 0&&(le(!1),D&&setTimeout(()=>{var a;y((a=Y.current)==null?void 0:a.element)},300))}},[l,d,v,D]),We=t.useCallback(e=>{if(!e.isDefaultPrevented()&&i.current){te(!0);const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};(l?F:de)(a)}},[l,d,N,v]),q=t.useCallback(e=>{$.current=!0,e(),window.setTimeout(()=>$.current=!1,0)},[]),Be=t.useCallback(e=>{var I,Ee;const{keyCode:a,altKey:c}=e,m=C.current&&C.current.element;if(!i.current||e.isDefaultPrevented()&&((I=R.current)==null?void 0:I.element)===e.target)return;const K={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(l)if(a===r.Keys.esc||c&&a===r.Keys.up)e.preventDefault(),F(K);else if(m&&m.querySelector(".k-focus")&&(a===r.Keys.up||a===r.Keys.down||a===r.Keys.left||a===r.Keys.right||a===r.Keys.home||a===r.Keys.end)){if(a===r.Keys.up&&((Ee=R.current)!=null&&Ee.element)){const A=Array.from(m.querySelectorAll(".k-treeview-item")),we=[...A].reverse().find(z=>!!(z&&z.querySelector(".k-focus")));if(we&&A.indexOf(we)===0)return q(()=>{var z;y((z=R.current)==null?void 0:z.element)})}q(r.noop)}else a===r.Keys.down&&q(()=>{var A;y(((A=R.current)==null?void 0:A.element)||m)});else c&&a===r.Keys.down?(e.preventDefault(),de(K)):l||a===r.Keys.esc&&ve(e)},[l,d,N,v]),pe=t.useCallback(e=>{const{keyCode:a,altKey:c}=e;c||a!==r.Keys.up&&a!==r.Keys.down||(e.preventDefault(),q(a===r.Keys.up?()=>{y(g.current)}:()=>{y(C.current&&C.current.element)}))},[]),y=t.useCallback(e=>{e&&q(()=>e.focus())},[]),Ae=t.useCallback(()=>{var e;!p&&l&&!d?F({target:i.current}):s.filterable?y((e=R.current)==null?void 0:e.element):y(C.current&&C.current.element)},[v,s.filterable,p,d,l]),ze=t.useCallback(()=>{p&&y(g.current)},[p]),He=t.useCallback(e=>{if(!p&&!$.current&&(te(!0),s.onFocus&&i.current)){const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};s.onFocus.call(void 0,a)}},[p,s.onFocus]),je=t.useCallback(e=>{if(p&&!$.current&&i.current){te(!1);const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(s.onBlur){const c={...a};s.onBlur.call(void 0,c)}D||F(a)}},[p,s.onBlur,l,d,v]),_e=t.useCallback(()=>{p&&q(r.noop),D&&setTimeout(()=>{var e;y((e=Y.current)==null?void 0:e.element)},300)},[p,D]),fe=t.useCallback((e,a,c)=>{if(s.onChange){const m={value:a,level:c?Ie(c):[],...e};s.onChange.call(void 0,m)}w||Me(a)},[s.onChange,w]),me=t.useCallback(e=>{if(G.areSame(e.item,b,T)||!i.current)return;const{item:a,itemHierarchicalIndex:c,nativeEvent:m,syntheticEvent:K}=e,I={syntheticEvent:K,nativeEvent:m,target:i.current};fe(I,a,c),F(I)},[w,b,s.onChange,T,l,d,v]),ve=t.useCallback(e=>{if(!i.current)return;const a={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};fe(a,null),F(a),e.preventDefault()},[w,s.onChange,l,d,v]),ge=t.useCallback(e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&i.current){const{item:a,itemHierarchicalIndex:c,nativeEvent:m,syntheticEvent:K}=e,I={level:Ie(c),item:a,nativeEvent:m,syntheticEvent:K,target:i.current};s.onExpandChange.call(void 0,I)}},[s.onExpandChange]),be=t.useCallback(e=>{if(s.onFilterChange&&i.current){const c={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:i.current};s.onFilterChange.call(void 0,c),s.filter===void 0&&Ve(e.target.value)}},[s.onFilterChange,s.filter,s.textField]),$e=()=>{const e=o.filterable?t.createElement(De,{value:o.filter===void 0?ce:o.filter,ref:Y,onChange:be,onKeyDown:pe,size:E,rounded:W,fillMode:B}):null,a={title:o.adaptiveTitle,expand:l,onClose:c=>F(c),windowWidth:ne,mobileFilter:e};return t.createElement(at.AdaptiveMode,{...a},t.createElement(ot.ActionSheetContent,{overflowHidden:!0},t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},M.length>0?t.createElement(xe.TreeView,{ref:C,tabIndex:X,data:ye,focusIdField:T,textField:o.textField,selectField:H,expandField:o.expandField,childrenField:V,expandIcons:!0,onItemClick:me,onExpandChange:ge,size:E,item:o.item,dir:x,animate:k.animate}):t.createElement(he,null,ae.toLanguageString(h.nodata,h.messages[h.nodata]))))))},Ge=t.useCallback(e=>{for(const a of e)Oe(a.target.clientWidth)},[]),ye=t.useMemo(()=>w||!L?M:r.mapTree(M,V,e=>r.extendDataItem(e,V,{[H]:G.areSame(e,b,T)})),[M,b,w,L,H,V]),he=o.listNoData||et.ListNoData,Ue=o.valueHolder||ct,ae=Xe.useLocalization(),ke=!Ke||ee.valid,{size:E,rounded:W,fillMode:B}=o,Ce=t.createElement(t.Fragment,null,t.createElement("span",{className:r.classNames("k-dropdowntree k-picker",o.className,{[`k-picker-${st[E]||E}`]:E,[`k-rounded-${it[W]||W}`]:W,[`k-picker-${B}`]:B,"k-focus":p,"k-invalid":!ke,"k-loading":o.loading,"k-required":Q,"k-disabled":o.disabled}),tabIndex:X,accessKey:o.accessKey,id:se,style:O?{...P,width:void 0}:P,dir:x,ref:g,onKeyDown:S?void 0:Be,onMouseDown:_e,onClick:S?void 0:We,onFocus:He,onBlur:je,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":S,"aria-label":O,"aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,"aria-required":Q},t.createElement("span",{className:"k-input-inner"},(Z||J)&&t.createElement(Ue,{item:b},Z||J)),o.loading&&t.createElement(r.IconWrap,{className:"k-input-loading-icon",name:"loading"}),L&&!S&&t.createElement("span",{onClick:ve,className:"k-clear-value",title:ae.toLanguageString(h.clear,h.messages[h.clear]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},t.createElement(r.IconWrap,{name:"x",icon:Fe.xIcon})),t.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:E,fillMode:B,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:Fe.caretAltDownIcon}),t.createElement("select",{name:Re,ref:_,tabIndex:-1,"aria-hidden":!0,title:O,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},t.createElement("option",{value:o.valueMap?o.valueMap.call(void 0,b):b})),!D&&t.createElement(Qe.Popup,{...k,className:r.classNames(k.className,{"k-rtl":x==="rtl"}),popupClass:r.classNames(k.popupClass,"k-dropdowntree-popup k-list-container"),style:Pe,anchor:k.anchor||g.current,show:l,onOpen:Ae,onClose:ze},o.filterable&&t.createElement(De,{value:o.filter===void 0?ce:o.filter,ref:R,onChange:be,onKeyDown:pe,size:E,rounded:W,fillMode:B,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),M.length>0?t.createElement(xe.TreeView,{style:{height:k.height},ref:C,tabIndex:X,data:ye,focusIdField:T,textField:o.textField,selectField:H,expandField:o.expandField,childrenField:V,expandIcons:!0,onItemClick:me,onExpandChange:ge,size:E,item:o.item,dir:x,animate:k.animate}):t.createElement(he,null,ae.toLanguageString(h.nodata,h.messages[h.nodata])))),D&&$e());return O?t.createElement(tt.FloatingLabel,{label:O,editorValue:Z,editorPlaceholder:J,editorValid:ke,editorDisabled:S,editorId:se,style:{width:P?P.width:void 0},children:Ce,dir:x}):Ce}),dt={opened:n.bool,disabled:n.bool,dir:n.string,tabIndex:n.number,accessKey:n.string,data:n.array,value:n.any,valueMap:n.func,placeholder:n.string,dataItemKey:n.string.isRequired,textField:n.string.isRequired,selectField:n.string,expandField:n.string,subItemsField:n.string,className:n.string,style:n.object,label:n.string,validationMessage:n.string,validityStyles:n.bool,valid:n.bool,required:n.bool,name:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,filterable:n.bool,filter:n.string,loading:n.bool,popupSettings:n.shape({animate:n.oneOfType([n.bool,n.shape({openDuration:n.number,closeDuration:n.number})]),popupClass:n.string,className:n.string,appendTo:n.any,width:n.oneOfType([n.string,n.number]),height:n.oneOfType([n.string,n.number])}),onOpen:n.func,onClose:n.func,onFocus:n.func,onBlur:n.func,onChange:n.func,onFilterChange:n.func,onExpandChange:n.func,item:n.func,valueHolder:n.func,listNoData:n.func,adaptiveTitle:n.string,adaptive:n.bool};re.displayName="KendoReactDropDownTree";re.propTypes=dt;exports.DropDownTree=re;exports.DropDownTreePropsContext=Se;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as t from "react";
9
10
  import n from "prop-types";
10
11
  import { createPropsContext as Ye, validatePackage as Ze, usePropsContext as et, useId as tt, getTabIndex as nt, useRtl as ot, useAdaptiveModeContext as at, canUseDOM as rt, Keys as c, noop as j, mapTree as it, extendDataItem as lt, classNames as ae, IconWrap as Fe, kendoThemeMaps as st } from "@progress/kendo-react-common";
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function o(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=o(c),l=e=>r.createElement("div",{className:"k-nodata"},r.createElement("div",null,e.children));exports.ListNoData=l;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react");function o(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=o(r),l=e=>c.createElement("div",{className:"k-nodata"},c.createElement("div",null,e.children));exports.ListNoData=l;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as e from "react";
9
10
  const a = (t) => /* @__PURE__ */ e.createElement("div", { className: "k-nodata" }, /* @__PURE__ */ e.createElement("div", null, t.children));
10
11
  export {
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react");function h(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const p=h(f);function a(t,n,e){const[i,o]=p.useState(n);return p.useEffect(()=>{i!==void 0&&t.current&&o(t.current.offsetWidth)},e),i}function d(t){return typeof t=="string"?Number(t.replace("px","")):t||void 0}function l(t,n,e,i){const o=d(n.popupSettings.width),c=(e.width!==void 0&&d(e.width))!==o,u=i.width!==void 0,s=c?e.width:u?i.width:o,r=d(a(t,s));return c||u?s:r&&o&&r>o?r:o}exports.useDropdownWidth=l;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react");function h(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const p=h(f);function a(t,n,e){const[i,o]=p.useState(n);return p.useEffect(()=>{i!==void 0&&t.current&&o(t.current.offsetWidth)},e),i}function c(t){return typeof t=="string"?Number(t.replace("px","")):t||void 0}function l(t,n,e,i){const o=c(n.popupSettings.width),d=(e.width!==void 0&&c(e.width))!==o,u=i.width!==void 0,s=d?e.width:u?i.width:o,r=c(a(t,s));return d||u?s:r&&o&&r>o?r:o}exports.useDropdownWidth=l;
@@ -5,19 +5,20 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as c from "react";
9
- function u(t, o, n) {
10
- const [d, i] = c.useState(o);
11
- return c.useEffect(() => {
8
+ "use client";
9
+ import * as p from "react";
10
+ function u(t, e, n) {
11
+ const [d, i] = p.useState(e);
12
+ return p.useEffect(() => {
12
13
  d !== void 0 && t.current && i(t.current.offsetWidth);
13
14
  }, n), d;
14
15
  }
15
16
  function r(t) {
16
17
  return typeof t == "string" ? Number(t.replace("px", "")) : t || void 0;
17
18
  }
18
- function W(t, o, n, d) {
19
- const i = r(o.popupSettings.width), s = (n.width !== void 0 && r(n.width)) !== i, h = d.width !== void 0, p = s ? n.width : h ? d.width : i, e = r(u(t, p));
20
- return s || h ? p : e && i && e > i ? e : i;
19
+ function W(t, e, n, d) {
20
+ const i = r(e.popupSettings.width), s = (n.width !== void 0 && r(n.width)) !== i, c = d.width !== void 0, h = s ? n.width : c ? d.width : i, o = r(u(t, h));
21
+ return s || c ? h : o && i && o > i ? o : i;
21
22
  }
22
23
  export {
23
24
  W as useDropdownWidth
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react"),ie=require("prop-types"),de=require("../common/MultiColumnList.js"),l=require("@progress/kendo-react-common"),j=require("../ComboBox/ComboBox.js"),ce=require("../common/utils.js"),K=require("../common/withCustomComponent.js");function pe(a){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(d,e,c.get?c:{enumerable:!0,get:()=>a[e]})}}return d.default=a,Object.freeze(d)}const t=pe(ue),me=(a,d)=>a?typeof a=="number"?a+"px":a:d,G=l.createPropsContext(),y=t.forwardRef((a,d)=>{const e=l.usePropsContext(G,a),c=t.useRef(null),n=t.useRef(null),w=l.getScrollbarWidth(),{columns:s=i.columns,popupSettings:f=i.popupSettings,size:W=i.size,rounded:z=i.rounded,fillMode:L=i.fillMode,className:_,prefix:D=void 0,suffix:$=void 0,onOpen:M,onClose:S,onFocus:N,onBlur:E,onChange:F,onFilterChange:H,onPageChange:R,...V}=e;t.useImperativeHandle(c,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),t.useImperativeHandle(d,()=>c.current);const g=t.useMemo(()=>{if(e.groupField!==void 0&&e.data)return ce.getItemValue(e.data[0],e.groupField)},[e.data,e.groupField]),[k,b]=t.useState(g),[q,B]=t.useState(!0),[A]=D?K(e.prefix||t.Fragment):[],[J]=$?K(e.suffix||t.Fragment):[],Q=t.useMemo(()=>{const o=t.createElement("th",{className:"k-table-th",colSpan:s.length},k);return t.createElement(t.Fragment,null,e.header,t.createElement("div",{className:"k-table-header-wrap"},t.createElement("table",{className:"k-table",role:"presentation"},t.createElement("colgroup",null,s.map((r,p)=>t.createElement("col",{key:r.uniqueKey?r.uniqueKey:p,style:{width:r.width?r.width:i.width}}))),t.createElement("thead",{className:"k-table-thead"},t.createElement("tr",{className:"k-table-row"},s.map((r,p)=>t.createElement("th",{className:"k-table-th",key:r.uniqueKey?r.uniqueKey:p},r.header||" "))),k&&q&&t.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,o,{}):o)))))},[e.header,s,k,q]),U=t.useMemo(()=>`calc(${s.map(o=>me(o.width,i.width)).filter(Boolean).join(" + ")} + ${w}px + 4px)`,[s,w]),I=e.virtual?e.virtual.skip:0,X=t.useCallback((o,r)=>{const p=s.map((m,se)=>t.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:m.width?m.width:i.width},key:m.uniqueKey?m.uniqueKey:se},m.field?String(l.getter(m.field)(r.dataItem)):""));let C,h,v,x,O=e.data||[];const P=r.index-I;e.groupField!==void 0&&(x=l.getter(e.groupField),h=x(O[P]),v=x(O[P-1]),h&&v&&h!==v&&(C=h)),C&&e.groupMode==="classic"&&p.push(t.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},t.createElement("span",null,C)));const T=t.cloneElement(o,{...o.props,className:l.classNames("k-table-row",{"k-table-alt-row":r.index%2!==0,"k-focus":r.focused,"k-selected":r.selected,"k-first":!!C,"k-disabled":r.dataItem.disabled})},p);return e.itemRender?e.itemRender.call(void 0,T,r):T},[s,e.groupField,e.itemRender,e.data,I]),u=t.useCallback((o,r)=>{o&&o.call(void 0,{...r,target:c.current})},[]),Y=t.useCallback(o=>(e.virtual||b(g),u(M,o)),[u,M,e.virtual,g]),Z=t.useCallback(o=>u(S,o),[S]),ee=t.useCallback(o=>u(N,o),[N]),te=t.useCallback(o=>u(E,o),[E]),oe=t.useCallback(o=>u(F,o),[F]),re=t.useCallback(o=>u(R,o),[R]),ae=t.useCallback(o=>(b(g),u(H,{...o,mobileMode:o.target.mobileMode})),[H]),ne=t.useCallback(o=>{b(o.group)},[]);t.useEffect(()=>{l.setScrollbarWidth()}),t.useEffect(()=>{const o=e.data;b(g),o&&o.length!==0?B(!0):B(!1)},[e.data]);const le=t.useCallback(o=>t.createElement(de.MultiColumnList,{...o}),[]);return t.createElement(j.ComboBox,{...V,list:le,popupSettings:{...f,popupClass:l.classNames("k-dropdowngrid-popup",f.popupClass),width:f.width||U,className:f.className},ref:n,header:Q,itemRender:X,groupHeaderItemRender:e.groupHeaderItemRender,size:W,rounded:z,fillMode:L,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:Y,onClose:Z,onFocus:ee,onBlur:te,onChange:oe,onFilterChange:ae,onPageChange:re,onGroupScroll:ne,className:l.classNames("k-dropdowngrid",_),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:A,suffix:J})}),ge={...j.ComboBoxWithoutContext.propTypes,columns:ie.any.isRequired},i={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};y.displayName="KendoMultiColumnComboBox";y.propTypes=ge;exports.MultiColumnComboBox=y;exports.MultiColumnComboBoxPropsContext=G;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react"),ie=require("prop-types"),de=require("../common/MultiColumnList.js"),l=require("@progress/kendo-react-common"),j=require("../ComboBox/ComboBox.js"),ce=require("../common/utils.js"),K=require("../common/withCustomComponent.js");function pe(a){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(d,e,c.get?c:{enumerable:!0,get:()=>a[e]})}}return d.default=a,Object.freeze(d)}const t=pe(ue),me=(a,d)=>a?typeof a=="number"?a+"px":a:d,G=l.createPropsContext(),y=t.forwardRef((a,d)=>{const e=l.usePropsContext(G,a),c=t.useRef(null),n=t.useRef(null),w=l.getScrollbarWidth(),{columns:s=i.columns,popupSettings:f=i.popupSettings,size:W=i.size,rounded:z=i.rounded,fillMode:L=i.fillMode,className:_,prefix:D=void 0,suffix:$=void 0,onOpen:M,onClose:S,onFocus:N,onBlur:E,onChange:F,onFilterChange:H,onPageChange:R,...V}=e;t.useImperativeHandle(c,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),t.useImperativeHandle(d,()=>c.current);const g=t.useMemo(()=>{if(e.groupField!==void 0&&e.data)return ce.getItemValue(e.data[0],e.groupField)},[e.data,e.groupField]),[k,b]=t.useState(g),[q,B]=t.useState(!0),[A]=D?K(e.prefix||t.Fragment):[],[J]=$?K(e.suffix||t.Fragment):[],Q=t.useMemo(()=>{const o=t.createElement("th",{className:"k-table-th",colSpan:s.length},k);return t.createElement(t.Fragment,null,e.header,t.createElement("div",{className:"k-table-header-wrap"},t.createElement("table",{className:"k-table",role:"presentation"},t.createElement("colgroup",null,s.map((r,p)=>t.createElement("col",{key:r.uniqueKey?r.uniqueKey:p,style:{width:r.width?r.width:i.width}}))),t.createElement("thead",{className:"k-table-thead"},t.createElement("tr",{className:"k-table-row"},s.map((r,p)=>t.createElement("th",{className:"k-table-th",key:r.uniqueKey?r.uniqueKey:p},r.header||" "))),k&&q&&t.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,o,{}):o)))))},[e.header,s,k,q]),U=t.useMemo(()=>`calc(${s.map(o=>me(o.width,i.width)).filter(Boolean).join(" + ")} + ${w}px + 4px)`,[s,w]),I=e.virtual?e.virtual.skip:0,X=t.useCallback((o,r)=>{const p=s.map((m,se)=>t.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:m.width?m.width:i.width},key:m.uniqueKey?m.uniqueKey:se},m.field?String(l.getter(m.field)(r.dataItem)):""));let C,h,v,x,O=e.data||[];const P=r.index-I;e.groupField!==void 0&&(x=l.getter(e.groupField),h=x(O[P]),v=x(O[P-1]),h&&v&&h!==v&&(C=h)),C&&e.groupMode==="classic"&&p.push(t.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},t.createElement("span",null,C)));const T=t.cloneElement(o,{...o.props,className:l.classNames("k-table-row",{"k-table-alt-row":r.index%2!==0,"k-focus":r.focused,"k-selected":r.selected,"k-first":!!C,"k-disabled":r.dataItem.disabled})},p);return e.itemRender?e.itemRender.call(void 0,T,r):T},[s,e.groupField,e.itemRender,e.data,I]),u=t.useCallback((o,r)=>{o&&o.call(void 0,{...r,target:c.current})},[]),Y=t.useCallback(o=>(e.virtual||b(g),u(M,o)),[u,M,e.virtual,g]),Z=t.useCallback(o=>u(S,o),[S]),ee=t.useCallback(o=>u(N,o),[N]),te=t.useCallback(o=>u(E,o),[E]),oe=t.useCallback(o=>u(F,o),[F]),re=t.useCallback(o=>u(R,o),[R]),ae=t.useCallback(o=>(b(g),u(H,{...o,mobileMode:o.target.mobileMode})),[H]),ne=t.useCallback(o=>{b(o.group)},[]);t.useEffect(()=>{l.setScrollbarWidth()}),t.useEffect(()=>{const o=e.data;b(g),o&&o.length!==0?B(!0):B(!1)},[e.data]);const le=t.useCallback(o=>t.createElement(de.MultiColumnList,{...o}),[]);return t.createElement(j.ComboBox,{...V,list:le,popupSettings:{...f,popupClass:l.classNames("k-dropdowngrid-popup",f.popupClass),width:f.width||U,className:f.className},ref:n,header:Q,itemRender:X,groupHeaderItemRender:e.groupHeaderItemRender,size:W,rounded:z,fillMode:L,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:Y,onClose:Z,onFocus:ee,onBlur:te,onChange:oe,onFilterChange:ae,onPageChange:re,onGroupScroll:ne,className:l.classNames("k-dropdowngrid",_),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:A,suffix:J})}),ge={...j.ComboBoxWithoutContext.propTypes,columns:ie.any.isRequired},i={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};y.displayName="KendoMultiColumnComboBox";y.propTypes=ge;exports.MultiColumnComboBox=y;exports.MultiColumnComboBoxPropsContext=G;
@@ -5,6 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
+ "use client";
8
9
  import * as e from "react";
9
10
  import se from "prop-types";
10
11
  import { MultiColumnList as ue } from "../common/MultiColumnList.mjs";