@progress/kendo-react-buttons 9.0.0-develop.1 → 9.0.0-develop.11
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/Button.js +1 -1
- package/Button.mjs +91 -108
- package/ButtonGroup.js +1 -1
- package/ButtonGroup.mjs +47 -67
- package/Chip/Chip.mjs +22 -56
- package/Chip/ChipList.mjs +2 -20
- package/Chip/chip-list-contexts.mjs +13 -4
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +243 -272
- package/FloatingActionButton/FloatingActionButtonItem.mjs +3 -6
- package/ListButton/ButtonItem.js +1 -1
- package/ListButton/ButtonItem.mjs +30 -27
- 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.d.mts +56 -168
- package/index.d.ts +56 -168
- package/index.mjs +6 -2
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +100 -110
- package/toolbar/tools/ToolbarItem.js +1 -1
- package/toolbar/tools/ToolbarItem.mjs +15 -32
- package/toolbar/tools/ToolbarSeparator.js +1 -1
- package/toolbar/tools/ToolbarSeparator.mjs +1 -8
- package/toolbar/tools/ToolbarSpacer.mjs +8 -18
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(n){const t={horizontal:"left",vertical:"bottom"};return n&&(t.horizontal="right"),t}function i(n){const t={horizontal:"left",vertical:"top"};return n&&(t.horizontal="right"),t}exports.getAnchorAlign=o;exports.getPopupAlign=i;
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
function n
|
|
10
|
-
|
|
11
|
-
return
|
|
9
|
+
function o(n) {
|
|
10
|
+
const t = { horizontal: "left", vertical: "bottom" };
|
|
11
|
+
return n && (t.horizontal = "right"), t;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
return
|
|
13
|
+
function i(n) {
|
|
14
|
+
const t = { horizontal: "left", vertical: "top" };
|
|
15
|
+
return n && (t.horizontal = "right"), t;
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
o as getAnchorAlign,
|
|
19
|
+
i as getPopupAlign
|
|
20
20
|
};
|
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,a){"use strict";function i(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=i(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=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,togglable:o,dir:a,disabled:i,selected:d,icon:u,iconClass:p,svgIcon:m,imageUrl:h,imageAlt:f,className:v,startIcon:y,endIcon:g,onClick:b,size:k=c.size,rounded:C=c.rounded,fillMode:I=c.fillMode,themeColor:x=c.themeColor,...D}=e,w=r.useRef(),E=r.useRef(null),[N,K]=r.useState(!0===o&&!0===d),B=void 0!==m||void 0!==u||void 0!==p||void 0!==h,O=void 0!==s,S=n.useUnstyled(),R=e.unstyled||S,z=R&&R.uButton;r.useImperativeHandle(t,(()=>({element:E.current,selected:void 0!==w.current?w.current:N}))),r.useMemo((()=>{o&&void 0!==d&&d!==N&&K(d)}),[o,d]),r.useEffect((()=>{w.current=void 0}),[N]);const M=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:a,buttonClasses:i}){return e?r.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:i})),alt:a,src:e}):t||o?r.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:i})),name:t,icon:o}):s?r.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:i}),s)}):null}({name:u,svgIcon:m,iconClass:p,imageUrl:h,imageAlt:f,buttonClasses:z}),F=e=>r.cloneElement(e,{className:n.classNames(n.uButton.icon({c:z}))});return r.createElement("button",{ref:E,"aria-pressed":o?N:void 0,...D,dir:a,disabled:i,onClick:e=>{o&&void 0===d&&(w.current=!N,K(!N)),b&&b.call(void 0,e)},className:n.classNames(n.uButton.wrapper({c:z,isRtl:"rtl"===a,selected:N,disabled:i,size:k,fillMode:I,rounded:C,themeColor:x,iconButton:!O&&B}),v)},y&&F(y),M,s&&r.createElement("span",{className:n.classNames(n.uButton.text({c:z}))},s),g&&F(g))})),c={togglable:!1,size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};d.displayName="KendoReactButton",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"])};const u=e=>{n.validatePackage(l);const{children:t,className:s,dir:o,disabled:a,width:i}=e,d=n.useUnstyled(),c=e.unstyled||d,u=c&&c.uButtonGroup,p=(e,t)=>{const s={...i?{width:i}:{},...e.props.style||{}},n=a||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)},m=r.useRef(null),h=(e=>{const t=r.Children.count(e),s=void 0!==o?"rtl"===o:m.current&&"rtl"===getComputedStyle(m.current).direction||!1;return r.Children.map(e,((e,o)=>{if(r.isValidElement(e)){const a=o===t-1,i=s,r=n.classNames(e.props.className,n.uButtonGroup.position({c:u,start:i?a:0===o,end:i?0===o:a}));return p(e,r)}return e}))})(t),f=n.classNames(n.uButtonGroup.wrapper({c:u,stretched:!!i,disabled:a}),s),v={className:f,style:{width:`${i}`},dir:o,role:"group","aria-disabled":a};return r.createElement("div",{ref:m,...v,className:f},h)};u.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};const p=e=>{const t=n.useUnstyled(),s=e.unstyled||t,o=s&&s.uDropDownButton,a=r.useCallback((t=>{e.onClick(t,e.index)}),[e]),i=e.dataItem.render||e.item||(void 0===e.item?e.render:null),l=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,d=r.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:o,focused:e.focused}),e.className),tabIndex:-1,onClick:a,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:o,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"}),l&&r.createElement("span",{className:"k-menu-link-text"},l))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,d,e):d};p.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 h=m;const f=(e,t,s,o)=>{if(s)return e;const a=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 a-1<0?o-1:a-1;case n.Keys.down:case n.Keys.right:return a+1>=o?0:a+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 y(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const g=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=f(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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===h)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:i,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(d,{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:i,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(d,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:a.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||y(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,a)=>r.createElement(p,{className:n.classNames("k-menu-item",{"k-first":0===a},{"k-last":a===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,key:a,index: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.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};g.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},g.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let b=g;const k=class extends r.Component{render(){return null}};k.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let C=k;const I=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=f(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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:a,tabIndex:i,disabled:l,size:c,rounded:u,fillMode:p,themeColor:m,ariaLabel:h,title:f,accessKey:v,icon:y,svgIcon:g,iconClass:b,buttonClass:k,className:I,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===C)).map((e=>e.props)),r.createElement(r.Fragment,null,r.createElement(d,{id:o,size:c,style:a,rounded:u,fillMode:p,themeColor:m,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":l?"true":void 0,tabIndex:i,accessKey:v,icon:y,svgIcon:g,iconClass:b,className:n.classNames(k,I,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":h,"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,a=this.context&&this.context.uDropDownButton,{focusedIndex:i}=this.state;return r.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:a}),t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||y(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":i>=0?`${this.guid}-${i}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:a,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(((a,i)=>r.createElement(p,{className:n.classNames(n.uDropDownButton.item({c:o}),a.className,{"k-first":0===i},{"k-last":i===this.buttonsData.length-1}),dataItem:a,textField:s,focused:this.state.focusedIndex===i,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:i,key: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.mainButton&&"rtl"===getComputedStyle(this.mainButton).direction}};I.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},I.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let x=I;x.contextType=n.UnstyledContext;const D=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",w=["button"+D,".k-button-group > button"+D,".k-colorpicker",".k-dropdownlist"],E=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,className:o,id:a,ariaLabel:i,keyboardNavigation:d,role:c,onResize:u,dir:p,style:m,tabIndex:h=N.tabIndex,size:f=N.size}=e,v=r.useRef(!1),y=r.useRef(null),g=r.useRef(0),b=r.useRef(0),k=r.useRef([]),C=r.useMemo((()=>e.buttons||w),[e.buttons]),I=r.useMemo((()=>C.map((e=>e+":focus")).join(",")),[C]),x=()=>{const e=y.current&&y.current.querySelector(I);return Math.max(0,k.current.findIndex((t=>t===e)))},D=r.useRef({element:null,props:e});r.useImperativeHandle(D,(()=>({element:y.current,props:e}))),r.useImperativeHandle(t,(()=>D.current)),r.useEffect((()=>(window.addEventListener("resize",B),y.current&&(b.current=y.current.offsetWidth,g.current=y.current.offsetHeight,!1!==d&&(k.current=Array.from(y.current.querySelectorAll(C.join(","))),E(0))),()=>{window.removeEventListener("resize",B),k.current.length=0})),[]),r.useEffect((()=>{if(v.current){if(!y.current||!1===d)return;k.current=Array.from(y.current.querySelectorAll(C.join(","))),E(x())}else v.current=!0}));const E=e=>{k.current.forEach(((t,s)=>{t.tabIndex=s===e?h:-1}))},K=(e,t)=>{const s=k.current[t];if(s){s.tabIndex=h,s.focus();const t=k.current[e];t&&(t.tabIndex=-1)}},B=e=>{if(!y.current)return;const t=y.current.offsetWidth,s=y.current.offsetHeight;if(b.current!==t||g.current!==s){b.current=t,g.current=s;const n={offsetWidth:b.current,offsetHeight:g.current};u&&u.call(void 0,{target:D.current,...n,nativeEvent:e})}};return r.createElement("div",{id:a,"aria-label":i,className:n.classNames("k-toolbar k-toolbar-solid",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[f]||f}`]:f},o),style:m,role:void 0!==c?c||void 0:"toolbar",dir:p,ref:y,onKeyDown:!1!==d?e=>{const t=e.keyCode===n.Keys.left||e.keyCode===n.Keys.right||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end,s=x();!t||e.defaultPrevented||-1===k.current.findIndex((t=>t===e.target))||(e.keyCode===n.Keys.left?K(s,0===s?k.current.length-1:s-1):K(s,s===k.current.length-1?0:s+1),e.keyCode===n.Keys.home&&K(s,0),e.keyCode===n.Keys.end&&K(s,k.current.length-1))}:void 0},s)})),N={tabIndex:0,size:"medium"};E.displayName="KendoReactToolbar",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.isRequired),size:s.oneOf([null,"small","medium","large"])};const K=r.forwardRef(((e,t)=>{const{id:s,className:o,style:a,children:i}=e,l=r.useRef(null);return r.useImperativeHandle(t,(()=>({element:l.current}))),r.createElement("div",{id:s,className:n.classNames("k-toolbar-item",o),style:a,ref:l},i)}));K.displayName="KendoReactToolbarItem",K.propTypes={className:s.string};const B=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 a=r.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return r.createElement("span",{ref:s,className:a})}));B.displayName="KendoReactToolbarSpacer",B.propTypes={className:s.string};const O=t.createContext([null,e=>{}]),S=t.createContext([null,e=>{}]),R=t.createContext([null,e=>{}]);var z=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(z||{});var M=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(M||{});var F=(e=>(e.toggle="toggle",e.remove="remove",e))(F||{});const P=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{disabled:i=A.disabled,fillMode:d=A.fillMode,themeColor:c=A.themeColor,size:u=A.size,rounded:p=A.rounded,dir:m=A.dir,removeIcon:h=A.removeIcon,removeSvgIcon:f=A.removeSvgIcon,removable:v=A.removable}=e,y=n.useDir(o,m);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const[g,b]=r.useContext(O),[k,C]=r.useContext(S),[,I]=r.useContext(R),x=r.useMemo((()=>e.selected||(Array.isArray(g)?g.some((t=>t===e.value)):g===e.value)),[e.selected,e.value,g]),D=r.useMemo((()=>k===e.value),[e.value,k]);r.useEffect((()=>{D&&o.current&&o.current.focus()}),[D]);const w=r.useCallback((t=>{b({type:F.toggle,payload:e.value,event:t})}),[b,e.value]),E=r.useCallback((t=>{v&&(I({type:M.remove,payload:e.value,event:t}),C({type:z.reset,payload:e.value,event:t}),b({type:F.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,v,I,C,b]),N=r.useCallback((t=>{switch(t.keyCode){case n.Keys.left:C({type:z.prev,payload:e.value,event:t});break;case n.Keys.right:C({type:z.next,payload:e.value,event:t});break;case n.Keys.enter:b({type:F.toggle,payload:e.value,event:t});break;case n.Keys.delete:E(t)}e.onKeyDown&&e.onKeyDown.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onKeyDown,e.value,C,b,E]),K=r.useCallback((t=>{C({payload:e.value,type:z.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]),P=n.useMouse(e,s,{onClick:w});return r.createElement("div",{...P,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:y,tabIndex:n.getTabIndex(e.tabIndex,i,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===y,"k-disabled":i,"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":i,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":v?"Enter Delete":void 0,onFocus:K,onBlur:B,onKeyDown:N},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)),v&&r.createElement("span",{className:"k-chip-actions"},r.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:E},r.createElement(n.IconWrap,{name:h?n.toIconName(h):void 0,icon:f||a.xCircleIcon,size:"small"}))))})),T={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"])},A={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:a.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};P.displayName="KendoReactChip",P.propTypes=T;const $=(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 a=((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(a,e.event),"none"!==t.selection&&o(a)}]},U=(e,t,s)=>{const[n,o]=r.useState(e);return[n,e=>{const a=((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(a,e.event),o(a)}]},j=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{id:a,style:i,tabIndex:d,className:c,ariaDescribedBy:u,ariaLabelledBy:p,ariaLabel:m,value:h,defaultData:f=L.defaultData,chip:v=L.chip,disabled:y=L.disabled,size:g=L.size,defaultValue:b=L.defaultValue,selection:k=L.selection,valueField:C=L.valueField,textField:I=L.textField,dir:x=L.dir,onChange:D,onDataChange:w}=e,E=n.useDir(o,x),N=r.useMemo((()=>v||P),[v,P]);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,z]=$(h||b,{selection:k,state:h},K),M=r.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[F,T]=U(e.data||f,{state:e.data,valueField:C},M),A=r.useCallback(((e,t)=>(e.push(t[C]),e)),[C]),j=r.useMemo((()=>e.data||F),[e.data,F]),H=r.useMemo((()=>h||B),[h,B]),q=r.useMemo((()=>j.reduce(A,[])),[j,A]),W=r.useCallback((e=>n.getter(C)(e)),[C]),V=r.useCallback((e=>n.getter(I)(e)),[I]),[G,Z]=(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:q}),J=n.useMouse(e,s);return r.createElement(O.Provider,{value:[H,z]},r.createElement(S.Provider,{value:[G,Z]},r.createElement(R.Provider,{value:[j,T]},r.createElement("div",{ref:o,...J,role:y?void 0:"listbox",id:a,dir:E,style:i,tabIndex:n.getTabIndex(d,y,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===E,"k-disabled":y,[`k-chip-list-${n.kendoThemeMaps.sizeMap[g]||g}`]:g},c),"aria-label":m,"aria-labelledby":p,"aria-describedby":u,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===k},j.map(((e,t)=>r.createElement(N,{role:"option",dataItem:e,size:g,key:[W(e),t].join("-"),text:V(e),value:W(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),H={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"])},L={chip:P,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};j.displayName="KendoReactChipList",j.propTypes=H;const q=r.forwardRef(((e,t)=>{const{className:s,disabled:o,text:a,icon:i,style:l,id:d,focused:c,tabIndex:u,index:p,dataItem:m,item:h,svgIcon:f,onDown:v,onClick:y,...g}=e,b=r.useRef(null),k=r.useCallback((()=>{b.current&&b.current.focus()}),[]),C=r.useCallback((()=>({element:b.current,focus:k})),[k]);r.useImperativeHandle(t,C);const I=r.useCallback((e=>{y&&void 0!==p&&!o&&y(e,p)}),[y,p]),x=r.useMemo((()=>n.classNames("k-fab-item",{"k-focus":c,"k-disabled":o},s)),[s,o,c]),D=h;return r.createElement("li",{ref:b,id:d,className:x,style:l,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${a||""} floatingactionbutton item`,onClick:I,onMouseDown:v,onPointerDown:v,...g},D?r.createElement(D,{itemIndex:p,item:m}):r.createElement(r.Fragment,null,a&&r.createElement("span",{className:"k-fab-item-text"},a),i||f?r.createElement(n.IconWrap,{className:"k-fab-item-icon",name:i,icon:f}):null))}));q.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},q.displayName="KendoFloatingActionButtonItem";const W="16px",V=e=>"number"==typeof e?e+"px":e,G=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},Z=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},J=(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"]),Q=(e,t,s,n)=>{const o=t.horizontal,a=t.vertical;if(e.current){const i=s&&void 0!==s.x?V(s.x):W,r=s&&void 0!==s.x?`calc(50% + ${V(s.x)})`:"50%",l=s&&void 0!==s.y?V(s.y):W,d=s&&void 0!==s.y?`calc(50% + ${V(s.y)})`:"50%";e.current.style.setProperty(X(t,n),"center"===o?r:i),e.current.style.setProperty(Y(t),"middle"===a?d:l),n&&(("top"===a||"bottom"===a)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===a&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===a&&"start"===o&&e.current.style.setProperty("left","unset"))}},X=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},Y=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),_=r.forwardRef(((e,t)=>{n.validatePackage(l);const{align:s=ee.align,alignOffset:a,className:i,disabled:d,icon:c,svgIcon:u,iconClass:p,id:m,items:h,item:f,text:v,positionMode:y=ee.positionMode,size:g=ee.size,style:b,rounded:k=ee.rounded,themeColor:C=ee.themeColor,overlayStyle:I,tabIndex:x,accessKey:D,popupSettings:w={},modal:E,onClick:N,onItemClick:K,onFocus:B,onBlur:O,onKeyDown:S,onOpen:R,onClose:z,...M}=e,F=n.useZIndexContext(),P=F?F+2:100,T=r.useRef(null),A=r.useRef(null),$=r.useRef(null),U=r.useRef(null),j=r.useCallback((()=>{A.current&&A.current.focus()}),[]),H=r.useCallback((()=>({element:A.current,focus:j})),[j]);r.useImperativeHandle(T,H),r.useImperativeHandle(t,(()=>T.current));const[L,W]=r.useState(!1),[V,X]=r.useState(!1),[Y,_]=r.useState(-1),te=n.useId()+"-button-id",se=n.useDir(A,e.dir),ne="rtl"===se,oe=n.useId()+"-list-id";r.useEffect((()=>{Q(A,s,a,ne)}),[A,s,a,ne]),r.useEffect((()=>{V&&A&&A.current&&A.current.focus()}),[V,A]);const ae=r.useCallback(((e,t)=>{h&&n.dispatchEvent(t?R:z,e,H(),void 0)}),[R,z,h]),ie=r.useCallback((e=>{!e.target||d||(!h&&N?n.dispatchEvent(N,e,H(),void 0):(W(!L),X(!0),_(L?-1:0),ae(e,!L)))}),[W,X,_,N,ae,L,h,d]),re=r.useCallback((e=>{X(!0),_(L?0:-1),B&&n.dispatchEvent(B,e,H(),void 0)}),[B,X,_]),le=r.useCallback((e=>{X(!1),W(!1),_(-1),n.dispatchEvent(O,e,H(),void 0),L&&ae(e,!1)}),[O,X,W,_,ae]),de=r.useCallback((e=>{e.preventDefault()}),[]),ce=r.useCallback(((e,t)=>{h&&(h[t].disabled||n.dispatchEvent(K,e,H(),{itemProps:h[t],itemIndex:t}))}),[K]),ue=r.useCallback(((e,t)=>{!e.target||!h||(_(t),W(!1),ce(e,t),ae(e,!1))}),[_,W,ce,ae]),pe=r.useCallback((e=>{n.getActiveElement(document)===A.current&&e.preventDefault()}),[A]),me=r.useCallback((e=>{const t=Y,s=h?h.length:-1;if(e.altKey)return!L&&e.keyCode===n.Keys.down&&(e.preventDefault(),W(!0),_(0)),void(L&&e.keyCode===n.Keys.up&&(e.preventDefault(),W(!1),_(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&ce(e,t),h||ie(e),e.preventDefault(),W(!L),_(L?-1:0);break;case n.Keys.esc:e.preventDefault(),W(!1),_(-1);break;case n.Keys.home:e.preventDefault(),_(0);break;case n.Keys.end:e.preventDefault(),_(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),_(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),_(t-1<0?s-1:t-1)}n.dispatchEvent(S,e,H(),void 0)}),[S,Y,_,ne,W]),he=r.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===g,"k-fab-md":"medium"===g,"k-fab-lg":"large"===g,"k-disabled":d,"k-pos-absolute":"absolute"===y,"k-pos-fixed":"fixed"===y,"k-focus":V,[`k-rounded-${n.kendoThemeMaps.roundedMap[k]||k}`]:k,[`k-fab-solid-${C}`]:C},`k-${s.vertical}-${s.horizontal}`,i)),[C,g,k,d,y,s,V,i]),fe=h&&h.map(((e,t)=>r.createElement(q,{...e,key:t,index:t,id:`${oe}-${t}`,disabled:d||e.disabled,focused:Y===t,dataItem:e,item:f,className:n.classNames(e.className,J(se||"ltr",s.horizontal)),onClick:ue,onDown:pe}))),ve=!(!c&&!u||v),ye=(A.current?A.current.offsetWidth:0)/2-16;return r.createElement(n.ZIndexContext.Provider,{value:P},r.createElement(r.Fragment,null,r.createElement("button",{ref:A,id:m||te,role:"button",type:"button","aria-disabled":d,"aria-expanded":h?L:void 0,"aria-haspopup":!!h,"aria-label":`${v||""} floatingactionbutton`,"aria-owns":h?oe:void 0,"aria-activedescendant":Y>=0&&h?`${oe}-${Y}`:void 0,tabIndex:n.getTabIndex(x,d),accessKey:D,dir:se,disabled:d,className:he,style:b,onClick:ie,onMouseDown:de,onFocus:re,onBlur:le,onKeyDown:me,...M},c||u?r.createElement(n.IconWrap,{className:"k-fab-icon",name:c,icon:u}):p?r.createElement("span",{role:"presentation",className:p}):null,v&&r.createElement("span",{className:"k-fab-text"},v)),E&&L&&r.createElement("div",{className:"k-overlay",style:{zIndex:P,...I}}),r.createElement(o.Popup,{ref:U,anchor:A.current,show:L,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||G(s,ne),popupAlign:w.popupAlign||Z(s,ne),style:{boxShadow:"none"}},r.createElement("ul",{ref:$,role:"menu","aria-labelledby":m,id:oe,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:ve?ye:void 0,paddingRight:ve?ye:void 0}},fe))))}));_.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]).isRequired,y:s.oneOfType([s.number,s.string]).isRequired}),align:s.shape({vertical:s.oneOf(["top","middle","bottom"]).isRequired,horizontal:s.oneOf(["start","center","end"]).isRequired}),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 ee={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};_.displayName="KendoFloatingActionButton";const te=n.withIdHOC(x);te.displayName="KendoReactDropDownButton";const se=n.withIdHOC(b);se.displayName="KendoReactSplitButton",e.Button=d,e.ButtonGroup=u,e.Chip=P,e.ChipList=j,e.DropDownButton=te,e.DropDownButtonClassComponent=x,e.DropDownButtonItem=C,e.FloatingActionButton=_,e.FloatingActionButtonItem=q,e.SplitButton=se,e.SplitButtonClassComponent=b,e.SplitButtonItem=h,e.Toolbar=E,e.ToolbarItem=K,e.ToolbarSeparator=e=>r.createElement("div",{className:n.classNames("k-separator",e.className)}),e.ToolbarSpacer=B,e.toolbarButtons=w}));
|