@progress/kendo-react-buttons 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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 +7 -7
- package/dist/es/Button.js +5 -5
- package/dist/es/ButtonGroup.d.ts +1 -1
- package/dist/es/ButtonGroup.js +1 -1
- package/dist/es/ButtonGroupInterface.d.ts +5 -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 +1 -1
- package/dist/es/Chip/selection-reducer.js +10 -6
- package/dist/es/FloatingActionButton/FloatingActionButton.d.ts +1 -1
- package/dist/es/FloatingActionButton/FloatingActionButton.js +7 -7
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.d.ts +1 -1
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +2 -2
- package/dist/es/FloatingActionButton/utils.js +2 -2
- package/dist/es/ListButton/ButtonItem.js +2 -2
- package/dist/es/ListButton/DropDownButton.js +3 -3
- package/dist/es/ListButton/DropDownButtonItem.d.ts +1 -1
- package/dist/es/ListButton/SplitButton.js +4 -4
- package/dist/es/ListButton/SplitButtonItem.d.ts +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/toolbar/Toolbar.d.ts +1 -1
- 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 +3 -3
- package/dist/npm/Button.d.ts +7 -7
- package/dist/npm/Button.js +9 -9
- package/dist/npm/ButtonGroup.d.ts +1 -1
- package/dist/npm/ButtonGroup.js +4 -4
- package/dist/npm/ButtonGroupInterface.d.ts +5 -0
- package/dist/npm/Chip/Chip.d.ts +1 -1
- package/dist/npm/Chip/Chip.js +11 -11
- package/dist/npm/Chip/ChipList.d.ts +4 -4
- package/dist/npm/Chip/ChipList.js +10 -10
- package/dist/npm/Chip/selection-reducer.js +10 -6
- package/dist/npm/FloatingActionButton/FloatingActionButton.d.ts +1 -1
- package/dist/npm/FloatingActionButton/FloatingActionButton.js +22 -22
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.d.ts +1 -1
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +3 -3
- package/dist/npm/FloatingActionButton/utils.js +4 -4
- package/dist/npm/ListButton/ButtonItem.js +4 -4
- package/dist/npm/ListButton/DropDownButton.js +13 -13
- package/dist/npm/ListButton/DropDownButtonItem.d.ts +1 -1
- package/dist/npm/ListButton/SplitButton.js +15 -15
- package/dist/npm/ListButton/SplitButtonItem.d.ts +1 -1
- package/dist/npm/main.js +5 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/toolbar/Toolbar.d.ts +1 -1
- package/dist/npm/toolbar/Toolbar.js +2 -2
- package/dist/npm/toolbar/tools/ToolbarSpacer.d.ts +1 -1
- package/dist/npm/toolbar/tools/ToolbarSpacer.js +2 -1
- package/dist/npm/util.d.ts +3 -3
- package/dist/systemjs/kendo-react-buttons.js +1 -1
- package/package.json +13 -13
package/dist/npm/Chip/Chip.js
CHANGED
|
@@ -27,10 +27,10 @@ var kendo_react_common_3 = require("@progress/kendo-react-common");
|
|
|
27
27
|
*/
|
|
28
28
|
exports.Chip = React.forwardRef(function (props, ref) {
|
|
29
29
|
var _a;
|
|
30
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
30
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
31
31
|
var target = React.useRef(null);
|
|
32
32
|
var chipRef = React.useRef(null);
|
|
33
|
-
var dir = kendo_react_common_1.useDir(chipRef, props.dir);
|
|
33
|
+
var dir = (0, kendo_react_common_1.useDir)(chipRef, props.dir);
|
|
34
34
|
React.useImperativeHandle(target, function () { return ({
|
|
35
35
|
element: chipRef.current,
|
|
36
36
|
props: props
|
|
@@ -108,27 +108,27 @@ exports.Chip = React.forwardRef(function (props, ref) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
}, [props.onBlur]);
|
|
111
|
-
var mouseProps = kendo_react_common_3.useMouse(props, target, { onClick: handleClick });
|
|
112
|
-
return (React.createElement("div", __assign({}, mouseProps, { role: props.role, id: props.value, style: props.style, ref: chipRef, dir: dir, tabIndex: kendo_react_common_1.getTabIndex(props.tabIndex, props.disabled, undefined), className: kendo_react_common_1.classNames('k-chip', (_a = {
|
|
111
|
+
var mouseProps = (0, kendo_react_common_3.useMouse)(props, target, { onClick: handleClick });
|
|
112
|
+
return (React.createElement("div", __assign({}, mouseProps, { role: props.role, id: props.value, style: props.style, ref: chipRef, dir: dir, tabIndex: (0, kendo_react_common_1.getTabIndex)(props.tabIndex, props.disabled, undefined), className: (0, kendo_react_common_1.classNames)('k-chip', (_a = {
|
|
113
113
|
'k-rtl': dir === 'rtl',
|
|
114
114
|
'k-disabled': props.disabled,
|
|
115
115
|
'k-selected': selected,
|
|
116
116
|
'k-focus': focused
|
|
117
117
|
},
|
|
118
|
-
_a["k-chip-"
|
|
119
|
-
_a["k-rounded-"
|
|
120
|
-
_a["k-chip-"
|
|
121
|
-
_a["k-chip-"
|
|
118
|
+
_a["k-chip-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[props.size] || props.size)] = props.size,
|
|
119
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[props.rounded] || props.rounded)] = props.rounded,
|
|
120
|
+
_a["k-chip-".concat(props.fillMode)] = props.fillMode,
|
|
121
|
+
_a["k-chip-".concat(props.fillMode, "-").concat(props.themeColor)] = Boolean(props.fillMode && props.themeColor),
|
|
122
122
|
_a), props.className), "aria-checked": selected, "aria-disabled": props.disabled, "aria-describedby": props.ariaDescribedBy, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown }),
|
|
123
|
-
(selected && props.selectedIcon) && React.createElement("span", { className: kendo_react_common_1.classNames('k-chip-icon', 'k-icon', props.selectedIcon) }),
|
|
124
|
-
props.icon && React.createElement("span", { className: kendo_react_common_1.classNames('k-chip-icon', 'k-icon', props.icon) }),
|
|
123
|
+
(selected && props.selectedIcon) && React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-chip-icon', 'k-icon', props.selectedIcon) }),
|
|
124
|
+
props.icon && React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-chip-icon', 'k-icon', props.icon) }),
|
|
125
125
|
React.createElement("span", { className: 'k-chip-content' }, props.children !== undefined
|
|
126
126
|
? props.children
|
|
127
127
|
: props.text &&
|
|
128
128
|
React.createElement("span", { "aria-label": props.text, className: 'k-chip-label' }, props.text)),
|
|
129
129
|
props.removable && (React.createElement("span", { className: "k-chip-actions" },
|
|
130
130
|
React.createElement("span", { className: "k-chip-action" },
|
|
131
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-chip-remove-action', 'k-icon', props.removeIcon), onClick: handleRemove }))))));
|
|
131
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-chip-remove-action', 'k-icon', props.removeIcon), onClick: handleRemove }))))));
|
|
132
132
|
});
|
|
133
133
|
var propTypes = {
|
|
134
134
|
id: PropTypes.string,
|
|
@@ -108,16 +108,16 @@ export interface ChipListHandle {
|
|
|
108
108
|
/**
|
|
109
109
|
* @hidden
|
|
110
110
|
*/
|
|
111
|
-
export declare const ChipListSelectionContext: React.Context<[string | string[], Function]>;
|
|
111
|
+
export declare const ChipListSelectionContext: React.Context<[string | string[] | null, Function]>;
|
|
112
112
|
/**
|
|
113
113
|
* @hidden
|
|
114
114
|
*/
|
|
115
|
-
export declare const ChipListFocusContext: React.Context<[string | string[], Function]>;
|
|
115
|
+
export declare const ChipListFocusContext: React.Context<[string | string[] | null, Function]>;
|
|
116
116
|
/**
|
|
117
117
|
* @hidden
|
|
118
118
|
*/
|
|
119
|
-
export declare const ChipListDataContext: React.Context<[string, Function]>;
|
|
119
|
+
export declare const ChipListDataContext: React.Context<[string | null, Function]>;
|
|
120
120
|
/**
|
|
121
121
|
* Represents the ChipList component.
|
|
122
122
|
*/
|
|
123
|
-
export declare const ChipList: React.ForwardRefExoticComponent<ChipListProps & React.RefAttributes<ChipListHandle>>;
|
|
123
|
+
export declare const ChipList: React.ForwardRefExoticComponent<ChipListProps & React.RefAttributes<ChipListHandle | null>>;
|
|
@@ -45,7 +45,7 @@ exports.ChipListDataContext = React.createContext([null, function (_args) {
|
|
|
45
45
|
var useSelection = function (defaultValue, args, callback) {
|
|
46
46
|
var _a = React.useState(defaultValue), state = _a[0], setState = _a[1];
|
|
47
47
|
var handleDispatchSelection = function (action) {
|
|
48
|
-
var newState = selection_reducer_1.selectionReducer(args.state || state, __assign(__assign({}, action), args));
|
|
48
|
+
var newState = (0, selection_reducer_1.selectionReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
49
49
|
if (callback) {
|
|
50
50
|
callback(newState, action.event);
|
|
51
51
|
}
|
|
@@ -59,7 +59,7 @@ var useSelection = function (defaultValue, args, callback) {
|
|
|
59
59
|
var useFocus = function (args) {
|
|
60
60
|
var _a = React.useState(null), state = _a[0], setState = _a[1];
|
|
61
61
|
var handleDispatchFocus = function (action) {
|
|
62
|
-
var newState = focus_reducer_1.focusReducer(action.payload, __assign(__assign({}, action), args));
|
|
62
|
+
var newState = (0, focus_reducer_1.focusReducer)(action.payload, __assign(__assign({}, action), args));
|
|
63
63
|
setState(newState);
|
|
64
64
|
};
|
|
65
65
|
return [state, handleDispatchFocus];
|
|
@@ -70,7 +70,7 @@ var useFocus = function (args) {
|
|
|
70
70
|
var useData = function (defaultData, args, callback) {
|
|
71
71
|
var _a = React.useState(defaultData), state = _a[0], setState = _a[1];
|
|
72
72
|
var handleDispatchData = function (action) {
|
|
73
|
-
var newState = data_reducer_1.dataReducer(args.state || state, __assign(__assign({}, action), args));
|
|
73
|
+
var newState = (0, data_reducer_1.dataReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
74
74
|
if (callback) {
|
|
75
75
|
callback(newState, action.event);
|
|
76
76
|
}
|
|
@@ -83,10 +83,10 @@ var useData = function (defaultData, args, callback) {
|
|
|
83
83
|
*/
|
|
84
84
|
exports.ChipList = React.forwardRef(function (props, ref) {
|
|
85
85
|
var _a;
|
|
86
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
86
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
87
87
|
var target = React.useRef(null);
|
|
88
88
|
var chipListRef = React.useRef(null);
|
|
89
|
-
var dir = kendo_react_common_1.useDir(chipListRef, props.dir);
|
|
89
|
+
var dir = (0, kendo_react_common_1.useDir)(chipListRef, props.dir);
|
|
90
90
|
var chip = props.chip, id = props.id, style = props.style, tabIndex = props.tabIndex, disabled = props.disabled, size = props.size, className = props.className, ariaDescribedBy = props.ariaDescribedBy, ariaLabelledBy = props.ariaLabelledBy, _b = props.selection, selection = _b === void 0 ? defaultProps.selection : _b, _c = props.value, value = _c === void 0 ? defaultProps.defaultValue : _c, _d = props.defaultData, defaultData = _d === void 0 ? defaultProps.defaultData : _d, _e = props.valueField, valueField = _e === void 0 ? defaultProps.valueField : _e, _f = props.textField, textField = _f === void 0 ? defaultProps.textField : _f, onChange = props.onChange, onDataChange = props.onDataChange;
|
|
91
91
|
var ChipComponent = React.useMemo(function () { return chip || Chip_1.Chip; }, [chip, Chip_1.Chip]);
|
|
92
92
|
React.useImperativeHandle(target, function () { return ({
|
|
@@ -127,18 +127,18 @@ exports.ChipList = React.forwardRef(function (props, ref) {
|
|
|
127
127
|
var data = React.useMemo(function () { return props.data || stateData; }, [props.data, stateData]);
|
|
128
128
|
var chipValue = React.useMemo(function () { return value || stateValue; }, [value, stateValue]);
|
|
129
129
|
var items = React.useMemo(function () { return data.reduce(itemsReducer, []); }, [data, itemsReducer]);
|
|
130
|
-
var valueGetter = React.useCallback(function (item) { return kendo_react_common_1.getter(valueField)(item); }, [valueField]);
|
|
131
|
-
var textGetter = React.useCallback(function (item) { return kendo_react_common_1.getter(textField)(item); }, [textField]);
|
|
130
|
+
var valueGetter = React.useCallback(function (item) { return (0, kendo_react_common_1.getter)(valueField)(item); }, [valueField]);
|
|
131
|
+
var textGetter = React.useCallback(function (item) { return (0, kendo_react_common_1.getter)(textField)(item); }, [textField]);
|
|
132
132
|
var _j = useFocus({ items: items }), focus = _j[0], dispatchFocus = _j[1];
|
|
133
|
-
var mouseProps = kendo_react_common_1.useMouse(props, target);
|
|
133
|
+
var mouseProps = (0, kendo_react_common_1.useMouse)(props, target);
|
|
134
134
|
return (React.createElement(exports.ChipListSelectionContext.Provider, { value: [chipValue, dispatchStateValue] },
|
|
135
135
|
React.createElement(exports.ChipListFocusContext.Provider, { value: [focus, dispatchFocus] },
|
|
136
136
|
React.createElement(exports.ChipListDataContext.Provider, { value: [data, dispatchData] },
|
|
137
|
-
React.createElement("div", __assign({ ref: chipListRef }, mouseProps, { role: 'listbox', id: id, dir: dir, style: style, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled, undefined), className: kendo_react_common_1.classNames('k-chip-list', (_a = {
|
|
137
|
+
React.createElement("div", __assign({ ref: chipListRef }, mouseProps, { role: 'listbox', id: id, dir: dir, style: style, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled, undefined), className: (0, kendo_react_common_1.classNames)('k-chip-list', (_a = {
|
|
138
138
|
'k-rtl': dir === 'rtl',
|
|
139
139
|
'k-disabled': disabled
|
|
140
140
|
},
|
|
141
|
-
_a["k-chip-list-"
|
|
141
|
+
_a["k-chip-list-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
142
142
|
_a), className), "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }), data.map(function (item, index) {
|
|
143
143
|
return (React.createElement(ChipComponent, { role: 'option', dataItem: item, size: size, key: [valueGetter(item), index].join('-'), text: textGetter(item), value: valueGetter(item) }));
|
|
144
144
|
}))))));
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.selectionReducer = exports.SELECTION_ACTION = exports.SELECTION_TYPE = void 0;
|
|
@@ -48,7 +52,7 @@ var selectionReducer = function (state, action) {
|
|
|
48
52
|
if (Array.isArray(state)) {
|
|
49
53
|
return state.some(function (i) { return i === action.payload; })
|
|
50
54
|
? state.filter(function (i) { return i !== action.payload; })
|
|
51
|
-
: __spreadArray(__spreadArray([], state), [action.payload]);
|
|
55
|
+
: __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
52
56
|
}
|
|
53
57
|
if (state === null) {
|
|
54
58
|
return [action.payload];
|
|
@@ -59,7 +63,7 @@ var selectionReducer = function (state, action) {
|
|
|
59
63
|
if (Array.isArray(state)) {
|
|
60
64
|
return state.some(function (i) { return i === action.payload; })
|
|
61
65
|
? state.filter(function (i) { return i !== action.payload; })
|
|
62
|
-
: __spreadArray(__spreadArray([], state), [action.payload]);
|
|
66
|
+
: __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
63
67
|
}
|
|
64
68
|
return state;
|
|
65
69
|
}
|
|
@@ -14,4 +14,4 @@ import { FloatingActionButtonProps } from './interfaces/FloatingActionButtonProp
|
|
|
14
14
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare const FloatingActionButton: React.ForwardRefExoticComponent<FloatingActionButtonProps & React.RefAttributes<FloatingActionButtonHandle>>;
|
|
17
|
+
export declare const FloatingActionButton: React.ForwardRefExoticComponent<FloatingActionButtonProps & React.RefAttributes<FloatingActionButtonHandle | null>>;
|
|
@@ -49,9 +49,9 @@ var DEFAULT_FAB_ZINDEX = 100;
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
52
|
-
kendo_react_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
52
|
+
(0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
53
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"]);
|
|
54
|
-
var zIndexContext = kendo_react_common_1.useZIndexContext();
|
|
54
|
+
var zIndexContext = (0, kendo_react_common_1.useZIndexContext)();
|
|
55
55
|
var currentZIndex = zIndexContext ? zIndexContext + ZINDEX_FAB_STEP : DEFAULT_FAB_ZINDEX;
|
|
56
56
|
var target = React.useRef(null);
|
|
57
57
|
var elementRef = React.useRef(null);
|
|
@@ -71,12 +71,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
71
71
|
var _h = React.useState(false), open = _h[0], setOpen = _h[1];
|
|
72
72
|
var _j = React.useState(false), focused = _j[0], setFocused = _j[1];
|
|
73
73
|
var _k = React.useState(-1), focusedIndex = _k[0], setFocusedIndex = _k[1];
|
|
74
|
-
var buttonId = React.useMemo(function () { return kendo_react_common_2.guid(); }, []);
|
|
75
|
-
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);
|
|
76
76
|
var isRtl = dir === 'rtl';
|
|
77
|
-
var listId = React.useMemo(function () { return kendo_react_common_2.guid(); }, []);
|
|
77
|
+
var listId = React.useMemo(function () { return (0, kendo_react_common_2.guid)(); }, []);
|
|
78
78
|
React.useEffect(function () {
|
|
79
|
-
utils_1.position(elementRef, align, alignOffset, isRtl);
|
|
79
|
+
(0, utils_1.position)(elementRef, align, alignOffset, isRtl);
|
|
80
80
|
}, [elementRef, align, alignOffset, isRtl]);
|
|
81
81
|
React.useEffect(function () {
|
|
82
82
|
if (focused && elementRef && elementRef.current) {
|
|
@@ -88,14 +88,14 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
88
88
|
if (!items) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
kendo_react_common_2.dispatchEvent(isOpen ? onOpen : onClose, dispatchedEvent, getImperativeHandle(), undefined);
|
|
91
|
+
(0, kendo_react_common_2.dispatchEvent)(isOpen ? onOpen : onClose, dispatchedEvent, getImperativeHandle(), undefined);
|
|
92
92
|
}, [onOpen, onClose, items]);
|
|
93
93
|
var handleClick = React.useCallback(function (event) {
|
|
94
94
|
if (!event.target || disabled) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
if (!items && onClick) {
|
|
98
|
-
kendo_react_common_2.dispatchEvent(onClick, event, getImperativeHandle(), undefined);
|
|
98
|
+
(0, kendo_react_common_2.dispatchEvent)(onClick, event, getImperativeHandle(), undefined);
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
setOpen(!open);
|
|
@@ -109,14 +109,14 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
109
109
|
setFocused(true);
|
|
110
110
|
setFocusedIndex(open ? 0 : -1);
|
|
111
111
|
if (onFocus) {
|
|
112
|
-
kendo_react_common_2.dispatchEvent(onFocus, event, getImperativeHandle(), undefined);
|
|
112
|
+
(0, kendo_react_common_2.dispatchEvent)(onFocus, event, getImperativeHandle(), undefined);
|
|
113
113
|
}
|
|
114
114
|
}, [onFocus, setFocused, setFocusedIndex]);
|
|
115
115
|
var handleBlur = React.useCallback(function (event) {
|
|
116
116
|
setFocused(false);
|
|
117
117
|
setOpen(false);
|
|
118
118
|
setFocusedIndex(-1);
|
|
119
|
-
kendo_react_common_2.dispatchEvent(onBlur, event, getImperativeHandle(), undefined);
|
|
119
|
+
(0, kendo_react_common_2.dispatchEvent)(onBlur, event, getImperativeHandle(), undefined);
|
|
120
120
|
var fireCloseEvent = open;
|
|
121
121
|
if (fireCloseEvent) {
|
|
122
122
|
dispatchPopupEvent(event, false);
|
|
@@ -130,7 +130,7 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
if (!items[index].disabled) {
|
|
133
|
-
kendo_react_common_2.dispatchEvent(onItemClick, dispatchedEvent, getImperativeHandle(), {
|
|
133
|
+
(0, kendo_react_common_2.dispatchEvent)(onItemClick, dispatchedEvent, getImperativeHandle(), {
|
|
134
134
|
itemProps: items[index],
|
|
135
135
|
itemIndex: index
|
|
136
136
|
});
|
|
@@ -200,12 +200,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
200
200
|
default:
|
|
201
201
|
break;
|
|
202
202
|
}
|
|
203
|
-
kendo_react_common_2.dispatchEvent(onKeyDown, event, getImperativeHandle(), undefined);
|
|
203
|
+
(0, kendo_react_common_2.dispatchEvent)(onKeyDown, event, getImperativeHandle(), undefined);
|
|
204
204
|
}, [onKeyDown, focusedIndex, setFocusedIndex, isRtl, setOpen]);
|
|
205
205
|
var buttonClassNames = React.useMemo(function () {
|
|
206
206
|
var _a;
|
|
207
|
-
return kendo_react_common_2.classNames('k-fab k-fab-solid', (_a = {},
|
|
208
|
-
_a["k-fab-"
|
|
207
|
+
return (0, kendo_react_common_2.classNames)('k-fab k-fab-solid', (_a = {},
|
|
208
|
+
_a["k-fab-".concat(shape)] = shape,
|
|
209
209
|
_a['k-fab-sm'] = size === 'small',
|
|
210
210
|
_a['k-fab-md'] = size === 'medium',
|
|
211
211
|
_a['k-fab-lg'] = size === 'large',
|
|
@@ -213,12 +213,12 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
213
213
|
_a['k-pos-absolute'] = positionMode === 'absolute',
|
|
214
214
|
_a['k-pos-fixed'] = positionMode === 'fixed',
|
|
215
215
|
_a['k-focus'] = focused,
|
|
216
|
-
_a["k-rounded-"
|
|
217
|
-
_a["k-fab-solid-"
|
|
218
|
-
_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);
|
|
219
219
|
}, [themeColor, size, rounded, shape, disabled, positionMode, align, focused, className]);
|
|
220
220
|
var fabItems = (items && (items.map(function (element, index) {
|
|
221
|
-
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 })));
|
|
222
222
|
})));
|
|
223
223
|
var isIconFab = icon && !text;
|
|
224
224
|
var fabWidth = elementRef.current ? elementRef.current.offsetWidth : 0;
|
|
@@ -226,16 +226,16 @@ exports.FloatingActionButton = React.forwardRef(function (props, ref) {
|
|
|
226
226
|
var spacing = (fabWidth / 2) - (iconWidth / 2);
|
|
227
227
|
return (React.createElement(kendo_react_common_1.ZIndexContext.Provider, { value: currentZIndex },
|
|
228
228
|
React.createElement(React.Fragment, null,
|
|
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": (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),
|
|
230
230
|
icon ?
|
|
231
|
-
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)) }) :
|
|
232
232
|
iconClass ?
|
|
233
233
|
React.createElement("span", { role: "presentation", className: iconClass }) :
|
|
234
234
|
null,
|
|
235
235
|
text && React.createElement("span", { className: "k-fab-text" }, text)),
|
|
236
236
|
modal && open && (React.createElement("div", { className: "k-overlay", style: __assign({ zIndex: currentZIndex }, overlayStyle) })),
|
|
237
|
-
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' } },
|
|
238
|
-
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', {
|
|
239
239
|
'k-fab-items-bottom': align.vertical !== 'bottom',
|
|
240
240
|
'k-fab-items-top': align.vertical === 'bottom'
|
|
241
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>>;
|
|
@@ -58,15 +58,15 @@ exports.FloatingActionButtonItem = React.forwardRef(function (props, ref) {
|
|
|
58
58
|
onClick(event, index);
|
|
59
59
|
}
|
|
60
60
|
}, [onClick, index]);
|
|
61
|
-
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', {
|
|
62
62
|
'k-focus': focused,
|
|
63
63
|
'k-disabled': disabled
|
|
64
64
|
}, className); }, [className, disabled, focused]);
|
|
65
65
|
var ItemComp = item;
|
|
66
|
-
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 }) :
|
|
67
67
|
(React.createElement(React.Fragment, null,
|
|
68
68
|
text && React.createElement("span", { className: "k-fab-item-text" }, text),
|
|
69
|
-
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)) })))));
|
|
70
70
|
});
|
|
71
71
|
exports.FloatingActionButtonItem.propTypes = {
|
|
72
72
|
className: PropTypes.string,
|
|
@@ -57,16 +57,16 @@ var position = function (ref, align, alignOffset, isRtl) {
|
|
|
57
57
|
var vertical = align.vertical;
|
|
58
58
|
if (ref.current) {
|
|
59
59
|
var xFab = alignOffset && alignOffset.x !== undefined ?
|
|
60
|
-
exports.toStringValues(alignOffset.x) :
|
|
60
|
+
(0, exports.toStringValues)(alignOffset.x) :
|
|
61
61
|
exports.DEFAULT_OFFSET;
|
|
62
62
|
var xCenterFab = alignOffset && alignOffset.x !== undefined ?
|
|
63
|
-
"calc(50% + "
|
|
63
|
+
"calc(50% + ".concat((0, exports.toStringValues)(alignOffset.x), ")") :
|
|
64
64
|
'50%';
|
|
65
65
|
var yFab = alignOffset && alignOffset.y !== undefined ?
|
|
66
|
-
exports.toStringValues(alignOffset.y) :
|
|
66
|
+
(0, exports.toStringValues)(alignOffset.y) :
|
|
67
67
|
exports.DEFAULT_OFFSET;
|
|
68
68
|
var yCenterFab = alignOffset && alignOffset.y !== undefined ?
|
|
69
|
-
"calc(50% + "
|
|
69
|
+
"calc(50% + ".concat((0, exports.toStringValues)(alignOffset.y), ")") :
|
|
70
70
|
'50%';
|
|
71
71
|
ref.current.style.setProperty(horizontalPosition(align, isRtl), horizontal === 'center' ? xCenterFab : xFab);
|
|
72
72
|
ref.current.style.setProperty(verticalPosition(align), vertical === 'middle' ? yCenterFab : yFab);
|
|
@@ -13,15 +13,15 @@ var ButtonItem = function (props) {
|
|
|
13
13
|
}, [props]);
|
|
14
14
|
var As = props.dataItem.render || props.item || (props.item === undefined ? props.render : null);
|
|
15
15
|
var text = props.dataItem.text !== undefined ? props.dataItem.text : (props.textField ? props.dataItem[props.textField] : props.dataItem);
|
|
16
|
-
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', {
|
|
17
17
|
'k-selected': props.dataItem.selected,
|
|
18
18
|
'k-disabled': props.dataItem.disabled
|
|
19
19
|
}), key: "icon" }, As
|
|
20
20
|
? (React.createElement(As, { item: props.dataItem, itemIndex: props.index }))
|
|
21
21
|
: (React.createElement(React.Fragment, null,
|
|
22
|
-
(props.dataItem.icon || props.dataItem.iconClass) && (React.createElement("span", { className: kendo_react_common_1.classNames('k-icon', (_a = {},
|
|
23
|
-
_a["k-i-"
|
|
24
|
-
_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,
|
|
25
25
|
_a)) })),
|
|
26
26
|
(props.dataItem.imageUrl) && (React.createElement("img", { role: "presentation", alt: "", src: props.dataItem.imageUrl, className: 'k-icon' })),
|
|
27
27
|
(text) && (React.createElement("span", { className: "k-menu-link-text" }, text))))))));
|
|
@@ -72,7 +72,7 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
72
72
|
};
|
|
73
73
|
_this.wrapper = null;
|
|
74
74
|
_this.mainButton = null;
|
|
75
|
-
_this.guid = kendo_react_common_1.guid();
|
|
75
|
+
_this.guid = (0, kendo_react_common_1.guid)();
|
|
76
76
|
_this.buttonsData = [];
|
|
77
77
|
_this.onKeyDown = function (event) {
|
|
78
78
|
var focusedIndex = _this.state.focusedIndex;
|
|
@@ -105,7 +105,7 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
105
105
|
_this.dispatchPopupEvent(event, newState.opened);
|
|
106
106
|
}
|
|
107
107
|
if (_this.opened) {
|
|
108
|
-
var newFocused = navigation_1.navigate(focusedIndex, event.keyCode, event.altKey, _this.buttonsData.length);
|
|
108
|
+
var newFocused = (0, navigation_1.navigate)(focusedIndex, event.keyCode, event.altKey, _this.buttonsData.length);
|
|
109
109
|
newState.focusedIndex = newFocused;
|
|
110
110
|
var arrowKey = event.keyCode === kendo_react_common_1.Keys.up || event.keyCode === kendo_react_common_1.Keys.down ||
|
|
111
111
|
event.keyCode === kendo_react_common_1.Keys.left || event.keyCode === kendo_react_common_1.Keys.right;
|
|
@@ -118,11 +118,11 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
118
118
|
};
|
|
119
119
|
_this.handleFocus = function (event) {
|
|
120
120
|
_this.setState({ focused: true, focusedIndex: _this.opened ? 0 : -1 });
|
|
121
|
-
kendo_react_common_2.dispatchEvent(_this.props.onFocus, event, _this, undefined);
|
|
121
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onFocus, event, _this, undefined);
|
|
122
122
|
};
|
|
123
123
|
_this.handleBlur = function (event) {
|
|
124
124
|
_this.setState({ focused: false, opened: false, focusedIndex: -1 });
|
|
125
|
-
kendo_react_common_2.dispatchEvent(_this.props.onBlur, event, _this, undefined);
|
|
125
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onBlur, event, _this, undefined);
|
|
126
126
|
var fireCloseEvent = _this.opened;
|
|
127
127
|
if (fireCloseEvent) {
|
|
128
128
|
_this.dispatchPopupEvent(event, false);
|
|
@@ -154,9 +154,9 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
154
154
|
_this.dispatchPopupEvent(event, toOpen);
|
|
155
155
|
};
|
|
156
156
|
_this.dispatchPopupEvent = function (dispatchedEvent, open) {
|
|
157
|
-
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);
|
|
158
158
|
};
|
|
159
|
-
kendo_react_common_3.validatePackage(package_metadata_1.packageMetadata);
|
|
159
|
+
(0, kendo_react_common_3.validatePackage)(package_metadata_1.packageMetadata);
|
|
160
160
|
return _this;
|
|
161
161
|
}
|
|
162
162
|
Object.defineProperty(DropDownButton.prototype, "opened", {
|
|
@@ -179,10 +179,10 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
179
179
|
React.Children.toArray(this.props.children)
|
|
180
180
|
.filter(function (child) { return child && child.type === DropDownButtonItem_1.DropDownButtonItem; })
|
|
181
181
|
.map(function (child) { return child.props; });
|
|
182
|
-
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', {
|
|
183
183
|
'k-focus': this.state.focused
|
|
184
184
|
}, this.props.className), onKeyDown: this.onKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
|
|
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": 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),
|
|
186
186
|
this.renderPopup(rtl)));
|
|
187
187
|
};
|
|
188
188
|
/**
|
|
@@ -215,7 +215,7 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
215
215
|
});
|
|
216
216
|
DropDownButton.prototype.dispatchClickEvent = function (dispatchedEvent, index) {
|
|
217
217
|
if (!this.isItemDisabled(index)) {
|
|
218
|
-
kendo_react_common_2.dispatchEvent(this.props.onItemClick, dispatchedEvent, this, {
|
|
218
|
+
(0, kendo_react_common_2.dispatchEvent)(this.props.onItemClick, dispatchedEvent, this, {
|
|
219
219
|
item: this.buttonsData[index],
|
|
220
220
|
itemIndex: index
|
|
221
221
|
});
|
|
@@ -224,16 +224,16 @@ var DropDownButton = /** @class */ (function (_super) {
|
|
|
224
224
|
DropDownButton.prototype.renderPopup = function (rtl) {
|
|
225
225
|
var _a;
|
|
226
226
|
var _b = this.props.popupSettings, popupSettings = _b === void 0 ? {} : _b;
|
|
227
|
-
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 },
|
|
228
|
-
React.createElement("ul", { role: "menu", id: this.guid, className: kendo_react_common_1.classNames('k-group k-menu-group k-reset', (_a = {},
|
|
229
|
-
_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,
|
|
230
230
|
_a)) }, this.renderChildItems())));
|
|
231
231
|
};
|
|
232
232
|
DropDownButton.prototype.renderChildItems = function () {
|
|
233
233
|
var _this = this;
|
|
234
234
|
var _a = this.props, item = _a.item, itemRender = _a.itemRender, textField = _a.textField;
|
|
235
235
|
return this.buttonsData.length > 0 ? (this.buttonsData.map(function (dataItem, index) {
|
|
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: _this.guid
|
|
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) }));
|
|
237
237
|
})) : null;
|
|
238
238
|
};
|
|
239
239
|
DropDownButton.prototype.isItemDisabled = function (index) {
|
|
@@ -61,7 +61,7 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
61
61
|
};
|
|
62
62
|
_this.wrapper = null;
|
|
63
63
|
_this.mainButton = null;
|
|
64
|
-
_this.guid = kendo_react_common_1.guid();
|
|
64
|
+
_this.guid = (0, kendo_react_common_1.guid)();
|
|
65
65
|
_this.buttonsData = [];
|
|
66
66
|
_this.onKeyDown = function (event) {
|
|
67
67
|
var focusedIndex = _this.state.focusedIndex;
|
|
@@ -98,7 +98,7 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
98
98
|
_this.dispatchPopupEvent(event, newState.opened);
|
|
99
99
|
}
|
|
100
100
|
if (_this.opened) {
|
|
101
|
-
var newFocused = navigation_1.navigate(focusedIndex, event.keyCode, event.altKey, _this.buttonsData.length);
|
|
101
|
+
var newFocused = (0, navigation_1.navigate)(focusedIndex, event.keyCode, event.altKey, _this.buttonsData.length);
|
|
102
102
|
if (newFocused !== focusedIndex) {
|
|
103
103
|
newState = newState || {};
|
|
104
104
|
newState.focusedIndex = newFocused;
|
|
@@ -115,7 +115,7 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
_this.onFocus = function (event) {
|
|
118
|
-
kendo_react_common_2.dispatchEvent(_this.props.onFocus, event, _this, undefined);
|
|
118
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onFocus, event, _this, undefined);
|
|
119
119
|
_this.setState({ focused: true, focusedIndex: -1 });
|
|
120
120
|
};
|
|
121
121
|
_this.onItemClick = function (event, clickedItemIndex) {
|
|
@@ -134,7 +134,7 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
134
134
|
focusedIndex: -1,
|
|
135
135
|
opened: false
|
|
136
136
|
});
|
|
137
|
-
kendo_react_common_2.dispatchEvent(_this.props.onBlur, event, _this, undefined);
|
|
137
|
+
(0, kendo_react_common_2.dispatchEvent)(_this.props.onBlur, event, _this, undefined);
|
|
138
138
|
if (_this.opened) {
|
|
139
139
|
_this.dispatchPopupEvent(event, false);
|
|
140
140
|
}
|
|
@@ -162,9 +162,9 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
_this.dispatchPopupEvent = function (dispatchedEvent, open) {
|
|
165
|
-
kendo_react_common_2.dispatchEvent(open ? _this.props.onOpen : _this.props.onClose, dispatchedEvent, _this, undefined);
|
|
165
|
+
(0, kendo_react_common_2.dispatchEvent)(open ? _this.props.onOpen : _this.props.onClose, dispatchedEvent, _this, undefined);
|
|
166
166
|
};
|
|
167
|
-
kendo_react_common_3.validatePackage(package_metadata_1.packageMetadata);
|
|
167
|
+
(0, kendo_react_common_3.validatePackage)(package_metadata_1.packageMetadata);
|
|
168
168
|
return _this;
|
|
169
169
|
}
|
|
170
170
|
Object.defineProperty(SplitButton.prototype, "opened", {
|
|
@@ -187,10 +187,10 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
187
187
|
var dir = rtl ? 'rtl' : undefined;
|
|
188
188
|
var _a = this.props, id = _a.id, style = _a.style, tabIndex = _a.tabIndex, disabled = _a.disabled;
|
|
189
189
|
var focusedIndex = this.state.focusedIndex;
|
|
190
|
-
return (React.createElement("div", { id: id, style: style, className: kendo_react_common_1.classNames('k-split-button', 'k-button-group', {
|
|
190
|
+
return (React.createElement("div", { id: id, style: style, className: (0, kendo_react_common_1.classNames)('k-split-button', 'k-button-group', {
|
|
191
191
|
'k-focus': this.state.focused
|
|
192
|
-
}, "k-rounded-"
|
|
193
|
-
React.createElement(main_1.Button, { ref: function (el) { return _this.mainButton = el && el.element; }, type: "button", size: this.props.size, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: function (event) { return _this.onItemClick(event, -1); }, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, className: this.props.buttonClass, icon: this.props.icon, iconClass: this.props.iconClass, imageUrl: this.props.imageUrl, dir: dir, "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": this.props.text
|
|
192
|
+
}, "k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[this.props.rounded || 'medium']), this.props.className), onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, dir: dir, ref: function (el) { return _this.wrapper = el; } },
|
|
193
|
+
React.createElement(main_1.Button, { ref: function (el) { return _this.mainButton = el && el.element; }, type: "button", size: this.props.size, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, onClick: function (event) { return _this.onItemClick(event, -1); }, disabled: disabled || undefined, tabIndex: tabIndex, accessKey: this.props.accessKey, className: this.props.buttonClass, icon: this.props.icon, iconClass: this.props.iconClass, imageUrl: this.props.imageUrl, dir: dir, "aria-disabled": disabled, "aria-haspopup": true, "aria-expanded": this.opened, "aria-label": "".concat(this.props.text, " splitbutton"), "aria-owns": this.guid, "aria-activedescendant": focusedIndex >= 0 ? "".concat(this.guid, "-").concat(focusedIndex) : undefined }, this.props.text),
|
|
194
194
|
React.createElement(main_1.Button, { type: "button", size: this.props.size, rounded: this.props.rounded, fillMode: this.props.fillMode, themeColor: this.props.themeColor, icon: "arrow-s", className: "k-split-button-arrow", disabled: disabled || undefined, tabIndex: -1, onClick: this.onSplitPartClick, onMouseDown: this.onDownSplitPart, onPointerDown: this.onDownSplitPart, dir: dir, "aria-label": "menu toggling button" }),
|
|
195
195
|
this.renderPopup(rtl)));
|
|
196
196
|
};
|
|
@@ -216,10 +216,10 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
216
216
|
SplitButton.prototype.dispatchClickEvent = function (dispatchedEvent, clickedItemIndex) {
|
|
217
217
|
if (!this.isItemDisabled(clickedItemIndex)) {
|
|
218
218
|
if (clickedItemIndex === -1) {
|
|
219
|
-
kendo_react_common_2.dispatchEvent(this.props.onButtonClick, dispatchedEvent, this, undefined);
|
|
219
|
+
(0, kendo_react_common_2.dispatchEvent)(this.props.onButtonClick, dispatchedEvent, this, undefined);
|
|
220
220
|
}
|
|
221
221
|
else {
|
|
222
|
-
kendo_react_common_2.dispatchEvent(this.props.onItemClick, dispatchedEvent, this, {
|
|
222
|
+
(0, kendo_react_common_2.dispatchEvent)(this.props.onItemClick, dispatchedEvent, this, {
|
|
223
223
|
item: this.buttonsData[clickedItemIndex],
|
|
224
224
|
itemIndex: clickedItemIndex
|
|
225
225
|
});
|
|
@@ -229,16 +229,16 @@ var SplitButton = /** @class */ (function (_super) {
|
|
|
229
229
|
SplitButton.prototype.renderPopup = function (rtl) {
|
|
230
230
|
var _a;
|
|
231
231
|
var _b = this.props.popupSettings, popupSettings = _b === void 0 ? {} : _b;
|
|
232
|
-
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 },
|
|
233
|
-
React.createElement("ul", { role: "menu", id: this.guid, className: kendo_react_common_1.classNames('k-group k-menu-group k-reset', (_a = {},
|
|
234
|
-
_a["k-menu-group-"
|
|
232
|
+
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 },
|
|
233
|
+
React.createElement("ul", { role: "menu", id: this.guid, className: (0, kendo_react_common_1.classNames)('k-group k-menu-group k-reset', (_a = {},
|
|
234
|
+
_a["k-menu-group-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
235
235
|
_a)) }, this.renderChildItems())));
|
|
236
236
|
};
|
|
237
237
|
SplitButton.prototype.renderChildItems = function () {
|
|
238
238
|
var _this = this;
|
|
239
239
|
var _a = this.props, item = _a.item, itemRender = _a.itemRender, textField = _a.textField;
|
|
240
240
|
return this.buttonsData.length > 0 ? (this.buttonsData.map(function (dataItem, index) {
|
|
241
|
-
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, key: index, index: index, id: _this.guid
|
|
241
|
+
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, key: index, index: index, id: "".concat(_this.guid, "-").concat(index) }));
|
|
242
242
|
})) : null;
|
|
243
243
|
};
|
|
244
244
|
SplitButton.prototype.isItemDisabled = function (index) {
|
package/dist/npm/main.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|