@progress/kendo-react-buttons 6.1.1 → 7.0.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/{dist/es/Button.d.ts → Button.d.ts} +5 -1
  2. package/{dist/npm/ButtonGroup.d.ts → ButtonGroup.d.ts} +5 -1
  3. package/{dist/es/ButtonGroupInterface.d.ts → ButtonGroupInterface.d.ts} +4 -1
  4. package/{dist/npm/ButtonInterface.d.ts → ButtonInterface.d.ts} +4 -0
  5. package/{dist/npm/Chip → Chip}/Chip.d.ts +4 -0
  6. package/{dist/npm/Chip → Chip}/ChipList.d.ts +4 -12
  7. package/Chip/chip-list-contexts.d.ts +17 -0
  8. package/{dist/npm/Chip → Chip}/data-reducer.d.ts +5 -1
  9. package/{dist/es/Chip → Chip}/focus-reducer.d.ts +5 -2
  10. package/{dist/npm/Chip → Chip}/selection-reducer.d.ts +5 -1
  11. package/{dist/npm/FloatingActionButton → FloatingActionButton}/FloatingActionButton.d.ts +4 -0
  12. package/{dist/es/FloatingActionButton → FloatingActionButton}/FloatingActionButtonItem.d.ts +4 -0
  13. package/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +17 -0
  14. package/{dist/es/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonPopupSettings.d.ts +4 -0
  15. package/{dist/npm/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonProps.d.ts +5 -2
  16. package/{dist/es/FloatingActionButton → FloatingActionButton}/models/align-offset.d.ts +4 -0
  17. package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/align.d.ts +4 -0
  18. package/{dist/es/FloatingActionButton → FloatingActionButton}/models/events.d.ts +5 -1
  19. package/FloatingActionButton/models/position-mode.d.ts +13 -0
  20. package/FloatingActionButton/models/rounded.d.ts +16 -0
  21. package/FloatingActionButton/models/size.d.ts +15 -0
  22. package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/theme-color.d.ts +5 -1
  23. package/{dist/npm/FloatingActionButton → FloatingActionButton}/utils.d.ts +4 -0
  24. package/LICENSE.md +1 -1
  25. package/{dist/es/ListButton → ListButton}/ButtonItem.d.ts +4 -0
  26. package/{dist/es/ListButton → ListButton}/DropDownButton.d.ts +5 -1
  27. package/{dist/npm/ListButton → ListButton}/DropDownButtonItem.d.ts +4 -0
  28. package/{dist/npm/ListButton → ListButton}/SplitButton.d.ts +5 -1
  29. package/{dist/es/ListButton → ListButton}/SplitButtonItem.d.ts +4 -0
  30. package/{dist/npm/ListButton → ListButton}/models/ButtonItem.d.ts +4 -0
  31. package/{dist/npm/ListButton → ListButton}/models/ListButtonProps.d.ts +4 -1
  32. package/{dist/npm/ListButton → ListButton}/models/PopupSettings.d.ts +4 -0
  33. package/{dist/npm/ListButton → ListButton}/models/events.d.ts +4 -0
  34. package/ListButton/utils/navigation.d.ts +9 -0
  35. package/ListButton/utils/popup.d.ts +13 -0
  36. package/dist/cdn/js/kendo-react-buttons.js +5 -1
  37. package/index.d.ts +36 -0
  38. package/index.js +5 -0
  39. package/index.mjs +1877 -0
  40. package/{dist/npm/models → models}/index.d.ts +4 -1
  41. package/package-metadata.d.ts +9 -0
  42. package/package.json +28 -42
  43. package/{dist/es/toolbar → toolbar}/Toolbar.d.ts +5 -1
  44. package/{dist/es/toolbar → toolbar}/tools/ToolbarItem.d.ts +5 -1
  45. package/toolbar/tools/ToolbarSeparator.d.ts +20 -0
  46. package/{dist/es/toolbar → toolbar}/tools/ToolbarSpacer.d.ts +4 -0
  47. package/{dist/npm/util.d.ts → util.d.ts} +4 -0
  48. package/about.md +0 -3
  49. package/dist/es/Button.js +0 -171
  50. package/dist/es/ButtonGroup.d.ts +0 -32
  51. package/dist/es/ButtonGroup.js +0 -101
  52. package/dist/es/ButtonGroupInterface.js +0 -2
  53. package/dist/es/ButtonInterface.d.ts +0 -35
  54. package/dist/es/ButtonInterface.js +0 -3
  55. package/dist/es/Chip/Chip.d.ts +0 -234
  56. package/dist/es/Chip/Chip.js +0 -173
  57. package/dist/es/Chip/ChipList.d.ts +0 -123
  58. package/dist/es/Chip/ChipList.js +0 -177
  59. package/dist/es/Chip/data-reducer.d.ts +0 -22
  60. package/dist/es/Chip/data-reducer.js +0 -26
  61. package/dist/es/Chip/focus-reducer.js +0 -32
  62. package/dist/es/Chip/selection-reducer.d.ts +0 -30
  63. package/dist/es/Chip/selection-reducer.js +0 -75
  64. package/dist/es/FloatingActionButton/FloatingActionButton.d.ts +0 -17
  65. package/dist/es/FloatingActionButton/FloatingActionButton.js +0 -281
  66. package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +0 -82
  67. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
  68. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -1
  69. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -1
  70. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +0 -216
  71. package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -1
  72. package/dist/es/FloatingActionButton/models/align-offset.js +0 -1
  73. package/dist/es/FloatingActionButton/models/align.d.ts +0 -27
  74. package/dist/es/FloatingActionButton/models/align.js +0 -1
  75. package/dist/es/FloatingActionButton/models/events.js +0 -1
  76. package/dist/es/FloatingActionButton/models/position-mode.d.ts +0 -9
  77. package/dist/es/FloatingActionButton/models/position-mode.js +0 -1
  78. package/dist/es/FloatingActionButton/models/rounded.d.ts +0 -12
  79. package/dist/es/FloatingActionButton/models/rounded.js +0 -1
  80. package/dist/es/FloatingActionButton/models/size.d.ts +0 -11
  81. package/dist/es/FloatingActionButton/models/size.js +0 -1
  82. package/dist/es/FloatingActionButton/models/theme-color.d.ts +0 -18
  83. package/dist/es/FloatingActionButton/models/theme-color.js +0 -1
  84. package/dist/es/FloatingActionButton/utils.d.ts +0 -27
  85. package/dist/es/FloatingActionButton/utils.js +0 -93
  86. package/dist/es/ListButton/ButtonItem.js +0 -24
  87. package/dist/es/ListButton/DropDownButton.js +0 -325
  88. package/dist/es/ListButton/DropDownButtonItem.d.ts +0 -30
  89. package/dist/es/ListButton/DropDownButtonItem.js +0 -43
  90. package/dist/es/ListButton/SplitButton.d.ts +0 -120
  91. package/dist/es/ListButton/SplitButton.js +0 -334
  92. package/dist/es/ListButton/SplitButtonItem.js +0 -42
  93. package/dist/es/ListButton/models/ButtonItem.d.ts +0 -34
  94. package/dist/es/ListButton/models/ButtonItem.js +0 -3
  95. package/dist/es/ListButton/models/ListButtonProps.d.ts +0 -336
  96. package/dist/es/ListButton/models/ListButtonProps.js +0 -2
  97. package/dist/es/ListButton/models/PopupSettings.d.ts +0 -24
  98. package/dist/es/ListButton/models/PopupSettings.js +0 -1
  99. package/dist/es/ListButton/models/events.d.ts +0 -47
  100. package/dist/es/ListButton/models/events.js +0 -1
  101. package/dist/es/ListButton/utils/navigation.d.ts +0 -5
  102. package/dist/es/ListButton/utils/navigation.js +0 -29
  103. package/dist/es/ListButton/utils/popup.d.ts +0 -9
  104. package/dist/es/ListButton/utils/popup.js +0 -20
  105. package/dist/es/main.d.ts +0 -32
  106. package/dist/es/main.js +0 -17
  107. package/dist/es/models/index.d.ts +0 -89
  108. package/dist/es/models/index.js +0 -1
  109. package/dist/es/package-metadata.d.ts +0 -5
  110. package/dist/es/package-metadata.js +0 -11
  111. package/dist/es/toolbar/Toolbar.js +0 -214
  112. package/dist/es/toolbar/tools/ToolbarItem.js +0 -56
  113. package/dist/es/toolbar/tools/ToolbarSeparator.d.ts +0 -16
  114. package/dist/es/toolbar/tools/ToolbarSeparator.js +0 -31
  115. package/dist/es/toolbar/tools/ToolbarSpacer.js +0 -20
  116. package/dist/es/util.d.ts +0 -27
  117. package/dist/es/util.js +0 -37
  118. package/dist/npm/Button.d.ts +0 -138
  119. package/dist/npm/Button.js +0 -174
  120. package/dist/npm/ButtonGroup.js +0 -104
  121. package/dist/npm/ButtonGroupInterface.d.ts +0 -33
  122. package/dist/npm/ButtonGroupInterface.js +0 -3
  123. package/dist/npm/ButtonInterface.js +0 -4
  124. package/dist/npm/Chip/Chip.js +0 -176
  125. package/dist/npm/Chip/ChipList.js +0 -180
  126. package/dist/npm/Chip/data-reducer.js +0 -30
  127. package/dist/npm/Chip/focus-reducer.d.ts +0 -25
  128. package/dist/npm/Chip/focus-reducer.js +0 -36
  129. package/dist/npm/Chip/selection-reducer.js +0 -79
  130. package/dist/npm/FloatingActionButton/FloatingActionButton.js +0 -284
  131. package/dist/npm/FloatingActionButton/FloatingActionButtonItem.d.ts +0 -105
  132. package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +0 -85
  133. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
  134. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -2
  135. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +0 -24
  136. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -2
  137. package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -2
  138. package/dist/npm/FloatingActionButton/models/align-offset.d.ts +0 -20
  139. package/dist/npm/FloatingActionButton/models/align-offset.js +0 -2
  140. package/dist/npm/FloatingActionButton/models/align.js +0 -2
  141. package/dist/npm/FloatingActionButton/models/events.d.ts +0 -21
  142. package/dist/npm/FloatingActionButton/models/events.js +0 -2
  143. package/dist/npm/FloatingActionButton/models/position-mode.d.ts +0 -9
  144. package/dist/npm/FloatingActionButton/models/position-mode.js +0 -2
  145. package/dist/npm/FloatingActionButton/models/rounded.d.ts +0 -12
  146. package/dist/npm/FloatingActionButton/models/rounded.js +0 -2
  147. package/dist/npm/FloatingActionButton/models/size.d.ts +0 -11
  148. package/dist/npm/FloatingActionButton/models/size.js +0 -2
  149. package/dist/npm/FloatingActionButton/models/theme-color.js +0 -2
  150. package/dist/npm/FloatingActionButton/utils.js +0 -101
  151. package/dist/npm/ListButton/ButtonItem.d.ts +0 -30
  152. package/dist/npm/ListButton/ButtonItem.js +0 -28
  153. package/dist/npm/ListButton/DropDownButton.d.ts +0 -118
  154. package/dist/npm/ListButton/DropDownButton.js +0 -328
  155. package/dist/npm/ListButton/DropDownButtonItem.js +0 -46
  156. package/dist/npm/ListButton/SplitButton.js +0 -337
  157. package/dist/npm/ListButton/SplitButtonItem.d.ts +0 -25
  158. package/dist/npm/ListButton/SplitButtonItem.js +0 -45
  159. package/dist/npm/ListButton/models/ButtonItem.js +0 -4
  160. package/dist/npm/ListButton/models/ListButtonProps.js +0 -3
  161. package/dist/npm/ListButton/models/PopupSettings.js +0 -2
  162. package/dist/npm/ListButton/models/events.js +0 -2
  163. package/dist/npm/ListButton/utils/navigation.d.ts +0 -5
  164. package/dist/npm/ListButton/utils/navigation.js +0 -32
  165. package/dist/npm/ListButton/utils/popup.d.ts +0 -9
  166. package/dist/npm/ListButton/utils/popup.js +0 -25
  167. package/dist/npm/main.d.ts +0 -32
  168. package/dist/npm/main.js +0 -48
  169. package/dist/npm/models/index.js +0 -2
  170. package/dist/npm/package-metadata.d.ts +0 -5
  171. package/dist/npm/package-metadata.js +0 -14
  172. package/dist/npm/toolbar/Toolbar.d.ts +0 -171
  173. package/dist/npm/toolbar/Toolbar.js +0 -217
  174. package/dist/npm/toolbar/tools/ToolbarItem.d.ts +0 -38
  175. package/dist/npm/toolbar/tools/ToolbarItem.js +0 -59
  176. package/dist/npm/toolbar/tools/ToolbarSeparator.d.ts +0 -16
  177. package/dist/npm/toolbar/tools/ToolbarSeparator.js +0 -34
  178. package/dist/npm/toolbar/tools/ToolbarSpacer.d.ts +0 -23
  179. package/dist/npm/toolbar/tools/ToolbarSpacer.js +0 -23
  180. package/dist/npm/util.js +0 -40
  181. package/dist/systemjs/kendo-react-buttons.js +0 -1
  182. package/e2e-next/button.basic.tests.ts +0 -24
  183. package/e2e-next/buttongroup.basic.tests.ts +0 -24
  184. package/e2e-next/chip.basic.tests.ts +0 -24
  185. package/e2e-next/chiplist.basic.tests.ts +0 -24
  186. package/e2e-next/dropdownbutton.basic.tests.ts +0 -24
  187. package/e2e-next/floatingactionbutton.basic.tests.ts +0 -24
  188. package/e2e-next/splitbutton.basic.tests.ts +0 -24
  189. package/e2e-next/toolbar.basic.tests.ts +0 -24
package/index.mjs ADDED
@@ -0,0 +1,1877 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as n from "react";
6
+ import we from "react";
7
+ import * as s from "prop-types";
8
+ import { svgIconPropType as O, validatePackage as K, classNames as f, kendoThemeMaps as P, IconWrap as L, Keys as r, guid as me, dispatchEvent as x, getActiveElement as se, useDir as De, useMouse as Oe, getTabIndex as fe, toIconName as Ie, getter as Be, useZIndexContext as rt, ZIndexContext as ct } from "@progress/kendo-react-common";
9
+ import { Popup as Ee } from "@progress/kendo-react-popup";
10
+ import { caretAltDownIcon as dt, xCircleIcon as ut } from "@progress/kendo-svg-icons";
11
+ const A = {
12
+ name: "@progress/kendo-react-buttons",
13
+ productName: "KendoReact",
14
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
15
+ publishDate: 1700573013,
16
+ version: "",
17
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
18
+ };
19
+ function ht({ imageUrl: e, name: o, iconClass: t, svgIcon: i, imageAlt: a }) {
20
+ return e ? /* @__PURE__ */ n.createElement("img", { role: "presentation", className: "k-button-icon", alt: a, src: e }) : o || i ? /* @__PURE__ */ n.createElement(L, { className: "k-button-icon", name: o, icon: i }) : t ? /* @__PURE__ */ n.createElement("span", { role: "presentation", className: f("k-button-icon", t) }) : null;
21
+ }
22
+ const ee = class extends n.Component {
23
+ constructor(e) {
24
+ super(e), this._element = null, this.handleClick = (o) => {
25
+ this.toggleIfApplicable(), this.props.onClick && this.props.onClick.call(void 0, o);
26
+ }, K(A), this.state = { selected: this.props.togglable === !0 && this.props.selected === !0 };
27
+ }
28
+ /**
29
+ * Gets the DOM element of the Button component.
30
+ */
31
+ get element() {
32
+ return this._element;
33
+ }
34
+ /**
35
+ * Returns `true` when the component is togglable and selected ([see example]({% slug toggleable_button %})).
36
+ * Otherwise, returns `false`.
37
+ */
38
+ get selected() {
39
+ return this._selectedTemp !== void 0 ? this._selectedTemp : this.state.selected;
40
+ }
41
+ /**
42
+ * @hidden
43
+ */
44
+ static getDerivedStateFromProps(e, o) {
45
+ return e.togglable && e.selected !== void 0 && e.selected !== o.selected ? { selected: e.selected } : null;
46
+ }
47
+ /**
48
+ * @hidden
49
+ */
50
+ render() {
51
+ const {
52
+ children: e,
53
+ togglable: o,
54
+ icon: t,
55
+ iconClass: i,
56
+ svgIcon: a,
57
+ imageUrl: l,
58
+ imageAlt: d,
59
+ className: c,
60
+ onClick: b,
61
+ size: C = ee.defaultProps.size,
62
+ rounded: u = ee.defaultProps.rounded,
63
+ fillMode: w = ee.defaultProps.fillMode,
64
+ themeColor: N = ee.defaultProps.themeColor,
65
+ ...D
66
+ } = this.props, S = a !== void 0 || t !== void 0 || i !== void 0 || l !== void 0, E = e !== void 0, F = ht({
67
+ name: t,
68
+ svgIcon: a,
69
+ iconClass: i,
70
+ imageUrl: l,
71
+ imageAlt: d
72
+ });
73
+ return /* @__PURE__ */ n.createElement(
74
+ "button",
75
+ {
76
+ ref: (k) => this._element = k,
77
+ "aria-pressed": o ? this.state.selected : void 0,
78
+ ...D,
79
+ onClick: this.handleClick,
80
+ className: f(
81
+ "k-button",
82
+ {
83
+ [`k-button-${P.sizeMap[C] || C}`]: C,
84
+ [`k-button-${w}`]: w,
85
+ [`k-button-${w}-${N}`]: !!(w && N),
86
+ [`k-rounded-${P.roundedMap[u] || u}`]: u,
87
+ "k-icon-button": !E && S,
88
+ "k-disabled": this.props.disabled,
89
+ "k-selected": this.state.selected,
90
+ "k-rtl": this.props.dir === "rtl"
91
+ },
92
+ this.props.className
93
+ )
94
+ },
95
+ F,
96
+ e && /* @__PURE__ */ n.createElement("span", { className: "k-button-text" }, e)
97
+ );
98
+ }
99
+ toggleIfApplicable() {
100
+ if (this.props.togglable && this.props.selected === void 0) {
101
+ const e = !this.state.selected;
102
+ this._selectedTemp = e, this.setState({ selected: e }, () => this._selectedTemp = void 0);
103
+ }
104
+ }
105
+ };
106
+ let ne = ee;
107
+ ne.propTypes = {
108
+ children: s.node,
109
+ selected: s.bool,
110
+ togglable: s.bool,
111
+ icon: s.string,
112
+ svgIcon: O,
113
+ iconClass: s.string,
114
+ imageUrl: s.string,
115
+ imageAlt: s.string,
116
+ size: s.oneOf([null, "small", "medium", "large"]),
117
+ rounded: s.oneOf([null, "small", "medium", "large", "full"]),
118
+ fillMode: s.oneOf([null, "flat", "link", "outline", "solid"]),
119
+ // eslint-disable-next-line max-len
120
+ themeColor: s.oneOf([null, "base", "primary", "secondary", "tertiary", "info", "success", "warning", "error", "dark", "light", "inverse"])
121
+ };
122
+ ne.defaultProps = {
123
+ togglable: !1,
124
+ size: "medium",
125
+ rounded: "medium",
126
+ fillMode: "solid",
127
+ themeColor: "base"
128
+ };
129
+ const pt = {
130
+ button: "k-button",
131
+ flat: "k-flat",
132
+ outline: "k-outline",
133
+ clear: "k-button-clear",
134
+ primary: "k-primary",
135
+ "state-selected": "k-selected",
136
+ "button-icon": "k-button-icon",
137
+ "button-icontext": "k-button-icontext",
138
+ "state-disabled": "k-disabled",
139
+ "group-start": "k-group-start",
140
+ "group-end": "k-group-end",
141
+ "button-group": "k-button-group",
142
+ "button-group-stretched": "k-button-group-stretched",
143
+ ltr: "k-ltr",
144
+ rtl: "k-rtl"
145
+ }, Me = ":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)", mt = [
146
+ "button" + Me,
147
+ ".k-button-group > button" + Me,
148
+ ".k-colorpicker",
149
+ ".k-dropdownlist"
150
+ ], ft = {
151
+ styles: pt
152
+ }, ue = ft.styles;
153
+ class bt extends n.Component {
154
+ constructor(o) {
155
+ super(o), this._element = null, K(A);
156
+ }
157
+ /**
158
+ * @hidden
159
+ */
160
+ render() {
161
+ const o = this.mapButtons(this.props.children), t = f(
162
+ [ue["button-group"]],
163
+ {
164
+ ["k-disabled"]: this.props.disabled,
165
+ [ue["button-group-stretched"]]: !!this.props.width
166
+ },
167
+ this.props.className
168
+ ), i = {
169
+ className: t,
170
+ style: { width: `${this.props.width}` },
171
+ dir: this.props.dir,
172
+ // Accessibility properties
173
+ role: "group",
174
+ "aria-disabled": this.props.disabled
175
+ };
176
+ return /* @__PURE__ */ n.createElement(
177
+ "div",
178
+ {
179
+ ref: (a) => {
180
+ this._element = a;
181
+ },
182
+ ...i,
183
+ className: t
184
+ },
185
+ o
186
+ );
187
+ }
188
+ mapButtons(o) {
189
+ const t = n.Children.count(o), i = this.props.dir !== void 0 ? this.props.dir === "rtl" : this._element && getComputedStyle(this._element).direction === "rtl" || !1;
190
+ return n.Children.map(o, (a, l) => n.isValidElement(a) ? this.renderButton(a, l, l === t - 1, i) : a);
191
+ }
192
+ renderButton(o, t, i, a) {
193
+ const l = f(o.props.className, {
194
+ [ue["group-start"]]: a ? i : t === 0,
195
+ [ue["group-end"]]: a ? t === 0 : i
196
+ }), d = { ...this.props.width ? { width: this.props.width } : {}, ...o.props.style || {} }, c = this.props.disabled || o.props.disabled, b = {
197
+ ...o.props,
198
+ ...l ? { className: l } : {},
199
+ ...Object.keys(d).length ? { style: d } : {},
200
+ ...c !== void 0 ? { disabled: c } : {}
201
+ };
202
+ return n.Children.count(o.props.children) > 0 ? n.cloneElement(o, b, o.props.children) : n.cloneElement(o, b);
203
+ }
204
+ }
205
+ bt.propTypes = {
206
+ children: s.oneOfType([s.arrayOf(s.element), s.element]),
207
+ className: s.string,
208
+ disabled: s.bool,
209
+ width: s.string,
210
+ dir: s.string
211
+ };
212
+ const Ne = (e) => {
213
+ const o = n.useCallback(
214
+ (l) => {
215
+ e.onClick(l, e.index);
216
+ },
217
+ [e]
218
+ ), t = e.dataItem.render || e.item || (e.item === void 0 ? e.render : null), i = e.dataItem.text !== void 0 ? e.dataItem.text : e.textField ? e.dataItem[e.textField] : e.dataItem, a = /* @__PURE__ */ n.createElement(
219
+ "li",
220
+ {
221
+ id: e.id,
222
+ className: f(
223
+ "k-item",
224
+ e.className,
225
+ { "k-focus": e.focused }
226
+ ),
227
+ tabIndex: -1,
228
+ onClick: o,
229
+ onMouseDown: e.onDown,
230
+ onPointerDown: e.onDown,
231
+ role: "menuitem",
232
+ "aria-disabled": e.dataItem.disabled || void 0
233
+ },
234
+ /* @__PURE__ */ n.createElement(
235
+ "span",
236
+ {
237
+ tabIndex: -1,
238
+ className: f(
239
+ "k-link k-menu-link",
240
+ {
241
+ "k-selected": e.dataItem.selected,
242
+ "k-disabled": e.dataItem.disabled
243
+ }
244
+ ),
245
+ key: "icon"
246
+ },
247
+ t ? /* @__PURE__ */ n.createElement(t, { item: e.dataItem, itemIndex: e.index }) : /* @__PURE__ */ n.createElement(n.Fragment, null, (e.dataItem.icon || e.dataItem.iconClass) && /* @__PURE__ */ n.createElement(L, { className: e.dataItem.iconClass, name: e.dataItem.icon, icon: e.dataItem.svgIcon }), e.dataItem.imageUrl && /* @__PURE__ */ n.createElement(
248
+ "img",
249
+ {
250
+ role: "presentation",
251
+ alt: "",
252
+ src: e.dataItem.imageUrl,
253
+ className: "k-icon"
254
+ }
255
+ ), i && /* @__PURE__ */ n.createElement("span", { className: "k-menu-link-text" }, i))
256
+ )
257
+ );
258
+ return e.item !== void 0 && /* to be removed in 5.0.0 */
259
+ e.render !== void 0 ? e.render.call(void 0, a, e) : a;
260
+ };
261
+ Ne.displayName = "KendoReactButtonItem";
262
+ class Ke extends n.Component {
263
+ /**
264
+ * @hidden
265
+ */
266
+ render() {
267
+ return null;
268
+ }
269
+ }
270
+ Ke.propTypes = {
271
+ text: s.string,
272
+ icon: s.string,
273
+ iconClass: s.string,
274
+ imageUrl: s.string,
275
+ disabled: s.bool,
276
+ render: s.any
277
+ };
278
+ const Ae = (e, o, t, i) => {
279
+ if (t)
280
+ return e;
281
+ const a = Math.min(i - 1, Math.max(0, e));
282
+ switch (o) {
283
+ case r.enter:
284
+ case r.space:
285
+ case r.esc:
286
+ return -1;
287
+ case r.up:
288
+ case r.left:
289
+ return a - 1 < 0 ? i - 1 : a - 1;
290
+ case r.down:
291
+ case r.right:
292
+ return a + 1 >= i ? 0 : a + 1;
293
+ case r.home:
294
+ return 0;
295
+ case r.end:
296
+ return i - 1;
297
+ default:
298
+ return e;
299
+ }
300
+ };
301
+ function $e(e) {
302
+ let o = { horizontal: "left", vertical: "bottom" };
303
+ return e && (o.horizontal = "right"), o;
304
+ }
305
+ function Te(e) {
306
+ let o = { horizontal: "left", vertical: "top" };
307
+ return e && (o.horizontal = "right"), o;
308
+ }
309
+ class _e extends n.Component {
310
+ constructor(o) {
311
+ super(o), this.state = {
312
+ focused: !1,
313
+ focusedIndex: -1,
314
+ opened: !1
315
+ }, this.wrapper = null, this.mainButton = null, this.list = null, this.guid = me(), this.skipFocus = !1, this.buttonsData = [], this.onKeyDown = (t) => {
316
+ const { focusedIndex: i } = this.state;
317
+ if (t.altKey) {
318
+ !this.opened && t.keyCode === r.down ? (this.dispatchPopupEvent(t, !0), this.setState({ focusedIndex: 0 }), this.setOpen(!0)) : this.opened && t.keyCode === r.up && (this.setState({ focusedIndex: -1 }), this.setOpen(!1));
319
+ return;
320
+ }
321
+ let a;
322
+ if (t.keyCode === r.enter || t.keyCode === r.space) {
323
+ if (t.preventDefault(), this.dispatchClickEvent(t, i), i >= 0) {
324
+ a = {
325
+ focusedIndex: this.opened ? -1 : 0
326
+ };
327
+ const l = !this.opened;
328
+ this.setOpen(l), l && this.dispatchPopupEvent(t, l);
329
+ }
330
+ } else if (this.opened && t.keyCode === r.esc) {
331
+ this.setState({ focusedIndex: -1 }), this.setOpen(!1);
332
+ return;
333
+ }
334
+ if (this.opened) {
335
+ const l = Ae(
336
+ i,
337
+ t.keyCode,
338
+ t.altKey,
339
+ this.buttonsData.length
340
+ );
341
+ l !== i && (a = a || {}, a.focusedIndex = l);
342
+ const d = t.keyCode === r.up || t.keyCode === r.down || t.keyCode === r.left || t.keyCode === r.right;
343
+ !t.altKey && (d || t.keyCode === r.home || t.keyCode === r.end) && t.preventDefault();
344
+ }
345
+ a && this.setState(a);
346
+ }, this.switchFocus = (t) => {
347
+ this.skipFocus = !0, t(), window.setTimeout(() => this.skipFocus = !1, 0);
348
+ }, this.onFocus = (t) => {
349
+ this.skipFocus || (x(this.props.onFocus, t, this, void 0), this.setState({ focused: !0 }));
350
+ }, this.setOpen = (t) => {
351
+ this.openedDuringOnChange = t, this.setState({ opened: t });
352
+ }, this.onItemClick = (t, i) => {
353
+ this.opened && (this.setState({ focusedIndex: 0 }), this.setOpen(!1)), this.dispatchClickEvent(t, i);
354
+ }, this.onBlur = (t) => {
355
+ this.skipFocus || (this.setState({
356
+ focused: !1,
357
+ focusedIndex: -1
358
+ }), this.setOpen(!1), x(this.props.onBlur, t, this, void 0));
359
+ }, this.onPopupClose = () => {
360
+ this.state.focused && this.switchFocus(() => {
361
+ this.element && (this.element.removeAttribute("tabindex"), this.element.focus({ preventScroll: !0 }));
362
+ }), this.dispatchPopupEvent({}, !1);
363
+ }, this.listRef = (t) => {
364
+ this.list = t, t && this.state.focused && this.switchFocus(() => {
365
+ t.focus({ preventScroll: !0 }), this.element && (this.element.tabIndex = -1);
366
+ });
367
+ }, this.onSplitPartClick = (t) => {
368
+ if (this.buttonsData.length) {
369
+ const i = !this.opened;
370
+ i && this.dispatchPopupEvent(t, i), this.setState({
371
+ focusedIndex: i ? 0 : -1,
372
+ focused: !0
373
+ }), this.setOpen(i);
374
+ }
375
+ }, this.onDownSplitPart = (t) => {
376
+ t.preventDefault();
377
+ const i = se(document);
378
+ this.element && i !== this.element && i !== this.list && this.element.focus();
379
+ }, this.onItemDown = (t) => {
380
+ se(document) === this.list && t.preventDefault();
381
+ }, this.dispatchPopupEvent = (t, i) => {
382
+ x(i ? this.props.onOpen : this.props.onClose, t, this, void 0), this.openedDuringOnChange = void 0;
383
+ }, K(A);
384
+ }
385
+ get opened() {
386
+ return this.openedDuringOnChange !== void 0 ? this.openedDuringOnChange : this.props.opened === void 0 ? this.state.opened : this.props.opened;
387
+ }
388
+ /**
389
+ * @hidden
390
+ */
391
+ render() {
392
+ this.buttonsData = this.props.items || n.Children.toArray(this.props.children).filter((c) => c && c.type === Ke).map((c) => c.props);
393
+ const o = this.isRtl(), t = o ? "rtl" : void 0, { id: i, style: a, tabIndex: l, disabled: d } = this.props;
394
+ return /* @__PURE__ */ n.createElement(
395
+ "div",
396
+ {
397
+ id: i,
398
+ style: a,
399
+ className: f(
400
+ "k-split-button",
401
+ "k-button-group",
402
+ {
403
+ "k-focus": this.state.focused
404
+ },
405
+ `k-rounded-${P.roundedMap[this.props.rounded || "medium"]}`,
406
+ this.props.className
407
+ ),
408
+ onKeyDown: this.onKeyDown,
409
+ onFocus: this.onFocus,
410
+ onBlur: this.onBlur,
411
+ dir: t,
412
+ ref: (c) => this.wrapper = c
413
+ },
414
+ /* @__PURE__ */ n.createElement(
415
+ ne,
416
+ {
417
+ ref: (c) => this.mainButton = c && c.element,
418
+ type: "button",
419
+ size: this.props.size,
420
+ rounded: this.props.rounded,
421
+ fillMode: this.props.fillMode,
422
+ themeColor: this.props.themeColor,
423
+ onClick: (c) => this.onItemClick(c, -1),
424
+ disabled: d || void 0,
425
+ tabIndex: l,
426
+ accessKey: this.props.accessKey,
427
+ className: this.props.buttonClass,
428
+ icon: this.props.icon,
429
+ svgIcon: this.props.svgIcon,
430
+ iconClass: this.props.iconClass,
431
+ imageUrl: this.props.imageUrl,
432
+ dir: t,
433
+ "aria-disabled": d,
434
+ "aria-haspopup": !0,
435
+ "aria-expanded": this.opened || void 0,
436
+ "aria-label": this.props.ariaLabel,
437
+ "aria-controls": this.opened ? this.guid : void 0,
438
+ id: "button-" + this.guid,
439
+ title: this.props.title
440
+ },
441
+ this.props.text
442
+ ),
443
+ /* @__PURE__ */ n.createElement(
444
+ ne,
445
+ {
446
+ type: "button",
447
+ size: this.props.size,
448
+ rounded: this.props.rounded,
449
+ fillMode: this.props.fillMode,
450
+ themeColor: this.props.themeColor,
451
+ icon: "caret-alt-down",
452
+ svgIcon: dt,
453
+ className: "k-split-button-arrow",
454
+ disabled: d || void 0,
455
+ tabIndex: -1,
456
+ onClick: this.onSplitPartClick,
457
+ onMouseDown: this.onDownSplitPart,
458
+ onPointerDown: this.onDownSplitPart,
459
+ dir: t,
460
+ "aria-label": "menu toggling button"
461
+ }
462
+ ),
463
+ this.renderPopup(o)
464
+ );
465
+ }
466
+ /**
467
+ * @hidden
468
+ */
469
+ componentDidMount() {
470
+ (this.props.dir === void 0 && this.isRtl() || this.opened) && this.forceUpdate();
471
+ }
472
+ /**
473
+ * The DOM element of main button.
474
+ */
475
+ get element() {
476
+ return this.mainButton;
477
+ }
478
+ dispatchClickEvent(o, t) {
479
+ this.isItemDisabled(t) || (t === -1 ? x(this.props.onButtonClick, o, this, void 0) : x(
480
+ this.props.onItemClick,
481
+ o,
482
+ this,
483
+ {
484
+ item: this.buttonsData[t],
485
+ itemIndex: t
486
+ }
487
+ ));
488
+ }
489
+ renderPopup(o) {
490
+ const { popupSettings: t = {} } = this.props, { focusedIndex: i } = this.state;
491
+ return /* @__PURE__ */ n.createElement(
492
+ Ee,
493
+ {
494
+ anchor: this.wrapper,
495
+ show: this.opened,
496
+ animate: t.animate,
497
+ popupClass: f("k-menu-popup", t.popupClass),
498
+ anchorAlign: t.anchorAlign || $e(o),
499
+ popupAlign: t.popupAlign || Te(o),
500
+ style: o ? { direction: "rtl" } : void 0,
501
+ onClose: this.onPopupClose
502
+ },
503
+ /* @__PURE__ */ n.createElement(
504
+ "ul",
505
+ {
506
+ role: "menu",
507
+ id: this.guid,
508
+ "aria-labelledby": "button-" + this.guid,
509
+ tabIndex: -1,
510
+ ref: this.listRef,
511
+ "aria-activedescendant": i >= 0 ? `${this.guid}-${i}` : void 0,
512
+ className: f("k-group k-menu-group k-reset", {
513
+ [`k-menu-group-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
514
+ })
515
+ },
516
+ this.renderChildItems()
517
+ )
518
+ );
519
+ }
520
+ renderChildItems() {
521
+ const { item: o, itemRender: t, textField: i } = this.props;
522
+ return this.buttonsData.length > 0 ? this.buttonsData.map((a, l) => /* @__PURE__ */ n.createElement(
523
+ Ne,
524
+ {
525
+ className: "k-menu-item",
526
+ dataItem: a,
527
+ textField: i,
528
+ focused: this.state.focusedIndex === l,
529
+ onClick: this.onItemClick,
530
+ onDown: this.onItemDown,
531
+ render: t,
532
+ item: o,
533
+ key: l,
534
+ index: l,
535
+ id: `${this.guid}-${l}`
536
+ }
537
+ )) : null;
538
+ }
539
+ isItemDisabled(o) {
540
+ return this.buttonsData[o] ? this.buttonsData[o].disabled : this.props.disabled;
541
+ }
542
+ isRtl() {
543
+ return this.props.dir !== void 0 ? this.props.dir === "rtl" : !!this.wrapper && getComputedStyle(this.wrapper).direction === "rtl";
544
+ }
545
+ }
546
+ _e.propTypes = {
547
+ accessKey: s.string,
548
+ ariaLabel: s.string,
549
+ title: s.string,
550
+ onButtonClick: s.func,
551
+ onFocus: s.func,
552
+ onBlur: s.func,
553
+ onItemClick: s.func,
554
+ onOpen: s.func,
555
+ onClose: s.func,
556
+ text: s.string,
557
+ items: s.arrayOf(s.any),
558
+ textField: s.string,
559
+ tabIndex: s.number,
560
+ disabled: s.bool,
561
+ icon: s.string,
562
+ svgIcon: O,
563
+ iconClass: s.string,
564
+ imageUrl: s.string,
565
+ popupSettings: s.object,
566
+ itemRender: s.any,
567
+ item: s.func,
568
+ className: s.string,
569
+ buttonClass: s.string,
570
+ dir: s.string
571
+ };
572
+ _e.defaultProps = {
573
+ size: "medium",
574
+ rounded: "medium",
575
+ fillMode: "solid",
576
+ themeColor: "base"
577
+ };
578
+ class Le extends n.Component {
579
+ /**
580
+ * @hidden
581
+ */
582
+ render() {
583
+ return null;
584
+ }
585
+ }
586
+ Le.propTypes = {
587
+ text: s.string,
588
+ icon: s.string,
589
+ iconClass: s.string,
590
+ imageUrl: s.string,
591
+ selected: s.bool,
592
+ disabled: s.bool,
593
+ render: s.any
594
+ };
595
+ class He extends n.Component {
596
+ constructor(o) {
597
+ super(o), this.state = {
598
+ opened: !1,
599
+ focused: !1,
600
+ focusedIndex: -1
601
+ }, this.wrapper = null, this.mainButton = null, this.list = null, this.skipFocus = !1, this.guid = me(), this.buttonsData = [], this.onKeyDown = (t) => {
602
+ const { focusedIndex: i } = this.state;
603
+ if (t.altKey) {
604
+ !this.opened && t.keyCode === r.down ? (this.setOpen(!0), this.dispatchPopupEvent(t, !0), this.setState({ focusedIndex: 0 })) : this.opened && t.keyCode === r.up && (this.setState({ focusedIndex: -1 }), this.setOpen(!1));
605
+ return;
606
+ }
607
+ const a = { ...this.state };
608
+ if (t.keyCode === r.enter || t.keyCode === r.space) {
609
+ i >= 0 && this.dispatchClickEvent(t, i), t.preventDefault();
610
+ const l = !this.opened;
611
+ this.setOpen(l), l && (this.dispatchPopupEvent(t, !0), this.setState({ focusedIndex: this.opened ? -1 : 0 }));
612
+ return;
613
+ } else if (this.opened && t.keyCode === r.esc) {
614
+ this.setState({ focusedIndex: -1 }), this.setOpen(!1);
615
+ return;
616
+ }
617
+ if (this.opened) {
618
+ const l = Ae(
619
+ i,
620
+ t.keyCode,
621
+ t.altKey,
622
+ this.buttonsData.length
623
+ );
624
+ a.focusedIndex = l;
625
+ const d = t.keyCode === r.up || t.keyCode === r.down || t.keyCode === r.left || t.keyCode === r.right;
626
+ !t.altKey && (d || t.keyCode === r.home || t.keyCode === r.end) && t.preventDefault();
627
+ }
628
+ this.setState(a);
629
+ }, this.switchFocus = (t) => {
630
+ this.skipFocus = !0, t(), window.setTimeout(() => this.skipFocus = !1, 0);
631
+ }, this.handleFocus = (t) => {
632
+ this.skipFocus || (this.setState({ focused: !0, focusedIndex: this.opened ? 0 : -1 }), x(this.props.onFocus, t, this, void 0));
633
+ }, this.handleBlur = (t) => {
634
+ this.skipFocus || (this.setState({ focused: !1, focusedIndex: -1 }), this.setOpen(!1), x(this.props.onBlur, t, this, void 0));
635
+ }, this.setOpen = (t) => {
636
+ this.openedDuringOnChange = t, this.setState({ opened: t });
637
+ }, this.onItemClick = (t, i) => {
638
+ this.setState({ focusedIndex: -1 }), this.setOpen(!1), this.dispatchClickEvent(t, i);
639
+ }, this.onItemDown = (t) => {
640
+ se(document) === this.list && t.preventDefault();
641
+ }, this.mouseDown = (t) => {
642
+ t.preventDefault();
643
+ const i = se(document);
644
+ this.element && i !== this.element && i !== this.list && this.element.focus();
645
+ }, this.onPopupClose = () => {
646
+ this.state.focused && this.switchFocus(() => {
647
+ this.element && (this.element.removeAttribute("tabindex"), this.element.focus({ preventScroll: !0 }));
648
+ }), this.dispatchPopupEvent({}, !1);
649
+ }, this.listRef = (t) => {
650
+ this.list = t, t && this.state.focused && this.switchFocus(() => {
651
+ t.focus({ preventScroll: !0 }), this.element && (this.element.tabIndex = -1);
652
+ });
653
+ }, this.onClickMainButton = (t) => {
654
+ if (!this.buttonsData.length)
655
+ return;
656
+ const i = !this.opened;
657
+ this.setState({
658
+ focused: !0,
659
+ focusedIndex: i ? 0 : -1
660
+ }), this.setOpen(i), i && this.dispatchPopupEvent(t, i);
661
+ }, this.dispatchPopupEvent = (t, i) => {
662
+ x(i ? this.props.onOpen : this.props.onClose, t, this, void 0), this.openedDuringOnChange = void 0;
663
+ }, K(A);
664
+ }
665
+ get opened() {
666
+ return this.openedDuringOnChange !== void 0 ? this.openedDuringOnChange : this.props.opened === void 0 ? this.state.opened : this.props.opened;
667
+ }
668
+ /**
669
+ * @hidden
670
+ */
671
+ render() {
672
+ const o = this.isRtl(), t = o ? "rtl" : void 0, { id: i, style: a, tabIndex: l, disabled: d } = this.props;
673
+ return this.buttonsData = this.props.items || n.Children.toArray(this.props.children).filter((c) => c && c.type === Le).map((c) => c.props), /* @__PURE__ */ n.createElement(
674
+ "div",
675
+ {
676
+ id: i,
677
+ style: a,
678
+ className: f(
679
+ "k-dropdown-button",
680
+ {
681
+ "k-focus": this.state.focused
682
+ },
683
+ this.props.className
684
+ ),
685
+ onKeyDown: this.onKeyDown,
686
+ onFocus: this.handleFocus,
687
+ onBlur: this.handleBlur,
688
+ dir: t,
689
+ ref: (c) => this.wrapper = c
690
+ },
691
+ /* @__PURE__ */ n.createElement(
692
+ ne,
693
+ {
694
+ size: this.props.size,
695
+ rounded: this.props.rounded,
696
+ fillMode: this.props.fillMode,
697
+ themeColor: this.props.themeColor,
698
+ onClick: this.onClickMainButton,
699
+ onMouseDown: this.mouseDown,
700
+ disabled: d || void 0,
701
+ tabIndex: l,
702
+ accessKey: this.props.accessKey,
703
+ icon: this.props.icon,
704
+ svgIcon: this.props.svgIcon,
705
+ iconClass: this.props.iconClass,
706
+ className: this.props.buttonClass,
707
+ imageUrl: this.props.imageUrl,
708
+ dir: t,
709
+ ref: (c) => this.mainButton = c && c.element,
710
+ type: "button",
711
+ "aria-haspopup": !0,
712
+ "aria-expanded": this.opened || void 0,
713
+ "aria-label": this.props.ariaLabel,
714
+ "aria-controls": this.opened ? this.guid : void 0,
715
+ id: "button-" + this.guid,
716
+ title: this.props.title
717
+ },
718
+ this.props.text
719
+ ),
720
+ this.renderPopup(o)
721
+ );
722
+ }
723
+ /**
724
+ * @hidden
725
+ */
726
+ componentDidMount() {
727
+ (this.props.dir === void 0 && this.isRtl() || this.opened) && this.forceUpdate();
728
+ }
729
+ /**
730
+ * The DOM element of main button.
731
+ */
732
+ get element() {
733
+ return this.mainButton;
734
+ }
735
+ dispatchClickEvent(o, t) {
736
+ this.isItemDisabled(t) || x(
737
+ this.props.onItemClick,
738
+ o,
739
+ this,
740
+ {
741
+ item: this.buttonsData[t],
742
+ itemIndex: t
743
+ }
744
+ );
745
+ }
746
+ renderPopup(o) {
747
+ const { popupSettings: t = {} } = this.props, { focusedIndex: i } = this.state;
748
+ return /* @__PURE__ */ n.createElement(
749
+ Ee,
750
+ {
751
+ anchor: this.wrapper,
752
+ show: this.opened,
753
+ animate: t.animate,
754
+ popupClass: f("k-menu-popup", t.popupClass),
755
+ anchorAlign: t.anchorAlign || $e(o),
756
+ popupAlign: t.popupAlign || Te(o),
757
+ style: o ? { direction: "rtl" } : void 0,
758
+ onClose: this.onPopupClose
759
+ },
760
+ /* @__PURE__ */ n.createElement(
761
+ "ul",
762
+ {
763
+ role: "menu",
764
+ id: this.guid,
765
+ "aria-labelledby": "button-" + this.guid,
766
+ tabIndex: -1,
767
+ "aria-activedescendant": i >= 0 ? `${this.guid}-${i}` : void 0,
768
+ ref: this.listRef,
769
+ className: f("k-group k-menu-group k-reset", {
770
+ [`k-menu-group-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
771
+ })
772
+ },
773
+ this.renderChildItems()
774
+ )
775
+ );
776
+ }
777
+ renderChildItems() {
778
+ const { item: o, itemRender: t, textField: i } = this.props;
779
+ return this.buttonsData.length > 0 ? this.buttonsData.map((a, l) => /* @__PURE__ */ n.createElement(
780
+ Ne,
781
+ {
782
+ className: "k-menu-item",
783
+ dataItem: a,
784
+ textField: i,
785
+ focused: this.state.focusedIndex === l,
786
+ onClick: this.onItemClick,
787
+ onDown: this.onItemDown,
788
+ render: t,
789
+ item: o,
790
+ index: l,
791
+ key: l,
792
+ id: `${this.guid}-${l}`
793
+ }
794
+ )) : null;
795
+ }
796
+ isItemDisabled(o) {
797
+ return this.buttonsData[o] ? this.buttonsData[o].disabled : this.props.disabled;
798
+ }
799
+ isRtl() {
800
+ return this.props.dir !== void 0 ? this.props.dir === "rtl" : !!this.wrapper && getComputedStyle(this.wrapper).direction === "rtl";
801
+ }
802
+ }
803
+ He.propTypes = {
804
+ accessKey: s.string,
805
+ ariaLabel: s.string,
806
+ title: s.string,
807
+ onFocus: s.func,
808
+ onBlur: s.func,
809
+ onItemClick: s.func,
810
+ onOpen: s.func,
811
+ onClose: s.func,
812
+ items: s.arrayOf(s.any),
813
+ textField: s.string,
814
+ tabIndex: s.number,
815
+ disabled: s.bool,
816
+ icon: s.string,
817
+ svgIcon: O,
818
+ iconClass: s.string,
819
+ imageUrl: s.string,
820
+ popupSettings: s.object,
821
+ itemRender: s.func,
822
+ item: s.func,
823
+ className: s.string,
824
+ buttonClass: s.string,
825
+ dir: s.string
826
+ };
827
+ He.defaultProps = {
828
+ size: "medium",
829
+ rounded: "medium",
830
+ fillMode: "solid",
831
+ themeColor: "base"
832
+ };
833
+ const xe = class extends n.Component {
834
+ constructor(e) {
835
+ super(e), this._element = null, this.offsetHeight = 0, this.offsetWidth = 0, this.buttons = [], this.focusedSelector = this.selectors.map((o) => o + ":focus").join(","), this.setTabIndex = (o) => {
836
+ const { tabIndex: t = xe.defaultProps.tabIndex } = this.props;
837
+ this.buttons.forEach((i, a) => {
838
+ i.tabIndex = a === o ? t : -1;
839
+ });
840
+ }, this.onKeyDown = (o) => {
841
+ const t = o.target;
842
+ if (!(o.keyCode === r.left || o.keyCode === r.right) || o.defaultPrevented || this.buttons.findIndex((l) => l === t) === -1)
843
+ return;
844
+ const a = this.focusedIndex;
845
+ o.keyCode === r.left ? this.focusButton(a, a - 1) : this.focusButton(a, a + 1);
846
+ }, this.onWindowResize = (o) => {
847
+ const t = this.element;
848
+ if (!t)
849
+ return;
850
+ const i = t.offsetWidth, a = t.offsetHeight;
851
+ if (this.offsetWidth !== i || this.offsetHeight !== a) {
852
+ this.offsetWidth = i, this.offsetHeight = a;
853
+ const l = { offsetWidth: this.offsetWidth, offsetHeight: this.offsetHeight };
854
+ this.props.onResize && this.props.onResize.call(void 0, { target: this, ...l, nativeEvent: o });
855
+ }
856
+ }, K(A);
857
+ }
858
+ get selectors() {
859
+ return this.props.buttons || mt;
860
+ }
861
+ get focusedIndex() {
862
+ const e = this.element && this.element.querySelector(this.focusedSelector);
863
+ return Math.max(0, this.buttons.findIndex((o) => o === e));
864
+ }
865
+ /**
866
+ * Returns the HTML element of the Toolbar component.
867
+ */
868
+ get element() {
869
+ return this._element;
870
+ }
871
+ /**
872
+ * @hidden
873
+ */
874
+ componentDidMount() {
875
+ window.addEventListener("resize", this.onWindowResize);
876
+ const e = this.element;
877
+ e && (this.offsetWidth = e.offsetWidth, this.offsetHeight = e.offsetHeight, this.props.keyboardNavigation !== !1 && (this.buttons = Array.from(e.querySelectorAll(this.selectors.join(","))), this.setTabIndex(0)));
878
+ }
879
+ /**
880
+ * @hidden
881
+ */
882
+ componentDidUpdate() {
883
+ const e = this.element;
884
+ !e || this.props.keyboardNavigation === !1 || (this.buttons = Array.from(e.querySelectorAll(this.selectors.join(","))), this.setTabIndex(this.focusedIndex));
885
+ }
886
+ /**
887
+ * @hidden
888
+ */
889
+ componentWillUnmount() {
890
+ window.removeEventListener("resize", this.onWindowResize), this.buttons.length = 0;
891
+ }
892
+ /**
893
+ * @hidden
894
+ */
895
+ render() {
896
+ return /* @__PURE__ */ n.createElement(
897
+ "div",
898
+ {
899
+ id: this.props.id,
900
+ "aria-label": this.props.ariaLabel,
901
+ className: f(
902
+ "k-toolbar",
903
+ {
904
+ [`k-toolbar-${P.sizeMap[this.props.size] || this.props.size}`]: this.props.size
905
+ },
906
+ this.props.className
907
+ ),
908
+ style: this.props.style,
909
+ role: this.props.role !== void 0 ? this.props.role || void 0 : "toolbar",
910
+ dir: this.props.dir,
911
+ ref: (e) => this._element = e,
912
+ onKeyDown: this.props.keyboardNavigation !== !1 ? this.onKeyDown : void 0
913
+ },
914
+ this.props.children
915
+ );
916
+ }
917
+ focusButton(e, o) {
918
+ const { tabIndex: t = xe.defaultProps.tabIndex } = this.props, i = this.buttons[o];
919
+ if (i) {
920
+ i.tabIndex = t, i.focus();
921
+ const a = this.buttons[e];
922
+ a && (a.tabIndex = -1);
923
+ }
924
+ }
925
+ };
926
+ let Ue = xe;
927
+ Ue.propTypes = {
928
+ tabIndex: s.number,
929
+ dir: s.string,
930
+ keyboardNavigation: s.bool,
931
+ style: s.object,
932
+ className: s.string,
933
+ role: s.string,
934
+ onResize: s.func,
935
+ buttons: s.arrayOf(s.string),
936
+ size: s.oneOf([null, "small", "medium", "large"])
937
+ };
938
+ Ue.defaultProps = {
939
+ tabIndex: 0,
940
+ size: "medium"
941
+ };
942
+ class gt extends n.PureComponent {
943
+ constructor() {
944
+ super(...arguments), this._element = null;
945
+ }
946
+ /**
947
+ * Returns the HTML element of the ToolbarItem component.
948
+ */
949
+ get element() {
950
+ return this._element;
951
+ }
952
+ /**
953
+ * @hidden
954
+ */
955
+ render() {
956
+ return /* @__PURE__ */ n.createElement(
957
+ "div",
958
+ {
959
+ id: this.props.id,
960
+ className: f("k-toolbar-item", this.props.className),
961
+ style: this.props.style,
962
+ ref: (o) => this._element = o
963
+ },
964
+ this.props.children
965
+ );
966
+ }
967
+ }
968
+ gt.propTypes = {
969
+ className: s.string
970
+ };
971
+ class Tt extends n.PureComponent {
972
+ /**
973
+ * @hidden
974
+ */
975
+ render() {
976
+ return /* @__PURE__ */ n.createElement("div", { className: f("k-separator", this.props.className) });
977
+ }
978
+ }
979
+ const We = n.forwardRef((e, o) => {
980
+ const t = n.useRef(null), i = n.useRef(null);
981
+ n.useImperativeHandle(i, () => ({ element: t.current })), n.useImperativeHandle(o, () => ({ element: t.current }));
982
+ const a = n.useMemo(
983
+ () => f(
984
+ "k-spacer",
985
+ e.className
986
+ ),
987
+ [e.className]
988
+ );
989
+ return /* @__PURE__ */ n.createElement(
990
+ "span",
991
+ {
992
+ ref: t,
993
+ className: a
994
+ }
995
+ );
996
+ });
997
+ We.displayName = "KendoReactToolbarSpacer";
998
+ We.propTypes = {
999
+ className: s.string
1000
+ };
1001
+ const je = we.createContext([null, (e) => {
1002
+ }]), Ve = we.createContext([null, (e) => {
1003
+ }]), Ze = we.createContext([null, (e) => {
1004
+ }]);
1005
+ var te = /* @__PURE__ */ ((e) => (e.next = "next", e.prev = "prev", e.current = "current", e.reset = "reset", e))(te || {});
1006
+ const kt = (e, o) => {
1007
+ const t = o.items.findIndex((i) => i === e);
1008
+ switch (o.type) {
1009
+ case "next":
1010
+ return t === o.items.length - 1 ? e : o.items[t + 1];
1011
+ case "prev":
1012
+ return t === 0 ? e : o.items[t - 1];
1013
+ case "current":
1014
+ return o.payload;
1015
+ case "reset":
1016
+ return null;
1017
+ default:
1018
+ return e;
1019
+ }
1020
+ };
1021
+ var qe = /* @__PURE__ */ ((e) => (e.remove = "remove", e.add = "add", e.reorder = "reorder", e))(qe || {});
1022
+ const yt = (e, o) => {
1023
+ switch (o.type) {
1024
+ case "add":
1025
+ break;
1026
+ case "remove":
1027
+ return e.filter((t) => t[o.valueField] !== o.payload);
1028
+ case "reorder":
1029
+ break;
1030
+ default:
1031
+ return e;
1032
+ }
1033
+ };
1034
+ var pe = /* @__PURE__ */ ((e) => (e.toggle = "toggle", e.remove = "remove", e))(pe || {});
1035
+ const vt = (e, o) => {
1036
+ switch (o.selection) {
1037
+ case "single":
1038
+ switch (o.type) {
1039
+ case "toggle": {
1040
+ if (!Array.isArray(e) || e === null)
1041
+ return o.payload === e ? null : o.payload;
1042
+ throw new Error("State cannot be an array in single selection");
1043
+ }
1044
+ case "remove":
1045
+ return o.payload === e ? null : e;
1046
+ default:
1047
+ return e;
1048
+ }
1049
+ case "multiple":
1050
+ switch (o.type) {
1051
+ case "toggle": {
1052
+ if (Array.isArray(e))
1053
+ return e.some((t) => t === o.payload) ? e.filter((t) => t !== o.payload) : [...e, o.payload];
1054
+ if (e === null)
1055
+ return [o.payload];
1056
+ throw new Error("State cannot be non-array in multiple selection");
1057
+ }
1058
+ case "remove":
1059
+ return Array.isArray(e) ? e.some((t) => t === o.payload) ? e.filter((t) => t !== o.payload) : [...e, o.payload] : e;
1060
+ default:
1061
+ return e;
1062
+ }
1063
+ case "none":
1064
+ return null;
1065
+ default:
1066
+ return e;
1067
+ }
1068
+ }, V = n.forwardRef((e, o) => {
1069
+ K(A);
1070
+ const t = n.useRef(null), i = n.useRef(null), a = De(i, e.dir);
1071
+ n.useImperativeHandle(t, () => ({
1072
+ element: i.current,
1073
+ props: e
1074
+ })), n.useImperativeHandle(o, () => t.current);
1075
+ const [l, d] = n.useContext(je), [c, b] = n.useContext(Ve), [, C] = n.useContext(Ze), u = n.useMemo(
1076
+ () => e.selected || (Array.isArray(l) ? l.some((p) => p === e.value) : l === e.value),
1077
+ [e.selected, e.value, l]
1078
+ ), w = n.useMemo(
1079
+ () => c === e.value,
1080
+ [e.value, c]
1081
+ );
1082
+ n.useEffect(
1083
+ () => {
1084
+ w && i.current && i.current.focus();
1085
+ },
1086
+ [w]
1087
+ );
1088
+ const N = n.useCallback(
1089
+ (p) => {
1090
+ d({ type: pe.toggle, payload: e.value, event: p });
1091
+ },
1092
+ [d, e.value]
1093
+ ), D = n.useCallback(
1094
+ (p) => {
1095
+ e.removable && (C({ type: qe.remove, payload: e.value, event: p }), b({ type: te.reset, payload: e.value, event: p }), d({ type: pe.remove, payload: e.value, event: p }), e.onRemove && e.onRemove.call(
1096
+ void 0,
1097
+ {
1098
+ target: t.current,
1099
+ syntheticEvent: p
1100
+ }
1101
+ ));
1102
+ },
1103
+ [e.onRemove, e.value, e.removable, C, b, d]
1104
+ ), S = n.useCallback(
1105
+ (p) => {
1106
+ switch (p.keyCode) {
1107
+ case r.left:
1108
+ b({ type: te.prev, payload: e.value, event: p });
1109
+ break;
1110
+ case r.right:
1111
+ b({ type: te.next, payload: e.value, event: p });
1112
+ break;
1113
+ case r.enter:
1114
+ d({ type: pe.toggle, payload: e.value, event: p });
1115
+ break;
1116
+ case r.delete:
1117
+ D(p);
1118
+ break;
1119
+ }
1120
+ e.onKeyDown && e.onKeyDown.call(
1121
+ void 0,
1122
+ {
1123
+ target: t.current,
1124
+ syntheticEvent: p
1125
+ }
1126
+ );
1127
+ },
1128
+ [e.onKeyDown, e.value, b, d, D]
1129
+ ), E = n.useCallback(
1130
+ (p) => {
1131
+ b({ payload: e.value, type: te.current, event: p }), e.onFocus && e.onFocus.call(
1132
+ void 0,
1133
+ {
1134
+ target: t.current,
1135
+ syntheticEvent: p
1136
+ }
1137
+ );
1138
+ },
1139
+ [e.onFocus, e.value, b]
1140
+ ), F = n.useCallback(
1141
+ (p) => {
1142
+ e.onBlur && e.onBlur.call(
1143
+ void 0,
1144
+ {
1145
+ target: t.current,
1146
+ syntheticEvent: p
1147
+ }
1148
+ );
1149
+ },
1150
+ [e.onBlur]
1151
+ ), k = Oe(e, t, { onClick: N });
1152
+ return /* @__PURE__ */ n.createElement(
1153
+ "div",
1154
+ {
1155
+ ...k,
1156
+ role: e.role,
1157
+ id: e.value,
1158
+ style: e.style,
1159
+ ref: i,
1160
+ dir: a,
1161
+ tabIndex: fe(e.tabIndex, e.disabled, void 0),
1162
+ className: f(
1163
+ "k-chip",
1164
+ {
1165
+ "k-rtl": a === "rtl",
1166
+ "k-disabled": e.disabled,
1167
+ "k-selected": u,
1168
+ "k-focus": w,
1169
+ [`k-chip-${P.sizeMap[e.size] || e.size}`]: e.size,
1170
+ [`k-rounded-${P.roundedMap[e.rounded] || e.rounded}`]: e.rounded,
1171
+ [`k-chip-${e.fillMode}`]: e.fillMode,
1172
+ [`k-chip-${e.fillMode}-${e.themeColor}`]: !!(e.fillMode && e.themeColor)
1173
+ },
1174
+ e.className
1175
+ ),
1176
+ "aria-checked": u,
1177
+ "aria-disabled": e.disabled,
1178
+ "aria-describedby": e.ariaDescribedBy,
1179
+ onFocus: E,
1180
+ onBlur: F,
1181
+ onKeyDown: S
1182
+ },
1183
+ u && (e.selectedIcon || e.selectedSvgIcon) && /* @__PURE__ */ n.createElement(
1184
+ L,
1185
+ {
1186
+ className: "k-chip-icon",
1187
+ name: e.selectedIcon ? Ie(e.selectedIcon) : void 0,
1188
+ icon: e.selectedSvgIcon,
1189
+ size: "small"
1190
+ }
1191
+ ),
1192
+ (e.icon || e.svgIcon) && /* @__PURE__ */ n.createElement(
1193
+ L,
1194
+ {
1195
+ className: "k-chip-icon",
1196
+ name: e.icon ? Ie(e.icon) : void 0,
1197
+ icon: e.svgIcon,
1198
+ size: "small"
1199
+ }
1200
+ ),
1201
+ e.avatar && /* @__PURE__ */ n.createElement(
1202
+ "div",
1203
+ {
1204
+ className: `k-chip-avatar k-avatar k-rounded-${e.avatar.rounded} k-avatar-md k-avatar-solid k-avatar-solid-primary`,
1205
+ style: e.avatar.style
1206
+ },
1207
+ /* @__PURE__ */ n.createElement("span", { className: "k-avatar-image" }, /* @__PURE__ */ n.createElement(
1208
+ "img",
1209
+ {
1210
+ src: e.avatar.image,
1211
+ alt: e.avatar.imageAlt
1212
+ }
1213
+ ))
1214
+ ),
1215
+ /* @__PURE__ */ n.createElement("span", { className: "k-chip-content" }, e.children !== void 0 ? e.children : e.text && /* @__PURE__ */ n.createElement(
1216
+ "span",
1217
+ {
1218
+ "aria-label": e.ariaLabel || e.text,
1219
+ className: "k-chip-label"
1220
+ },
1221
+ e.text
1222
+ )),
1223
+ e.removable && /* @__PURE__ */ n.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ n.createElement("span", { className: f("k-chip-action", "k-chip-remove-action"), onClick: D }, /* @__PURE__ */ n.createElement(
1224
+ L,
1225
+ {
1226
+ name: e.removeIcon ? Ie(e.removeIcon) : void 0,
1227
+ icon: e.removeSvgIcon || ut,
1228
+ size: "small"
1229
+ }
1230
+ )))
1231
+ );
1232
+ }), Ct = {
1233
+ id: s.string,
1234
+ text: s.string,
1235
+ value: s.any,
1236
+ dir: s.oneOf(["ltr", "rtl"]),
1237
+ removable: s.bool,
1238
+ removeIcon: s.string,
1239
+ removeIconSvg: O,
1240
+ disabled: s.bool,
1241
+ icon: s.string,
1242
+ svgIcon: O,
1243
+ selectedIcon: s.string,
1244
+ selectedIconSvg: O,
1245
+ onRemove: s.func,
1246
+ dataItem: s.any,
1247
+ selected: s.bool,
1248
+ ariaDescribedBy: s.string,
1249
+ size: s.oneOf([null, "small", "medium", "large"]),
1250
+ rounded: s.oneOf([null, "small", "medium", "large", "full"]),
1251
+ fillMode: s.oneOf([null, "outline", "solid"]),
1252
+ // eslint-disable-next-line max-len
1253
+ themeColor: s.oneOf([null, "base", "info", "success", "warning", "error"])
1254
+ }, It = {
1255
+ disabled: !1,
1256
+ removable: !1,
1257
+ removeIcon: "k-i-x-circle",
1258
+ dir: "ltr",
1259
+ size: "medium",
1260
+ rounded: "medium",
1261
+ fillMode: "solid",
1262
+ themeColor: "base"
1263
+ };
1264
+ V.displayName = "KendoReactChip";
1265
+ V.propTypes = Ct;
1266
+ V.defaultProps = It;
1267
+ const xt = (e, o, t) => {
1268
+ const [i, a] = n.useState(e);
1269
+ return [i, (d) => {
1270
+ const c = vt(o.state || i, { ...d, ...o });
1271
+ t && t(c, d.event), a(c);
1272
+ }];
1273
+ }, wt = (e) => {
1274
+ const [o, t] = n.useState(null);
1275
+ return [o, (a) => {
1276
+ const l = kt(a.payload, { ...a, ...e });
1277
+ t(l);
1278
+ }];
1279
+ }, Dt = (e, o, t) => {
1280
+ const [i, a] = n.useState(e);
1281
+ return [i, (d) => {
1282
+ const c = yt(o.state || i, { ...d, ...o });
1283
+ t && t(c, d.event), a(c);
1284
+ }];
1285
+ }, Se = n.forwardRef((e, o) => {
1286
+ K(A);
1287
+ const t = n.useRef(null), i = n.useRef(null), a = De(i, e.dir), {
1288
+ chip: l,
1289
+ id: d,
1290
+ style: c,
1291
+ tabIndex: b,
1292
+ disabled: C,
1293
+ size: u,
1294
+ className: w,
1295
+ ariaDescribedBy: N,
1296
+ ariaLabelledBy: D,
1297
+ selection: S = j.selection,
1298
+ value: E = j.defaultValue,
1299
+ defaultData: F = j.defaultData,
1300
+ valueField: k = j.valueField,
1301
+ textField: p = j.textField,
1302
+ onChange: $,
1303
+ onDataChange: T
1304
+ } = e, M = n.useMemo(
1305
+ () => l || V,
1306
+ [l, V]
1307
+ );
1308
+ n.useImperativeHandle(t, () => ({
1309
+ element: i.current,
1310
+ props: e
1311
+ })), n.useImperativeHandle(o, () => t.current);
1312
+ const H = n.useCallback(
1313
+ (g, I) => {
1314
+ $ && t.current && $.call(void 0, {
1315
+ value: g,
1316
+ target: t.current,
1317
+ syntheticEvent: I
1318
+ });
1319
+ },
1320
+ [$]
1321
+ ), [R, oe] = xt(
1322
+ E,
1323
+ {
1324
+ selection: S,
1325
+ state: E
1326
+ },
1327
+ H
1328
+ ), Z = n.useCallback(
1329
+ (g, I) => {
1330
+ T && t.current && T.call(void 0, {
1331
+ value: g,
1332
+ target: t.current,
1333
+ syntheticEvent: I
1334
+ });
1335
+ },
1336
+ [T]
1337
+ ), [q, ie] = Dt(
1338
+ e.data || F,
1339
+ {
1340
+ state: e.data,
1341
+ valueField: k
1342
+ },
1343
+ Z
1344
+ ), G = n.useCallback(
1345
+ (g, I) => (g.push(I[k]), g),
1346
+ [k]
1347
+ ), _ = n.useMemo(
1348
+ () => e.data || q,
1349
+ [e.data, q]
1350
+ ), be = n.useMemo(
1351
+ () => E || R,
1352
+ [E, R]
1353
+ ), ae = n.useMemo(
1354
+ () => _.reduce(G, []),
1355
+ [_, G]
1356
+ ), X = n.useCallback(
1357
+ (g) => Be(k)(g),
1358
+ [k]
1359
+ ), le = n.useCallback(
1360
+ (g) => Be(p)(g),
1361
+ [p]
1362
+ ), [y, ge] = wt({ items: ae }), ke = Oe(e, t);
1363
+ return /* @__PURE__ */ n.createElement(je.Provider, { value: [be, oe] }, /* @__PURE__ */ n.createElement(Ve.Provider, { value: [y, ge] }, /* @__PURE__ */ n.createElement(Ze.Provider, { value: [_, ie] }, /* @__PURE__ */ n.createElement(
1364
+ "div",
1365
+ {
1366
+ ref: i,
1367
+ ...ke,
1368
+ role: "listbox",
1369
+ id: d,
1370
+ dir: a,
1371
+ style: c,
1372
+ tabIndex: fe(b, C, void 0),
1373
+ className: f(
1374
+ "k-chip-list",
1375
+ {
1376
+ "k-rtl": a === "rtl",
1377
+ "k-disabled": C,
1378
+ [`k-chip-list-${P.sizeMap[u] || u}`]: u
1379
+ },
1380
+ w
1381
+ ),
1382
+ "aria-labelledby": D,
1383
+ "aria-describedby": N
1384
+ },
1385
+ _.map((g, I) => /* @__PURE__ */ n.createElement(
1386
+ M,
1387
+ {
1388
+ role: "option",
1389
+ dataItem: g,
1390
+ size: u,
1391
+ key: [X(g), I].join("-"),
1392
+ text: le(g),
1393
+ value: X(g),
1394
+ ariaLabel: g.ariaLabel,
1395
+ svgIcon: g.svgIcon || void 0
1396
+ }
1397
+ ))
1398
+ ))));
1399
+ }), Et = {
1400
+ id: s.string,
1401
+ className: s.string,
1402
+ tabIndex: s.number,
1403
+ data: s.any,
1404
+ defaultData: s.arrayOf(s.any),
1405
+ onDataChange: s.func,
1406
+ value: s.oneOfType([s.any, s.arrayOf(s.any)]),
1407
+ defaultValue: s.oneOfType([s.any, s.arrayOf(s.any)]),
1408
+ onChange: s.func,
1409
+ selection: s.oneOf(["single", "none", "multiple"]),
1410
+ textField: s.string,
1411
+ valueField: s.string,
1412
+ disabled: s.bool,
1413
+ dir: s.oneOf(["ltr", "rtl"]),
1414
+ ariaLabelledBy: s.string,
1415
+ ariaDescribedBy: s.string,
1416
+ size: s.oneOf([null, "small", "medium", "large"])
1417
+ }, j = {
1418
+ chip: V,
1419
+ size: "medium",
1420
+ disabled: !1,
1421
+ defaultValue: null,
1422
+ defaultData: [],
1423
+ dir: "ltr",
1424
+ selection: "none",
1425
+ textField: "text",
1426
+ valueField: "value",
1427
+ removable: "removable"
1428
+ };
1429
+ Se.displayName = "KendoReactChipList";
1430
+ Se.propTypes = Et;
1431
+ Se.defaultProps = j;
1432
+ const Fe = n.forwardRef((e, o) => {
1433
+ const {
1434
+ className: t,
1435
+ disabled: i,
1436
+ text: a,
1437
+ icon: l,
1438
+ style: d,
1439
+ id: c,
1440
+ focused: b,
1441
+ tabIndex: C,
1442
+ index: u,
1443
+ dataItem: w,
1444
+ item: N,
1445
+ svgIcon: D,
1446
+ onDown: S,
1447
+ onClick: E,
1448
+ ...F
1449
+ } = e, k = n.useRef(null), p = n.useCallback(
1450
+ () => {
1451
+ k.current && k.current.focus();
1452
+ },
1453
+ []
1454
+ ), $ = n.useCallback(
1455
+ () => ({
1456
+ element: k.current,
1457
+ focus: p
1458
+ }),
1459
+ [p]
1460
+ );
1461
+ n.useImperativeHandle(o, $);
1462
+ const T = n.useCallback(
1463
+ (R) => {
1464
+ E && u !== void 0 && !i && E(R, u);
1465
+ },
1466
+ [E, u]
1467
+ ), M = n.useMemo(
1468
+ () => f(
1469
+ "k-fab-item",
1470
+ {
1471
+ "k-focus": b,
1472
+ "k-disabled": i
1473
+ },
1474
+ t
1475
+ ),
1476
+ [t, i, b]
1477
+ ), H = N;
1478
+ return /* @__PURE__ */ n.createElement(
1479
+ "li",
1480
+ {
1481
+ ref: k,
1482
+ id: c,
1483
+ className: M,
1484
+ style: d,
1485
+ role: "menuitem",
1486
+ tabIndex: fe(C, i),
1487
+ "aria-disabled": i,
1488
+ "aria-label": `${a || ""} floatingactionbutton item`,
1489
+ onClick: T,
1490
+ onMouseDown: S,
1491
+ onPointerDown: S,
1492
+ ...F
1493
+ },
1494
+ H ? /* @__PURE__ */ n.createElement(H, { itemIndex: u, item: w }) : /* @__PURE__ */ n.createElement(n.Fragment, null, a && /* @__PURE__ */ n.createElement("span", { className: "k-fab-item-text" }, a), l || D ? /* @__PURE__ */ n.createElement(L, { className: "k-fab-item-icon", name: l, icon: D }) : null)
1495
+ );
1496
+ });
1497
+ Fe.propTypes = {
1498
+ className: s.string,
1499
+ style: s.object,
1500
+ children: s.any,
1501
+ disabled: s.bool,
1502
+ focused: s.bool,
1503
+ index: s.number,
1504
+ icon: s.string,
1505
+ svgIcon: O,
1506
+ text: s.string,
1507
+ tabIndex: s.number,
1508
+ customProp: s.any
1509
+ };
1510
+ Fe.displayName = "KendoFloatingActionButtonItem";
1511
+ const Re = "16px", he = (e) => typeof e == "number" ? e + "px" : e, Nt = (e, o) => {
1512
+ const t = { horizontal: o ? "right" : "left", vertical: "bottom" };
1513
+ return e.horizontal === "end" && (t.horizontal = o ? "left" : "right"), t;
1514
+ }, St = (e, o) => {
1515
+ const t = { horizontal: o ? "right" : "left", vertical: "top" };
1516
+ return e.horizontal === "end" && (t.horizontal = o ? "left" : "right"), t;
1517
+ }, Ft = (e, o) => {
1518
+ const t = o === "end" ? "end" : "start";
1519
+ return {
1520
+ rtl: { end: "k-text-left", start: "k-text-right" },
1521
+ ltr: { start: "k-text-left", end: "k-text-right" }
1522
+ }[e][t];
1523
+ }, zt = (e, o, t, i) => {
1524
+ const a = o.horizontal, l = o.vertical;
1525
+ if (e.current) {
1526
+ const d = t && t.x !== void 0 ? he(t.x) : Re, c = t && t.x !== void 0 ? `calc(50% + ${he(t.x)})` : "50%", b = t && t.y !== void 0 ? he(t.y) : Re, C = t && t.y !== void 0 ? `calc(50% + ${he(t.y)})` : "50%";
1527
+ e.current.style.setProperty(Pt(o, i), a === "center" ? c : d), e.current.style.setProperty(Bt(o), l === "middle" ? C : b), i && ((l === "top" || l === "bottom") && a === "start" && e.current.style.setProperty("left", "unset"), l === "middle" && a === "end" && e.current.style.setProperty("right", "unset"), l === "middle" && a === "start" && e.current.style.setProperty("left", "unset"));
1528
+ }
1529
+ }, Pt = (e, o) => {
1530
+ const { horizontal: t } = e;
1531
+ return {
1532
+ end: o ? "left" : "right",
1533
+ center: "left",
1534
+ start: o ? "right" : "left"
1535
+ }[t || "end"];
1536
+ }, Bt = (e) => ({
1537
+ top: "top",
1538
+ middle: "top",
1539
+ bottom: "bottom"
1540
+ })[e.vertical || "bottom"], Mt = 2, Rt = 100, Ge = n.forwardRef((e, o) => {
1541
+ K(A);
1542
+ const {
1543
+ align: t = Y.align,
1544
+ alignOffset: i,
1545
+ className: a,
1546
+ disabled: l,
1547
+ icon: d,
1548
+ svgIcon: c,
1549
+ iconClass: b,
1550
+ id: C,
1551
+ items: u,
1552
+ item: w,
1553
+ text: N,
1554
+ positionMode: D = Y.positionMode,
1555
+ size: S = Y.size,
1556
+ style: E,
1557
+ rounded: F = Y.rounded,
1558
+ themeColor: k = Y.themeColor,
1559
+ overlayStyle: p,
1560
+ tabIndex: $,
1561
+ accessKey: T,
1562
+ popupSettings: M = {},
1563
+ modal: H,
1564
+ onClick: R,
1565
+ onItemClick: oe,
1566
+ onFocus: Z,
1567
+ onBlur: q,
1568
+ onKeyDown: ie,
1569
+ onOpen: G,
1570
+ onClose: _,
1571
+ ...be
1572
+ } = e, ae = rt(), X = ae ? ae + Mt : Rt, le = n.useRef(null), y = n.useRef(null), ge = n.useRef(null), ke = n.useRef(null), g = n.useCallback(
1573
+ () => {
1574
+ y.current && y.current.focus();
1575
+ },
1576
+ []
1577
+ ), I = n.useCallback(
1578
+ () => ({
1579
+ element: y.current,
1580
+ focus: g
1581
+ }),
1582
+ [g]
1583
+ );
1584
+ n.useImperativeHandle(le, I), n.useImperativeHandle(o, () => le.current);
1585
+ const [z, B] = n.useState(!1), [re, U] = n.useState(!1), [J, v] = n.useState(-1), Xe = n.useMemo(() => me(), []), ye = De(y, e.dir), Q = ye === "rtl", ce = n.useMemo(() => me(), []);
1586
+ n.useEffect(
1587
+ () => {
1588
+ zt(y, t, i, Q);
1589
+ },
1590
+ [y, t, i, Q]
1591
+ ), n.useEffect(
1592
+ () => {
1593
+ re && y && y.current && y.current.focus();
1594
+ },
1595
+ [re, y]
1596
+ );
1597
+ const W = n.useCallback(
1598
+ (h, m) => {
1599
+ u && x(
1600
+ m ? G : _,
1601
+ h,
1602
+ I(),
1603
+ void 0
1604
+ );
1605
+ },
1606
+ [G, _, u]
1607
+ ), Je = n.useCallback(
1608
+ (h) => {
1609
+ !h.target || l || (!u && R ? x(
1610
+ R,
1611
+ h,
1612
+ I(),
1613
+ void 0
1614
+ ) : (B(!z), U(!0), v(z ? -1 : 0), W(h, !z)));
1615
+ },
1616
+ [
1617
+ B,
1618
+ U,
1619
+ v,
1620
+ R,
1621
+ W,
1622
+ z,
1623
+ u,
1624
+ l
1625
+ ]
1626
+ ), Qe = n.useCallback(
1627
+ (h) => {
1628
+ U(!0), v(z ? 0 : -1), Z && x(
1629
+ Z,
1630
+ h,
1631
+ I(),
1632
+ void 0
1633
+ );
1634
+ },
1635
+ [Z, U, v]
1636
+ ), Ye = n.useCallback(
1637
+ (h) => {
1638
+ U(!1), B(!1), v(-1), x(
1639
+ q,
1640
+ h,
1641
+ I(),
1642
+ void 0
1643
+ ), z && W(h, !1);
1644
+ },
1645
+ [q, U, B, v, W]
1646
+ ), et = n.useCallback(
1647
+ (h) => {
1648
+ h.preventDefault();
1649
+ },
1650
+ []
1651
+ ), ve = n.useCallback(
1652
+ (h, m) => {
1653
+ u && (u[m].disabled || x(
1654
+ oe,
1655
+ h,
1656
+ I(),
1657
+ {
1658
+ itemProps: u[m],
1659
+ itemIndex: m
1660
+ }
1661
+ ));
1662
+ },
1663
+ [oe]
1664
+ ), tt = n.useCallback(
1665
+ (h, m) => {
1666
+ !h.target || !u || (v(m), B(!1), ve(h, m), W(h, !1));
1667
+ },
1668
+ [v, B, ve, W]
1669
+ ), st = n.useCallback(
1670
+ (h) => {
1671
+ se(document) === y.current && h.preventDefault();
1672
+ },
1673
+ [y]
1674
+ ), nt = n.useCallback(
1675
+ (h) => {
1676
+ const m = J, Ce = u ? u.length - 1 : -1, de = t.vertical === "bottom";
1677
+ switch (h.keyCode) {
1678
+ case r.enter:
1679
+ case r.space:
1680
+ m >= 0 && ve(h, m), h.preventDefault(), B(!z), v(z ? -1 : 0);
1681
+ break;
1682
+ case r.esc:
1683
+ h.preventDefault(), B(!1), v(-1);
1684
+ break;
1685
+ case r.home:
1686
+ h.preventDefault(), v(0);
1687
+ break;
1688
+ case r.end:
1689
+ h.preventDefault(), v(Ce);
1690
+ break;
1691
+ case r.down:
1692
+ case r.right:
1693
+ h.preventDefault(), m < Ce && !de && v(m + 1), m > 0 && de && v(m - 1);
1694
+ break;
1695
+ case r.up:
1696
+ case r.left:
1697
+ h.preventDefault(), m > 0 && !de && v(m - 1), m < Ce && de && v(m + 1);
1698
+ break;
1699
+ }
1700
+ x(
1701
+ ie,
1702
+ h,
1703
+ I(),
1704
+ void 0
1705
+ );
1706
+ },
1707
+ [ie, J, v, Q, B]
1708
+ ), ot = n.useMemo(
1709
+ () => f(
1710
+ "k-fab k-fab-solid",
1711
+ {
1712
+ "k-fab-sm": S === "small",
1713
+ "k-fab-md": S === "medium",
1714
+ "k-fab-lg": S === "large",
1715
+ "k-disabled": l,
1716
+ "k-pos-absolute": D === "absolute",
1717
+ "k-pos-fixed": D === "fixed",
1718
+ "k-focus": re,
1719
+ [`k-rounded-${P.roundedMap[F] || F}`]: F,
1720
+ [`k-fab-solid-${k}`]: k
1721
+ },
1722
+ `k-${t.vertical}-${t.horizontal}`,
1723
+ a
1724
+ ),
1725
+ [k, S, F, l, D, t, re, a]
1726
+ ), it = u && u.map((h, m) => /* @__PURE__ */ n.createElement(
1727
+ Fe,
1728
+ {
1729
+ ...h,
1730
+ key: m,
1731
+ index: m,
1732
+ id: `${ce}-${m}`,
1733
+ disabled: l || h.disabled,
1734
+ focused: J === m,
1735
+ dataItem: h,
1736
+ item: w,
1737
+ className: f(
1738
+ h.className,
1739
+ Ft(ye || "ltr", t.horizontal)
1740
+ ),
1741
+ onClick: tt,
1742
+ onDown: st
1743
+ }
1744
+ )), ze = !!((d || c) && !N), at = y.current ? y.current.offsetWidth : 0, lt = 32, Pe = at / 2 - lt / 2;
1745
+ return /* @__PURE__ */ n.createElement(ct.Provider, { value: X }, /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
1746
+ "button",
1747
+ {
1748
+ ref: y,
1749
+ id: C || Xe,
1750
+ role: u ? "menubutton" : "button",
1751
+ type: "button",
1752
+ "aria-disabled": l,
1753
+ "aria-expanded": u ? z : void 0,
1754
+ "aria-haspopup": !!u,
1755
+ "aria-label": `${N || ""} floatingactionbutton`,
1756
+ "aria-owns": u ? ce : void 0,
1757
+ "aria-activedescendant": J >= 0 && u ? `${ce}-${J}` : void 0,
1758
+ tabIndex: fe($, l),
1759
+ accessKey: T,
1760
+ dir: ye,
1761
+ disabled: l,
1762
+ className: ot,
1763
+ style: E,
1764
+ onClick: Je,
1765
+ onMouseDown: et,
1766
+ onFocus: Qe,
1767
+ onBlur: Ye,
1768
+ onKeyDown: nt,
1769
+ ...be
1770
+ },
1771
+ d || c ? /* @__PURE__ */ n.createElement(L, { className: "k-fab-icon", name: d, icon: c }) : b ? /* @__PURE__ */ n.createElement("span", { role: "presentation", className: b }) : null,
1772
+ N && /* @__PURE__ */ n.createElement("span", { className: "k-fab-text" }, N)
1773
+ ), H && z && /* @__PURE__ */ n.createElement(
1774
+ "div",
1775
+ {
1776
+ className: "k-overlay",
1777
+ style: {
1778
+ zIndex: X,
1779
+ ...p
1780
+ }
1781
+ }
1782
+ ), /* @__PURE__ */ n.createElement(
1783
+ Ee,
1784
+ {
1785
+ ref: ke,
1786
+ anchor: y.current,
1787
+ show: z,
1788
+ animate: M.animate,
1789
+ popupClass: f("k-popup-transparent k-fab-popup", M.popupClass),
1790
+ anchorAlign: M.anchorAlign || Nt(t, Q),
1791
+ popupAlign: M.popupAlign || St(t, Q),
1792
+ style: { boxShadow: "none" }
1793
+ },
1794
+ /* @__PURE__ */ n.createElement(
1795
+ "ul",
1796
+ {
1797
+ ref: ge,
1798
+ role: "menu",
1799
+ "aria-labelledby": C,
1800
+ id: ce,
1801
+ className: f("k-fab-items", {
1802
+ "k-fab-items-bottom": t.vertical !== "bottom",
1803
+ "k-fab-items-top": t.vertical === "bottom"
1804
+ }),
1805
+ style: {
1806
+ paddingLeft: ze ? Pe : void 0,
1807
+ paddingRight: ze ? Pe : void 0
1808
+ }
1809
+ },
1810
+ it
1811
+ )
1812
+ )));
1813
+ });
1814
+ Ge.propTypes = {
1815
+ className: s.string,
1816
+ style: s.object,
1817
+ id: s.string,
1818
+ dir: s.string,
1819
+ tabIndex: s.number,
1820
+ accessKey: s.string,
1821
+ disabled: s.bool,
1822
+ icon: s.string,
1823
+ svgIcon: O,
1824
+ iconClass: s.string,
1825
+ text: s.string,
1826
+ alignOffset: s.shape({
1827
+ x: s.oneOfType([s.number, s.string]),
1828
+ y: s.oneOfType([s.number, s.string])
1829
+ }),
1830
+ align: s.shape({
1831
+ vertical: s.oneOf(["top", "middle", "bottom"]),
1832
+ horizontal: s.oneOf(["start", "center", "end"])
1833
+ }),
1834
+ positionMode: s.oneOf(["absolute", "fixed"]),
1835
+ size: s.oneOf([null, "small", "medium", "large"]),
1836
+ rounded: s.oneOf([null, "small", "medium", "large", "full"]),
1837
+ themeColor: s.oneOf([
1838
+ null,
1839
+ "primary",
1840
+ "secondary",
1841
+ "tertiary",
1842
+ "info",
1843
+ "success",
1844
+ "warning",
1845
+ "error",
1846
+ "dark",
1847
+ "light",
1848
+ "inverse"
1849
+ ]),
1850
+ modal: s.bool,
1851
+ overlayStyle: s.object
1852
+ };
1853
+ const Y = {
1854
+ align: { vertical: "bottom", horizontal: "end" },
1855
+ size: "medium",
1856
+ rounded: "full",
1857
+ themeColor: "primary",
1858
+ positionMode: "fixed"
1859
+ };
1860
+ Ge.displayName = "KendoFloatingActionButton";
1861
+ export {
1862
+ ne as Button,
1863
+ bt as ButtonGroup,
1864
+ V as Chip,
1865
+ Se as ChipList,
1866
+ He as DropDownButton,
1867
+ Le as DropDownButtonItem,
1868
+ Ge as FloatingActionButton,
1869
+ Fe as FloatingActionButtonItem,
1870
+ _e as SplitButton,
1871
+ Ke as SplitButtonItem,
1872
+ Ue as Toolbar,
1873
+ gt as ToolbarItem,
1874
+ Tt as ToolbarSeparator,
1875
+ We as ToolbarSpacer,
1876
+ mt as toolbarButtons
1877
+ };