@progress/kendo-react-buttons 5.4.0-dev.202205200719 → 5.4.0-dev.202206061009
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/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/dist/es/Button.d.ts +9 -9
- package/dist/es/Button.js +16 -12
- package/dist/es/ButtonGroup.d.ts +2 -2
- package/dist/es/ButtonGroup.js +8 -6
- package/dist/es/ButtonGroupInterface.d.ts +5 -0
- package/dist/es/ButtonGroupInterface.js +1 -0
- package/dist/es/ButtonInterface.js +1 -0
- package/dist/es/Chip/Chip.d.ts +1 -1
- package/dist/es/Chip/Chip.js +4 -4
- package/dist/es/Chip/ChipList.d.ts +4 -4
- package/dist/es/Chip/ChipList.js +4 -4
- package/dist/es/Chip/selection-reducer.js +11 -2
- package/dist/es/FloatingActionButton/FloatingActionButton.d.ts +1 -1
- package/dist/es/FloatingActionButton/FloatingActionButton.js +11 -9
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.d.ts +1 -1
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +6 -4
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +1 -0
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +1 -0
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.js +1 -0
- package/dist/es/FloatingActionButton/models/align-offset.js +1 -0
- package/dist/es/FloatingActionButton/models/align.js +1 -0
- package/dist/es/FloatingActionButton/models/events.js +1 -0
- package/dist/es/FloatingActionButton/models/position-mode.js +1 -0
- package/dist/es/FloatingActionButton/models/rounded.js +1 -0
- package/dist/es/FloatingActionButton/models/shape.js +1 -0
- package/dist/es/FloatingActionButton/models/size.js +1 -0
- package/dist/es/FloatingActionButton/models/theme-color.js +1 -0
- package/dist/es/FloatingActionButton/utils.d.ts +2 -2
- package/dist/es/FloatingActionButton/utils.js +2 -2
- package/dist/es/ListButton/ButtonItem.d.ts +1 -2
- package/dist/es/ListButton/ButtonItem.js +3 -4
- package/dist/es/ListButton/DropDownButton.d.ts +3 -3
- package/dist/es/ListButton/DropDownButton.js +12 -10
- package/dist/es/ListButton/DropDownButtonItem.d.ts +2 -2
- package/dist/es/ListButton/DropDownButtonItem.js +4 -2
- package/dist/es/ListButton/SplitButton.d.ts +3 -3
- package/dist/es/ListButton/SplitButton.js +13 -11
- package/dist/es/ListButton/SplitButtonItem.d.ts +2 -2
- package/dist/es/ListButton/SplitButtonItem.js +4 -2
- package/dist/es/ListButton/models/ButtonItem.js +1 -0
- package/dist/es/ListButton/models/ListButtonProps.js +1 -0
- package/dist/es/ListButton/models/PopupSettings.js +1 -0
- package/dist/es/ListButton/models/events.d.ts +2 -2
- package/dist/es/ListButton/models/events.js +1 -0
- package/dist/es/ListButton/utils/navigation.d.ts +1 -1
- package/dist/es/ListButton/utils/navigation.js +1 -1
- package/dist/es/main.d.ts +9 -9
- package/dist/es/main.js +10 -9
- package/dist/es/models/index.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/toolbar/Toolbar.d.ts +5 -5
- package/dist/es/toolbar/Toolbar.js +8 -6
- package/dist/es/toolbar/tools/ToolbarItem.d.ts +2 -2
- package/dist/es/toolbar/tools/ToolbarItem.js +5 -3
- package/dist/es/toolbar/tools/ToolbarSeparator.d.ts +1 -1
- package/dist/es/toolbar/tools/ToolbarSeparator.js +5 -3
- package/dist/es/toolbar/tools/ToolbarSpacer.d.ts +1 -1
- package/dist/es/toolbar/tools/ToolbarSpacer.js +1 -0
- package/dist/es/util.d.ts +9 -9
- package/dist/npm/Button.d.ts +9 -9
- package/dist/npm/Button.js +21 -16
- package/dist/npm/ButtonGroup.d.ts +2 -2
- package/dist/npm/ButtonGroup.js +12 -9
- package/dist/npm/ButtonGroupInterface.d.ts +5 -0
- package/dist/npm/Chip/Chip.d.ts +1 -1
- package/dist/npm/Chip/Chip.js +12 -11
- package/dist/npm/Chip/ChipList.d.ts +4 -4
- package/dist/npm/Chip/ChipList.js +11 -10
- package/dist/npm/Chip/data-reducer.js +3 -1
- package/dist/npm/Chip/focus-reducer.js +3 -1
- package/dist/npm/Chip/selection-reducer.js +14 -3
- package/dist/npm/FloatingActionButton/FloatingActionButton.d.ts +1 -1
- package/dist/npm/FloatingActionButton/FloatingActionButton.js +27 -24
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.d.ts +1 -1
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +8 -5
- package/dist/npm/FloatingActionButton/utils.d.ts +2 -2
- package/dist/npm/FloatingActionButton/utils.js +15 -9
- package/dist/npm/ListButton/ButtonItem.d.ts +1 -2
- package/dist/npm/ListButton/ButtonItem.js +7 -6
- package/dist/npm/ListButton/DropDownButton.d.ts +3 -3
- package/dist/npm/ListButton/DropDownButton.js +21 -18
- package/dist/npm/ListButton/DropDownButtonItem.d.ts +2 -2
- package/dist/npm/ListButton/DropDownButtonItem.js +5 -2
- package/dist/npm/ListButton/SplitButton.d.ts +3 -3
- package/dist/npm/ListButton/SplitButton.js +23 -20
- package/dist/npm/ListButton/SplitButtonItem.d.ts +2 -2
- package/dist/npm/ListButton/SplitButtonItem.js +5 -2
- package/dist/npm/ListButton/models/events.d.ts +2 -2
- package/dist/npm/ListButton/utils/navigation.d.ts +1 -1
- package/dist/npm/ListButton/utils/navigation.js +2 -1
- package/dist/npm/ListButton/utils/popup.js +1 -0
- package/dist/npm/main.d.ts +9 -9
- package/dist/npm/main.js +30 -14
- package/dist/npm/package-metadata.js +2 -1
- package/dist/npm/toolbar/Toolbar.d.ts +5 -5
- package/dist/npm/toolbar/Toolbar.js +11 -8
- package/dist/npm/toolbar/tools/ToolbarItem.d.ts +2 -2
- package/dist/npm/toolbar/tools/ToolbarItem.js +6 -3
- package/dist/npm/toolbar/tools/ToolbarSeparator.d.ts +1 -1
- package/dist/npm/toolbar/tools/ToolbarSeparator.js +6 -3
- package/dist/npm/toolbar/tools/ToolbarSpacer.d.ts +1 -1
- package/dist/npm/toolbar/tools/ToolbarSpacer.js +3 -1
- package/dist/npm/util.d.ts +9 -9
- package/dist/npm/util.js +1 -0
- package/dist/systemjs/kendo-react-buttons.js +1 -1
- package/package.json +13 -13
|
@@ -15,11 +15,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.FloatingActionButton = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var PropTypes = require("prop-types");
|
|
25
28
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -46,9 +49,9 @@ var DEFAULT_FAB_ZINDEX = 100;
|
|
|
46
49
|
* ```
|
|
47
50
|
*/
|
|
48
51
|
exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
49
|
-
kendo_react_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
52
|
+
(0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
50
53
|
var _a = props.align, align = _a === void 0 ? defaultProps.align : _a, alignOffset = props.alignOffset, className = props.className, disabled = props.disabled, icon = props.icon, iconClass = props.iconClass, id = props.id, items = props.items, item = props.item, text = props.text, _b = props.positionMode, positionMode = _b === void 0 ? defaultProps.positionMode : _b, _c = props.shape, shape = _c === void 0 ? defaultProps.shape : _c, _d = props.size, size = _d === void 0 ? defaultProps.size : _d, style = props.style, _e = props.rounded, rounded = _e === void 0 ? defaultProps.rounded : _e, _f = props.themeColor, themeColor = _f === void 0 ? defaultProps.themeColor : _f, overlayStyle = props.overlayStyle, tabIndex = props.tabIndex, accessKey = props.accessKey, _g = props.popupSettings, popupSettings = _g === void 0 ? {} : _g, modal = props.modal, onClick = props.onClick, onItemClick = props.onItemClick, onFocus = props.onFocus, onBlur = props.onBlur, onKeyDown = props.onKeyDown, onOpen = props.onOpen, onClose = props.onClose, others = __rest(props, ["align", "alignOffset", "className", "disabled", "icon", "iconClass", "id", "items", "item", "text", "positionMode", "shape", "size", "style", "rounded", "themeColor", "overlayStyle", "tabIndex", "accessKey", "popupSettings", "modal", "onClick", "onItemClick", "onFocus", "onBlur", "onKeyDown", "onOpen", "onClose"]);
|
|
51
|
-
var zIndexContext = kendo_react_common_1.useZIndexContext();
|
|
54
|
+
var zIndexContext = (0, kendo_react_common_1.useZIndexContext)();
|
|
52
55
|
var currentZIndex = zIndexContext ? zIndexContext + ZINDEX_FAB_STEP : DEFAULT_FAB_ZINDEX;
|
|
53
56
|
var target = React.useRef(null);
|
|
54
57
|
var elementRef = React.useRef(null);
|
|
@@ -68,12 +71,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
68
71
|
var _h = React.useState(false), open = _h[0], setOpen = _h[1];
|
|
69
72
|
var _j = React.useState(false), focused = _j[0], setFocused = _j[1];
|
|
70
73
|
var _k = React.useState(-1), focusedIndex = _k[0], setFocusedIndex = _k[1];
|
|
71
|
-
var buttonId = React.useMemo(function () { return kendo_react_common_2.guid(); }, []);
|
|
72
|
-
var dir = kendo_react_common_2.useDir(elementRef, props.dir);
|
|
74
|
+
var buttonId = React.useMemo(function () { return (0, kendo_react_common_2.guid)(); }, []);
|
|
75
|
+
var dir = (0, kendo_react_common_2.useDir)(elementRef, props.dir);
|
|
73
76
|
var isRtl = dir === 'rtl';
|
|
74
|
-
var listId = React.useMemo(function () { return kendo_react_common_2.guid(); }, []);
|
|
77
|
+
var listId = React.useMemo(function () { return (0, kendo_react_common_2.guid)(); }, []);
|
|
75
78
|
React.useEffect(function () {
|
|
76
|
-
utils_1.position(elementRef, align, alignOffset, isRtl);
|
|
79
|
+
(0, utils_1.position)(elementRef, align, alignOffset, isRtl);
|
|
77
80
|
}, [elementRef, align, alignOffset, isRtl]);
|
|
78
81
|
React.useEffect(function () {
|
|
79
82
|
if (focused && elementRef && elementRef.current) {
|
|
@@ -85,14 +88,14 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
85
88
|
if (!items) {
|
|
86
89
|
return;
|
|
87
90
|
}
|
|
88
|
-
kendo_react_common_2.dispatchEvent(isOpen ? onOpen : onClose, dispatchedEvent, getImperativeHandle(), undefined);
|
|
91
|
+
(0, kendo_react_common_2.dispatchEvent)(isOpen ? onOpen : onClose, dispatchedEvent, getImperativeHandle(), undefined);
|
|
89
92
|
}, [onOpen, onClose, items]);
|
|
90
93
|
var handleClick = React.useCallback(function (event) {
|
|
91
94
|
if (!event.target || disabled) {
|
|
92
95
|
return;
|
|
93
96
|
}
|
|
94
97
|
if (!items && onClick) {
|
|
95
|
-
kendo_react_common_2.dispatchEvent(onClick, event, getImperativeHandle(), undefined);
|
|
98
|
+
(0, kendo_react_common_2.dispatchEvent)(onClick, event, getImperativeHandle(), undefined);
|
|
96
99
|
}
|
|
97
100
|
else {
|
|
98
101
|
setOpen(!open);
|
|
@@ -106,14 +109,14 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
106
109
|
setFocused(true);
|
|
107
110
|
setFocusedIndex(open ? 0 : -1);
|
|
108
111
|
if (onFocus) {
|
|
109
|
-
kendo_react_common_2.dispatchEvent(onFocus, event, getImperativeHandle(), undefined);
|
|
112
|
+
(0, kendo_react_common_2.dispatchEvent)(onFocus, event, getImperativeHandle(), undefined);
|
|
110
113
|
}
|
|
111
114
|
}, [onFocus, setFocused, setFocusedIndex]);
|
|
112
115
|
var handleBlur = React.useCallback(function (event) {
|
|
113
116
|
setFocused(false);
|
|
114
117
|
setOpen(false);
|
|
115
118
|
setFocusedIndex(-1);
|
|
116
|
-
kendo_react_common_2.dispatchEvent(onBlur, event, getImperativeHandle(), undefined);
|
|
119
|
+
(0, kendo_react_common_2.dispatchEvent)(onBlur, event, getImperativeHandle(), undefined);
|
|
117
120
|
var fireCloseEvent = open;
|
|
118
121
|
if (fireCloseEvent) {
|
|
119
122
|
dispatchPopupEvent(event, false);
|
|
@@ -127,7 +130,7 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
127
130
|
return;
|
|
128
131
|
}
|
|
129
132
|
if (!items[index].disabled) {
|
|
130
|
-
kendo_react_common_2.dispatchEvent(onItemClick, dispatchedEvent, getImperativeHandle(), {
|
|
133
|
+
(0, kendo_react_common_2.dispatchEvent)(onItemClick, dispatchedEvent, getImperativeHandle(), {
|
|
131
134
|
itemProps: items[index],
|
|
132
135
|
itemIndex: index
|
|
133
136
|
});
|
|
@@ -197,12 +200,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
197
200
|
default:
|
|
198
201
|
break;
|
|
199
202
|
}
|
|
200
|
-
kendo_react_common_2.dispatchEvent(onKeyDown, event, getImperativeHandle(), undefined);
|
|
203
|
+
(0, kendo_react_common_2.dispatchEvent)(onKeyDown, event, getImperativeHandle(), undefined);
|
|
201
204
|
}, [onKeyDown, focusedIndex, setFocusedIndex, isRtl, setOpen]);
|
|
202
205
|
var buttonClassNames = React.useMemo(function () {
|
|
203
206
|
var _a;
|
|
204
|
-
return kendo_react_common_2.classNames('k-fab k-fab-solid', (_a = {},
|
|
205
|
-
_a["k-fab-"
|
|
207
|
+
return (0, kendo_react_common_2.classNames)('k-fab k-fab-solid', (_a = {},
|
|
208
|
+
_a["k-fab-".concat(shape)] = shape,
|
|
206
209
|
_a['k-fab-sm'] = size === 'small',
|
|
207
210
|
_a['k-fab-md'] = size === 'medium',
|
|
208
211
|
_a['k-fab-lg'] = size === 'large',
|
|
@@ -210,12 +213,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
210
213
|
_a['k-pos-absolute'] = positionMode === 'absolute',
|
|
211
214
|
_a['k-pos-fixed'] = positionMode === 'fixed',
|
|
212
215
|
_a['k-focus'] = focused,
|
|
213
|
-
_a["k-rounded-"
|
|
214
|
-
_a["k-fab-solid-"
|
|
215
|
-
_a), "k-"
|
|
216
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
217
|
+
_a["k-fab-solid-".concat(themeColor)] = themeColor,
|
|
218
|
+
_a), "k-".concat(align.vertical, "-").concat(align.horizontal), className);
|
|
216
219
|
}, [themeColor, size, rounded, shape, disabled, positionMode, align, focused, className]);
|
|
217
220
|
var fabItems = (items && (items.map(function (element, index) {
|
|
218
|
-
return (React.createElement(FloatingActionButtonItem_1.FloatingActionButtonItem, __assign({}, element, { key: index, index: index, id: listId
|
|
221
|
+
return (React.createElement(FloatingActionButtonItem_1.FloatingActionButtonItem, __assign({}, element, { key: index, index: index, id: "".concat(listId, "-").concat(index), disabled: disabled || element.disabled, focused: focusedIndex === index, dataItem: element, item: item, className: (0, kendo_react_common_2.classNames)(element.className, (0, utils_1.getTextDirectionClass)(dir || 'ltr', align.horizontal)), onClick: handleItemClick, onDown: handleItemDown })));
|
|
219
222
|
})));
|
|
220
223
|
var isIconFab = icon && !text;
|
|
221
224
|
var fabWidth = elementRef.current ? elementRef.current.offsetWidth : 0;
|
|
@@ -223,16 +226,16 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
223
226
|
var spacing = (fabWidth / 2) - (iconWidth / 2);
|
|
224
227
|
return (React.createElement(kendo_react_common_1.ZIndexContext.Provider, { value: currentZIndex },
|
|
225
228
|
React.createElement(React.Fragment, null,
|
|
226
|
-
React.createElement("button", __assign({ ref: elementRef, id: id || buttonId, role: items ? 'menubutton' : 'button', type: 'button', "aria-disabled": disabled, "aria-expanded": items ? open : undefined, "aria-haspopup": items ? true : false, "aria-label": (text || ''
|
|
229
|
+
React.createElement("button", __assign({ ref: elementRef, id: id || buttonId, role: items ? 'menubutton' : 'button', type: 'button', "aria-disabled": disabled, "aria-expanded": items ? open : undefined, "aria-haspopup": items ? true : false, "aria-label": "".concat(text || '', " floatingactionbutton"), "aria-owns": items ? listId : undefined, "aria-activedescendant": focusedIndex >= 0 && items ? "".concat(listId, "-").concat(focusedIndex) : undefined, tabIndex: (0, kendo_react_common_2.getTabIndex)(tabIndex, disabled), accessKey: accessKey, dir: dir, disabled: disabled, className: buttonClassNames, style: style, onClick: handleClick, onMouseDown: handleMouseDown, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown }, others),
|
|
227
230
|
icon ?
|
|
228
|
-
React.createElement("span", { role: "presentation", className: kendo_react_common_2.classNames("k-fab-icon k-icon k-i-"
|
|
231
|
+
React.createElement("span", { role: "presentation", className: (0, kendo_react_common_2.classNames)("k-fab-icon k-icon k-i-".concat(icon)) }) :
|
|
229
232
|
iconClass ?
|
|
230
233
|
React.createElement("span", { role: "presentation", className: iconClass }) :
|
|
231
234
|
null,
|
|
232
235
|
text && React.createElement("span", { className: "k-fab-text" }, text)),
|
|
233
236
|
modal && open && (React.createElement("div", { className: "k-overlay", style: __assign({ zIndex: currentZIndex }, overlayStyle) })),
|
|
234
|
-
React.createElement(kendo_react_popup_1.Popup, { ref: popupRef, anchor: elementRef.current, show: open, animate: popupSettings.animate, popupClass: kendo_react_common_2.classNames('k-popup-transparent k-fab-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || utils_1.getAnchorAlign(align, isRtl), popupAlign: popupSettings.popupAlign || utils_1.getPopupAlign(align, isRtl), style: { boxShadow: 'none' } },
|
|
235
|
-
React.createElement("ul", { ref: listRef, role: 'menu', "aria-labelledby": id, id: listId, className: kendo_react_common_2.classNames('k-fab-items', {
|
|
237
|
+
React.createElement(kendo_react_popup_1.Popup, { ref: popupRef, anchor: elementRef.current, show: open, animate: popupSettings.animate, popupClass: (0, kendo_react_common_2.classNames)('k-popup-transparent k-fab-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || (0, utils_1.getAnchorAlign)(align, isRtl), popupAlign: popupSettings.popupAlign || (0, utils_1.getPopupAlign)(align, isRtl), style: { boxShadow: 'none' } },
|
|
238
|
+
React.createElement("ul", { ref: listRef, role: 'menu', "aria-labelledby": id, id: listId, className: (0, kendo_react_common_2.classNames)('k-fab-items', {
|
|
236
239
|
'k-fab-items-bottom': align.vertical !== 'bottom',
|
|
237
240
|
'k-fab-items-top': align.vertical === 'bottom'
|
|
238
241
|
}), style: {
|
|
@@ -97,4 +97,4 @@ export interface FloatingActionButtonItemProps {
|
|
|
97
97
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
|
-
export declare const FloatingActionButtonItem: React.ForwardRefExoticComponent<Pick<FloatingActionButtonItemProps,
|
|
100
|
+
export declare const FloatingActionButtonItem: React.ForwardRefExoticComponent<Pick<FloatingActionButtonItemProps, keyof FloatingActionButtonItemProps> & React.RefAttributes<FloatingActionButtonItemHandle | null>>;
|
|
@@ -15,11 +15,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.FloatingActionButtonItem = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var PropTypes = require("prop-types");
|
|
25
28
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -55,15 +58,15 @@ exports.FloatingActionButtonItem = React.forwardRef(function (props, ref) {
|
|
|
55
58
|
onClick(event, index);
|
|
56
59
|
}
|
|
57
60
|
}, [onClick, index]);
|
|
58
|
-
var itemClassNames = React.useMemo(function () { return kendo_react_common_1.classNames('k-fab-item', {
|
|
61
|
+
var itemClassNames = React.useMemo(function () { return (0, kendo_react_common_1.classNames)('k-fab-item', {
|
|
59
62
|
'k-focus': focused,
|
|
60
63
|
'k-disabled': disabled
|
|
61
64
|
}, className); }, [className, disabled, focused]);
|
|
62
65
|
var ItemComp = item;
|
|
63
|
-
return (React.createElement("li", __assign({ ref: elementRef, id: id, className: itemClassNames, style: style, role: 'menuitem', tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled), "aria-disabled": disabled, "aria-label": (text || ''
|
|
66
|
+
return (React.createElement("li", __assign({ ref: elementRef, id: id, className: itemClassNames, style: style, role: 'menuitem', tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled), "aria-disabled": disabled, "aria-label": "".concat(text || '', " floatingactionbutton item"), onClick: handleClick, onMouseDown: onDown, onPointerDown: onDown }, others), ItemComp ? React.createElement(ItemComp, { itemIndex: index, item: dataItem }) :
|
|
64
67
|
(React.createElement(React.Fragment, null,
|
|
65
68
|
text && React.createElement("span", { className: "k-fab-item-text" }, text),
|
|
66
|
-
icon && React.createElement("span", { className: kendo_react_common_1.classNames("k-fab-item-icon k-icon k-i-"
|
|
69
|
+
icon && React.createElement("span", { className: (0, kendo_react_common_1.classNames)("k-fab-item-icon k-icon k-i-".concat(icon)) })))));
|
|
67
70
|
});
|
|
68
71
|
exports.FloatingActionButtonItem.propTypes = {
|
|
69
72
|
className: PropTypes.string,
|
|
@@ -8,7 +8,7 @@ export declare const DEFAULT_OFFSET = "16px";
|
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
|
-
export declare const toStringValues: (val:
|
|
11
|
+
export declare const toStringValues: (val: number | string) => string;
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
@@ -24,4 +24,4 @@ export declare const getTextDirectionClass: (rtl: string, hAlign: any) => any;
|
|
|
24
24
|
/**
|
|
25
25
|
* @hidden
|
|
26
26
|
*/
|
|
27
|
-
export declare const position: (ref: any, align: FloatingActionButtonAlign, alignOffset: FloatingActionButtonAlignOffset, isRtl: boolean) => void;
|
|
27
|
+
export declare const position: (ref: any, align: FloatingActionButtonAlign, alignOffset: FloatingActionButtonAlignOffset | undefined, isRtl: boolean) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.position = exports.getTextDirectionClass = exports.getPopupAlign = exports.getAnchorAlign = exports.toStringValues = exports.DEFAULT_OFFSET = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -7,36 +8,39 @@ exports.DEFAULT_OFFSET = '16px';
|
|
|
7
8
|
/**
|
|
8
9
|
* @hidden
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
var toStringValues = function (val) {
|
|
11
12
|
if (typeof val === 'number') {
|
|
12
13
|
return val + 'px';
|
|
13
14
|
}
|
|
14
15
|
return val;
|
|
15
16
|
};
|
|
17
|
+
exports.toStringValues = toStringValues;
|
|
16
18
|
/**
|
|
17
19
|
* @hidden
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
var getAnchorAlign = function (fabAlign, rtl) {
|
|
20
22
|
var align = { horizontal: (rtl ? 'right' : 'left'), vertical: 'bottom' };
|
|
21
23
|
if (fabAlign.horizontal === 'end') {
|
|
22
24
|
align.horizontal = rtl ? 'left' : 'right';
|
|
23
25
|
}
|
|
24
26
|
return align;
|
|
25
27
|
};
|
|
28
|
+
exports.getAnchorAlign = getAnchorAlign;
|
|
26
29
|
/**
|
|
27
30
|
* @hidden
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
var getPopupAlign = function (fabAlign, rtl) {
|
|
30
33
|
var align = { horizontal: (rtl ? 'right' : 'left'), vertical: 'top' };
|
|
31
34
|
if (fabAlign.horizontal === 'end') {
|
|
32
35
|
align.horizontal = rtl ? 'left' : 'right';
|
|
33
36
|
}
|
|
34
37
|
return align;
|
|
35
38
|
};
|
|
39
|
+
exports.getPopupAlign = getPopupAlign;
|
|
36
40
|
/**
|
|
37
41
|
* @hidden
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
var getTextDirectionClass = function (rtl, hAlign) {
|
|
40
44
|
var al = hAlign === 'end' ? 'end' : 'start';
|
|
41
45
|
var directions = {
|
|
42
46
|
rtl: { end: 'k-text-left', start: 'k-text-right' },
|
|
@@ -44,24 +48,25 @@ exports.getTextDirectionClass = function (rtl, hAlign) {
|
|
|
44
48
|
};
|
|
45
49
|
return directions[rtl][al];
|
|
46
50
|
};
|
|
51
|
+
exports.getTextDirectionClass = getTextDirectionClass;
|
|
47
52
|
/**
|
|
48
53
|
* @hidden
|
|
49
54
|
*/
|
|
50
|
-
|
|
55
|
+
var position = function (ref, align, alignOffset, isRtl) {
|
|
51
56
|
var horizontal = align.horizontal;
|
|
52
57
|
var vertical = align.vertical;
|
|
53
58
|
if (ref.current) {
|
|
54
59
|
var xFab = alignOffset && alignOffset.x !== undefined ?
|
|
55
|
-
exports.toStringValues(alignOffset.x) :
|
|
60
|
+
(0, exports.toStringValues)(alignOffset.x) :
|
|
56
61
|
exports.DEFAULT_OFFSET;
|
|
57
62
|
var xCenterFab = alignOffset && alignOffset.x !== undefined ?
|
|
58
|
-
"calc(50% + "
|
|
63
|
+
"calc(50% + ".concat((0, exports.toStringValues)(alignOffset.x), ")") :
|
|
59
64
|
'50%';
|
|
60
65
|
var yFab = alignOffset && alignOffset.y !== undefined ?
|
|
61
|
-
exports.toStringValues(alignOffset.y) :
|
|
66
|
+
(0, exports.toStringValues)(alignOffset.y) :
|
|
62
67
|
exports.DEFAULT_OFFSET;
|
|
63
68
|
var yCenterFab = alignOffset && alignOffset.y !== undefined ?
|
|
64
|
-
"calc(50% + "
|
|
69
|
+
"calc(50% + ".concat((0, exports.toStringValues)(alignOffset.y), ")") :
|
|
65
70
|
'50%';
|
|
66
71
|
ref.current.style.setProperty(horizontalPosition(align, isRtl), horizontal === 'center' ? xCenterFab : xFab);
|
|
67
72
|
ref.current.style.setProperty(verticalPosition(align), vertical === 'middle' ? yCenterFab : yFab);
|
|
@@ -78,6 +83,7 @@ exports.position = function (ref, align, alignOffset, isRtl) {
|
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
85
|
};
|
|
86
|
+
exports.position = position;
|
|
81
87
|
var horizontalPosition = function (align, isRtl) {
|
|
82
88
|
var horizontal = align.horizontal;
|
|
83
89
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonItem = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
5
6
|
/**
|
|
@@ -12,20 +13,20 @@ var ButtonItem = function (props) {
|
|
|
12
13
|
}, [props]);
|
|
13
14
|
var As = props.dataItem.render || props.item || (props.item === undefined ? props.render : null);
|
|
14
15
|
var text = props.dataItem.text !== undefined ? props.dataItem.text : (props.textField ? props.dataItem[props.textField] : props.dataItem);
|
|
15
|
-
var item = (React.createElement("li", { id: props.id, className: kendo_react_common_1.classNames('k-item', props.className, { 'k-focus': props.focused }), onClick: handleClick, onMouseDown: props.onDown, onPointerDown: props.onDown, role: "menuitem", "aria-disabled": props.dataItem.disabled || undefined }, (React.createElement("span", { tabIndex: -1, className: kendo_react_common_1.classNames('k-link k-menu-link', {
|
|
16
|
+
var item = (React.createElement("li", { id: props.id, className: (0, kendo_react_common_1.classNames)('k-item', props.className, { 'k-focus': props.focused }), onClick: handleClick, onMouseDown: props.onDown, onPointerDown: props.onDown, role: "menuitem", "aria-disabled": props.dataItem.disabled || undefined }, (React.createElement("span", { tabIndex: -1, className: (0, kendo_react_common_1.classNames)('k-link k-menu-link', {
|
|
16
17
|
'k-selected': props.dataItem.selected,
|
|
17
18
|
'k-disabled': props.dataItem.disabled
|
|
18
19
|
}), key: "icon" }, As
|
|
19
20
|
? (React.createElement(As, { item: props.dataItem, itemIndex: props.index }))
|
|
20
21
|
: (React.createElement(React.Fragment, null,
|
|
21
|
-
(props.dataItem.icon || props.dataItem.iconClass) && (React.createElement("span", { className: kendo_react_common_1.classNames('k-icon', (_a = {},
|
|
22
|
-
_a["k-i-"
|
|
23
|
-
_a[""
|
|
22
|
+
(props.dataItem.icon || props.dataItem.iconClass) && (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-icon', (_a = {},
|
|
23
|
+
_a["k-i-".concat(props.dataItem.icon)] = props.dataItem.icon,
|
|
24
|
+
_a["".concat(props.dataItem.iconClass)] = props.dataItem.iconClass,
|
|
24
25
|
_a)) })),
|
|
25
26
|
(props.dataItem.imageUrl) && (React.createElement("img", { role: "presentation", alt: "", src: props.dataItem.imageUrl, className: 'k-icon' })),
|
|
26
27
|
(text) && (React.createElement("span", { className: "k-menu-link-text" }, text))))))));
|
|
27
28
|
return ((props.item !== undefined && /* to be removed in 5.0.0 */
|
|
28
29
|
props.render !== undefined) ? props.render.call(undefined, item, props) : item);
|
|
29
30
|
};
|
|
30
|
-
ButtonItem
|
|
31
|
-
exports.
|
|
31
|
+
exports.ButtonItem = ButtonItem;
|
|
32
|
+
exports.ButtonItem.displayName = 'KendoReactButtonItem';
|
|
@@ -28,7 +28,7 @@ export interface DropDownButtonState {
|
|
|
28
28
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export declare class DropDownButton extends React.Component<DropDownButtonProps, DropDownButtonState> {
|
|
32
32
|
/**
|
|
33
33
|
* @hidden
|
|
34
34
|
*/
|
|
@@ -76,7 +76,7 @@ export default class DropDownButton extends React.Component<DropDownButtonProps,
|
|
|
76
76
|
private guid;
|
|
77
77
|
private buttonsData;
|
|
78
78
|
constructor(props: DropDownButtonProps);
|
|
79
|
-
private
|
|
79
|
+
private get opened();
|
|
80
80
|
/**
|
|
81
81
|
* @hidden
|
|
82
82
|
*/
|
|
@@ -92,7 +92,7 @@ export default class DropDownButton extends React.Component<DropDownButtonProps,
|
|
|
92
92
|
/**
|
|
93
93
|
* The DOM element of main button.
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
get element(): HTMLButtonElement | null;
|
|
96
96
|
private onKeyDown;
|
|
97
97
|
private handleFocus;
|
|
98
98
|
private handleBlur;
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -24,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
26
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.DropDownButton = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var main_1 = require("./../main");
|
|
@@ -69,7 +72,7 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
69
72
|
};
|
|
70
73
|
_this.wrapper = null;
|
|
71
74
|
_this.mainButton = null;
|
|
72
|
-
_this.guid = kendo_react_common_1.guid();
|
|
75
|
+
_this.guid = (0, kendo_react_common_1.guid)();
|
|
73
76
|
_this.buttonsData = [];
|
|
74
77
|
_this.onKeyDown = function (event) {
|
|
75
78
|
var focusedIndex = _this.state.focusedIndex;
|
|
@@ -102,7 +105,7 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
102
105
|
_this.dispatchPopupEvent(event, newState.opened);
|
|
103
106
|
}
|
|
104
107
|
if (_this.opened) {
|
|
105
|
-
var newFocused = navigation_1.
|
|
108
|
+
var newFocused = (0, navigation_1.navigate)(focusedIndex, event.keyCode, event.altKey, _this.buttonsData.length);
|
|
106
109
|
newState.focusedIndex = newFocused;
|
|
107
110
|
var arrowKey = event.keyCode === kendo_react_common_1.Keys.up || event.keyCode === kendo_react_common_1.Keys.down ||
|
|
108
111
|
event.keyCode === kendo_react_common_1.Keys.left || event.keyCode === kendo_react_common_1.Keys.right;
|
|
@@ -115,11 +118,11 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
115
118
|
};
|
|
116
119
|
_this.handleFocus = function (event) {
|
|
117
120
|
_this.setState({ focused: true, focusedIndex: _this.opened ? 0 : -1 });
|
|
118
|
-
kendo_react_common_2.dispatchEvent(_this.props.onFocus, event, _this, undefined);
|
|
121
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onFocus, event, _this, undefined);
|
|
119
122
|
};
|
|
120
123
|
_this.handleBlur = function (event) {
|
|
121
124
|
_this.setState({ focused: false, opened: false, focusedIndex: -1 });
|
|
122
|
-
kendo_react_common_2.dispatchEvent(_this.props.onBlur, event, _this, undefined);
|
|
125
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onBlur, event, _this, undefined);
|
|
123
126
|
var fireCloseEvent = _this.opened;
|
|
124
127
|
if (fireCloseEvent) {
|
|
125
128
|
_this.dispatchPopupEvent(event, false);
|
|
@@ -151,16 +154,16 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
151
154
|
_this.dispatchPopupEvent(event, toOpen);
|
|
152
155
|
};
|
|
153
156
|
_this.dispatchPopupEvent = function (dispatchedEvent, open) {
|
|
154
|
-
kendo_react_common_2.dispatchEvent(open ? _this.props.onOpen : _this.props.onClose, dispatchedEvent, _this, undefined);
|
|
157
|
+
(0, kendo_react_common_2.dispatchEvent)(open ? _this.props.onOpen : _this.props.onClose, dispatchedEvent, _this, undefined);
|
|
155
158
|
};
|
|
156
|
-
kendo_react_common_3.validatePackage(package_metadata_1.packageMetadata);
|
|
159
|
+
(0, kendo_react_common_3.validatePackage)(package_metadata_1.packageMetadata);
|
|
157
160
|
return _this;
|
|
158
161
|
}
|
|
159
162
|
Object.defineProperty(DropDownButton.prototype, "opened", {
|
|
160
163
|
get: function () {
|
|
161
164
|
return this.props.opened === undefined ? this.state.opened : this.props.opened;
|
|
162
165
|
},
|
|
163
|
-
enumerable:
|
|
166
|
+
enumerable: false,
|
|
164
167
|
configurable: true
|
|
165
168
|
});
|
|
166
169
|
/**
|
|
@@ -174,12 +177,12 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
174
177
|
var focusedIndex = this.state.focusedIndex;
|
|
175
178
|
this.buttonsData = this.props.items ||
|
|
176
179
|
React.Children.toArray(this.props.children)
|
|
177
|
-
.filter(function (child) { return child && child.type === DropDownButtonItem_1.
|
|
180
|
+
.filter(function (child) { return child && child.type === DropDownButtonItem_1.DropDownButtonItem; })
|
|
178
181
|
.map(function (child) { return child.props; });
|
|
179
|
-
return (React.createElement("div", { id: id, style: style, className: kendo_react_common_1.classNames('k-dropdown-button', {
|
|
182
|
+
return (React.createElement("div", { id: id, style: style, className: (0, kendo_react_common_1.classNames)('k-dropdown-button', {
|
|
180
183
|
'k-focus': this.state.focused
|
|
181
184
|
}, this.props.className), onKeyDown: this.onKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
|
|
182
|
-
React.createElement(main_1.Button, { size: this.props.size, shape: this.props.shape, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: this.onClickMainButton, onMouseDown: this.mouseDown, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, icon: this.props.icon, iconClass: this.props.iconClass, className: this.props.buttonClass, imageUrl: this.props.imageUrl, dir: dir, ref: function (btn) { return _this.mainButton = btn && btn.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text
|
|
185
|
+
React.createElement(main_1.Button, { size: this.props.size, shape: this.props.shape, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: this.onClickMainButton, onMouseDown: this.mouseDown, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, icon: this.props.icon, iconClass: this.props.iconClass, className: this.props.buttonClass, imageUrl: this.props.imageUrl, dir: dir, ref: function (btn) { return _this.mainButton = btn && btn.element; }, type: "button", "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": "".concat(this.props.text, " dropdownbutton"), "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? "".concat(this.guid, "-").concat(focusedIndex) : undefined }, this.props.text),
|
|
183
186
|
this.renderPopup(rtl)));
|
|
184
187
|
};
|
|
185
188
|
/**
|
|
@@ -207,12 +210,12 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
207
210
|
get: function () {
|
|
208
211
|
return this.mainButton;
|
|
209
212
|
},
|
|
210
|
-
enumerable:
|
|
213
|
+
enumerable: false,
|
|
211
214
|
configurable: true
|
|
212
215
|
});
|
|
213
216
|
DropDownButton.prototype.dispatchClickEvent = function (dispatchedEvent, index) {
|
|
214
217
|
if (!this.isItemDisabled(index)) {
|
|
215
|
-
kendo_react_common_2.dispatchEvent(this.props.onItemClick, dispatchedEvent, this, {
|
|
218
|
+
(0, kendo_react_common_2.dispatchEvent)(this.props.onItemClick, dispatchedEvent, this, {
|
|
216
219
|
item: this.buttonsData[index],
|
|
217
220
|
itemIndex: index
|
|
218
221
|
});
|
|
@@ -221,16 +224,16 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
221
224
|
DropDownButton.prototype.renderPopup = function (rtl) {
|
|
222
225
|
var _a;
|
|
223
226
|
var _b = this.props.popupSettings, popupSettings = _b === void 0 ? {} : _b;
|
|
224
|
-
return (React.createElement(kendo_react_popup_1.Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: kendo_react_common_1.classNames('k-menu-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || popup_1.getAnchorAlign(rtl), popupAlign: popupSettings.popupAlign || popup_1.getPopupAlign(rtl), style: rtl ? { direction: 'rtl' } : undefined },
|
|
225
|
-
React.createElement("ul", { role: "menu", id: this.guid, className: kendo_react_common_1.classNames('k-group k-menu-group k-reset', (_a = {},
|
|
226
|
-
_a["k-menu-group-"
|
|
227
|
+
return (React.createElement(kendo_react_popup_1.Popup, { anchor: this.wrapper, show: this.opened, animate: popupSettings.animate, popupClass: (0, kendo_react_common_1.classNames)('k-menu-popup', popupSettings.popupClass), anchorAlign: popupSettings.anchorAlign || (0, popup_1.getAnchorAlign)(rtl), popupAlign: popupSettings.popupAlign || (0, popup_1.getPopupAlign)(rtl), style: rtl ? { direction: 'rtl' } : undefined },
|
|
228
|
+
React.createElement("ul", { role: "menu", id: this.guid, className: (0, kendo_react_common_1.classNames)('k-group k-menu-group k-reset', (_a = {},
|
|
229
|
+
_a["k-menu-group-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
227
230
|
_a)) }, this.renderChildItems())));
|
|
228
231
|
};
|
|
229
232
|
DropDownButton.prototype.renderChildItems = function () {
|
|
230
233
|
var _this = this;
|
|
231
234
|
var _a = this.props, item = _a.item, itemRender = _a.itemRender, textField = _a.textField;
|
|
232
235
|
return this.buttonsData.length > 0 ? (this.buttonsData.map(function (dataItem, index) {
|
|
233
|
-
return (React.createElement(ButtonItem_1.
|
|
236
|
+
return (React.createElement(ButtonItem_1.ButtonItem, { className: "k-menu-item", dataItem: dataItem, textField: textField, focused: _this.state.focusedIndex === index, onClick: _this.onItemClick, onDown: _this.onItemDown, render: itemRender, item: item, index: index, key: index, id: "".concat(_this.guid, "-").concat(index) }));
|
|
234
237
|
})) : null;
|
|
235
238
|
};
|
|
236
239
|
DropDownButton.prototype.isItemDisabled = function (index) {
|
|
@@ -276,4 +279,4 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
276
279
|
};
|
|
277
280
|
return DropDownButton;
|
|
278
281
|
}(React.Component));
|
|
279
|
-
exports.
|
|
282
|
+
exports.DropDownButton = DropDownButton;
|
|
@@ -10,7 +10,7 @@ export interface DropDownButtonItemProps extends ButtonItem {
|
|
|
10
10
|
*/
|
|
11
11
|
selected?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare class DropDownButtonItem extends React.Component<DropDownButtonItemProps, {}> {
|
|
14
14
|
/**
|
|
15
15
|
* @hidden
|
|
16
16
|
*/
|
|
@@ -26,5 +26,5 @@ export default class DropDownButtonItem extends React.Component<DropDownButtonIt
|
|
|
26
26
|
/**
|
|
27
27
|
* @hidden
|
|
28
28
|
*/
|
|
29
|
-
render():
|
|
29
|
+
render(): null;
|
|
30
30
|
}
|
|
@@ -3,16 +3,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
15
|
};
|
|
14
16
|
})();
|
|
15
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DropDownButtonItem = void 0;
|
|
16
19
|
var React = require("react");
|
|
17
20
|
var PropTypes = require("prop-types");
|
|
18
21
|
var DropDownButtonItem = /** @class */ (function (_super) {
|
|
@@ -40,4 +43,4 @@ var DropDownButtonItem = /** @class */ (function (_super) {
|
|
|
40
43
|
};
|
|
41
44
|
return DropDownButtonItem;
|
|
42
45
|
}(React.Component));
|
|
43
|
-
exports.
|
|
46
|
+
exports.DropDownButtonItem = DropDownButtonItem;
|
|
@@ -28,7 +28,7 @@ export interface SplitButtonState {
|
|
|
28
28
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export declare class SplitButton extends React.Component<SplitButtonProps, SplitButtonState> {
|
|
32
32
|
/**
|
|
33
33
|
* @hidden
|
|
34
34
|
*/
|
|
@@ -78,7 +78,7 @@ export default class SplitButton extends React.Component<SplitButtonProps, Split
|
|
|
78
78
|
private guid;
|
|
79
79
|
private buttonsData;
|
|
80
80
|
constructor(props: SplitButtonProps);
|
|
81
|
-
private
|
|
81
|
+
private get opened();
|
|
82
82
|
/**
|
|
83
83
|
* @hidden
|
|
84
84
|
*/
|
|
@@ -90,7 +90,7 @@ export default class SplitButton extends React.Component<SplitButtonProps, Split
|
|
|
90
90
|
/**
|
|
91
91
|
* The DOM element of main button.
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
get element(): HTMLButtonElement | null;
|
|
94
94
|
private onKeyDown;
|
|
95
95
|
private onFocus;
|
|
96
96
|
private onItemClick;
|