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