@progress/kendo-react-dropdowns 9.0.0-develop.2 → 9.0.0-develop.20

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.
@@ -323,7 +323,14 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
323
323
  this.props.prefix && /* @__PURE__ */ u.createElement(ee, { ...te }),
324
324
  this.renderSearchBar(T || "", A, h),
325
325
  Z && !o && /* @__PURE__ */ u.createElement(Ie, { onClick: this.clearButtonClick, key: "clearbutton" }),
326
- o && /* @__PURE__ */ u.createElement(le, { className: I(D.loadingIcon({ c: _ })), name: "loading", key: "loading" }),
326
+ o && /* @__PURE__ */ u.createElement(
327
+ le,
328
+ {
329
+ className: I(D.loadingIcon({ c: _ })),
330
+ name: "loading",
331
+ key: "loading"
332
+ }
333
+ ),
327
334
  this.props.suffix && /* @__PURE__ */ u.createElement(se, { ...ie }),
328
335
  /* @__PURE__ */ u.createElement(
329
336
  G,
@@ -451,38 +458,64 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
451
458
  icon: "x",
452
459
  svgIcon: Ce
453
460
  }
454
- ))), /* @__PURE__ */ u.createElement("div", { className: I(M.titleBarGroup({ c: m })) }, this.renderMobileListFilter())), /* @__PURE__ */ u.createElement(we, { overflowHidden: !0 }, /* @__PURE__ */ u.createElement("div", { className: I(
455
- D.listContainer({
456
- c: v
457
- })
458
- ) }, /* @__PURE__ */ u.createElement(
461
+ ))), /* @__PURE__ */ u.createElement("div", { className: I(M.titleBarGroup({ c: m })) }, this.renderMobileListFilter())), /* @__PURE__ */ u.createElement(we, { overflowHidden: !0 }, /* @__PURE__ */ u.createElement(
459
462
  "div",
460
463
  {
461
464
  className: I(
462
- D.list({
463
- c: v,
464
- list: a,
465
- size: "large",
466
- tableSize: i,
467
- virtual: d
465
+ D.listContainer({
466
+ c: v
468
467
  })
469
468
  )
470
469
  },
471
- e && /* @__PURE__ */ u.createElement("div", { className: I(D.listHeader({ c: v })) }, e),
472
- !a && h && p.length !== 0 && /* @__PURE__ */ u.createElement(
473
- q,
470
+ /* @__PURE__ */ u.createElement(
471
+ "div",
474
472
  {
475
- group: h,
476
- groupMode: r,
477
- render: o
478
- }
479
- ),
480
- this.renderList(),
481
- t && /* @__PURE__ */ u.createElement("div", { className: I(D.listFooter({ c: v }), this.props.footerClassName) }, t)
482
- ))));
473
+ className: I(
474
+ D.list({
475
+ c: v,
476
+ list: a,
477
+ size: "large",
478
+ tableSize: i,
479
+ virtual: d
480
+ })
481
+ )
482
+ },
483
+ e && /* @__PURE__ */ u.createElement("div", { className: I(D.listHeader({ c: v })) }, e),
484
+ !a && h && p.length !== 0 && /* @__PURE__ */ u.createElement(
485
+ q,
486
+ {
487
+ group: h,
488
+ groupMode: r,
489
+ render: o
490
+ }
491
+ ),
492
+ this.renderList(),
493
+ t && /* @__PURE__ */ u.createElement(
494
+ "div",
495
+ {
496
+ className: I(
497
+ D.listFooter({ c: v }),
498
+ this.props.footerClassName
499
+ )
500
+ },
501
+ t
502
+ )
503
+ )
504
+ )));
483
505
  }
484
506
  renderListContainer() {
485
- const s = this.base, { dir: e, header: t, footer: i, groupField: n, groupMode: r, size: a, list: d, virtual: l, groupStickyHeaderItemRender: o, unstyled: c } = this.props, p = S(this.props), y = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), v = x.width !== void 0 ? x.width : s.popupWidth, m = c && c.uComboBox;
507
+ const s = this.base, {
508
+ dir: e,
509
+ header: t,
510
+ footer: i,
511
+ groupField: n,
512
+ groupMode: r,
513
+ size: a,
514
+ list: d,
515
+ virtual: l,
516
+ groupStickyHeaderItemRender: o,
517
+ unstyled: c
518
+ } = this.props, p = S(this.props), y = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), v = x.width !== void 0 ? x.width : s.popupWidth, m = c && c.uComboBox;
486
519
  let { group: h } = this.state;
487
520
  return h === void 0 && n !== void 0 && (h = k(p[0], n)), /* @__PURE__ */ u.createElement(
488
521
  ve,
@@ -522,7 +555,10 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
522
555
  i && /* @__PURE__ */ u.createElement(
523
556
  "div",
524
557
  {
525
- className: I(D.listFooter({ c: m }), this.props.footerClassName)
558
+ className: I(
559
+ D.listFooter({ c: m }),
560
+ this.props.footerClassName
561
+ )
526
562
  },
527
563
  i
528
564
  )
@@ -559,10 +595,12 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
559
595
  c.list = this.base.list = O, this.itemHeight = 0;
560
596
  },
561
597
  wrapperStyle: this.state.windowWidth && this.state.windowWidth > Y ? { maxHeight: o.height } : {},
562
- wrapperCssClass: I(D.listContent({
563
- c: B,
564
- virtual: a
565
- })),
598
+ wrapperCssClass: I(
599
+ D.listContent({
600
+ c: B,
601
+ virtual: a
602
+ })
603
+ ),
566
604
  listStyle: c.enabled ? { transform: x } : void 0,
567
605
  key: "listkey",
