@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.
package/README.md CHANGED
@@ -5,10 +5,11 @@
5
5
  # KendoReact DropDowns Library for React
6
6
 
7
7
  > **Important**
8
- > * This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)—a commercial UI library.
9
- > * You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
10
- > * To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
11
- > * The 30-day free trial gives you access to all the KendoReact components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the KendoReact dev team!
8
+ >
9
+ > - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)—a commercial UI library.
10
+ > - You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
11
+ > - To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
12
+ > - The 30-day free trial gives you access to all the KendoReact components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the KendoReact dev team!
12
13
  >
13
14
  > [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) and speed up your development process!
14
15
 
@@ -16,16 +17,16 @@ The React DropDowns, part of KendoReact, offer a highly customizable interface f
16
17
 
17
18
  What's in this package (ToC):
18
19
 
19
- * [React AutoComplete component](#react-autocomplete-component)
20
- * [React ComboBox component](#react-combobox-component)
21
- * [React MultiColumnComboBox component](#react-multicolumncombobox-component)
22
- * [React DropDown List component](#react-dropdown-list-component)
23
- * [React DropDownTree component](#react-dropdowntree-component)
24
- * [React MultiSelect component](#react-multiselect-component)
25
- * [React MultiSelectTree component](#react-multiselecttree-component)
26
- * [React DropDowns Components Library Features](#react-dropdowns-components-library-features)
27
- * [Support Options](#support-options)
28
- * [Resources](#resources)
20
+ - [React AutoComplete component](#react-autocomplete-component)
21
+ - [React ComboBox component](#react-combobox-component)
22
+ - [React MultiColumnComboBox component](#react-multicolumncombobox-component)
23
+ - [React DropDown List component](#react-dropdown-list-component)
24
+ - [React DropDownTree component](#react-dropdowntree-component)
25
+ - [React MultiSelect component](#react-multiselect-component)
26
+ - [React MultiSelectTree component](#react-multiselecttree-component)
27
+ - [React DropDowns Components Library Features](#react-dropdowns-components-library-features)
28
+ - [Support Options](#support-options)
29
+ - [Resources](#resources)
29
30
 
30
31
  ## React AutoComplete Component
31
32
 
@@ -59,45 +60,45 @@ A combination of a TreeView and a DropDown component, [the KendoReact DropDownTr
59
60
 
60
61
  Among the many features which the KendoReact DropDowns deliver are:
61
62
 
62
- * **Controlled state**—Control the value and popup state of the DropDowns.
63
- * **Filtering**—Filter the data of the DropDowns to easily find any value in a large dataset.
64
- * **Disabled state**—To disable user input or selection, just change a single property.
65
- * **Virtualization support**—The virtualization helps when displaying large sets of data.
66
- * **Custom rendering**—You can replace the value and the popup list item renders with custom ones.
67
- * **Setting the default value**—Easily configure the initial value that the DropDowns render.
68
- * **Form validation**—Validate the values, set validation requirements, and prevent the submission of forms which are in invalid state.
69
- * **Accessibility support**—The DropDowns are compliant with WAI-ARIA, Section 508, and provide keyboard navigation.
70
- * [Theme support](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)—The KendoReact DropDowns, as well as all 100+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
63
+ - **Controlled state**—Control the value and popup state of the DropDowns.
64
+ - **Filtering**—Filter the data of the DropDowns to easily find any value in a large dataset.
65
+ - **Disabled state**—To disable user input or selection, just change a single property.
66
+ - **Virtualization support**—The virtualization helps when displaying large sets of data.
67
+ - **Custom rendering**—You can replace the value and the popup list item renders with custom ones.
68
+ - **Setting the default value**—Easily configure the initial value that the DropDowns render.
69
+ - **Form validation**—Validate the values, set validation requirements, and prevent the submission of forms which are in invalid state.
70
+ - **Accessibility support**—The DropDowns are compliant with WAI-ARIA, Section 508, and provide keyboard navigation.
71
+ - [Theme support](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)—The KendoReact DropDowns, as well as all 100+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
71
72
 
72
73
  ## Support Options
73
74
 
74
75
  For any issues you might encounter while working with the KendoReact DropDowns, use any of the available support channels:
75
76
 
76
- * Industry-leading technical support—KendoReact paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated KendoReact support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
77
- * Product forums—The [KendoReact forums](https://www.telerik.com/forums/kendo-ui-react?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) are part of the free support you can get from the community and from the KendoReact team.
78
- * Feedback portal—The [KendoReact feedback portal](https://feedback.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) is where you can request and vote for new features to be added.
77
+ - Industry-leading technical support—KendoReact paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated KendoReact support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns).
78
+ - Product forums—The [KendoReact forums](https://www.telerik.com/forums/kendo-ui-react?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) are part of the free support you can get from the community and from the KendoReact team.
79
+ - Feedback portal—The [KendoReact feedback portal](https://feedback.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns) is where you can request and vote for new features to be added.
79
80
 
80
81
  ## Resources
81
82
 
82
- * [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
83
- * [Getting Started with the KendoReact DropDowns](https://www.telerik.com/kendo-react-ui/components/dropdowns/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
84
- * [API Reference of the KendoReact DropDowns](https://www.telerik.com/kendo-react-ui/components/dropdowns/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
85
- * [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
86
- * [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
87
- * [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
88
- * [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
89
- * [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
83
+ - [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
84
+ - [Getting Started with the KendoReact DropDowns](https://www.telerik.com/kendo-react-ui/components/dropdowns/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
85
+ - [API Reference of the KendoReact DropDowns](https://www.telerik.com/kendo-react-ui/components/dropdowns/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
86
+ - [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
87
+ - [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
88
+ - [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
89
+ - [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
90
+ - [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-dropdowns)
90
91
 
91
92
  High-level component overview pages
92
93
 
93
- * [React AutoComplete Component](https://www.telerik.com/kendo-react-ui/autocomplete)
94
- * [React ComboBox Component](https://www.telerik.com/kendo-react-ui/combobox)
95
- * [React DropDownList Component](https://www.telerik.com/kendo-react-ui/dropdownlist)
96
- * [React DropDownTree Component](https://www.telerik.com/kendo-react-ui/dropdowntree)
97
- * [React MultiColumn ComboBox Component](https://www.telerik.com/kendo-react-ui/multicolumncombobox)
98
- * [React MultiSelect Component](https://www.telerik.com/kendo-react-ui/multiselect)
99
- * [React MultiSelectTree Component](https://www.telerik.com/kendo-react-ui/multiselecttree)
94
+ - [React AutoComplete Component](https://www.telerik.com/kendo-react-ui/autocomplete)
95
+ - [React ComboBox Component](https://www.telerik.com/kendo-react-ui/combobox)
96
+ - [React DropDownList Component](https://www.telerik.com/kendo-react-ui/dropdownlist)
97
+ - [React DropDownTree Component](https://www.telerik.com/kendo-react-ui/dropdowntree)
98
+ - [React MultiColumn ComboBox Component](https://www.telerik.com/kendo-react-ui/multicolumncombobox)
99
+ - [React MultiSelect Component](https://www.telerik.com/kendo-react-ui/multiselect)
100
+ - [React MultiSelectTree Component](https://www.telerik.com/kendo-react-ui/multiselecttree)
100
101
 
101
- *Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
102
+ _Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
102
103
 
103
- *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
104
+ _Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries._
@@ -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";const v=require("react"),n=require("prop-types"),y=require("./VirtualScrollStatic.js"),S=require("./Navigation.js"),c=require("./utils.js");function b(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const e in l)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(l,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>l[e]})}}return s.default=l,Object.freeze(s)}const P=b(v),a=class a{constructor(s){this.wrapper=null,this.list=null,this.vs=new y.VirtualScroll,this.navigation=new S.Navigation,this.handleItemClick=(e,t)=>{const i=this.initState();i.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,i),this.togglePopup(i),this.applyState(i)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:i,filterable:o}=this.component.props;o&&t.events.push({type:"onFilterChange",filter:{field:i,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,i=t.opened!==void 0?t.opened:this.component.state.opened;t.opened===void 0&&(e.data.opened=!i),i?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const i=this.initState();i.syntheticEvent=t,this.triggerOnPageChange(i,e.skip,e.take),this.applyState(i)},this.scrollToVirtualItem=(e,t)=>{const i=this.vs;if(e.skip===0)i.reset();else{let o=i.translate;o===0&&(i.calcScrollElementHeight(),o=i.itemHeight*e.skip,i.translateTo(o,!0)),t<0&&o>0&&(o+=i.itemHeight*(e.pageSize/4)),i.container&&(i.container.scrollTop=o),this.scrollToItem(t,!0)}},this.scrollPopupByPageSize=e=>{var p,u,d,g,f,m;const t=this.vs,i=(u=(p=this.list)==null?void 0:p.parentElement)==null?void 0:u.scrollTop,o=t.enabled&&t.itemHeight?t.itemHeight:this.list?this.list.children[0].offsetHeight:0,r=(g=(d=this.list)==null?void 0:d.parentElement)==null?void 0:g.offsetHeight;i!==void 0&&r!==void 0&&((m=(f=this.list)==null?void 0:f.parentElement)==null||m.scroll({top:i+e*Math.floor(r/o)*o}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&P.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({...t.state,group:e})},this.listBoxId=s.props.id+"list",this.guid=s.props.id,this.component=s,this.vs.PageChange=this.pageChange}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}didMount(){const s=this.component.props,e=s.popupSettings||{},t=s.style||{},i=e.width;let o=s.opened===!0;i===void 0&&this.calculatePopupWidth(),s.dir===void 0&&t.direction===void 0&&(this.calculateDir(),o=!0),o&&this.component.forceUpdate()}calculateDir(){const s=this.component.element;s&&s.ownerDocument&&s.ownerDocument.defaultView&&(this.dirCalculated=s.ownerDocument.defaultView.getComputedStyle(s).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(s,e,t){const i=this.list||this.vs.list;if(!i&&!t&&setTimeout(()=>{this.scrollToItem(s,e,!0)},10),s===0&&e&&this.vs.skip===0){this.vs.reset();return}if(i&&s>=0){const o=this.vs,r=o.container||i.parentNode,p=e!==void 0?e:o.enabled;c.scrollToItem(r,i,s,o.translate,p)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(s){Object.keys(s.data).length>0&&this.component.setState(s.data);const e={syntheticEvent:s.syntheticEvent,nativeEvent:s.syntheticEvent?s.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};s.events.forEach(t=>{const i=t.type;delete t.type;const o=i&&this.component.props[i];o&&o.call(void 0,{...e,...t})})}triggerOnPageChange(s,e,t){const i=this.component.props.virtual;if(i){const o=Math.min(Math.max(0,e),Math.max(0,i.total-t));o!==i.skip&&s.events.push({type:"onPageChange",page:{skip:o,take:t}})}}triggerPageChangeCornerItems(s,e){const t=this.component.props,{data:i=[],dataItemKey:o,virtual:r}=t,p=t.opened!==void 0?t.opened:this.component.state.opened;s&&r&&this.vs.enabled&&(r.skip>0&&c.areSame(s,i[0],o)?this.triggerOnPageChange(e,r.skip-1,r.pageSize):!p&&r.skip+r.pageSize<r.total&&c.areSame(s,i[i.length-1],o)&&this.triggerOnPageChange(e,r.skip+1,r.pageSize))}getPopupSettings(){return Object.assign({},a.defaultProps.popupSettings,this.component.props.popupSettings)}getAdaptiveAnimation(){const s=this.getPopupSettings();return s.animate!==void 0?s.animate:!0}getGroupedDataModernMode(s,e){const t=[];return s.forEach((i,o)=>{s[o-1]&&i[e]!==s[o-1][e]&&t.push({[e]:i[e]}),t.push(s[o])}),t}};a.basicPropTypes={opened:n.bool,disabled:n.bool,dir:n.string,tabIndex:n.number,accessKey:n.string,data:n.array,textField:n.string,className:n.string,label: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,itemRender:n.func,listNoDataRender:n.func,focusedItemIndex:n.func,header:n.node,footer:n.node},a.propTypes={...a.basicPropTypes,value:n.any,defaultValue:n.any,filterable:n.bool,filter:n.string,virtual:n.shape({pageSize:n.number.isRequired,skip:n.number.isRequired,total:n.number.isRequired}),onFilterChange:n.func,onPageChange:n.func},a.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let h=a;module.exports=h;
8
+ "use client";"use strict";const v=require("react"),n=require("prop-types"),y=require("./VirtualScrollStatic.js"),S=require("./Navigation.js"),c=require("./utils.js");function b(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const P=b(v),a=class a{constructor(e){this.wrapper=null,this.list=null,this.vs=new y.VirtualScroll,this.navigation=new S.Navigation,this.handleItemClick=(t,s)=>{const i=this.initState();i.syntheticEvent=s,s.stopPropagation(),this.component.handleItemSelect(t,i),this.togglePopup(i),this.applyState(i)},this.handleFocus=t=>{if(!this.component.state.focused){const s=this.initState();s.data.focused=!0,s.events.push({type:"onFocus"}),s.syntheticEvent=t,this.applyState(s)}},this.filterChanged=(t,s)=>{const{textField:i,filterable:o}=this.component.props;o&&s.events.push({type:"onFilterChange",filter:{field:i,operator:"contains",ignoreCase:!0,value:t}})},this.togglePopup=t=>{const s=this.component.props,i=s.opened!==void 0?s.opened:this.component.state.opened;s.opened===void 0&&(t.data.opened=!i),i?t.events.push({type:"onClose"}):(t.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(t,s)=>{const i=this.initState();i.syntheticEvent=s,this.triggerOnPageChange(i,t.skip,t.take),this.applyState(i)},this.scrollToVirtualItem=(t,s)=>{const i=this.vs;if(t.skip===0)i.reset();else{let o=i.translate;o===0&&(i.calcScrollElementHeight(),o=i.itemHeight*t.skip,i.translateTo(o,!0)),s<0&&o>0&&(o+=i.itemHeight*(t.pageSize/4)),i.container&&(i.container.scrollTop=o),this.scrollToItem(s,!0)}},this.scrollPopupByPageSize=t=>{var p,u,d,g,f,m;const s=this.vs,i=(u=(p=this.list)==null?void 0:p.parentElement)==null?void 0:u.scrollTop,o=s.enabled&&s.itemHeight?s.itemHeight:this.list?this.list.children[0].offsetHeight:0,r=(g=(d=this.list)==null?void 0:d.parentElement)==null?void 0:g.offsetHeight;i!==void 0&&r!==void 0&&((m=(f=this.list)==null?void 0:f.parentElement)==null||m.scroll({top:i+t*Math.floor(r/o)*o}))},this.renderScrollElement=()=>{const t=this.vs;return t.enabled&&P.createElement("div",{ref:s=>t.scrollElement=s,key:"scrollElementKey"})},this.resetGroupStickyHeader=(t,s)=>{t!==s.state.group&&s.setState({group:t})},this.listBoxId=e.props.id+"list",this.guid=e.props.id,this.component=e,this.vs.PageChange=this.pageChange}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}didMount(){const e=this.component.props,t=e.popupSettings||{},s=e.style||{},i=t.width;let o=e.opened===!0;i===void 0&&this.calculatePopupWidth(),e.dir===void 0&&s.direction===void 0&&(this.calculateDir(),o=!0),o&&this.component.forceUpdate()}calculateDir(){const e=this.component.element;e&&e.ownerDocument&&e.ownerDocument.defaultView&&(this.dirCalculated=e.ownerDocument.defaultView.getComputedStyle(e).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(e,t,s){const i=this.list||this.vs.list;if(!i&&!s&&setTimeout(()=>{this.scrollToItem(e,t,!0)},10),e===0&&t&&this.vs.skip===0){this.vs.reset();return}if(i&&e>=0){const o=this.vs,r=o.container||i.parentNode,p=t!==void 0?t:o.enabled;c.scrollToItem(r,i,e,o.translate,p)}}updateComponentArgs(e){for(let t in e)Object.hasOwnProperty.call(e,t)&&(this.component[t]=e[t])}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(e){Object.keys(e.data).length>0&&this.component.setState(e.data);const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.syntheticEvent?e.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};e.events.forEach(s=>{const i=s.type;delete s.type;const o=i&&this.component.props[i];o&&o.call(void 0,{...t,...s})})}triggerOnPageChange(e,t,s){const i=this.component.props.virtual;if(i){const o=Math.min(Math.max(0,t),Math.max(0,i.total-s));o!==i.skip&&e.events.push({type:"onPageChange",page:{skip:o,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:o,virtual:r}=s,p=s.opened!==void 0?s.opened:this.component.state.opened;e&&r&&this.vs.enabled&&(r.skip>0&&c.areSame(e,i[0],o)?this.triggerOnPageChange(t,r.skip-1,r.pageSize):!p&&r.skip+r.pageSize<r.total&&c.areSame(e,i[i.length-1],o)&&this.triggerOnPageChange(t,r.skip+1,r.pageSize))}getPopupSettings(){return Object.assign({},a.defaultProps.popupSettings,this.component.props.popupSettings)}getAdaptiveAnimation(){const e=this.getPopupSettings();return e.animate!==void 0?e.animate:!0}getGroupedDataModernMode(e,t){const s=[];return e.forEach((i,o)=>{e[o-1]&&i[t]!==e[o-1][t]&&s.push({[t]:i[t]}),s.push(e[o])}),s}};a.basicPropTypes={opened:n.bool,disabled:n.bool,dir:n.string,tabIndex:n.number,accessKey:n.string,data:n.array,textField:n.string,className:n.string,label: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,itemRender:n.func,listNoDataRender:n.func,focusedItemIndex:n.func,header:n.node,footer:n.node},a.propTypes={...a.basicPropTypes,value:n.any,defaultValue:n.any,filterable:n.bool,filter:n.string,virtual:n.shape({pageSize:n.number.isRequired,skip:n.number.isRequired,total:n.number.isRequired}),onFilterChange:n.func,onPageChange:n.func},a.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let h=a;module.exports=h;
@@ -7,86 +7,90 @@
7
7
  */
8
8
  "use client";
9
9
  import * as m from "react";
10
- import s from "prop-types";
10
+ import n from "prop-types";
11
11
  import { VirtualScroll as v } from "./VirtualScrollStatic.mjs";
12
12
  import { Navigation as y } from "./Navigation.mjs";
13
13
  import { scrollToItem as S, areSame as g } from "./utils.mjs";
14
14
  const a = class a {
15
- constructor(n) {
16
- this.wrapper = null, this.list = null, this.vs = new v(), this.navigation = new y(), this.handleItemClick = (i, t) => {
17
- const e = this.initState();
18
- e.syntheticEvent = t, t.stopPropagation(), this.component.handleItemSelect(i, e), this.togglePopup(e), this.applyState(e);
19
- }, this.handleFocus = (i) => {
15
+ constructor(s) {
16
+ this.wrapper = null, this.list = null, this.vs = new v(), this.navigation = new y(), this.handleItemClick = (t, e) => {
17
+ const i = this.initState();
18
+ i.syntheticEvent = e, e.stopPropagation(), this.component.handleItemSelect(t, i), this.togglePopup(i), this.applyState(i);
19
+ }, this.handleFocus = (t) => {
20
20
  if (!this.component.state.focused) {
21
- const t = this.initState();
22
- t.data.focused = !0, t.events.push({ type: "onFocus" }), t.syntheticEvent = i, this.applyState(t);
21
+ const e = this.initState();
22
+ e.data.focused = !0, e.events.push({ type: "onFocus" }), e.syntheticEvent = t, this.applyState(e);
23
23
  }
24
- }, this.filterChanged = (i, t) => {
25
- const { textField: e, filterable: o } = this.component.props;
26
- o && t.events.push({
24
+ }, this.filterChanged = (t, e) => {
25
+ const { textField: i, filterable: o } = this.component.props;
26
+ o && e.events.push({
27
27
  type: "onFilterChange",
28
28
  filter: {
29
- field: e,
29
+ field: i,
30
30
  operator: "contains",
31
31
  ignoreCase: !0,
32
- value: i
32
+ value: t
33
33
  }
34
34
  });
35
- }, this.togglePopup = (i) => {
36
- const t = this.component.props, e = t.opened !== void 0 ? t.opened : this.component.state.opened;
37
- t.opened === void 0 && (i.data.opened = !e), e ? i.events.push({ type: "onClose" }) : (i.events.push({ type: "onOpen" }), this.calculatePopupWidth());
38
- }, this.pageChange = (i, t) => {
39
- const e = this.initState();
40
- e.syntheticEvent = t, this.triggerOnPageChange(e, i.skip, i.take), this.applyState(e);
41
- }, this.scrollToVirtualItem = (i, t) => {
42
- const e = this.vs;
43
- if (i.skip === 0)
44
- e.reset();
35
+ }, this.togglePopup = (t) => {
36
+ const e = this.component.props, i = e.opened !== void 0 ? e.opened : this.component.state.opened;
37
+ e.opened === void 0 && (t.data.opened = !i), i ? t.events.push({ type: "onClose" }) : (t.events.push({ type: "onOpen" }), this.calculatePopupWidth());
38
+ }, this.pageChange = (t, e) => {
39
+ const i = this.initState();
40
+ i.syntheticEvent = e, this.triggerOnPageChange(i, t.skip, t.take), this.applyState(i);
41
+ }, this.scrollToVirtualItem = (t, e) => {
42
+ const i = this.vs;
43
+ if (t.skip === 0)
44
+ i.reset();
45
45
  else {
46
- let o = e.translate;
47
- o === 0 && (e.calcScrollElementHeight(), o = e.itemHeight * i.skip, e.translateTo(o, !0)), t < 0 && o > 0 && (o += e.itemHeight * (i.pageSize / 4)), e.container && (e.container.scrollTop = o), this.scrollToItem(t, !0);
46
+ let o = i.translate;
47
+ o === 0 && (i.calcScrollElementHeight(), o = i.itemHeight * t.skip, i.translateTo(o, !0)), e < 0 && o > 0 && (o += i.itemHeight * (t.pageSize / 4)), i.container && (i.container.scrollTop = o), this.scrollToItem(e, !0);
48
48
  }
49
- }, this.scrollPopupByPageSize = (i) => {
49
+ }, this.scrollPopupByPageSize = (t) => {
50
50
  var r, l, h, c, u, d;
51
- const t = this.vs, e = (l = (r = this.list) == null ? void 0 : r.parentElement) == null ? void 0 : l.scrollTop, o = t.enabled && t.itemHeight ? t.itemHeight : this.list ? this.list.children[0].offsetHeight : 0, p = (c = (h = this.list) == null ? void 0 : h.parentElement) == null ? void 0 : c.offsetHeight;
52
- e !== void 0 && p !== void 0 && ((d = (u = this.list) == null ? void 0 : u.parentElement) == null || d.scroll({
53
- top: e + i * Math.floor(p / o) * o
51
+ const e = this.vs, i = (l = (r = this.list) == null ? void 0 : r.parentElement) == null ? void 0 : l.scrollTop, o = e.enabled && e.itemHeight ? e.itemHeight : this.list ? this.list.children[0].offsetHeight : 0, p = (c = (h = this.list) == null ? void 0 : h.parentElement) == null ? void 0 : c.offsetHeight;
52
+ i !== void 0 && p !== void 0 && ((d = (u = this.list) == null ? void 0 : u.parentElement) == null || d.scroll({
53
+ top: i + t * Math.floor(p / o) * o
54
54
  }));
55
55
  }, this.renderScrollElement = () => {
56
- const i = this.vs;
57
- return i.enabled && /* @__PURE__ */ m.createElement("div", { ref: (t) => i.scrollElement = t, key: "scrollElementKey" });
58
- }, this.resetGroupStickyHeader = (i, t) => {
59
- i !== t.state.group && t.setState({ ...t.state, group: i });
60
- }, this.listBoxId = n.props.id + "list", this.guid = n.props.id, this.component = n, this.vs.PageChange = this.pageChange;
56
+ const t = this.vs;
57
+ return t.enabled && /* @__PURE__ */ m.createElement("div", { ref: (e) => t.scrollElement = e, key: "scrollElementKey" });
58
+ }, this.resetGroupStickyHeader = (t, e) => {
59
+ t !== e.state.group && e.setState({ group: t });
60
+ }, this.listBoxId = s.props.id + "list", this.guid = s.props.id, this.component = s, this.vs.PageChange = this.pageChange;
61
61
  }
62
62
  didUpdate() {
63
63
  this.vs.listTransform && this.vs.list && (this.vs.list.style.transform = this.vs.listTransform, this.vs.listTransform = "");
64
64
  }
65
65
  didMount() {
66
- const n = this.component.props, i = n.popupSettings || {}, t = n.style || {}, e = i.width;
67
- let o = n.opened === !0;
68
- e === void 0 && this.calculatePopupWidth(), n.dir === void 0 && t.direction === void 0 && (this.calculateDir(), o = !0), o && this.component.forceUpdate();
66
+ const s = this.component.props, t = s.popupSettings || {}, e = s.style || {}, i = t.width;
67
+ let o = s.opened === !0;
68
+ i === void 0 && this.calculatePopupWidth(), s.dir === void 0 && e.direction === void 0 && (this.calculateDir(), o = !0), o && this.component.forceUpdate();
69
69
  }
70
70
  calculateDir() {
71
- const n = this.component.element;
72
- n && n.ownerDocument && n.ownerDocument.defaultView && (this.dirCalculated = n.ownerDocument.defaultView.getComputedStyle(n).direction || void 0);
71
+ const s = this.component.element;
72
+ s && s.ownerDocument && s.ownerDocument.defaultView && (this.dirCalculated = s.ownerDocument.defaultView.getComputedStyle(s).direction || void 0);
73
73
  }
74
74
  calculatePopupWidth() {
75
75
  this.wrapper && (this.popupWidth = this.wrapper.offsetWidth + "px");
76
76
  }
77
- scrollToItem(n, i, t) {
78
- const e = this.list || this.vs.list;
79
- if (!e && !t && setTimeout(() => {
80
- this.scrollToItem(n, i, !0);
81
- }, 10), n === 0 && i && this.vs.skip === 0) {
77
+ scrollToItem(s, t, e) {
78
+ const i = this.list || this.vs.list;
79
+ if (!i && !e && setTimeout(() => {
80
+ this.scrollToItem(s, t, !0);
81
+ }, 10), s === 0 && t && this.vs.skip === 0) {
82
82
  this.vs.reset();
83
83
  return;
84
84
  }
85
- if (e && n >= 0) {
86
- const o = this.vs, p = o.container || e.parentNode, r = i !== void 0 ? i : o.enabled;
87
- S(p, e, n, o.translate, r);
85
+ if (i && s >= 0) {
86
+ const o = this.vs, p = o.container || i.parentNode, r = t !== void 0 ? t : o.enabled;
87
+ S(p, i, s, o.translate, r);
88
88
  }
89
89
  }
90
+ updateComponentArgs(s) {
91
+ for (let t in s)
92
+ Object.hasOwnProperty.call(s, t) && (this.component[t] = s[t]);
93
+ }
90
94
  initState() {
91
95
  return {
92
96
  data: {},
@@ -94,100 +98,100 @@ const a = class a {
94
98
  syntheticEvent: void 0
95
99
  };
96
100
  }
97
- applyState(n) {
98
- Object.keys(n.data).length > 0 && this.component.setState(n.data);
99
- const i = {
100
- syntheticEvent: n.syntheticEvent,
101
- nativeEvent: n.syntheticEvent ? n.syntheticEvent.nativeEvent : void 0,
101
+ applyState(s) {
102
+ Object.keys(s.data).length > 0 && this.component.setState(s.data);
103
+ const t = {
104
+ syntheticEvent: s.syntheticEvent,
105
+ nativeEvent: s.syntheticEvent ? s.syntheticEvent.nativeEvent : void 0,
102
106
  target: this.component,
103
107
  value: this.component.value
104
108
  };
105
- n.events.forEach((t) => {
106
- const e = t.type;
107
- delete t.type;
108
- const o = e && this.component.props[e];
109
+ s.events.forEach((e) => {
110
+ const i = e.type;
111
+ delete e.type;
112
+ const o = i && this.component.props[i];
109
113
  o && o.call(void 0, {
110
- ...i,
111
- ...t
114
+ ...t,
115
+ ...e
112
116
  });
113
117
  });
114
118
  }
115
- triggerOnPageChange(n, i, t) {
116
- const e = this.component.props.virtual;
117
- if (e) {
118
- const o = Math.min(Math.max(0, i), Math.max(0, e.total - t));
119
- o !== e.skip && n.events.push({
119
+ triggerOnPageChange(s, t, e) {
120
+ const i = this.component.props.virtual;
121
+ if (i) {
122
+ const o = Math.min(Math.max(0, t), Math.max(0, i.total - e));
123
+ o !== i.skip && s.events.push({
120
124
  type: "onPageChange",
121
- page: { skip: o, take: t }
125
+ page: { skip: o, take: e }
122
126
  });
123
127
  }
124
128
  }
125
- triggerPageChangeCornerItems(n, i) {
126
- const t = this.component.props, { data: e = [], dataItemKey: o, virtual: p } = t, r = t.opened !== void 0 ? t.opened : this.component.state.opened;
127
- n && p && this.vs.enabled && (p.skip > 0 && g(n, e[0], o) ? this.triggerOnPageChange(i, p.skip - 1, p.pageSize) : !r && p.skip + p.pageSize < p.total && g(n, e[e.length - 1], o) && this.triggerOnPageChange(i, p.skip + 1, p.pageSize));
129
+ triggerPageChangeCornerItems(s, t) {
130
+ const e = this.component.props, { data: i = [], dataItemKey: o, virtual: p } = e, r = e.opened !== void 0 ? e.opened : this.component.state.opened;
131
+ s && p && this.vs.enabled && (p.skip > 0 && g(s, i[0], o) ? this.triggerOnPageChange(t, p.skip - 1, p.pageSize) : !r && p.skip + p.pageSize < p.total && g(s, i[i.length - 1], o) && this.triggerOnPageChange(t, p.skip + 1, p.pageSize));
128
132
  }
129
133
  getPopupSettings() {
130
134
  return Object.assign({}, a.defaultProps.popupSettings, this.component.props.popupSettings);
131
135
  }
132
136
  getAdaptiveAnimation() {
133
- const n = this.getPopupSettings();
134
- return n.animate !== void 0 ? n.animate : !0;
137
+ const s = this.getPopupSettings();
138
+ return s.animate !== void 0 ? s.animate : !0;
135
139
  }
136
- getGroupedDataModernMode(n, i) {
137
- const t = [];
138
- return n.forEach((e, o) => {
139
- n[o - 1] && e[i] !== n[o - 1][i] && t.push({ [i]: e[i] }), t.push(n[o]);
140
- }), t;
140
+ getGroupedDataModernMode(s, t) {
141
+ const e = [];
142
+ return s.forEach((i, o) => {
143
+ s[o - 1] && i[t] !== s[o - 1][t] && e.push({ [t]: i[t] }), e.push(s[o]);
144
+ }), e;
141
145
  }
142
146
  };
143
147
  a.basicPropTypes = {
144
- opened: s.bool,
145
- disabled: s.bool,
146
- dir: s.string,
147
- tabIndex: s.number,
148
- accessKey: s.string,
149
- data: s.array,
150
- textField: s.string,
151
- className: s.string,
152
- label: s.string,
153
- loading: s.bool,
154
- popupSettings: s.shape({
155
- animate: s.oneOfType([
156
- s.bool,
157
- s.shape({
158
- openDuration: s.number,
159
- closeDuration: s.number
148
+ opened: n.bool,
149
+ disabled: n.bool,
150
+ dir: n.string,
151
+ tabIndex: n.number,
152
+ accessKey: n.string,
153
+ data: n.array,
154
+ textField: n.string,
155
+ className: n.string,
156
+ label: n.string,
157
+ loading: n.bool,
158
+ popupSettings: n.shape({
159
+ animate: n.oneOfType([
160
+ n.bool,
161
+ n.shape({
162
+ openDuration: n.number,
163
+ closeDuration: n.number
160
164
  })
161
165
  ]),
162
- popupClass: s.string,
163
- className: s.string,
164
- appendTo: s.any,
165
- width: s.oneOfType([s.string, s.number]),
166
- height: s.oneOfType([s.string, s.number])
166
+ popupClass: n.string,
167
+ className: n.string,
168
+ appendTo: n.any,
169
+ width: n.oneOfType([n.string, n.number]),
170
+ height: n.oneOfType([n.string, n.number])
167
171
  }),
168
- onOpen: s.func,
169
- onClose: s.func,
170
- onFocus: s.func,
171
- onBlur: s.func,
172
- onChange: s.func,
173
- itemRender: s.func,
174
- listNoDataRender: s.func,
175
- focusedItemIndex: s.func,
176
- header: s.node,
177
- footer: s.node
172
+ onOpen: n.func,
173
+ onClose: n.func,
174
+ onFocus: n.func,
175
+ onBlur: n.func,
176
+ onChange: n.func,
177
+ itemRender: n.func,
178
+ listNoDataRender: n.func,
179
+ focusedItemIndex: n.func,
180
+ header: n.node,
181
+ footer: n.node
178
182
  }, a.propTypes = {
179
183
  ...a.basicPropTypes,
180
- value: s.any,
181
- defaultValue: s.any,
182
- filterable: s.bool,
183
- filter: s.string,
184
- virtual: s.shape({
185
- pageSize: s.number.isRequired,
186
- skip: s.number.isRequired,
187
- total: s.number.isRequired
184
+ value: n.any,
185
+ defaultValue: n.any,
186
+ filterable: n.bool,
187
+ filter: n.string,
188
+ virtual: n.shape({
189
+ pageSize: n.number.isRequired,
190
+ skip: n.number.isRequired,
191
+ total: n.number.isRequired
188
192
  }),
189
- onFilterChange: s.func,
190
- onPageChange: s.func
193
+ onFilterChange: n.func,
194
+ onPageChange: n.func
191
195
  }, a.defaultProps = {
192
196
  popupSettings: {
193
197
  height: "200px"
@@ -9,11 +9,7 @@
9
9
  import { useUnstyled as i, classNames as c, uDropDownsBase as d } from "@progress/kendo-react-common";
10
10
  import * as l from "react";
11
11
  const m = (e) => {
12
- const {
13
- group: s,
14
- groupMode: n,
15
- render: t
16
- } = e, r = i(), a = r && r.uDropDownsBase, o = /* @__PURE__ */ l.createElement("div", { className: c(d.groupStickyHeader({ c: a })) }, n === "classic" ? s : /* @__PURE__ */ l.createElement("div", { className: c(d.listHeaderText({ c: a })) }, s));
12
+ const { group: s, groupMode: n, render: t } = e, r = i(), a = r && r.uDropDownsBase, o = /* @__PURE__ */ l.createElement("div", { className: c(d.groupStickyHeader({ c: a })) }, n === "classic" ? s : /* @__PURE__ */ l.createElement("div", { className: c(d.listHeaderText({ c: a })) }, s));
17
13
  return t !== void 0 ? t.call(void 0, o, e) : o;
18
14
  };
19
15
  export {
package/common/List.js CHANGED
@@ -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";const T=require("react"),U=require("./ListItem.js"),J=require("./ListGroupItem.js"),f=require("./utils.js"),K=require("@progress/kendo-react-intl"),I=require("../messages/index.js"),n=require("@progress/kendo-react-common");function Q(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(c,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return c.default=e,Object.freeze(c)}const r=Q(T),W=e=>{const c=K.useLocalization(),t=n.useUnstyled(),s=t&&t.uDropDownsBase,{id:k,show:q,wrapperCssClass:B,wrapperStyle:z,listStyle:L,listRef:M,wrapperRef:O,listClassName:j,ariaSetSize:x}=e,S=(()=>{const{textField:u,valueField:i,groupField:v,groupMode:d,isMultiColumn:A,optionsGuid:b,skip:w=0,virtual:C,focusedIndex:N,hasDuplicates:F,highlightSelected:V=!0,value:m,data:R,itemRender:_,groupHeaderItemRender:G}=e,h=Array.isArray(m);let E=0;return R.map((a,o)=>{const D=w+o,p=w+o+E,P=F?m?N===o:!1:a.disabled?!1:V&&(!h&&f.areSame(a,m,i)||h&&m.findIndex(H=>f.areSame(H,a,i))!==-1);let l,g,y;return o>0&&v!==void 0&&(g=f.getItemValue(a,v),y=f.getItemValue(R[o-1],v),g&&y&&g!==y&&(l=g)),l!==void 0&&d==="modern"&&(E+=1),[l!==void 0&&d==="modern"&&r.createElement(J,{id:`option-${b}-${p}`,virtual:C,key:D+"-group-item",group:l,isMultiColumn:A,render:G}),r.createElement(U,{id:`option-${b}-${l!==void 0&&d==="modern"?p+1:p}`,virtual:C,dataItem:a,groupMode:d,selected:P,focused:N===o,index:D,key:D,onClick:e.onClick,textField:u,group:l,render:_,disabled:a.disabled})]})})(),$=()=>{const u=e.noDataRender,i=r.createElement("div",{className:n.classNames(n.uDropDownsBase.noData({c:s}))},r.createElement("div",null,c.toLanguageString(I.nodata,I.messages[I.nodata])));return u?u.call(void 0,i):i};return S.length?r.createElement("div",{className:B,style:z,ref:O,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},r.createElement("ul",{id:k,role:"listbox","aria-hidden":q?void 0:!0,"aria-setsize":x,className:j||n.classNames(n.uDropDownsBase.ul({c:s})),ref:M,style:L},S),e.scroller&&r.createElement("div",{className:n.classNames(n.uDropDownsBase.heightContainer({c:s}))},e.scroller)):$()};module.exports=W;
8
+ "use client";"use strict";const U=require("react"),J=require("./ListItem.js"),K=require("./ListGroupItem.js"),f=require("./utils.js"),Q=require("@progress/kendo-react-intl"),S=require("../messages/index.js"),n=require("@progress/kendo-react-common");function W(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const s=W(U),X=e=>{const l=Q.useLocalization(),t=n.useUnstyled(),r=t&&t.uDropDownsBase,{id:q,show:B,wrapperCssClass:M,wrapperStyle:z,listStyle:L,listRef:O,wrapperRef:j,listClassName:x,ariaSetSize:$}=e,b=(()=>{const{textField:i,valueField:c,groupField:g,groupMode:w,isMultiColumn:F,optionsGuid:C,skip:N=0,virtual:R,focusedIndex:h,hasDuplicates:G,highlightSelected:V=!0,value:u,data:E,itemRender:_,groupHeaderItemRender:P}=e,k=Array.isArray(u);let D=0;return E.map((a,o)=>{const p=N+o,v=N+o+D,H=G?u?h===o:!1:a.disabled?!1:V&&(!k&&f.areSame(a,u,c)||k&&u.findIndex(T=>f.areSame(T,a,c))!==-1);let d,m,y;o>0&&g!==void 0&&(m=f.getItemValue(a,g),y=f.getItemValue(E[o-1],g),m&&y&&m!==y&&(d=m));const I=d!==void 0&&w==="modern";return I?D+=1:D=0,[I&&s.createElement(K,{id:`option-${C}-${v}`,virtual:R,key:p+"-group-item",group:d,isMultiColumn:F,render:P}),s.createElement(J,{id:`option-${C}-${I?v+1:v}`,virtual:R,dataItem:a,groupMode:w,selected:H,focused:h===o,index:p,key:p,onClick:e.onClick,textField:i,group:d,render:_,disabled:a.disabled})]})})(),A=()=>{const i=e.noDataRender,c=s.createElement("div",{className:n.classNames(n.uDropDownsBase.noData({c:r}))},s.createElement("div",null,l.toLanguageString(S.nodata,S.messages[S.nodata])));return i?i.call(void 0,c):c};return b.length?s.createElement("div",{className:M,style:z,ref:j,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},s.createElement("ul",{id:q,role:"listbox","aria-hidden":B?void 0:!0,"aria-setsize":$,className:x||n.classNames(n.uDropDownsBase.ul({c:r})),ref:O,style:L},b),e.scroller&&s.createElement("div",{className:n.classNames(n.uDropDownsBase.heightContainer({c:r}))},e.scroller)):A()};module.exports=X;