@progress/kendo-react-buttons 9.0.0-develop.2 → 9.0.0-develop.4
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/Chip/Chip.mjs +22 -56
- package/Chip/ChipList.mjs +2 -20
- package/Chip/chip-list-contexts.mjs +13 -4
- package/FloatingActionButton/FloatingActionButton.mjs +235 -264
- package/FloatingActionButton/FloatingActionButtonItem.mjs +3 -6
- package/ListButton/ButtonItem.mjs +21 -18
- package/ListButton/utils/popup.js +1 -1
- package/ListButton/utils/popup.mjs +8 -8
- package/README.md +60 -58
- package/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/index.mjs +6 -2
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
- package/toolbar/tools/ToolbarSpacer.mjs +8 -18
package/README.md
CHANGED
|
@@ -5,26 +5,27 @@
|
|
|
5
5
|
# KendoReact Buttons Library for React
|
|
6
6
|
|
|
7
7
|
> **Important**
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
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-buttons)—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-buttons).
|
|
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-buttons) 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-buttons). 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-buttons).
|
|
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-buttons) and speed up your development process!
|
|
14
15
|
|
|
15
16
|
What's in this package (ToC):
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
- [React Button component](#react-button-component)
|
|
19
|
+
- [React ButtonGroup component](#react-buttongroup-component)
|
|
20
|
+
- [React Chip component](#react-chip-component)
|
|
21
|
+
- [React ChipList component](#react-chiplist-component)
|
|
22
|
+
- [React DropDown Button component](#react-dropdown-button-component)
|
|
23
|
+
- [React FloatingActionButton component](#react-floating-action-button-component)
|
|
24
|
+
- [React SplitButton component](#react-splitbutton-component)
|
|
25
|
+
- [React Toolbar component](#react-toolbar-component)
|
|
26
|
+
- [React Buttons Components Library Features](#react-buttons-library-shared-features)
|
|
27
|
+
- [Support Options](#support-options)
|
|
28
|
+
- [Resources](#resources)
|
|
28
29
|
|
|
29
30
|
## React Button Component
|
|
30
31
|
|
|
@@ -32,22 +33,23 @@ What's in this package (ToC):
|
|
|
32
33
|
|
|
33
34
|
### Key Features
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
- **Primary Button**—As a part of several built-in styles for the KendoReact Button, the Primary Button provides a unique highlighted look and feel to the React Button component.
|
|
37
|
+
- **Toggleable Button**—A KendoReact Button that can be toggled showcases a clear representation between the default rendering of the Button and when the Button has been pressed.
|
|
38
|
+
- **Globalization**—The React Button supports being rendered in a right-to-left mode, allowing for it to be used in any globalization or localization scenarios.
|
|
38
39
|
|
|
39
40
|
## React ButtonGroup Component
|
|
40
41
|
|
|
41
42
|
[The KendoReact ButtonGroup](https://www.telerik.com/kendo-react-ui/components/buttons/buttongroup/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons) is a container for two or more React Button components which can be separately configured to display only textual content, or show predefined icons, images and custom icons.
|
|
43
|
+
|
|
42
44
|
## React Chip Component
|
|
43
45
|
|
|
44
46
|
[The React Chip component](https://www.telerik.com/kendo-react-ui/components/buttons/chip/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons) is responsible for a single Chip (also called React Pill) and can contain text, an image or avatar (optional) and a built-in icon, such as an "X," to indicate that an action can be taken.
|
|
45
47
|
|
|
46
48
|
### Key Features
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
- **Removable Chip**—Through the removable property, React developers can configure whether the KendoReact Chip component should provide a built-in “X” icon to allow users to remove the Chip.
|
|
51
|
+
- **Chip Types**—To provide as much flexibility as possible, the React Chip component has several readily available types, each with its own unique style.
|
|
52
|
+
- **Appearance**—The KendoReact Chip component has two built-in appearance options. The filled option sets a background color of the React Chip and fills in the entire content area.
|
|
51
53
|
|
|
52
54
|
## React ChipList Component
|
|
53
55
|
|
|
@@ -55,8 +57,8 @@ What's in this package (ToC):
|
|
|
55
57
|
|
|
56
58
|
### Key Features
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
- **Selection Mode**—To ensure flexibility, the KendoReact ChipList component provides several selection modes.The default mode is “none”, which means no chips can be selected, yet you can enable single and multiple selection to help users manage their items individually or in bulk.
|
|
61
|
+
- **Data Binding**—As the KendoReact ChipList component deals with displaying and manipulating a collection of items, you can bind it to different data sources.
|
|
60
62
|
|
|
61
63
|
## React DropDown Button Component
|
|
62
64
|
|
|
@@ -64,8 +66,8 @@ What's in this package (ToC):
|
|
|
64
66
|
|
|
65
67
|
### Key Features
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
- **Icon DropDownButton**—The KendoReact DropDownButton can be displayed as just an icon, or with a mix of text and icons as a part of its main content.
|
|
70
|
+
- **Data Binding**—Beyond being declaratively built, the KendoReact DropDownButton component can be data bound to an array of strings or an array of objects.
|
|
69
71
|
|
|
70
72
|
## React Floating Action Button Component
|
|
71
73
|
|
|
@@ -73,9 +75,9 @@ What's in this package (ToC):
|
|
|
73
75
|
|
|
74
76
|
### Key Features
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
- **Content Types**—The content within the KendoReact Floating Action Button can be completely customized through the available properties. Access the icon, iconClass and text properties to define the React Floating Action Button icon, apply a custom CSS class to control the style of the button and set text displayed within the component.
|
|
79
|
+
- **Speed Dial**—If additional action items should be available to users, the speed dial feature of the KendoReact Floating Action Button is the perfect solution.
|
|
80
|
+
- **Positioning**—The KendoReact Floating Action Button provides several configuration options to assist with defining where the React component should be displayed within the application. The position can be set through easy-to-remember options like “start”, “center”, “end”, “top”, “middle” and “bottom”.
|
|
79
81
|
|
|
80
82
|
## React SplitButton Component
|
|
81
83
|
|
|
@@ -83,8 +85,8 @@ What's in this package (ToC):
|
|
|
83
85
|
|
|
84
86
|
### Key Features
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
- **Icon SplitButton**—Each item within the KendoReact SplitButton can be rendered as just text, text along with an icon, or just as an icon.
|
|
89
|
+
- **Data Binding**—The React SplitButton can be defined declaratively and can also be bound to an array of strings, or an array of objects.
|
|
88
90
|
|
|
89
91
|
## React Toolbar Component
|
|
90
92
|
|
|
@@ -92,49 +94,49 @@ What's in this package (ToC):
|
|
|
92
94
|
|
|
93
95
|
### Key Features
|
|
94
96
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
- **Tools**—Within the KendoReact Toolbar, the Tools can be rendered as a Button, ButtonGroup, DropDownButton and SplitButtons. Of course, custom buttons can also be added.
|
|
98
|
+
- **Globalization**—The React Toolbar fully supports right-to-left (RTL) scenarios, ensuring that the component can be added in to any application, no matter what requirements for layout your applications have.
|
|
97
99
|
|
|
98
100
|
## React Buttons Components Library Features
|
|
99
101
|
|
|
100
102
|
Among the many features which the KendoReact Buttons deliver are:
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
- **Disabled state**—To disable user interaction, just change a single property.
|
|
105
|
+
- **Custom rendering**—You can replace the content of the buttons with custom icons, text and elements.
|
|
106
|
+
- **Keyboard navigation**—You can interact with the buttons using only the keyboard.
|
|
107
|
+
- **Accessibility support**—The Buttons are compliant with WAI-ARIA and Section 508.
|
|
108
|
+
- [**Theme support**](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons)—The KendoReact Buttons, 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.
|
|
107
109
|
|
|
108
110
|
## Support Options
|
|
109
111
|
|
|
110
112
|
For any issues you might encounter while working with the KendoReact Buttons, use any of the available support channels:
|
|
111
113
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
- 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-buttons).
|
|
115
|
+
- 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-buttons) are part of the free support you can get from the community and from the KendoReact team.
|
|
116
|
+
- 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-buttons) is where you can request and vote for new features to be added.
|
|
115
117
|
|
|
116
118
|
## Resources
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
- [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-buttons)
|
|
121
|
+
- [Getting Started with the KendoReact Buttons](https://www.telerik.com/kendo-react-ui/components/buttons/get-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons)
|
|
122
|
+
- [API Reference of the KendoReact Buttons](https://www.telerik.com/kendo-react-ui/components/buttons/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons)
|
|
123
|
+
- [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-buttons)
|
|
124
|
+
- [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-buttons)
|
|
125
|
+
- [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-buttons)
|
|
126
|
+
- [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-buttons)
|
|
127
|
+
- [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-buttons)
|
|
126
128
|
|
|
127
129
|
High-level component overview pages
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
- [React Button Component](https://www.telerik.com/kendo-react-ui/button)
|
|
132
|
+
- [React ButtonGroup Component](https://www.telerik.com/kendo-react-ui/buttongroup)
|
|
133
|
+
- [React Chip Component](https://www.telerik.com/kendo-react-ui/chip)
|
|
134
|
+
- [React ChipList Component](https://www.telerik.com/kendo-react-ui/chiplist)
|
|
135
|
+
- [React DropDownButton Component](https://www.telerik.com/kendo-react-ui/dropdownbutton)
|
|
136
|
+
- [React Floating Action Button](https://www.telerik.com/kendo-react-ui/floatingactionbutton)
|
|
137
|
+
- [React SplitButton Component](https://www.telerik.com/kendo-react-ui/splitbutton)
|
|
138
|
+
- [React Toolbar Component](https://www.telerik.com/kendo-react-ui/toolbar)
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
_Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
_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
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,s,n,o,i){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var r=a(t);const l={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};const d=class e extends r.Component{constructor(e){super(e),this._element=null,this.handleClick=e=>{this.toggleIfApplicable(),this.props.onClick&&this.props.onClick.call(void 0,e)},n.validatePackage(l),this.state={selected:!0===this.props.togglable&&!0===this.props.selected}}get element(){return this._element}get selected(){return void 0!==this._selectedTemp?this._selectedTemp:this.state.selected}static getDerivedStateFromProps(e,t){return e.togglable&&void 0!==e.selected&&e.selected!==t.selected?{selected:e.selected}:null}render(){const{children:t,togglable:s,icon:o,iconClass:i,svgIcon:a,imageUrl:l,imageAlt:d,className:c,startIcon:u,endIcon:p,onClick:h,size:m=e.defaultProps.size,rounded:f=e.defaultProps.rounded,fillMode:g=e.defaultProps.fillMode,themeColor:v=e.defaultProps.themeColor,...b}=this.props,y=void 0!==a||void 0!==o||void 0!==i||void 0!==l,k=void 0!==t,C=this.context&&this.context.uButton,I=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:i,buttonClasses:a}){return e?r.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:a})),alt:i,src:e}):t||o?r.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:a})),name:t,icon:o}):s?r.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:a}),s)}):null}({name:o,svgIcon:a,iconClass:i,imageUrl:l,imageAlt:d,buttonClasses:C}),x=e=>r.cloneElement(e,{className:n.classNames(n.uButton.icon({c:C}))});return r.createElement("button",{ref:e=>this._element=e,"aria-pressed":s?this.state.selected:void 0,...b,onClick:this.handleClick,className:n.classNames(n.uButton.wrapper({c:C,isRtl:"rtl"===this.props.dir,selected:this.state.selected,disabled:this.props.disabled,size:m,fillMode:g,rounded:f,themeColor:v,iconButton:!k&&y}),c)},u&&x(u),I,t&&r.createElement("span",{className:n.classNames(n.uButton.text({c:C}))},t),p&&x(p))}toggleIfApplicable(){if(this.props.togglable&&void 0===this.props.selected){const e=!this.state.selected;this._selectedTemp=e,this.setState({selected:e},(()=>this._selectedTemp=void 0))}}};d.propTypes={children:s.node,selected:s.bool,togglable:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,imageAlt:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"flat","link","outline","solid","clear"]),themeColor:s.oneOf([null,"base","primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"])},d.defaultProps={togglable:!1,size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let c=d;c.contextType=n.UnstyledContext;const u=class extends r.Component{constructor(e){super(e),this._element=null,n.validatePackage(l)}render(){const{children:e,className:t,dir:s,disabled:o,unstyled:i,width:a}=this.props,l=i&&i.uButtonGroup,d=this.mapButtons(e),c=n.classNames(n.uButtonGroup.wrapper({c:l,stretched:!!a,disabled:o}),t),u={className:c,style:{width:`${a}`},dir:s,role:"group","aria-disabled":o};return r.createElement("div",{ref:e=>{this._element=e},...u,className:c},d)}mapButtons(e){const t=r.Children.count(e),s=void 0!==this.props.dir?"rtl"===this.props.dir:this._element&&"rtl"===getComputedStyle(this._element).direction||!1;return r.Children.map(e,((e,o)=>{if(r.isValidElement(e)){const{unstyled:i}=this.props,a=i&&i.uButtonGroup,r=o===t-1,l=s,d=n.classNames(e.props.className,n.uButtonGroup.position({c:a,start:l?r:0===o,end:l?0===o:r}));return this.renderButton(e,d)}return e}))}renderButton(e,t){const s={...this.props.width?{width:this.props.width}:{},...e.props.style||{}},n=this.props.disabled||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return r.Children.count(e.props.children)>0?r.cloneElement(e,o,e.props.children):r.cloneElement(e,o)}};u.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};let p=u;const h=e=>{const t=n.useUnstyled(),s=t&&t.uDropDownButton,o=r.useCallback((t=>{e.onClick(t,e.index)}),[e]),i=e.dataItem.render||e.item||(void 0===e.item?e.render:null),a=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,l=r.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:s,focused:e.focused}),e.className),tabIndex:-1,onClick:o,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},r.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:s,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},i?r.createElement(i,{item:e.dataItem,itemIndex:e.index}):r.createElement(r.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&r.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&r.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),a&&r.createElement("span",{className:"k-menu-link-text"},a))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,l,e):l};h.displayName="KendoReactButtonItem";const m=class extends r.Component{render(){return null}};m.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let f=m;const g=(e,t,s,o)=>{if(s)return e;const i=Math.min(o-1,Math.max(0,e));switch(t){case n.Keys.enter:case n.Keys.space:case n.Keys.esc:return-1;case n.Keys.up:case n.Keys.left:return i-1<0?o-1:i-1;case n.Keys.down:case n.Keys.right:return i+1>=o?0:i+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function v(e){let t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function b(e){let t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const y=class extends r.Component{constructor(e){super(e),this.state={focused:!1,focusedIndex:-1,opened:!1},this.wrapper=null,this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setState({focusedIndex:0}),this.setOpen(!0,e)));let s;if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){if(e.preventDefault(),this.dispatchClickEvent(e,t),t>=0){s={focusedIndex:this.opened?-1:0};const t=!this.opened;this.setOpen(t,e)}}else if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=g(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const i=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(i||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}s&&this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.onFocus=e=>{this.skipFocus||(n.dispatchEvent(this.props.onFocus,e,this,void 0),this.setState({focused:!0}))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.opened&&this.setState({focusedIndex:0}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onSplitPartClick=e=>{if(this.buttonsData.length){const t=!this.opened;this.setState({focusedIndex:t?0:-1,focused:!0}),this.setOpen(t,e)}},this.onDownSplitPart=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},n.validatePackage(l)}get guid(){return this.props.id?this.props.id+"-accessibility-id":this.props.id}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===f)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:a,disabled:l}=this.props;return r.createElement("div",{id:s,style:o,className:n.classNames("k-split-button","k-button-group",{"k-focus":this.state.focused},`k-rounded-${n.kendoThemeMaps.roundedMap[this.props.rounded||"medium"]}`,this.props.className),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,dir:t,ref:e=>this.wrapper=e},r.createElement(c,{ref:e=>this.mainButton=e&&e.element,type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,onClick:e=>this.onItemClick(e,-1),disabled:l||void 0,tabIndex:a,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,imageUrl:this.props.imageUrl,dir:t,"aria-disabled":l,"aria-haspopup":!0,"aria-expanded":this.opened||void 0,"aria-label":this.props.ariaLabel,"aria-controls":this.opened?this.guid:void 0,id:"button-"+this.guid,title:this.props.title},this.props.text),r.createElement(c,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:i.caretAltDownIcon,className:"k-split-button-arrow",disabled:l||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMouseDown:this.onDownSplitPart,onPointerDown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"}),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||(-1===t?n.dispatchEvent(this.props.onButtonClick,e,this,void 0):n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t}))}renderPopup(e){const{popupSettings:t={}}=this.props,{focusedIndex:s}=this.state;return r.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||b(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"menu",id:this.guid,"aria-labelledby":"button-"+this.guid,tabIndex:-1,ref:this.listRef,"aria-activedescendant":s>=0?`${this.guid}-${s}`:void 0,className:n.classNames("k-menu-group",{[`k-menu-group-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size})},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props;return this.buttonsData.length>0?this.buttonsData.map(((o,i)=>r.createElement(h,{className:n.classNames("k-menu-item",{"k-first":0===i},{"k-last":i===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===i,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,key:i,index:i,id:`${this.guid}-${i}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};y.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onButtonClick:s.func,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,text:s.string,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.any,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},y.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let k=y;const C=class extends r.Component{render(){return null}};C.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let I=C;const x=class extends r.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setOpen(!0,e),this.setState({focusedIndex:0})));const s={...this.state};if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){e.preventDefault(),t>=0&&this.dispatchClickEvent(e,t);const s=!this.opened;return this.setState({focused:!0,focusedIndex:s?0:-1}),void this.setOpen(s,e)}if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=g(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const i=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(i||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.handleFocus=e=>{this.skipFocus||(this.setState({focused:!0,focusedIndex:this.opened?0:-1}),n.dispatchEvent(this.props.onFocus,e,this,void 0))},this.handleButtonBlur=e=>{this.opened||(this.setState({focused:!1}),n.dispatchEvent(this.props.onBlur,e,this,void 0))},this.handleMenuBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.setState({focusedIndex:-1}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.mouseDown=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onClickMainButton=e=>{if(!this.buttonsData.length)return;const t=!this.opened;this.setState({focused:!0,focusedIndex:t?0:-1}),this.setOpen(t,e)},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},n.validatePackage(l)}get guid(){return this.props.id+"-accessibility-id"}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){const e=this.isRtl(),t=this.context&&this.context.uDropDownButton,s=e?"rtl":void 0,{id:o,style:i,tabIndex:a,disabled:l,size:d,rounded:u,fillMode:p,themeColor:h,ariaLabel:m,title:f,accessKey:g,icon:v,svgIcon:b,iconClass:y,buttonClass:k,className:C,imageUrl:x,startIcon:D,endIcon:w}=this.props;return this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===I)).map((e=>e.props)),r.createElement(r.Fragment,null,r.createElement(c,{id:o,size:d,style:i,rounded:u,fillMode:p,themeColor:h,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":l?"true":void 0,tabIndex:a,accessKey:g,icon:v,svgIcon:b,iconClass:y,className:n.classNames(k,C,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:l})),imageUrl:x,dir:s,ref:e=>this.mainButton=e&&e.element,type:"button","aria-expanded":this.opened?"true":"false","aria-label":m,"aria-controls":this.opened?this.guid:void 0,title:f,startIcon:D,endIcon:w},this.props.text),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t})}renderPopup(e){const{popupSettings:t={},id:s}=this.props,i=this.context&&this.context.uDropDownButton,{focusedIndex:a}=this.state;return r.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:i}),t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||b(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":a>=0?`${this.guid}-${a}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:i,size:this.props.size}))},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props,o=this.context&&this.context.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((i,a)=>r.createElement(h,{className:n.classNames(n.uDropDownButton.item({c:o}),i.className,{"k-first":0===a},{"k-last":a===this.buttonsData.length-1}),dataItem:i,textField:s,focused:this.state.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:a,key:a,id:`${this.guid}-${a}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.mainButton&&"rtl"===getComputedStyle(this.mainButton).direction}};x.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.func,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},x.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let D=x;D.contextType=n.UnstyledContext;const w=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",N=["button"+w,".k-button-group > button"+w,".k-colorpicker",".k-dropdownlist"],E=class e extends r.Component{constructor(t){super(t),this._element=null,this.offsetHeight=0,this.offsetWidth=0,this.buttons=[],this.focusedSelector=this.selectors.map((e=>e+":focus")).join(","),this.setTabIndex=t=>{const{tabIndex:s=e.defaultProps.tabIndex}=this.props;this.buttons.forEach(((e,n)=>{e.tabIndex=n===t?s:-1}))},this.onKeyDown=e=>{const t=e.target;if(e.keyCode!==n.Keys.left&&e.keyCode!==n.Keys.right&&e.keyCode!==n.Keys.home&&e.keyCode!==n.Keys.end||e.defaultPrevented||-1===this.buttons.findIndex((e=>e===t)))return;const s=this.focusedIndex;e.keyCode===n.Keys.left?this.focusButton(s,0===s?this.buttons.length-1:s-1):this.focusButton(s,s===this.buttons.length-1?0:s+1),e.keyCode===n.Keys.home&&this.focusButton(s,0),e.keyCode===n.Keys.end&&this.focusButton(s,this.buttons.length-1)},this.onWindowResize=e=>{const t=this.element;if(!t)return;const s=t.offsetWidth,n=t.offsetHeight;if(this.offsetWidth!==s||this.offsetHeight!==n){this.offsetWidth=s,this.offsetHeight=n;const t={offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight};this.props.onResize&&this.props.onResize.call(void 0,{target:this,...t,nativeEvent:e})}},n.validatePackage(l)}get selectors(){return this.props.buttons||N}get focusedIndex(){const e=this.element&&this.element.querySelector(this.focusedSelector);return Math.max(0,this.buttons.findIndex((t=>t===e)))}get element(){return this._element}componentDidMount(){window.addEventListener("resize",this.onWindowResize);const e=this.element;e&&(this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,!1!==this.props.keyboardNavigation&&(this.buttons=Array.from(e.querySelectorAll(this.selectors.join(","))),this.setTabIndex(0)))}componentDidUpdate(){const e=this.element;!e||!1===this.props.keyboardNavigation||(this.buttons=Array.from(e.querySelectorAll(this.selectors.join(","))),this.setTabIndex(this.focusedIndex))}componentWillUnmount(){window.removeEventListener("resize",this.onWindowResize),this.buttons.length=0}render(){return r.createElement("div",{id:this.props.id,"aria-label":this.props.ariaLabel,className:n.classNames("k-toolbar k-toolbar-solid",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),style:this.props.style,role:void 0!==this.props.role?this.props.role||void 0:"toolbar",dir:this.props.dir,ref:e=>this._element=e,onKeyDown:!1!==this.props.keyboardNavigation?this.onKeyDown:void 0},this.props.children)}focusButton(t,s){const{tabIndex:n=e.defaultProps.tabIndex}=this.props,o=this.buttons[s];if(o){o.tabIndex=n,o.focus();const e=this.buttons[t];e&&(e.tabIndex=-1)}}};E.propTypes={tabIndex:s.number,dir:s.string,keyboardNavigation:s.bool,style:s.object,className:s.string,role:s.string,onResize:s.func,buttons:s.arrayOf(s.string),size:s.oneOf([null,"small","medium","large"])},E.defaultProps={tabIndex:0,size:"medium"};let K=E;const B=class extends r.PureComponent{constructor(){super(...arguments),this._element=null}get element(){return this._element}render(){return r.createElement("div",{id:this.props.id,className:n.classNames("k-toolbar-item",this.props.className),style:this.props.style,ref:e=>this._element=e},this.props.children)}};B.propTypes={className:s.string};let O=B;class S extends r.PureComponent{render(){return r.createElement("div",{className:n.classNames("k-separator",this.props.className)})}}const z=r.forwardRef(((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,(()=>({element:s.current}))),r.useImperativeHandle(t,(()=>({element:s.current})));const i=r.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return r.createElement("span",{ref:s,className:i})}));z.displayName="KendoReactToolbarSpacer",z.propTypes={className:s.string};const P=t.createContext([null,e=>{}]),M=t.createContext([null,e=>{}]),T=t.createContext([null,e=>{}]);var F=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(F||{});var R=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(R||{});var A=(e=>(e.toggle="toggle",e.remove="remove",e))(A||{});const $=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{disabled:a=W.disabled,fillMode:d=W.fillMode,themeColor:c=W.themeColor,size:u=W.size,rounded:p=W.rounded,dir:h=W.dir,removeIcon:m=W.removeIcon,removeSvgIcon:f=W.removeSvgIcon,removable:g=W.removable}=e,v=n.useDir(o,h);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const[b,y]=r.useContext(P),[k,C]=r.useContext(M),[,I]=r.useContext(T),x=r.useMemo((()=>e.selected||(Array.isArray(b)?b.some((t=>t===e.value)):b===e.value)),[e.selected,e.value,b]),D=r.useMemo((()=>k===e.value),[e.value,k]);r.useEffect((()=>{D&&o.current&&o.current.focus()}),[D]);const w=r.useCallback((t=>{y({type:A.toggle,payload:e.value,event:t})}),[y,e.value]),N=r.useCallback((t=>{g&&(I({type:R.remove,payload:e.value,event:t}),C({type:F.reset,payload:e.value,event:t}),y({type:A.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,g,I,C,y]),E=r.useCallback((t=>{switch(t.keyCode){case n.Keys.left:C({type:F.prev,payload:e.value,event:t});break;case n.Keys.right:C({type:F.next,payload:e.value,event:t});break;case n.Keys.enter:y({type:A.toggle,payload:e.value,event:t});break;case n.Keys.delete:N(t)}e.onKeyDown&&e.onKeyDown.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onKeyDown,e.value,C,y,N]),K=r.useCallback((t=>{C({payload:e.value,type:F.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,C]),B=r.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),O=n.useMouse(e,s,{onClick:w});return r.createElement("div",{...O,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:v,tabIndex:n.getTabIndex(e.tabIndex,a,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===v,"k-disabled":a,"k-selected":x,"k-focus":D,[`k-chip-${n.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-rounded-${n.kendoThemeMaps.roundedMap[p]||p}`]:p,[`k-chip-${d}`]:d,[`k-chip-${d}-${c}`]:!(!d||!c)},e.className),"aria-pressed":e.role?void 0:x,"aria-disabled":a,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":g?"Enter Delete":void 0,onFocus:K,onBlur:B,onKeyDown:E},x&&(e.selectedIcon||e.selectedSvgIcon)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.selectedIcon?n.toIconName(e.selectedIcon):void 0,icon:e.selectedSvgIcon,size:"small"}),(e.icon||e.svgIcon)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&r.createElement("div",{className:`k-chip-avatar k-avatar k-rounded-${e.avatar.rounded} k-avatar-md k-avatar-solid k-avatar-solid-primary`,style:e.avatar.style},r.createElement("span",{className:"k-avatar-image"},r.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),r.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&r.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),g&&r.createElement("span",{className:"k-chip-actions"},r.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:N},r.createElement(n.IconWrap,{name:m?n.toIconName(m):void 0,icon:f||i.xCircleIcon,size:"small"}))))})),U={id:s.string,text:s.string,value:s.any,dir:s.oneOf(["ltr","rtl"]),removable:s.bool,removeIcon:s.string,removeIconSvg:n.svgIconPropType,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,selectedIcon:s.string,selectedIconSvg:n.svgIconPropType,onRemove:s.func,dataItem:s.any,selected:s.bool,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"outline","solid"]),themeColor:s.oneOf([null,"base","info","success","warning","error"])},W={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:i.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};$.displayName="KendoReactChip",$.propTypes=U;const H=(e,t,s)=>{"multiple"===t.selection?Array.isArray(e)||(e=e?[e]:null):"single"===t.selection&&Array.isArray(e)&&(e=e?e.join(""):null);const[n,o]=r.useState(e);return[n,e=>{const i=((e,t)=>{switch(t.selection){case"single":switch(t.type){case"toggle":if(!Array.isArray(e)||null===e)return t.payload===e?null:t.payload;throw new Error("State cannot be an array in single selection");case"remove":return t.payload===e?null:e;default:return e}case"multiple":switch(t.type){case"toggle":if(Array.isArray(e))return e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload];if(null===e)return[t.payload];throw new Error("State cannot be non-array in multiple selection");case"remove":return Array.isArray(e)?e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload]:e;default:return e}case"none":return null;default:return e}})(t.state||n,{...e,...t});s&&s(i,e.event),"none"!==t.selection&&o(i)}]},j=(e,t,s)=>{const[n,o]=r.useState(e);return[n,e=>{const i=((e,t)=>{switch(t.type){case"add":case"reorder":break;case"remove":return e.filter((e=>e[t.valueField]!==t.payload));default:return e}})(t.state||n,{...e,...t});s&&s(i,e.event),o(i)}]},L=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{id:i,style:a,tabIndex:d,className:c,ariaDescribedBy:u,ariaLabelledBy:p,ariaLabel:h,value:m,defaultData:f=q.defaultData,chip:g=q.chip,disabled:v=q.disabled,size:b=q.size,defaultValue:y=q.defaultValue,selection:k=q.selection,valueField:C=q.valueField,textField:I=q.textField,dir:x=q.dir,onChange:D,onDataChange:w}=e,N=n.useDir(o,x),E=r.useMemo((()=>g||$),[g,$]);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const K=r.useCallback(((e,t)=>{D&&s.current&&D.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[D]),[B,O]=H(m||y,{selection:k,state:m},K),S=r.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[z,F]=j(e.data||f,{state:e.data,valueField:C},S),R=r.useCallback(((e,t)=>(e.push(t[C]),e)),[C]),A=r.useMemo((()=>e.data||z),[e.data,z]),U=r.useMemo((()=>m||B),[m,B]),W=r.useMemo((()=>A.reduce(R,[])),[A,R]),L=r.useCallback((e=>n.getter(C)(e)),[C]),_=r.useCallback((e=>n.getter(I)(e)),[I]),[G,V]=(e=>{const[t,s]=r.useState(null);return[t,t=>{const n=((e,t)=>{const s=t.items.findIndex((t=>t===e));switch(t.type){case"next":return s===t.items.length-1?e:t.items[s+1];case"prev":return 0===s?e:t.items[s-1];case"current":return t.payload;case"reset":return null;default:return e}})(t.payload,{...t,...e});s(n)}]})({items:W}),Z=n.useMouse(e,s);return r.createElement(P.Provider,{value:[U,O]},r.createElement(M.Provider,{value:[G,V]},r.createElement(T.Provider,{value:[A,F]},r.createElement("div",{ref:o,...Z,role:v?void 0:"listbox",id:i,dir:N,style:a,tabIndex:n.getTabIndex(d,v,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===N,"k-disabled":v,[`k-chip-list-${n.kendoThemeMaps.sizeMap[b]||b}`]:b},c),"aria-label":h,"aria-labelledby":p,"aria-describedby":u,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===k},A.map(((e,t)=>r.createElement(E,{role:"option",dataItem:e,size:b,key:[L(e),t].join("-"),text:_(e),value:L(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),_={id:s.string,className:s.string,tabIndex:s.number,data:s.any,defaultData:s.arrayOf(s.any),onDataChange:s.func,value:s.oneOfType([s.any,s.arrayOf(s.any)]),defaultValue:s.oneOfType([s.any,s.arrayOf(s.any)]),onChange:s.func,selection:s.oneOf(["single","none","multiple"]),textField:s.string,valueField:s.string,disabled:s.bool,dir:s.oneOf(["ltr","rtl"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"])},q={chip:$,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};L.displayName="KendoReactChipList",L.propTypes=_;const G=r.forwardRef(((e,t)=>{const{className:s,disabled:o,text:i,icon:a,style:l,id:d,focused:c,tabIndex:u,index:p,dataItem:h,item:m,svgIcon:f,onDown:g,onClick:v,...b}=e,y=r.useRef(null),k=r.useCallback((()=>{y.current&&y.current.focus()}),[]),C=r.useCallback((()=>({element:y.current,focus:k})),[k]);r.useImperativeHandle(t,C);const I=r.useCallback((e=>{v&&void 0!==p&&!o&&v(e,p)}),[v,p]),x=r.useMemo((()=>n.classNames("k-fab-item",{"k-focus":c,"k-disabled":o},s)),[s,o,c]),D=m;return r.createElement("li",{ref:y,id:d,className:x,style:l,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${i||""} floatingactionbutton item`,onClick:I,onMouseDown:g,onPointerDown:g,...b},D?r.createElement(D,{itemIndex:p,item:h}):r.createElement(r.Fragment,null,i&&r.createElement("span",{className:"k-fab-item-text"},i),a||f?r.createElement(n.IconWrap,{className:"k-fab-item-icon",name:a,icon:f}):null))}));G.propTypes={className:s.string,style:s.object,children:s.any,disabled:s.bool,focused:s.bool,index:s.number,icon:s.string,svgIcon:n.svgIconPropType,text:s.string,tabIndex:s.number,customProp:s.any},G.displayName="KendoFloatingActionButtonItem";const V="16px",Z=e=>"number"==typeof e?e+"px":e,J=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},Q=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},X=(e,t)=>({rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[e]["end"===t?"end":"start"]),Y=(e,t,s,n)=>{const o=t.horizontal,i=t.vertical;if(e.current){const a=s&&void 0!==s.x?Z(s.x):V,r=s&&void 0!==s.x?`calc(50% + ${Z(s.x)})`:"50%",l=s&&void 0!==s.y?Z(s.y):V,d=s&&void 0!==s.y?`calc(50% + ${Z(s.y)})`:"50%";e.current.style.setProperty(ee(t,n),"center"===o?r:a),e.current.style.setProperty(te(t),"middle"===i?d:l),n&&(("top"===i||"bottom"===i)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===i&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===i&&"start"===o&&e.current.style.setProperty("left","unset"))}},ee=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},te=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),se=r.forwardRef(((e,t)=>{n.validatePackage(l);const{align:s=ne.align,alignOffset:i,className:a,disabled:d,icon:c,svgIcon:u,iconClass:p,id:h,items:m,item:f,text:g,positionMode:v=ne.positionMode,size:b=ne.size,style:y,rounded:k=ne.rounded,themeColor:C=ne.themeColor,overlayStyle:I,tabIndex:x,accessKey:D,popupSettings:w={},modal:N,onClick:E,onItemClick:K,onFocus:B,onBlur:O,onKeyDown:S,onOpen:z,onClose:P,...M}=e,T=n.useZIndexContext(),F=T?T+2:100,R=r.useRef(null),A=r.useRef(null),$=r.useRef(null),U=r.useRef(null),W=r.useCallback((()=>{A.current&&A.current.focus()}),[]),H=r.useCallback((()=>({element:A.current,focus:W})),[W]);r.useImperativeHandle(R,H),r.useImperativeHandle(t,(()=>R.current));const[j,L]=r.useState(!1),[_,q]=r.useState(!1),[V,Z]=r.useState(-1),ee=n.useId()+"-button-id",te=n.useDir(A,e.dir),se="rtl"===te,oe=n.useId()+"-list-id";r.useEffect((()=>{Y(A,s,i,se)}),[A,s,i,se]),r.useEffect((()=>{_&&A&&A.current&&A.current.focus()}),[_,A]);const ie=r.useCallback(((e,t)=>{m&&n.dispatchEvent(t?z:P,e,H(),void 0)}),[z,P,m]),ae=r.useCallback((e=>{!e.target||d||(!m&&E?n.dispatchEvent(E,e,H(),void 0):(L(!j),q(!0),Z(j?-1:0),ie(e,!j)))}),[L,q,Z,E,ie,j,m,d]),re=r.useCallback((e=>{q(!0),Z(j?0:-1),B&&n.dispatchEvent(B,e,H(),void 0)}),[B,q,Z]),le=r.useCallback((e=>{q(!1),L(!1),Z(-1),n.dispatchEvent(O,e,H(),void 0),j&&ie(e,!1)}),[O,q,L,Z,ie]),de=r.useCallback((e=>{e.preventDefault()}),[]),ce=r.useCallback(((e,t)=>{m&&(m[t].disabled||n.dispatchEvent(K,e,H(),{itemProps:m[t],itemIndex:t}))}),[K]),ue=r.useCallback(((e,t)=>{!e.target||!m||(Z(t),L(!1),ce(e,t),ie(e,!1))}),[Z,L,ce,ie]),pe=r.useCallback((e=>{n.getActiveElement(document)===A.current&&e.preventDefault()}),[A]),he=r.useCallback((e=>{const t=V,s=m?m.length:-1;if(e.altKey)return!j&&e.keyCode===n.Keys.down&&(e.preventDefault(),L(!0),Z(0)),void(j&&e.keyCode===n.Keys.up&&(e.preventDefault(),L(!1),Z(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&ce(e,t),m||ae(e),e.preventDefault(),L(!j),Z(j?-1:0);break;case n.Keys.esc:e.preventDefault(),L(!1),Z(-1);break;case n.Keys.home:e.preventDefault(),Z(0);break;case n.Keys.end:e.preventDefault(),Z(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),Z(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),Z(t-1<0?s-1:t-1)}n.dispatchEvent(S,e,H(),void 0)}),[S,V,Z,se,L]),me=r.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===b,"k-fab-md":"medium"===b,"k-fab-lg":"large"===b,"k-disabled":d,"k-pos-absolute":"absolute"===v,"k-pos-fixed":"fixed"===v,"k-focus":_,[`k-rounded-${n.kendoThemeMaps.roundedMap[k]||k}`]:k,[`k-fab-solid-${C}`]:C},`k-${s.vertical}-${s.horizontal}`,a)),[C,b,k,d,v,s,_,a]),fe=m&&m.map(((e,t)=>r.createElement(G,{...e,key:t,index:t,id:`${oe}-${t}`,disabled:d||e.disabled,focused:V===t,dataItem:e,item:f,className:n.classNames(e.className,X(te||"ltr",s.horizontal)),onClick:ue,onDown:pe}))),ge=!(!c&&!u||g),ve=(A.current?A.current.offsetWidth:0)/2-16;return r.createElement(n.ZIndexContext.Provider,{value:F},r.createElement(r.Fragment,null,r.createElement("button",{ref:A,id:h||ee,role:"button",type:"button","aria-disabled":d,"aria-expanded":m?j:void 0,"aria-haspopup":!!m,"aria-label":`${g||""} floatingactionbutton`,"aria-owns":m?oe:void 0,"aria-activedescendant":V>=0&&m?`${oe}-${V}`:void 0,tabIndex:n.getTabIndex(x,d),accessKey:D,dir:te,disabled:d,className:me,style:y,onClick:ae,onMouseDown:de,onFocus:re,onBlur:le,onKeyDown:he,...M},c||u?r.createElement(n.IconWrap,{className:"k-fab-icon",name:c,icon:u}):p?r.createElement("span",{role:"presentation",className:p}):null,g&&r.createElement("span",{className:"k-fab-text"},g)),N&&j&&r.createElement("div",{className:"k-overlay",style:{zIndex:F,...I}}),r.createElement(o.Popup,{ref:U,anchor:A.current,show:j,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||J(s,se),popupAlign:w.popupAlign||Q(s,se),style:{boxShadow:"none"}},r.createElement("ul",{ref:$,role:"menu","aria-labelledby":h,id:oe,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:ge?ve:void 0,paddingRight:ge?ve:void 0}},fe))))}));se.propTypes={className:s.string,style:s.object,id:s.string,dir:s.string,tabIndex:s.number,accessKey:s.string,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,text:s.string,alignOffset:s.shape({x:s.oneOfType([s.number,s.string]),y:s.oneOfType([s.number,s.string])}),align:s.shape({vertical:s.oneOf(["top","middle","bottom"]),horizontal:s.oneOf(["start","center","end"])}),positionMode:s.oneOf(["absolute","fixed"]),size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),themeColor:s.oneOf([null,"primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"]),modal:s.bool,overlayStyle:s.object};const ne={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};se.displayName="KendoFloatingActionButton";const oe=n.withIdHOC(D);oe.displayName="KendoReactDropDownButton";const ie=n.withIdHOC(k);ie.displayName="KendoReactSplitButton",e.Button=c,e.ButtonGroup=p,e.Chip=$,e.ChipList=L,e.DropDownButton=oe,e.DropDownButtonClassComponent=D,e.DropDownButtonItem=I,e.FloatingActionButton=se,e.FloatingActionButtonItem=G,e.SplitButton=ie,e.SplitButtonClassComponent=k,e.SplitButtonItem=f,e.Toolbar=K,e.ToolbarItem=O,e.ToolbarSeparator=S,e.ToolbarSpacer=z,e.toolbarButtons=N}));
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,s,n,o,i){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var r=a(t);const l={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};const d=class e extends r.Component{constructor(e){super(e),this._element=null,this.handleClick=e=>{this.toggleIfApplicable(),this.props.onClick&&this.props.onClick.call(void 0,e)},n.validatePackage(l),this.state={selected:!0===this.props.togglable&&!0===this.props.selected}}get element(){return this._element}get selected(){return void 0!==this._selectedTemp?this._selectedTemp:this.state.selected}static getDerivedStateFromProps(e,t){return e.togglable&&void 0!==e.selected&&e.selected!==t.selected?{selected:e.selected}:null}render(){const{children:t,togglable:s,icon:o,iconClass:i,svgIcon:a,imageUrl:l,imageAlt:d,className:c,startIcon:u,endIcon:p,onClick:h,size:m=e.defaultProps.size,rounded:f=e.defaultProps.rounded,fillMode:g=e.defaultProps.fillMode,themeColor:v=e.defaultProps.themeColor,...b}=this.props,y=void 0!==a||void 0!==o||void 0!==i||void 0!==l,k=void 0!==t,C=this.context&&this.context.uButton,I=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:i,buttonClasses:a}){return e?r.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:a})),alt:i,src:e}):t||o?r.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:a})),name:t,icon:o}):s?r.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:a}),s)}):null}({name:o,svgIcon:a,iconClass:i,imageUrl:l,imageAlt:d,buttonClasses:C}),x=e=>r.cloneElement(e,{className:n.classNames(n.uButton.icon({c:C}))});return r.createElement("button",{ref:e=>this._element=e,"aria-pressed":s?this.state.selected:void 0,...b,onClick:this.handleClick,className:n.classNames(n.uButton.wrapper({c:C,isRtl:"rtl"===this.props.dir,selected:this.state.selected,disabled:this.props.disabled,size:m,fillMode:g,rounded:f,themeColor:v,iconButton:!k&&y}),c)},u&&x(u),I,t&&r.createElement("span",{className:n.classNames(n.uButton.text({c:C}))},t),p&&x(p))}toggleIfApplicable(){if(this.props.togglable&&void 0===this.props.selected){const e=!this.state.selected;this._selectedTemp=e,this.setState({selected:e},(()=>this._selectedTemp=void 0))}}};d.propTypes={children:s.node,selected:s.bool,togglable:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,imageAlt:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"flat","link","outline","solid","clear"]),themeColor:s.oneOf([null,"base","primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"])},d.defaultProps={togglable:!1,size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let c=d;c.contextType=n.UnstyledContext;const u=class extends r.Component{constructor(e){super(e),this._element=null,n.validatePackage(l)}render(){const{children:e,className:t,dir:s,disabled:o,unstyled:i,width:a}=this.props,l=i&&i.uButtonGroup,d=this.mapButtons(e),c=n.classNames(n.uButtonGroup.wrapper({c:l,stretched:!!a,disabled:o}),t),u={className:c,style:{width:`${a}`},dir:s,role:"group","aria-disabled":o};return r.createElement("div",{ref:e=>{this._element=e},...u,className:c},d)}mapButtons(e){const t=r.Children.count(e),s=void 0!==this.props.dir?"rtl"===this.props.dir:this._element&&"rtl"===getComputedStyle(this._element).direction||!1;return r.Children.map(e,((e,o)=>{if(r.isValidElement(e)){const{unstyled:i}=this.props,a=i&&i.uButtonGroup,r=o===t-1,l=s,d=n.classNames(e.props.className,n.uButtonGroup.position({c:a,start:l?r:0===o,end:l?0===o:r}));return this.renderButton(e,d)}return e}))}renderButton(e,t){const s={...this.props.width?{width:this.props.width}:{},...e.props.style||{}},n=this.props.disabled||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return r.Children.count(e.props.children)>0?r.cloneElement(e,o,e.props.children):r.cloneElement(e,o)}};u.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};let p=u;const h=e=>{const t=n.useUnstyled(),s=t&&t.uDropDownButton,o=r.useCallback((t=>{e.onClick(t,e.index)}),[e]),i=e.dataItem.render||e.item||(void 0===e.item?e.render:null),a=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,l=r.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:s,focused:e.focused}),e.className),tabIndex:-1,onClick:o,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},r.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:s,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},i?r.createElement(i,{item:e.dataItem,itemIndex:e.index}):r.createElement(r.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&r.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&r.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),a&&r.createElement("span",{className:"k-menu-link-text"},a))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,l,e):l};h.displayName="KendoReactButtonItem";const m=class extends r.Component{render(){return null}};m.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let f=m;const g=(e,t,s,o)=>{if(s)return e;const i=Math.min(o-1,Math.max(0,e));switch(t){case n.Keys.enter:case n.Keys.space:case n.Keys.esc:return-1;case n.Keys.up:case n.Keys.left:return i-1<0?o-1:i-1;case n.Keys.down:case n.Keys.right:return i+1>=o?0:i+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function v(e){const t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function b(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const y=class extends r.Component{constructor(e){super(e),this.state={focused:!1,focusedIndex:-1,opened:!1},this.wrapper=null,this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setState({focusedIndex:0}),this.setOpen(!0,e)));let s;if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){if(e.preventDefault(),this.dispatchClickEvent(e,t),t>=0){s={focusedIndex:this.opened?-1:0};const t=!this.opened;this.setOpen(t,e)}}else if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=g(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const i=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(i||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}s&&this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.onFocus=e=>{this.skipFocus||(n.dispatchEvent(this.props.onFocus,e,this,void 0),this.setState({focused:!0}))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.opened&&this.setState({focusedIndex:0}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onSplitPartClick=e=>{if(this.buttonsData.length){const t=!this.opened;this.setState({focusedIndex:t?0:-1,focused:!0}),this.setOpen(t,e)}},this.onDownSplitPart=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},n.validatePackage(l)}get guid(){return this.props.id?this.props.id+"-accessibility-id":this.props.id}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===f)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:a,disabled:l}=this.props;return r.createElement("div",{id:s,style:o,className:n.classNames("k-split-button","k-button-group",{"k-focus":this.state.focused},`k-rounded-${n.kendoThemeMaps.roundedMap[this.props.rounded||"medium"]}`,this.props.className),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,dir:t,ref:e=>this.wrapper=e},r.createElement(c,{ref:e=>this.mainButton=e&&e.element,type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,onClick:e=>this.onItemClick(e,-1),disabled:l||void 0,tabIndex:a,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,imageUrl:this.props.imageUrl,dir:t,"aria-disabled":l,"aria-haspopup":!0,"aria-expanded":this.opened||void 0,"aria-label":this.props.ariaLabel,"aria-controls":this.opened?this.guid:void 0,id:"button-"+this.guid,title:this.props.title},this.props.text),r.createElement(c,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:i.caretAltDownIcon,className:"k-split-button-arrow",disabled:l||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMouseDown:this.onDownSplitPart,onPointerDown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"}),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||(-1===t?n.dispatchEvent(this.props.onButtonClick,e,this,void 0):n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t}))}renderPopup(e){const{popupSettings:t={}}=this.props,{focusedIndex:s}=this.state;return r.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||b(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"menu",id:this.guid,"aria-labelledby":"button-"+this.guid,tabIndex:-1,ref:this.listRef,"aria-activedescendant":s>=0?`${this.guid}-${s}`:void 0,className:n.classNames("k-menu-group",{[`k-menu-group-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size})},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props;return this.buttonsData.length>0?this.buttonsData.map(((o,i)=>r.createElement(h,{className:n.classNames("k-menu-item",{"k-first":0===i},{"k-last":i===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===i,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,key:i,index:i,id:`${this.guid}-${i}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};y.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onButtonClick:s.func,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,text:s.string,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.any,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},y.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let k=y;const C=class extends r.Component{render(){return null}};C.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let I=C;const x=class extends r.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setOpen(!0,e),this.setState({focusedIndex:0})));const s={...this.state};if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){e.preventDefault(),t>=0&&this.dispatchClickEvent(e,t);const s=!this.opened;return this.setState({focused:!0,focusedIndex:s?0:-1}),void this.setOpen(s,e)}if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=g(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const i=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(i||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.handleFocus=e=>{this.skipFocus||(this.setState({focused:!0,focusedIndex:this.opened?0:-1}),n.dispatchEvent(this.props.onFocus,e,this,void 0))},this.handleButtonBlur=e=>{this.opened||(this.setState({focused:!1}),n.dispatchEvent(this.props.onBlur,e,this,void 0))},this.handleMenuBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.setState({focusedIndex:-1}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.mouseDown=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onClickMainButton=e=>{if(!this.buttonsData.length)return;const t=!this.opened;this.setState({focused:!0,focusedIndex:t?0:-1}),this.setOpen(t,e)},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},n.validatePackage(l)}get guid(){return this.props.id+"-accessibility-id"}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){const e=this.isRtl(),t=this.context&&this.context.uDropDownButton,s=e?"rtl":void 0,{id:o,style:i,tabIndex:a,disabled:l,size:d,rounded:u,fillMode:p,themeColor:h,ariaLabel:m,title:f,accessKey:g,icon:v,svgIcon:b,iconClass:y,buttonClass:k,className:C,imageUrl:x,startIcon:D,endIcon:w}=this.props;return this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===I)).map((e=>e.props)),r.createElement(r.Fragment,null,r.createElement(c,{id:o,size:d,style:i,rounded:u,fillMode:p,themeColor:h,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":l?"true":void 0,tabIndex:a,accessKey:g,icon:v,svgIcon:b,iconClass:y,className:n.classNames(k,C,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:l})),imageUrl:x,dir:s,ref:e=>this.mainButton=e&&e.element,type:"button","aria-expanded":this.opened?"true":"false","aria-label":m,"aria-controls":this.opened?this.guid:void 0,title:f,startIcon:D,endIcon:w},this.props.text),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t})}renderPopup(e){const{popupSettings:t={},id:s}=this.props,i=this.context&&this.context.uDropDownButton,{focusedIndex:a}=this.state;return r.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:i}),t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||b(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":a>=0?`${this.guid}-${a}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:i,size:this.props.size}))},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props,o=this.context&&this.context.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((i,a)=>r.createElement(h,{className:n.classNames(n.uDropDownButton.item({c:o}),i.className,{"k-first":0===a},{"k-last":a===this.buttonsData.length-1}),dataItem:i,textField:s,focused:this.state.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:a,key:a,id:`${this.guid}-${a}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.mainButton&&"rtl"===getComputedStyle(this.mainButton).direction}};x.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.func,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},x.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let D=x;D.contextType=n.UnstyledContext;const w=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",N=["button"+w,".k-button-group > button"+w,".k-colorpicker",".k-dropdownlist"],E=class e extends r.Component{constructor(t){super(t),this._element=null,this.offsetHeight=0,this.offsetWidth=0,this.buttons=[],this.focusedSelector=this.selectors.map((e=>e+":focus")).join(","),this.setTabIndex=t=>{const{tabIndex:s=e.defaultProps.tabIndex}=this.props;this.buttons.forEach(((e,n)=>{e.tabIndex=n===t?s:-1}))},this.onKeyDown=e=>{const t=e.target;if(e.keyCode!==n.Keys.left&&e.keyCode!==n.Keys.right&&e.keyCode!==n.Keys.home&&e.keyCode!==n.Keys.end||e.defaultPrevented||-1===this.buttons.findIndex((e=>e===t)))return;const s=this.focusedIndex;e.keyCode===n.Keys.left?this.focusButton(s,0===s?this.buttons.length-1:s-1):this.focusButton(s,s===this.buttons.length-1?0:s+1),e.keyCode===n.Keys.home&&this.focusButton(s,0),e.keyCode===n.Keys.end&&this.focusButton(s,this.buttons.length-1)},this.onWindowResize=e=>{const t=this.element;if(!t)return;const s=t.offsetWidth,n=t.offsetHeight;if(this.offsetWidth!==s||this.offsetHeight!==n){this.offsetWidth=s,this.offsetHeight=n;const t={offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight};this.props.onResize&&this.props.onResize.call(void 0,{target:this,...t,nativeEvent:e})}},n.validatePackage(l)}get selectors(){return this.props.buttons||N}get focusedIndex(){const e=this.element&&this.element.querySelector(this.focusedSelector);return Math.max(0,this.buttons.findIndex((t=>t===e)))}get element(){return this._element}componentDidMount(){window.addEventListener("resize",this.onWindowResize);const e=this.element;e&&(this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,!1!==this.props.keyboardNavigation&&(this.buttons=Array.from(e.querySelectorAll(this.selectors.join(","))),this.setTabIndex(0)))}componentDidUpdate(){const e=this.element;!e||!1===this.props.keyboardNavigation||(this.buttons=Array.from(e.querySelectorAll(this.selectors.join(","))),this.setTabIndex(this.focusedIndex))}componentWillUnmount(){window.removeEventListener("resize",this.onWindowResize),this.buttons.length=0}render(){return r.createElement("div",{id:this.props.id,"aria-label":this.props.ariaLabel,className:n.classNames("k-toolbar k-toolbar-solid",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),style:this.props.style,role:void 0!==this.props.role?this.props.role||void 0:"toolbar",dir:this.props.dir,ref:e=>this._element=e,onKeyDown:!1!==this.props.keyboardNavigation?this.onKeyDown:void 0},this.props.children)}focusButton(t,s){const{tabIndex:n=e.defaultProps.tabIndex}=this.props,o=this.buttons[s];if(o){o.tabIndex=n,o.focus();const e=this.buttons[t];e&&(e.tabIndex=-1)}}};E.propTypes={tabIndex:s.number,dir:s.string,keyboardNavigation:s.bool,style:s.object,className:s.string,role:s.string,onResize:s.func,buttons:s.arrayOf(s.string),size:s.oneOf([null,"small","medium","large"])},E.defaultProps={tabIndex:0,size:"medium"};let K=E;const B=class extends r.PureComponent{constructor(){super(...arguments),this._element=null}get element(){return this._element}render(){return r.createElement("div",{id:this.props.id,className:n.classNames("k-toolbar-item",this.props.className),style:this.props.style,ref:e=>this._element=e},this.props.children)}};B.propTypes={className:s.string};let O=B;class S extends r.PureComponent{render(){return r.createElement("div",{className:n.classNames("k-separator",this.props.className)})}}const z=r.forwardRef(((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,(()=>({element:s.current}))),r.useImperativeHandle(t,(()=>({element:s.current})));const i=r.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return r.createElement("span",{ref:s,className:i})}));z.displayName="KendoReactToolbarSpacer",z.propTypes={className:s.string};const P=t.createContext([null,e=>{}]),M=t.createContext([null,e=>{}]),T=t.createContext([null,e=>{}]);var F=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(F||{});var R=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(R||{});var A=(e=>(e.toggle="toggle",e.remove="remove",e))(A||{});const $=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{disabled:a=W.disabled,fillMode:d=W.fillMode,themeColor:c=W.themeColor,size:u=W.size,rounded:p=W.rounded,dir:h=W.dir,removeIcon:m=W.removeIcon,removeSvgIcon:f=W.removeSvgIcon,removable:g=W.removable}=e,v=n.useDir(o,h);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const[b,y]=r.useContext(P),[k,C]=r.useContext(M),[,I]=r.useContext(T),x=r.useMemo((()=>e.selected||(Array.isArray(b)?b.some((t=>t===e.value)):b===e.value)),[e.selected,e.value,b]),D=r.useMemo((()=>k===e.value),[e.value,k]);r.useEffect((()=>{D&&o.current&&o.current.focus()}),[D]);const w=r.useCallback((t=>{y({type:A.toggle,payload:e.value,event:t})}),[y,e.value]),N=r.useCallback((t=>{g&&(I({type:R.remove,payload:e.value,event:t}),C({type:F.reset,payload:e.value,event:t}),y({type:A.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,g,I,C,y]),E=r.useCallback((t=>{switch(t.keyCode){case n.Keys.left:C({type:F.prev,payload:e.value,event:t});break;case n.Keys.right:C({type:F.next,payload:e.value,event:t});break;case n.Keys.enter:y({type:A.toggle,payload:e.value,event:t});break;case n.Keys.delete:N(t)}e.onKeyDown&&e.onKeyDown.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onKeyDown,e.value,C,y,N]),K=r.useCallback((t=>{C({payload:e.value,type:F.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,C]),B=r.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),O=n.useMouse(e,s,{onClick:w});return r.createElement("div",{...O,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:v,tabIndex:n.getTabIndex(e.tabIndex,a,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===v,"k-disabled":a,"k-selected":x,"k-focus":D,[`k-chip-${n.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-rounded-${n.kendoThemeMaps.roundedMap[p]||p}`]:p,[`k-chip-${d}`]:d,[`k-chip-${d}-${c}`]:!(!d||!c)},e.className),"aria-pressed":e.role?void 0:x,"aria-disabled":a,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":g?"Enter Delete":void 0,onFocus:K,onBlur:B,onKeyDown:E},x&&(e.selectedIcon||e.selectedSvgIcon)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.selectedIcon?n.toIconName(e.selectedIcon):void 0,icon:e.selectedSvgIcon,size:"small"}),(e.icon||e.svgIcon)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&r.createElement("div",{className:`k-chip-avatar k-avatar k-rounded-${e.avatar.rounded} k-avatar-md k-avatar-solid k-avatar-solid-primary`,style:e.avatar.style},r.createElement("span",{className:"k-avatar-image"},r.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),r.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&r.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),g&&r.createElement("span",{className:"k-chip-actions"},r.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:N},r.createElement(n.IconWrap,{name:m?n.toIconName(m):void 0,icon:f||i.xCircleIcon,size:"small"}))))})),U={id:s.string,text:s.string,value:s.any,dir:s.oneOf(["ltr","rtl"]),removable:s.bool,removeIcon:s.string,removeIconSvg:n.svgIconPropType,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,selectedIcon:s.string,selectedIconSvg:n.svgIconPropType,onRemove:s.func,dataItem:s.any,selected:s.bool,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"outline","solid"]),themeColor:s.oneOf([null,"base","info","success","warning","error"])},W={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:i.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};$.displayName="KendoReactChip",$.propTypes=U;const H=(e,t,s)=>{"multiple"===t.selection?Array.isArray(e)||(e=e?[e]:null):"single"===t.selection&&Array.isArray(e)&&(e=e?e.join(""):null);const[n,o]=r.useState(e);return[n,e=>{const i=((e,t)=>{switch(t.selection){case"single":switch(t.type){case"toggle":if(!Array.isArray(e)||null===e)return t.payload===e?null:t.payload;throw new Error("State cannot be an array in single selection");case"remove":return t.payload===e?null:e;default:return e}case"multiple":switch(t.type){case"toggle":if(Array.isArray(e))return e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload];if(null===e)return[t.payload];throw new Error("State cannot be non-array in multiple selection");case"remove":return Array.isArray(e)?e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload]:e;default:return e}case"none":return null;default:return e}})(t.state||n,{...e,...t});s&&s(i,e.event),"none"!==t.selection&&o(i)}]},j=(e,t,s)=>{const[n,o]=r.useState(e);return[n,e=>{const i=((e,t)=>{switch(t.type){case"add":case"reorder":break;case"remove":return e.filter((e=>e[t.valueField]!==t.payload));default:return e}})(t.state||n,{...e,...t});s&&s(i,e.event),o(i)}]},L=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{id:i,style:a,tabIndex:d,className:c,ariaDescribedBy:u,ariaLabelledBy:p,ariaLabel:h,value:m,defaultData:f=q.defaultData,chip:g=q.chip,disabled:v=q.disabled,size:b=q.size,defaultValue:y=q.defaultValue,selection:k=q.selection,valueField:C=q.valueField,textField:I=q.textField,dir:x=q.dir,onChange:D,onDataChange:w}=e,N=n.useDir(o,x),E=r.useMemo((()=>g||$),[g,$]);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const K=r.useCallback(((e,t)=>{D&&s.current&&D.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[D]),[B,O]=H(m||y,{selection:k,state:m},K),S=r.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[z,F]=j(e.data||f,{state:e.data,valueField:C},S),R=r.useCallback(((e,t)=>(e.push(t[C]),e)),[C]),A=r.useMemo((()=>e.data||z),[e.data,z]),U=r.useMemo((()=>m||B),[m,B]),W=r.useMemo((()=>A.reduce(R,[])),[A,R]),L=r.useCallback((e=>n.getter(C)(e)),[C]),_=r.useCallback((e=>n.getter(I)(e)),[I]),[G,V]=(e=>{const[t,s]=r.useState(null);return[t,t=>{const n=((e,t)=>{const s=t.items.findIndex((t=>t===e));switch(t.type){case"next":return s===t.items.length-1?e:t.items[s+1];case"prev":return 0===s?e:t.items[s-1];case"current":return t.payload;case"reset":return null;default:return e}})(t.payload,{...t,...e});s(n)}]})({items:W}),Z=n.useMouse(e,s);return r.createElement(P.Provider,{value:[U,O]},r.createElement(M.Provider,{value:[G,V]},r.createElement(T.Provider,{value:[A,F]},r.createElement("div",{ref:o,...Z,role:v?void 0:"listbox",id:i,dir:N,style:a,tabIndex:n.getTabIndex(d,v,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===N,"k-disabled":v,[`k-chip-list-${n.kendoThemeMaps.sizeMap[b]||b}`]:b},c),"aria-label":h,"aria-labelledby":p,"aria-describedby":u,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===k},A.map(((e,t)=>r.createElement(E,{role:"option",dataItem:e,size:b,key:[L(e),t].join("-"),text:_(e),value:L(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),_={id:s.string,className:s.string,tabIndex:s.number,data:s.any,defaultData:s.arrayOf(s.any),onDataChange:s.func,value:s.oneOfType([s.any,s.arrayOf(s.any)]),defaultValue:s.oneOfType([s.any,s.arrayOf(s.any)]),onChange:s.func,selection:s.oneOf(["single","none","multiple"]),textField:s.string,valueField:s.string,disabled:s.bool,dir:s.oneOf(["ltr","rtl"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"])},q={chip:$,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};L.displayName="KendoReactChipList",L.propTypes=_;const G=r.forwardRef(((e,t)=>{const{className:s,disabled:o,text:i,icon:a,style:l,id:d,focused:c,tabIndex:u,index:p,dataItem:h,item:m,svgIcon:f,onDown:g,onClick:v,...b}=e,y=r.useRef(null),k=r.useCallback((()=>{y.current&&y.current.focus()}),[]),C=r.useCallback((()=>({element:y.current,focus:k})),[k]);r.useImperativeHandle(t,C);const I=r.useCallback((e=>{v&&void 0!==p&&!o&&v(e,p)}),[v,p]),x=r.useMemo((()=>n.classNames("k-fab-item",{"k-focus":c,"k-disabled":o},s)),[s,o,c]),D=m;return r.createElement("li",{ref:y,id:d,className:x,style:l,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${i||""} floatingactionbutton item`,onClick:I,onMouseDown:g,onPointerDown:g,...b},D?r.createElement(D,{itemIndex:p,item:h}):r.createElement(r.Fragment,null,i&&r.createElement("span",{className:"k-fab-item-text"},i),a||f?r.createElement(n.IconWrap,{className:"k-fab-item-icon",name:a,icon:f}):null))}));G.propTypes={className:s.string,style:s.object,children:s.any,disabled:s.bool,focused:s.bool,index:s.number,icon:s.string,svgIcon:n.svgIconPropType,text:s.string,tabIndex:s.number,customProp:s.any},G.displayName="KendoFloatingActionButtonItem";const V="16px",Z=e=>"number"==typeof e?e+"px":e,J=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},Q=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},X=(e,t)=>({rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[e]["end"===t?"end":"start"]),Y=(e,t,s,n)=>{const o=t.horizontal,i=t.vertical;if(e.current){const a=s&&void 0!==s.x?Z(s.x):V,r=s&&void 0!==s.x?`calc(50% + ${Z(s.x)})`:"50%",l=s&&void 0!==s.y?Z(s.y):V,d=s&&void 0!==s.y?`calc(50% + ${Z(s.y)})`:"50%";e.current.style.setProperty(ee(t,n),"center"===o?r:a),e.current.style.setProperty(te(t),"middle"===i?d:l),n&&(("top"===i||"bottom"===i)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===i&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===i&&"start"===o&&e.current.style.setProperty("left","unset"))}},ee=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},te=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),se=r.forwardRef(((e,t)=>{n.validatePackage(l);const{align:s=ne.align,alignOffset:i,className:a,disabled:d,icon:c,svgIcon:u,iconClass:p,id:h,items:m,item:f,text:g,positionMode:v=ne.positionMode,size:b=ne.size,style:y,rounded:k=ne.rounded,themeColor:C=ne.themeColor,overlayStyle:I,tabIndex:x,accessKey:D,popupSettings:w={},modal:N,onClick:E,onItemClick:K,onFocus:B,onBlur:O,onKeyDown:S,onOpen:z,onClose:P,...M}=e,T=n.useZIndexContext(),F=T?T+2:100,R=r.useRef(null),A=r.useRef(null),$=r.useRef(null),U=r.useRef(null),W=r.useCallback((()=>{A.current&&A.current.focus()}),[]),H=r.useCallback((()=>({element:A.current,focus:W})),[W]);r.useImperativeHandle(R,H),r.useImperativeHandle(t,(()=>R.current));const[j,L]=r.useState(!1),[_,q]=r.useState(!1),[V,Z]=r.useState(-1),ee=n.useId()+"-button-id",te=n.useDir(A,e.dir),se="rtl"===te,oe=n.useId()+"-list-id";r.useEffect((()=>{Y(A,s,i,se)}),[A,s,i,se]),r.useEffect((()=>{_&&A&&A.current&&A.current.focus()}),[_,A]);const ie=r.useCallback(((e,t)=>{m&&n.dispatchEvent(t?z:P,e,H(),void 0)}),[z,P,m]),ae=r.useCallback((e=>{!e.target||d||(!m&&E?n.dispatchEvent(E,e,H(),void 0):(L(!j),q(!0),Z(j?-1:0),ie(e,!j)))}),[L,q,Z,E,ie,j,m,d]),re=r.useCallback((e=>{q(!0),Z(j?0:-1),B&&n.dispatchEvent(B,e,H(),void 0)}),[B,q,Z]),le=r.useCallback((e=>{q(!1),L(!1),Z(-1),n.dispatchEvent(O,e,H(),void 0),j&&ie(e,!1)}),[O,q,L,Z,ie]),de=r.useCallback((e=>{e.preventDefault()}),[]),ce=r.useCallback(((e,t)=>{m&&(m[t].disabled||n.dispatchEvent(K,e,H(),{itemProps:m[t],itemIndex:t}))}),[K]),ue=r.useCallback(((e,t)=>{!e.target||!m||(Z(t),L(!1),ce(e,t),ie(e,!1))}),[Z,L,ce,ie]),pe=r.useCallback((e=>{n.getActiveElement(document)===A.current&&e.preventDefault()}),[A]),he=r.useCallback((e=>{const t=V,s=m?m.length:-1;if(e.altKey)return!j&&e.keyCode===n.Keys.down&&(e.preventDefault(),L(!0),Z(0)),void(j&&e.keyCode===n.Keys.up&&(e.preventDefault(),L(!1),Z(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&ce(e,t),m||ae(e),e.preventDefault(),L(!j),Z(j?-1:0);break;case n.Keys.esc:e.preventDefault(),L(!1),Z(-1);break;case n.Keys.home:e.preventDefault(),Z(0);break;case n.Keys.end:e.preventDefault(),Z(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),Z(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),Z(t-1<0?s-1:t-1)}n.dispatchEvent(S,e,H(),void 0)}),[S,V,Z,se,L]),me=r.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===b,"k-fab-md":"medium"===b,"k-fab-lg":"large"===b,"k-disabled":d,"k-pos-absolute":"absolute"===v,"k-pos-fixed":"fixed"===v,"k-focus":_,[`k-rounded-${n.kendoThemeMaps.roundedMap[k]||k}`]:k,[`k-fab-solid-${C}`]:C},`k-${s.vertical}-${s.horizontal}`,a)),[C,b,k,d,v,s,_,a]),fe=m&&m.map(((e,t)=>r.createElement(G,{...e,key:t,index:t,id:`${oe}-${t}`,disabled:d||e.disabled,focused:V===t,dataItem:e,item:f,className:n.classNames(e.className,X(te||"ltr",s.horizontal)),onClick:ue,onDown:pe}))),ge=!(!c&&!u||g),ve=(A.current?A.current.offsetWidth:0)/2-16;return r.createElement(n.ZIndexContext.Provider,{value:F},r.createElement(r.Fragment,null,r.createElement("button",{ref:A,id:h||ee,role:"button",type:"button","aria-disabled":d,"aria-expanded":m?j:void 0,"aria-haspopup":!!m,"aria-label":`${g||""} floatingactionbutton`,"aria-owns":m?oe:void 0,"aria-activedescendant":V>=0&&m?`${oe}-${V}`:void 0,tabIndex:n.getTabIndex(x,d),accessKey:D,dir:te,disabled:d,className:me,style:y,onClick:ae,onMouseDown:de,onFocus:re,onBlur:le,onKeyDown:he,...M},c||u?r.createElement(n.IconWrap,{className:"k-fab-icon",name:c,icon:u}):p?r.createElement("span",{role:"presentation",className:p}):null,g&&r.createElement("span",{className:"k-fab-text"},g)),N&&j&&r.createElement("div",{className:"k-overlay",style:{zIndex:F,...I}}),r.createElement(o.Popup,{ref:U,anchor:A.current,show:j,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||J(s,se),popupAlign:w.popupAlign||Q(s,se),style:{boxShadow:"none"}},r.createElement("ul",{ref:$,role:"menu","aria-labelledby":h,id:oe,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:ge?ve:void 0,paddingRight:ge?ve:void 0}},fe))))}));se.propTypes={className:s.string,style:s.object,id:s.string,dir:s.string,tabIndex:s.number,accessKey:s.string,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,text:s.string,alignOffset:s.shape({x:s.oneOfType([s.number,s.string]),y:s.oneOfType([s.number,s.string])}),align:s.shape({vertical:s.oneOf(["top","middle","bottom"]),horizontal:s.oneOf(["start","center","end"])}),positionMode:s.oneOf(["absolute","fixed"]),size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),themeColor:s.oneOf([null,"primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"]),modal:s.bool,overlayStyle:s.object};const ne={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};se.displayName="KendoFloatingActionButton";const oe=n.withIdHOC(D);oe.displayName="KendoReactDropDownButton";const ie=n.withIdHOC(k);ie.displayName="KendoReactSplitButton",e.Button=c,e.ButtonGroup=p,e.Chip=$,e.ChipList=L,e.DropDownButton=oe,e.DropDownButtonClassComponent=D,e.DropDownButtonItem=I,e.FloatingActionButton=se,e.FloatingActionButtonItem=G,e.SplitButton=ie,e.SplitButtonClassComponent=k,e.SplitButtonItem=f,e.Toolbar=K,e.ToolbarItem=O,e.ToolbarSeparator=S,e.ToolbarSpacer=z,e.toolbarButtons=N}));
|
package/index.mjs
CHANGED
|
@@ -22,9 +22,13 @@ import { ChipList as N } from "./Chip/ChipList.mjs";
|
|
|
22
22
|
import { FloatingActionButton as $ } from "./FloatingActionButton/FloatingActionButton.mjs";
|
|
23
23
|
import { FloatingActionButtonItem as H } from "./FloatingActionButton/FloatingActionButtonItem.mjs";
|
|
24
24
|
import { withIdHOC as o } from "@progress/kendo-react-common";
|
|
25
|
-
const p = o(
|
|
25
|
+
const p = o(
|
|
26
|
+
r
|
|
27
|
+
);
|
|
26
28
|
p.displayName = "KendoReactDropDownButton";
|
|
27
|
-
const n = o(
|
|
29
|
+
const n = o(
|
|
30
|
+
t
|
|
31
|
+
);
|
|
28
32
|
n.displayName = "KendoReactSplitButton";
|
|
29
33
|
export {
|
|
30
34
|
l as Button,
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-buttons",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1729499008,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-buttons",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.4",
|
|
4
4
|
"description": "All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
27
|
-
"@progress/kendo-react-popup": "9.0.0-develop.
|
|
26
|
+
"@progress/kendo-react-common": "9.0.0-develop.4",
|
|
27
|
+
"@progress/kendo-react-popup": "9.0.0-develop.4",
|
|
28
28
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
29
29
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
30
30
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
@@ -9,24 +9,14 @@
|
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import m from "prop-types";
|
|
11
11
|
import { classNames as n } from "@progress/kendo-react-common";
|
|
12
|
-
const r = e.forwardRef(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
() => n(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[s.className]
|
|
21
|
-
);
|
|
22
|
-
return /* @__PURE__ */ e.createElement(
|
|
23
|
-
"span",
|
|
24
|
-
{
|
|
25
|
-
ref: a,
|
|
26
|
-
className: l
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
});
|
|
12
|
+
const r = e.forwardRef(
|
|
13
|
+
(s, t) => {
|
|
14
|
+
const a = e.useRef(null), c = e.useRef(null);
|
|
15
|
+
e.useImperativeHandle(c, () => ({ element: a.current })), e.useImperativeHandle(t, () => ({ element: a.current }));
|
|
16
|
+
const l = e.useMemo(() => n("k-spacer", s.className), [s.className]);
|
|
17
|
+
return /* @__PURE__ */ e.createElement("span", { ref: a, className: l });
|
|
18
|
+
}
|
|
19
|
+
);
|
|
30
20
|
r.displayName = "KendoReactToolbarSpacer";
|
|
31
21
|
r.propTypes = {
|
|
32
22
|
className: m.string
|