568
606
  skip: p,
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),x=require("prop-types"),s=require("@progress/kendo-react-common"),Q=require("@progress/kendo-react-labels"),V=require("@progress/kendo-svg-icons"),X=require("../common/ListContainer.js"),Z=require("../common/ListFilter.js"),B=require("../common/GroupStickyHeader.js"),ee=require("../common/ListDefaultItem.js"),te=require("../common/List.js"),R=require("../common/DropDownBase.js"),c=require("../common/utils.js"),se=require("../package-metadata.js"),H=require("@progress/kendo-react-buttons"),ie=require("@progress/kendo-react-intl"),T=require("../messages/index.js"),M=require("../common/constants.js"),q=require("@progress/kendo-react-layout");function ae(_){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(_){for(const e in _)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(_,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>_[e]})}}return i.default=_,Object.freeze(i)}const m=ae(J),oe="Please select a value from the list!",k=class k extends m.Component{constructor(i){super(i),this.state={},this._element=null,this.base=new R(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus({preventScroll:!0})},this.handleItemSelect=(e,t)=>{const{virtual:o,dataItemKey:u,defaultItem:r}=this.props,d=c.getFilteredData(this.props),I=o?o.skip:0,p=e===-1&&r!==void 0?r:d[e-I],a=!c.areSame(p,this.value,u);this.triggerOnChange(p,t),a&&this.base.triggerPageChangeCornerItems(p,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.dummySelect=e=>m.createElement("select",{name:this.props.name,ref:t=>{this._select=t},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},m.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,e):e})),this.renderListContainer=()=>{const{header:e,footer:t,dir:o,size:u,groupField:r,groupStickyHeaderItemRender:d,list:I,unstyled:p}=this.props,a=c.getFilteredData(this.props),g=this.base,n=g.getPopupSettings(),v=this.props.opened!==void 0?this.props.opened:this.state.opened,b=n.width!==void 0?n.width:g.popupWidth,h=p&&p.uDropDownList,l={dir:o!==void 0?o:g.dirCalculated,width:b,popupSettings:{...n,popupClass:s.classNames(n.popupClass,s.uDropDownList.listContainer({c:h})),anchor:n.anchor||this.element,show:v,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,onMouseDownOutside:this.onPopupMouseDown},itemsCount:[a.length]};let{group:S}=this.state;return S===void 0&&r!==void 0&&(S=c.getItemValue(a[0],r)),m.createElement(X,{...l},this.renderListFilter(),e&&m.createElement("div",{className:s.classNames(s.uDropDownList.listHeader({c:h}))},e),m.createElement("div",{className:s.classNames(s.uDropDownList.list({c:h,size:u,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!I&&S&&a.length!==0&&m.createElement(B,{group:S,groupMode:"modern",render:d}),this.renderList()),t&&m.createElement("div",{className:s.classNames(s.uDropDownList.listFooter({c:h}))},t))},this.renderList=()=>{const{textField:e,dataItemKey:t,virtual:o={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:r,itemRender:d,unstyled:I}=this.props,p=c.getFilteredData(this.props),a=I&&I.uDropDownList,g=this.base.vs,n=o.skip,v=this.props.opened!==void 0?this.props.opened:this.state.opened,b=this.base.getPopupSettings(),h=`translateY(${g.translate}px)`;return m.createElement(te,{id:this._listboxId,show:v,data:p.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:t,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:l=>g.list=this.base.list=l,wrapperStyle:{maxHeight:b.height},wrapperCssClass:s.classNames(s.uDropDownList.listContent({c:a})),listStyle:g.enabled?{transform:h}:void 0,key:"listkey",skip:n,onClick:this.handleItemClick,itemRender:d,groupHeaderItemRender:u,noDataRender:r,onScroll:this.onScroll,wrapperRef:g.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:o.total})},this.onScroll=e=>{const{vs:t,list:o}=this.base;t.scrollHandler(e);const{groupField:u}=this.props;let r=c.getFilteredData(this.props);if(!(!u||!r.length)&&u){const d=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:o?o.children[0].offsetHeight:0),p=e.target.scrollTop-t.skip*d;r=this.base.getGroupedDataModernMode(r,u);let a=r[0][u];for(let g=1;g<r.length&&!(d*g>p);g++)r[g]&&r[g][u]&&(a=r[g][u]);a!==this.state.group&&this.setState({group:a})}},this.renderListFilter=()=>{const e=this.props.filter!==void 0?this.props.filter:this.state.text;return this.props.filterable&&m.createElement(Z,{value:e,ref:t=>this._filterInput=t&&t.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,renderListFilterWrapper:!0})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:o}=this.props;return t!==void 0&&m.createElement(ee,{defaultItem:t,textField:e,selected:c.areSame(this.value,t,o),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=e=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout(()=>this.searchState.word="",this.props.delay),this.selectNext(e))},this.selectNext=e=>{const{dataItemKey:t}=this.props,o=c.getFilteredData(this.props);let u=o.map((C,L)=>({item:C,itemIndex:L}));const r=this.searchState.word,d=this.searchState.last,I=c.sameCharsOnly(r,d);let p=u.length,a=Math.max(0,o.findIndex(C=>c.areSame(C,this.value,t))),g;this.props.defaultItem&&(g={item:this.props.defaultItem,itemIndex:-1},p+=1,a+=1),a+=I?1:0,u=c.shuffleData(u,a,g);let n,v,b,h=0;const{textField:l,ignoreCase:S}=this.props;for(;h<p;h++)if(n=c.getItemValue(u[h].item,l),v=I&&c.matchText(n,d,S),b=c.matchText(n,r,S),v||b){h=u[h].itemIndex;break}if(h!==p){const C=this.base.initState();C.syntheticEvent=e,this.handleItemSelect(h,C),this.applyState(C),this._valueDuringOnChange=void 0}},this.handleKeyDown=e=>{e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:t,disabled:o,defaultItem:u,leftRightKeysNavigation:r=!0,virtual:d={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:p="",textField:a,skipDisabledItems:g=!0}=this.props,n=c.getFilteredData(this.props),v=this.value,b=n.findIndex(D=>c.areSame(D,v,I)),h=this.props.opened!==void 0?this.props.opened:this.state.opened,l=e.keyCode,S=l===s.Keys.home||l===s.Keys.end,C=l===s.Keys.up||l===s.Keys.down,L=!h&&(e.altKey&&l===s.Keys.down||l===s.Keys.enter||l===s.Keys.space),E=h&&(e.altKey&&l===s.Keys.up||l===s.Keys.esc),P=r&&(l===s.Keys.left||l===s.Keys.right),N=C||P&&!t||S,w=this.base.initState();if(w.syntheticEvent=e,!o){if(S&&this.base.vs.enabled)l===s.Keys.home?d.skip!==0?(this.base.triggerOnPageChange(w,0,d.pageSize),this._navigated=!0):this.triggerOnChange(n[0],w):d.skip<d.total-d.pageSize?(this.base.triggerOnPageChange(w,d.total-d.pageSize,d.pageSize),this._navigated=!0):this.triggerOnChange(n[n.length-1],w);else if(h&&l===s.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(h&&l===s.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if(h&&l===s.Keys.enter){const D=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(n,D)?(this.triggerOnChange(null,w),this.applyState(w)):this.handleItemSelect(D,w),this.base.togglePopup(w),e.preventDefault()}else if(L||E)E&&this.resetValueIfDisabledItem(),this.base.togglePopup(w),e.preventDefault();else if(N){if(this._lastKeypressIsFilter=!1,p!==""&&a)if(!g&&h)this.onNavigate(w,l);else{let D;if(l===s.Keys.down||l===s.Keys.right){const y=n.slice(b+1).find(f=>!f.disabled&&f[a]);D=y&&n.findIndex(f=>f[a]===y[a])}else if(l===s.Keys.up||l===s.Keys.left){let y;if(b===0&&u)D=-1;else if(b===-1)y=n,D=n.findIndex(f=>!f.disabled&&f[a]);else{y=n.slice(0,b);let f=y.pop();for(;f&&f.disabled;)f=y.pop();D=f&&n.findIndex(F=>F[a]===f[a])}}if(D!==void 0){const y=D-b;this.onNavigate(w,l,y)}else D===void 0&&n.findIndex(y=>y[a]===v[a])===n.length-1&&this.onNavigate(w,l)}else if(!g&&h||S)this.onNavigate(w,l);else if(a){let D;if(l===s.Keys.down||l===s.Keys.right){const y=n.slice(b+1).find(f=>!f.disabled&&f[a]);D=y&&n.findIndex(f=>f[a]===y[a])}else if(l===s.Keys.up||l===s.Keys.left){let y;if(b===0&&u)D=-1;else if(b===-1)y=n,D=n.find(f=>!f.disabled&&f[a]);else{y=n.slice(0,b);let f=y.pop();for(;f&&f.disabled;)f=y.pop();D=f&&n.findIndex(F=>F[a]===f[a])}}if(D!==void 0){const y=D-b;this.onNavigate(w,l,y)}else D===void 0&&n.findIndex(y=>y[a]===v[a])===n.length-1&&this.onNavigate(w,l)}else this.onNavigate(w,l);e.preventDefault()}this.applyState(w)}},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{if(this._skipFocusEvent||!this.state.focused)return;const t=this.props.opened!==void 0?this.props.opened:this.state.opened,{adaptive:o}=this.props,{windowWidth:u=0}=this.state,r=u<=M.MOBILE_MEDIUM_DEVISE&&o,d=this.base.initState();d.syntheticEvent=e,d.data.focused=!1,d.events.push({type:"onBlur"}),t&&this.resetValueIfDisabledItem(),t&&!r&&this.base.togglePopup(d),this.applyState(d)},this.handleDefaultItemClick=e=>{const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.triggerOnChange(this.props.defaultItem,t),this.applyState(t)},this.handleWrapperClick=e=>{if(e.isPropagationStopped())return;const t=this.base.initState();t.syntheticEvent=e,this.state.focused||(t.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(t),this.applyState(t)},this.handleKeyPress=e=>{if(this.props.filterable||e.which===0||e.keyCode===s.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.props.ignoreCase&&(t=t.toLowerCase()),t===" "&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},this.handleListFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,this.props.filter===void 0&&(t.data.text=e.target.value),this.base.filterChanged(e.target.value,t),this._lastKeypressIsFilter=!0,this.applyState(t),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout(()=>{this._filterInput&&this.focusElement(this._filterInput)},300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},this.onPopupMouseDown=e=>{var t;(t=this.props.popupSettings)!=null&&t.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,e)},this.togglePopup=()=>{const e=this.base.initState();e.data.opened=this.state.opened,this.base.togglePopup(e),this.applyState(e)},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||oe)},s.validatePackage(se.packageMetadata)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let i;return this._valueDuringOnChange!==void 0?i=this._valueDuringOnChange:this.props.value!==void 0?i=this.props.value:this.state.value!==void 0?i=this.state.value:this.props.defaultValue!==void 0&&(i=this.props.defaultValue),!c.isPresent(i)&&this.props.defaultItem!==void 0&&(i=this.props.defaultItem),i}get index(){const{dataItemKey:i}=this.props,e=c.getFilteredData(this.props),t=this.value;return e.findIndex(o=>c.areSame(o,t,i))}get name(){return this.props.name}get validity(){const i=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:i,valid:t,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:k.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:k.defaultProps.required}componentDidUpdate(i,e){var n;const{dataItemKey:t,virtual:o,groupField:u="",textField:r}=this.props,d=c.getFilteredData(this.props),I=i.virtual?i.virtual.total:0,p=this.props.opened!==void 0?this.props.opened:this.state.opened,a=i.opened!==void 0?i.opened:e.opened,g=!a&&p;if(this.base.didUpdate(),this.base.getPopupSettings().animate||g&&this.onPopupOpened(),o&&o.total!==I)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const v=this.value,b=i.value!==void 0?i.value:e.value;let h=d.findIndex(S=>c.areSame(S,v,t));u!==""&&v&&r&&(h=(n=this.base.getGroupedDataModernMode(d,u))==null?void 0:n.map(S=>S[r]).indexOf(v[r]));const l=!c.areSame(b,v,t);g&&o?this.base.scrollToVirtualItem(o,h):g&&!o?(this.onPopupOpened(),d&&d.length!==0&&this.base.resetGroupStickyHeader(d[0][u],this),this.base.scrollToItem(h)):p&&a&&v&&l&&!this._navigated?this.base.scrollToItem(h,this.base.vs.enabled):p&&a&&this._navigated&&(this._navigated&&o&&o.skip===0?this.base.vs.reset():this._navigated&&o&&o.skip===o.total-o.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=ie.provideLocalizationService(this).toLanguageString(T.dropDownListArrowBtnAriaLabel,T.messages[T.dropDownListArrowBtnAriaLabel]),{style:e,className:t,label:o,dir:u,virtual:r,size:d,rounded:I,fillMode:p,adaptive:a,unstyled:g}=this.props,{windowWidth:n=0}=this.state,v=this.props.opened!==void 0?this.props.opened:this.state.opened,b=this.value,h=c.getItemValue(b,this.props.textField),l=!this.validityStyles||this.validity.valid,S=this.base,C=S.vs,L=n<=M.MOBILE_MEDIUM_DEVISE&&a,E=g&&g.uDropDownList;C.enabled=r!==void 0,r!==void 0&&(S.vs.skip=r.skip,S.vs.total=r.total,S.vs.pageSize=r.pageSize);const{dataItemKey:P,disabled:N,tabIndex:w,loading:D,iconClassName:y,svgIcon:f,valueRender:F}=this.props,G=c.getFilteredData(this.props),{focused:j}=this.state,Y=G.findIndex(K=>c.areSame(K,b,P)),A=m.createElement("span",{id:this._inputId,className:s.classNames(s.uDropDownList.inputInner({c:E}))},h&&m.createElement("span",{className:s.classNames(s.uDropDownList.inputText({c:E}))},h)),$=F!==void 0?F.call(void 0,A,b):A,z=m.createElement(m.Fragment,null,m.createElement("span",{ref:this.componentRef,className:s.classNames(s.uDropDownList.wrapper({c:E,size:d,rounded:I,fillMode:p,focused:j,disabled:N,invalid:!l,loading:D,required:this.required}),t),style:o?{...e,width:void 0}:e,dir:u,onMouseDown:v?K=>{K.target.nodeName!=="INPUT"&&(this.focusElement(this.base.wrapper),K.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:s.getTabIndex(w,N),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:N?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":N||void 0,"aria-haspopup":"listbox","aria-expanded":v||!1,"aria-owns":this._listboxId,"aria-activedescendant":v?"option-"+this._guid+"-"+(Y+(r?r.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,"aria-controls":this._listboxId,id:this.props.id,title:this.props.title},$,D&&m.createElement(s.IconWrap,{className:s.classNames(s.uDropDownList.loadingIcon({c:E})),name:"loading"}),m.createElement(H.Button,{tabIndex:-1,type:"button","aria-label":i,size:d,fillMode:p,iconClass:y,className:s.classNames(s.uDropDownList.inputButton({c:E})),rounded:null,themeColor:"base",icon:y?void 0:"caret-alt-down",svgIcon:f||V.caretAltDownIcon,onMouseDown:K=>this.state.focused&&K.preventDefault()}),this.dummySelect(b),!L&&this.renderListContainer()),L&&this.renderAdaptiveListContainer());return o?m.createElement(Q.FloatingLabel,{label:o,editorValue:h,editorValid:l,editorDisabled:this.props.disabled,style:{width:e?e.width:void 0},children:z}):z}onNavigate(i,e,t){const{defaultItem:o,dataItemKey:u,virtual:r={skip:0,total:0,pageSize:0}}=this.props,d=c.getFilteredData(this.props),I=this.base.vs,p=this.value,a=d.findIndex(n=>c.areSame(n,p,u)),g=this.base.navigation.navigate({current:r.skip+a,max:(I.enabled?r.total:d.length)-1,min:o!==void 0?-1:0,keyCode:e,skipItems:t||void 0});g!==void 0&&this.handleItemSelect(g,i),this.applyState(i)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:e,footer:t,size:o,adaptiveTitle:u,groupField:r,groupStickyHeaderItemRender:d,list:I,unstyled:p}=this.props,a=c.getFilteredData(this.props),g=this.props.opened!==void 0?this.props.opened:this.state.opened,n=p&&p.uDropDownList,v=p&&p.uDropDownsActionSheet,b={navigatable:!1,navigatableElements:[],expand:g,animation:!0,onClose:l=>this.handleWrapperClick(l),animationStyles:i<=M.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:s.classNames(s.uDropDownsActionSheet.wrapper({c:v,isFullScreen:i<=M.MOBILE_SMALL_DEVISE}))};let{group:h}=this.state;return h===void 0&&r!==void 0&&(h=c.getItemValue(a[0],r)),m.createElement(q.ActionSheet,{...b},m.createElement(q.ActionSheetHeader,{className:s.classNames(s.uDropDownsActionSheet.header({c:v}))},m.createElement("div",{className:s.classNames(s.uDropDownsActionSheet.titleBar({c:v}))},m.createElement("div",{className:s.classNames(s.uDropDownsActionSheet.title({c:v}))},m.createElement("div",null,u)),m.createElement("div",{className:s.classNames(s.uDropDownsActionSheet.actions({c:v}))},m.createElement(H.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:V.xIcon}))),m.createElement("div",{className:s.classNames(s.uDropDownsActionSheet.titleBarGroup({c:v}))},this.renderListFilter())),m.createElement(q.ActionSheetContent,{overflowHidden:!0},e&&m.createElement("div",{className:s.classNames(s.uDropDownList.listHeader({c:n}))},e),m.createElement("div",{className:s.classNames(s.uDropDownList.list({c:n,size:o,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!I&&h&&a.length!==0&&m.createElement(B,{group:h,groupMode:"modern",render:d}),this.renderList()),t&&m.createElement("div",{className:s.classNames(s.uDropDownList.listFooter({c:n}))},t)))}getFocusedIndex(){const i=this.value,{textField:e,dataItemKey:t,virtual:o={skip:0},focusedItemIndex:u=c.itemIndexStartsWith,filterable:r,skipDisabledItems:d=!0}=this.props,I=c.getFilteredData(this.props),p=this.props.filter?this.props.filter:this.state.text;return d&&e&&!p&&!i?I.findIndex(a=>!a.disabled&&a[e]):c.isPresent(i)&&p===void 0||r&&p===""?I.findIndex(a=>c.areSame(a,i,t)):p?this._lastKeypressIsFilter?u(I,p,e):I.findIndex(a=>c.areSame(a,i,t)):o.skip===0?0:-1}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,30)}triggerOnChange(i,e){c.areSame(this.value,i,this.props.dataItemKey)||(this.props.value===void 0&&(e.data.value=i),this._valueDuringOnChange=i,e.events.push({type:"onChange"}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(const e of i)this.setState({windowWidth:e.target.clientWidth})}resetValueIfDisabledItem(){const i=c.getFilteredData(this.props),e=this.base.initState(),t=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(i,t)&&(this.triggerOnChange(null,e),this.applyState(e))}haveFocusedItemAndDataNotEmpty(i,e){return e!==void 0&&e!==-1&&i&&i.length>0&&i[e].disabled}};k.displayName="DropDownList",k.propTypes={delay:x.number,ignoreCase:x.bool,iconClassName:x.string,svgIcon:s.svgIconPropType,defaultItem:x.any,valueRender:x.func,valueMap:x.func,validationMessage:x.string,required:x.bool,id:x.string,ariaLabelledBy:x.string,ariaDescribedBy:x.string,ariaLabel:x.string,leftRightKeysNavigation:x.bool,title:x.string,groupField:x.string,list:x.any,skipDisabledItems:x.bool,renderListFilterWrapper:x.bool,...R.propTypes},k.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...R.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let O=k;const W=s.createPropsContext(),U=s.withIdHOC(s.withPropsContext(W,s.withUnstyledHOC(O)));U.displayName="KendoReactDropDownList";exports.DropDownList=U;exports.DropDownListPropsContext=W;exports.DropDownListWithoutContext=O;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Bt=require("react"),C=require("prop-types"),o=require("@progress/kendo-react-common"),_t=require("@progress/kendo-react-labels"),et=require("@progress/kendo-svg-icons"),Ht=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),tt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),rt=require("../common/DropDownBase.js"),p=require("../common/utils.js"),jt=require("../package-metadata.js"),nt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Ke=require("../messages/index.js"),pe=require("../common/constants.js"),Me=require("@progress/kendo-react-layout");function $t(h){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const k in h)if(k!=="default"){const B=Object.getOwnPropertyDescriptor(h,k);Object.defineProperty(Y,k,B.get?B:{enumerable:!0,get:()=>h[k]})}}return Y.default=h,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",me=s.forwardRef((h,Y)=>{o.validatePackage(jt.packageMetadata);const k=o.useUnstyled(),B=o.useId(h.id),r=o.usePropsContext(ot,h),{delay:at=P.delay,tabIndex:st=P.tabIndex,ignoreCase:ge=P.ignoreCase,size:$=P.size,rounded:be=P.rounded,fillMode:fe=P.fillMode,groupMode:Qt=P.groupMode}=r,ve=()=>{if(o.canUseDOM)return H.current&&H.current.ownerDocument||window.document},it=()=>{var e,n;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((n=t==null?void 0:t.current)==null||n.wrapper.focus({preventScroll:!0}))},N=()=>{let e;return T.current!==void 0&&T.current!==null?e=T.current:r.value!==void 0?e=r.value:f.value!==void 0&&f.value!==null?e=f.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!p.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},lt=()=>{const{dataItemKey:e}=r,n=p.getFilteredData(h),i=N();return n.findIndex(u=>p.areSame(u,i,e))},De=()=>r.required!==void 0?r.required:P.required,we=()=>{const e=r.validationMessage!==void 0,n=N(),i=!De()||n!==null&&n!==""&&n!==void 0,u=r.valid!==void 0?r.valid:i;return{customError:e,valid:u,valueMissing:n===null}},ct=()=>r.validityStyles!==void 0?r.validityStyles:P.validityStyles,ee=e=>{ne.current=!0,e.focus(),window.setTimeout(()=>ne.current=!1,30)},Ie=()=>{Q.current&&ee(Q.current),r.adaptive&&setTimeout(()=>{Q.current&&ee(Q.current)},300)},dt=e=>{for(const n of e)n.target.clientWidth!==re.current.windowWidth&&U({windowWidth:n.target.clientWidth})},Pe=()=>{te.current&&te.current.setCustomValidity&&te.current.setCustomValidity(we().valid?"":r.validationMessage||Jt)},_=(e,n)=>{const i=N();p.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),T.current=e,n.events.push({type:"onChange"}))},M=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),T.current=void 0},J=(e,n)=>{var c;const{virtual:i,dataItemKey:u,defaultItem:d}=r,m=p.getFilteredData(h),I=i?i.skip:0,v=N(),a=e===-1&&d!==void 0?d:m[e-I],g=!p.areSame(a,v,u);_(a,n),g&&((c=t==null?void 0:t.current)==null||c.triggerPageChangeCornerItems(a,n))},O=(e,n,i)=>{var x,D;const{defaultItem:u,dataItemKey:d,virtual:m={skip:0,total:0,pageSize:0}}=r,I=N(),v=p.getFilteredData(h),a=(x=t==null?void 0:t.current)==null?void 0:x.vs,g=v.findIndex(y=>p.areSame(y,I,d)),c=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:m.skip+g,max:(a!=null&&a.enabled?m.total:v.length)-1,min:u!==void 0?-1:0,keyCode:n,skipItems:i||void 0});c!==void 0&&J(c,e),M(e)},ut=e=>{H.current=e,t.current.wrapper=e},pt=e=>s.createElement("select",{name:r.name,ref:n=>{te.current=n},tabIndex:-1,"aria-hidden":!0,title:r.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:r.valueMap?r.valueMap.call(void 0,e):e})),ye=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:u=p.itemIndexStartsWith,filterable:d,skipDisabledItems:m=!0}=r,I=N(),v=p.getFilteredData(h),a=r.filter?r.filter:f.text;return m&&e&&!a&&!I?v.findIndex(g=>!g.disabled&&g[e]):p.isPresent(I)&&a===void 0||d&&a===""?v.findIndex(g=>p.areSame(g,I,n)):a?xe.current?u(v,a,e):v.findIndex(g=>p.areSame(g,I,n)):i.skip===0?0:-1},Fe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=p.getFilteredData(h),n=t.current.initState(),i=ye();Fe(e,i)&&(_(null,n),M(n))},Se=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,f.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),M(n)},Oe=e=>{var F,de,z,ue,j,Ze,Re;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:u,leftRightKeysNavigation:d=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:v="",textField:a,skipDisabledItems:g=!0}=r,c=p.getFilteredData(h),x=N(),D=c.findIndex(L=>p.areSame(L,x,I)),y=r.opened!==void 0?r.opened:f.opened,l=e.keyCode,b=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!y&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),R=y&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=d&&(l===o.Keys.left||l===o.Keys.right),ce=K||le&&!n||b,E=t.current.initState();if(E.syntheticEvent=e,!i){if(b&&((F=t==null?void 0:t.current)!=null&&F.vs.enabled))l===o.Keys.home?m.skip!==0?((de=t==null?void 0:t.current)==null||de.triggerOnPageChange(E,0,m.pageSize),A.current=!0):_(c[0],E):m.skip<m.total-m.pageSize?((z=t==null?void 0:t.current)==null||z.triggerOnPageChange(E,m.total-m.pageSize,m.pageSize),A.current=!0):_(c[c.length-1],E);else if(y&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(y&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(y&&l===o.Keys.enter){const L=ye();Fe(c,L)?(_(null,E),M(E)):J(L,E),(Ze=t==null?void 0:t.current)==null||Ze.togglePopup(E),e.preventDefault()}else if(G||R)R&&he(),(Re=t==null?void 0:t.current)==null||Re.togglePopup(E),e.preventDefault();else if(ce){if(xe.current=!1,v!==""&&a)if(!g&&y)O(E,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.findIndex(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else if(!g&&y||b)O(E,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.find(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else O(E,l);e.preventDefault()}M(E)}},mt=e=>{const n=t.current.initState();n.syntheticEvent=e.syntheticEvent,r.filter===void 0&&(n.data.text=e.target.value),t.current.filterChanged(e.target.value,n),xe.current=!0,M(n),U({group:void 0,text:String(e.target.value)})},Te=()=>{const e=r.filter!==void 0?r.filter:f.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>Q.current=n&&n.element,onChange:mt,onKeyDown:Oe,size:$,rounded:be,fillMode:fe,renderListFilterWrapper:!0})},gt=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),_(r.defaultItem,n),M(n)},Ae=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,u=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:p.areSame(u,n,i),key:"defaultitemkey",onClick:gt})},ft=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),T.current=void 0},vt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:u}=r;let d=p.getFilteredData(h);if(!(!u||!d.length)&&u){const m=Be.current=Be.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*m;d=t.current.getGroupedDataModernMode(d,u);let a=d[0][u];for(let g=1;g<d.length&&!(m*g>v);g++)d[g]&&d[g][u]&&(a=d[g][u]);a!==f.group&&U({group:a})}},qe=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:d,itemRender:m}=r,I=p.getFilteredData(h),v=k&&k.uDropDownList,a=t.current.vs,g=i.skip,c=r.opened!==void 0?r.opened:f.opened,x=t.current.getPopupSettings(),D=`translateY(${a.translate}px)`,y=N();return s.createElement(Gt,{id:Ee,show:c,data:I.slice(),focusedIndex:ye(),value:y,textField:e,valueField:n,optionsGuid:We,groupField:r.groupField,groupMode:"modern",listRef:b=>a.list=t.current.list=b,wrapperStyle:{maxHeight:x.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:ft,itemRender:m,groupHeaderItemRender:u,noDataRender:d,onScroll:vt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},Dt=()=>{var y;const{windowWidth:e=0}=f,{header:n,footer:i,adaptiveTitle:u,groupField:d,groupStickyHeaderItemRender:m,list:I}=r,v=p.getFilteredData(h),a=r.opened!==void 0?r.opened:f.opened,g=k&&k.uDropDownList,c=k&&k.uDropDownsActionSheet,x={navigatable:!1,navigatableElements:[],expand:a,animation:!0,onClose:l=>Se(l),animationStyles:e<=pe.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c,isFullScreen:e<=pe.MOBILE_SMALL_DEVISE}))};let{group:D}=f;return D===void 0&&d!==void 0&&(D=p.getItemValue(v[0],d)),s.createElement(Me.ActionSheet,{...x},s.createElement(Me.ActionSheetHeader,{className:o.classNames(o.uDropDownsActionSheet.header({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c}))},s.createElement("div",null,u)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c}))},s.createElement(nt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Se,icon:"x",svgIcon:et.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c}))},Te())),s.createElement(Me.ActionSheetContent,{overflowHidden:!0},n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},n),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:g,size:$,virtual:(y=t==null?void 0:t.current)==null?void 0:y.vs.enabled}))},Ae(),!I&&D&&v.length!==0&&s.createElement(tt,{group:D,groupMode:"modern",render:m}),qe()),i&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:g}))},i)))},wt=()=>{f.focused&&window.setTimeout(()=>{f.focused&&t.current.wrapper&&ee(t.current.wrapper)})},It=e=>{var n;(n=r.popupSettings)!=null&&n.onMouseDownOutside&&r.popupSettings.onMouseDownOutside.call(void 0,e)},yt=()=>{const{header:e,footer:n,dir:i,groupField:u,groupStickyHeaderItemRender:d,list:m}=r,I=p.getFilteredData(h),v=t.current,a=v.getPopupSettings(),g=r.opened!==void 0?r.opened:f.opened,c=a.width!==void 0?a.width:v.popupWidth,x=k&&k.uDropDownList,D={dir:i!==void 0?i:v.dirCalculated,width:c,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:x})),anchor:a.anchor||H.current,show:g,onOpen:Ie,onClose:wt,onMouseDownOutside:It},itemsCount:[I.length]};let{group:y}=f;return y===void 0&&u!==void 0&&(y=p.getItemValue(I[0],u)),s.createElement(Ht,{...D},Te(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:x}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:x,size:$,virtual:t.current.vs.enabled}))},Ae(),!m&&y&&I.length!==0&&s.createElement(tt,{group:y,groupMode:"modern",render:d}),qe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:x}))},n))},ht=e=>{const{dataItemKey:n}=r,i=p.getFilteredData(h),u=N();let d=i.map((K,G)=>({item:K,itemIndex:G}));const m=W.current.word,I=W.current.last,v=p.sameCharsOnly(m,I);let a=d.length,g=Math.max(0,i.findIndex(K=>p.areSame(K,u,n))),c;r.defaultItem&&(c={item:r.defaultItem,itemIndex:-1},a+=1,g+=1),g+=v?1:0,d=p.shuffleData(d,g,c);let x,D,y,l=0;const{textField:b}=r;for(;l<a;l++)if(x=p.getItemValue(d[l].item,b),D=v&&p.matchText(x,I,ge),y=p.matchText(x,m,ge),D||y){l=d[l].itemIndex;break}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),M(K),T.current=void 0}},St=e=>{clearTimeout(ze.current),r.filterable||(ze.current=window.setTimeout(()=>W.current.word="",at),ht(e))},xt=e=>{ne.current||t.current.handleFocus(e)},Et=e=>{if(ne.current||!f.focused)return;const n=r.opened!==void 0?r.opened:f.opened,{adaptive:i}=r,{windowWidth:u=0}=f,d=u<=pe.MOBILE_MEDIUM_DEVISE&&i,m=t.current.initState();m.syntheticEvent=e,m.data.focused=!1,m.events.push({type:"onBlur"}),n&&he(),n&&!d&&t.current.togglePopup(m),M(m)},Lt=e=>{if(r.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);ge&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),W.current={word:W.current.word+n,last:W.current.last+n},St(e)},Ct=()=>{const e=t.current.initState();e.data.opened=f.opened,t.current.togglePopup(e),M(e)},Ve=s.useRef(null),H=s.useRef(null),te=s.useRef(),Q=s.useRef(null);s.useImperativeHandle(Ve,()=>({get element(){return H.current},get index(){return lt()},get name(){return r.name},get validity(){return we()},get value(){return N()},focus:it,props:r,togglePopup:Ct})),s.useImperativeHandle(Y,()=>Ve.current);const ze=s.useRef(null),W=s.useRef({word:"",last:""}),ne=s.useRef(!1),T=s.useRef(null),A=s.useRef(!1),xe=s.useRef(!1),q=s.useRef({}),re=s.useRef({}),t=s.useRef(new rt({props:h,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Be=s.useRef(0),X=s.useRef(null),[f,kt]=s.useState({}),[,_e]=s.useReducer(e=>e,!0),Nt=Yt.useLocalization(),U=e=>{kt({...f,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:h,setState:U,state:f,forceUpdate:_e,element:H.current,handleItemSelect:J,value:N()})},[U,f,_e,J,N]),s.useEffect(()=>{var g,c,x,D,y,l,b,K,G,R,le,ce,E;const{dataItemKey:e,virtual:n,groupField:i="",textField:u}=r,d=p.getFilteredData(h),m=q.current.virtual?q.current.virtual.total:0,I=r.opened!==void 0?r.opened:f.opened,v=q.current.opened!==void 0?q.current.opened:re.current.opened,a=!v&&I;if((g=t==null?void 0:t.current)==null||g.didUpdate(),(c=t==null?void 0:t.current)!=null&&c.getPopupSettings().animate||a&&Ie(),n&&n.total!==m)(x=t==null?void 0:t.current)==null||x.vs.calcScrollElementHeight(),(D=t==null?void 0:t.current)==null||D.vs.reset();else{const F=N(),de=q.current.value!==void 0?q.current.value:re.current.value;let z=d.findIndex(j=>p.areSame(j,F,e));i!==""&&F&&u&&(z=(l=(y=t==null?void 0:t.current)==null?void 0:y.getGroupedDataModernMode(d,i))==null?void 0:l.map(j=>j[u]).indexOf(F[u]));const ue=!p.areSame(de,F,e);a&&n?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(n,z):a&&!n?(Ie(),d&&d.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(d[0][i],{setState:U,group:f.group,state:f})),(G=t==null?void 0:t.current)==null||G.scrollToItem(z)):I&&v&&F&&ue&&!A.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(z,(R=t==null?void 0:t.current)==null?void 0:R.vs.enabled):I&&v&&A.current&&(A.current&&n&&n.skip===0?(ce=t==null?void 0:t.current)==null||ce.vs.reset():A.current&&n&&n.skip===n.total-n.pageSize&&((E=t==null?void 0:t.current)==null||E.vs.scrollToEnd()))}A.current=!1,re.current=f,q.current=r,Pe()}),s.useEffect(()=>{var e,n;return X.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(i=>dt(i)),(e=t==null?void 0:t.current)==null||e.didMount(),Pe(),(n=ve())!=null&&n.body&&X.current&&X.current.observe(ve().body),()=>{var i;(i=ve())!=null&&i.body&&X.current&&X.current.disconnect()}},[]);const He=B+"-accessibility-id",Ee=B+"-listbox-id",We=B+"-guid",Kt=Nt.toLanguageString(Ke.dropDownListArrowBtnAriaLabel,Ke.messages[Ke.dropDownListArrowBtnAriaLabel]),{style:oe,className:Mt,label:Le,dir:bt,virtual:V,adaptive:Pt,dataItemKey:Ft,disabled:ae,loading:Ue,iconClassName:Ge,svgIcon:je,valueRender:Ye}=r,{windowWidth:Ot=0}=f,Ce=r.opened!==void 0?r.opened:f.opened,se=N(),ke=p.getItemValue(se,r.textField),$e=!ct()||we().valid,ie=t.current,Tt=ie.vs,Je=Ot<=pe.MOBILE_MEDIUM_DEVISE&&Pt,Z=k&&k.uDropDownList;Tt.enabled=V!==void 0,V!==void 0&&(ie.vs.skip=V.skip,ie.vs.total=V.total,ie.vs.pageSize=V.pageSize);const At=p.getFilteredData(h),{focused:qt}=f,Vt=At.findIndex(e=>p.areSame(e,se,Ft)),Qe=s.createElement("span",{id:He,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},ke&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},ke)),zt=Ye!==void 0?Ye.call(void 0,Qe,se):Qe,Xe=s.createElement(s.Fragment,null,s.createElement("span",{ref:ut,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:$,rounded:be,fillMode:fe,focused:qt,disabled:ae,invalid:!$e,loading:Ue,required:De()}),Mt),style:Le?{...oe,width:void 0}:oe,dir:bt,onMouseDown:Ce?e=>{e.target.nodeName!=="INPUT"&&(ee(t.current.wrapper),e.preventDefault())}:void 0,onFocus:xt,onBlur:Et,tabIndex:o.getTabIndex(st,ae),accessKey:r.accessKey,onKeyDown:Oe,onKeyPress:Lt,onClick:ae?void 0:Se,role:"combobox","aria-required":De(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ce||!1,"aria-owns":Ee,"aria-activedescendant":Ce?"option-"+We+"-"+(Vt+(V?V.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||He,"aria-controls":Ee,id:r.id,title:r.title},zt,Ue&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),s.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":Kt,size:$,fillMode:fe,iconClass:Ge,className:o.classNames(o.uDropDownList.inputButton({c:Z})),rounded:null,themeColor:"base",icon:Ge?void 0:"caret-alt-down",svgIcon:je||et.caretAltDownIcon,onMouseDown:e=>f.focused&&e.preventDefault()}),pt(se),!Je&&yt()),Je&&Dt());return Le?s.createElement(_t.FloatingLabel,{label:Le,editorValue:ke,editorValid:$e,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Xe}):Xe});me.propTypes={delay:C.number,ignoreCase:C.bool,iconClassName:C.string,svgIcon:o.svgIconPropType,defaultItem:C.any,valueRender:C.func,valueMap:C.func,validationMessage:C.string,required:C.bool,id:C.string,ariaLabelledBy:C.string,ariaDescribedBy:C.string,ariaLabel:C.string,leftRightKeysNavigation:C.bool,title:C.string,groupField:C.string,list:C.any,skipDisabledItems:C.bool};const P={delay:500,tabIndex:0,ignoreCase:!0,...rt.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};me.displayName="KendoReactDropDownList";const ot=o.createPropsContext();me.displayName="KendoReactDropDownList";exports.DropDownList=me;exports.DropDownListPropsContext=ot;exports.dropDownListDefaultProps=P;