@progress/kendo-react-buttons 5.4.0-dev.202205250548 → 5.4.0-dev.202206081230
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 +10 -10
- 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 +10 -10
- 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
package/dist/npm/Button.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export interface ButtonProps extends ButtonInterface, React.ButtonHTMLAttributes
|
|
|
86
86
|
export interface ButtonState {
|
|
87
87
|
selected: boolean;
|
|
88
88
|
}
|
|
89
|
-
export
|
|
89
|
+
export declare class Button extends React.Component<ButtonProps, ButtonState> {
|
|
90
90
|
/**
|
|
91
91
|
* @hidden
|
|
92
92
|
*/
|
|
@@ -98,11 +98,11 @@ export default class Button extends React.Component<ButtonProps, ButtonState> {
|
|
|
98
98
|
iconClass: PropTypes.Requireable<string>;
|
|
99
99
|
imageUrl: PropTypes.Requireable<string>;
|
|
100
100
|
imageAlt: PropTypes.Requireable<string>;
|
|
101
|
-
size: PropTypes.Requireable<string>;
|
|
102
|
-
shape: PropTypes.Requireable<string>;
|
|
103
|
-
rounded: PropTypes.Requireable<string>;
|
|
104
|
-
fillMode: PropTypes.Requireable<string>;
|
|
105
|
-
themeColor: PropTypes.Requireable<string>;
|
|
101
|
+
size: PropTypes.Requireable<string | null>;
|
|
102
|
+
shape: PropTypes.Requireable<string | null>;
|
|
103
|
+
rounded: PropTypes.Requireable<string | null>;
|
|
104
|
+
fillMode: PropTypes.Requireable<string | null>;
|
|
105
|
+
themeColor: PropTypes.Requireable<string | null>;
|
|
106
106
|
};
|
|
107
107
|
/**
|
|
108
108
|
* @hidden
|
|
@@ -124,19 +124,19 @@ export default class Button extends React.Component<ButtonProps, ButtonState> {
|
|
|
124
124
|
/**
|
|
125
125
|
* Gets the DOM element of the Button component.
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
get element(): HTMLButtonElement | null;
|
|
128
128
|
/**
|
|
129
129
|
* Returns `true` when the component is togglable and selected ([see example]({% slug toggleable_button %})).
|
|
130
130
|
* Otherwise, returns `false`.
|
|
131
131
|
*/
|
|
132
|
-
|
|
133
|
-
constructor(props:
|
|
132
|
+
get selected(): boolean;
|
|
133
|
+
constructor(props: ButtonProps);
|
|
134
134
|
/**
|
|
135
135
|
* @hidden
|
|
136
136
|
*/
|
|
137
137
|
static getDerivedStateFromProps(props: ButtonProps, state: ButtonState): {
|
|
138
138
|
selected: boolean;
|
|
139
|
-
};
|
|
139
|
+
} | null;
|
|
140
140
|
/**
|
|
141
141
|
* @hidden
|
|
142
142
|
*/
|
package/dist/npm/Button.js
CHANGED
|
@@ -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 __());
|
|
@@ -28,11 +30,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
28
30
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
31
|
t[p] = s[p];
|
|
30
32
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
32
|
-
|
|
33
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
+
t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
33
37
|
return t;
|
|
34
38
|
};
|
|
35
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Button = void 0;
|
|
36
41
|
var React = require("react");
|
|
37
42
|
var PropTypes = require("prop-types");
|
|
38
43
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -47,11 +52,11 @@ function iconElement(_a) {
|
|
|
47
52
|
return (React.createElement("img", { role: "presentation", className: 'k-button-icon', alt: imageAlt, src: imageUrl }));
|
|
48
53
|
}
|
|
49
54
|
else if (icon) {
|
|
50
|
-
var iconClasses = kendo_react_common_1.classNames('k-button-icon k-icon', 'k-i-' + icon);
|
|
55
|
+
var iconClasses = (0, kendo_react_common_1.classNames)('k-button-icon k-icon', 'k-i-' + icon);
|
|
51
56
|
return (React.createElement("span", { role: "presentation", className: iconClasses }));
|
|
52
57
|
}
|
|
53
58
|
else if (iconClass) {
|
|
54
|
-
return (React.createElement("span", { role: "presentation", className: kendo_react_common_1.classNames('k-button-icon', iconClass) }));
|
|
59
|
+
return (React.createElement("span", { role: "presentation", className: (0, kendo_react_common_1.classNames)('k-button-icon', iconClass) }));
|
|
55
60
|
}
|
|
56
61
|
return null;
|
|
57
62
|
}
|
|
@@ -66,7 +71,7 @@ var Button = /** @class */ (function (_super) {
|
|
|
66
71
|
_this.props.onClick.call(undefined, event);
|
|
67
72
|
}
|
|
68
73
|
};
|
|
69
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
74
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
70
75
|
_this.state = { selected: _this.props.togglable === true && _this.props.selected === true };
|
|
71
76
|
return _this;
|
|
72
77
|
}
|
|
@@ -77,7 +82,7 @@ var Button = /** @class */ (function (_super) {
|
|
|
77
82
|
get: function () {
|
|
78
83
|
return this._element;
|
|
79
84
|
},
|
|
80
|
-
enumerable:
|
|
85
|
+
enumerable: false,
|
|
81
86
|
configurable: true
|
|
82
87
|
});
|
|
83
88
|
Object.defineProperty(Button.prototype, "selected", {
|
|
@@ -88,7 +93,7 @@ var Button = /** @class */ (function (_super) {
|
|
|
88
93
|
get: function () {
|
|
89
94
|
return this._selectedTemp !== undefined ? this._selectedTemp : this.state.selected;
|
|
90
95
|
},
|
|
91
|
-
enumerable:
|
|
96
|
+
enumerable: false,
|
|
92
97
|
configurable: true
|
|
93
98
|
});
|
|
94
99
|
/**
|
|
@@ -104,8 +109,8 @@ var Button = /** @class */ (function (_super) {
|
|
|
104
109
|
* @hidden
|
|
105
110
|
*/
|
|
106
111
|
Button.prototype.render = function () {
|
|
107
|
-
var _this = this;
|
|
108
112
|
var _a;
|
|
113
|
+
var _this = this;
|
|
109
114
|
var _b = this.props, children = _b.children, togglable = _b.togglable, icon = _b.icon, iconClass = _b.iconClass, imageUrl = _b.imageUrl, imageAlt = _b.imageAlt, className = _b.className, onClick = _b.onClick, _c = _b.size, size = _c === void 0 ? Button.defaultProps.size : _c, _d = _b.shape, shape = _d === void 0 ? Button.defaultProps.shape : _d, _e = _b.rounded, rounded = _e === void 0 ? Button.defaultProps.rounded : _e, _f = _b.fillMode, fillMode = _f === void 0 ? Button.defaultProps.fillMode : _f, _g = _b.themeColor, themeColor = _g === void 0 ? Button.defaultProps.themeColor : _g, htmlAttributes = __rest(_b, ["children", "togglable", "icon", "iconClass", "imageUrl", "imageAlt", "className", "onClick", "size", "shape", "rounded", "fillMode", "themeColor"]);
|
|
110
115
|
var hasIcon = (icon !== undefined || iconClass !== undefined || imageUrl !== undefined);
|
|
111
116
|
var hasChildren = children !== undefined;
|
|
@@ -115,12 +120,12 @@ var Button = /** @class */ (function (_super) {
|
|
|
115
120
|
imageUrl: imageUrl,
|
|
116
121
|
imageAlt: imageAlt
|
|
117
122
|
});
|
|
118
|
-
return (React.createElement("button", __assign({ ref: function (button) { return _this._element = button; }, role: togglable ? 'checkbox' : undefined, "aria-disabled": this.props.disabled || undefined, "aria-checked": togglable ? this.state.selected : undefined }, htmlAttributes, { onClick: this.handleClick, className: kendo_react_common_1.classNames('k-button', (_a = {},
|
|
119
|
-
_a["k-button-"
|
|
120
|
-
_a["k-button-"
|
|
121
|
-
_a["k-button-"
|
|
122
|
-
_a["k-button-"
|
|
123
|
-
_a["k-rounded-"
|
|
123
|
+
return (React.createElement("button", __assign({ ref: function (button) { return _this._element = button; }, role: togglable ? 'checkbox' : undefined, "aria-disabled": this.props.disabled || undefined, "aria-checked": togglable ? this.state.selected : undefined }, htmlAttributes, { onClick: this.handleClick, className: (0, kendo_react_common_1.classNames)('k-button', (_a = {},
|
|
124
|
+
_a["k-button-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
125
|
+
_a["k-button-".concat(shape)] = shape,
|
|
126
|
+
_a["k-button-".concat(fillMode)] = fillMode,
|
|
127
|
+
_a["k-button-".concat(fillMode, "-").concat(themeColor)] = Boolean(fillMode && themeColor),
|
|
128
|
+
_a["k-rounded-".concat(kendo_react_common_1.kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded,
|
|
124
129
|
_a['k-icon-button'] = !hasChildren && hasIcon,
|
|
125
130
|
_a['k-disabled'] = this.props.disabled,
|
|
126
131
|
_a['k-selected'] = this.state.selected,
|
|
@@ -168,4 +173,4 @@ var Button = /** @class */ (function (_super) {
|
|
|
168
173
|
};
|
|
169
174
|
return Button;
|
|
170
175
|
}(React.Component));
|
|
171
|
-
exports.
|
|
176
|
+
exports.Button = Button;
|
|
@@ -10,12 +10,12 @@ export interface ButtonGroupProps extends ButtonGroupInterface {
|
|
|
10
10
|
*/
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare class ButtonGroup extends React.Component<ButtonGroupProps, {}> {
|
|
14
14
|
/**
|
|
15
15
|
* @hidden
|
|
16
16
|
*/
|
|
17
17
|
static propTypes: {
|
|
18
|
-
children: PropTypes.Requireable<PropTypes.ReactElementLike | PropTypes.ReactElementLike[]>;
|
|
18
|
+
children: PropTypes.Requireable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[]>;
|
|
19
19
|
className: PropTypes.Requireable<string>;
|
|
20
20
|
disabled: PropTypes.Requireable<boolean>;
|
|
21
21
|
width: PropTypes.Requireable<string>;
|
package/dist/npm/ButtonGroup.js
CHANGED
|
@@ -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.ButtonGroup = void 0;
|
|
27
30
|
var React = require("react");
|
|
28
31
|
var PropTypes = require("prop-types");
|
|
29
32
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -36,23 +39,23 @@ var ButtonGroup = /** @class */ (function (_super) {
|
|
|
36
39
|
function ButtonGroup(props) {
|
|
37
40
|
var _this = _super.call(this, props) || this;
|
|
38
41
|
_this._element = null;
|
|
39
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
42
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
40
43
|
return _this;
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* @hidden
|
|
44
47
|
*/
|
|
45
48
|
ButtonGroup.prototype.render = function () {
|
|
46
|
-
var _this = this;
|
|
47
49
|
var _a;
|
|
50
|
+
var _this = this;
|
|
48
51
|
var buttons = this.mapButtons(this.props.children);
|
|
49
|
-
var groupClasses = kendo_react_common_1.classNames([styles['button-group']], (_a = {},
|
|
52
|
+
var groupClasses = (0, kendo_react_common_1.classNames)([styles['button-group']], (_a = {},
|
|
50
53
|
_a['k-disabled'] = this.props.disabled,
|
|
51
54
|
_a[styles['button-group-stretched']] = !!this.props.width,
|
|
52
55
|
_a), this.props.className);
|
|
53
56
|
var groupProps = {
|
|
54
57
|
className: groupClasses,
|
|
55
|
-
style: { 'width': ""
|
|
58
|
+
style: { 'width': "".concat(this.props.width) },
|
|
56
59
|
dir: this.props.dir,
|
|
57
60
|
// Accessibility properties
|
|
58
61
|
role: 'group',
|
|
@@ -75,13 +78,13 @@ var ButtonGroup = /** @class */ (function (_super) {
|
|
|
75
78
|
};
|
|
76
79
|
ButtonGroup.prototype.renderButton = function (child, index, isLast, isRtl) {
|
|
77
80
|
var _a;
|
|
78
|
-
var className = kendo_react_common_1.classNames(child.props.className, (_a = {},
|
|
81
|
+
var className = (0, kendo_react_common_1.classNames)(child.props.className, (_a = {},
|
|
79
82
|
_a[styles['group-start']] = isRtl ? isLast : index === 0,
|
|
80
83
|
_a[styles['group-end']] = isRtl ? index === 0 : isLast,
|
|
81
84
|
_a));
|
|
82
|
-
var style = __assign({}, (this.props.width ? { width: this.props.width } : {}), (child.props.style || {}));
|
|
85
|
+
var style = __assign(__assign({}, (this.props.width ? { width: this.props.width } : {})), (child.props.style || {}));
|
|
83
86
|
var disabled = this.props.disabled || child.props.disabled;
|
|
84
|
-
var buttonProps = __assign({}, child.props, (className ? { className: className } : {}), (Object.keys(style).length ? { style: style } : {}), (disabled !== undefined ? { disabled: disabled } : {}));
|
|
87
|
+
var buttonProps = __assign(__assign(__assign(__assign({}, child.props), (className ? { className: className } : {})), (Object.keys(style).length ? { style: style } : {})), (disabled !== undefined ? { disabled: disabled } : {}));
|
|
85
88
|
return React.Children.count(child.props.children) > 0 ?
|
|
86
89
|
React.cloneElement(child, buttonProps, child.props.children) :
|
|
87
90
|
React.cloneElement(child, buttonProps);
|
|
@@ -98,4 +101,4 @@ var ButtonGroup = /** @class */ (function (_super) {
|
|
|
98
101
|
};
|
|
99
102
|
return ButtonGroup;
|
|
100
103
|
}(React.Component));
|
|
101
|
-
exports.
|
|
104
|
+
exports.ButtonGroup = ButtonGroup;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* Represents the properties which can be set to a ButtonGroup.
|
|
3
4
|
*/
|
|
4
5
|
export interface ButtonGroupInterface {
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
children?: React.ReactNode;
|
|
5
10
|
/**
|
|
6
11
|
* By default, the ButtonGroup is enabled ([see example]({% slug disabledstate_buttongroup %})). To disable the whole group of buttons, set its `disabled` attribute to `true`. To disable a specific button, set its own `disabled` attribute to `true` and leave the `disabled` attribute of the ButtonGroup undefined.
|
|
7
12
|
*
|
package/dist/npm/Chip/Chip.d.ts
CHANGED
|
@@ -192,4 +192,4 @@ export interface ChipHandle {
|
|
|
192
192
|
/**
|
|
193
193
|
* Represents the Chip component.
|
|
194
194
|
*/
|
|
195
|
-
export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<ChipHandle>>;
|
|
195
|
+
export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<ChipHandle | null>>;
|
package/dist/npm/Chip/Chip.js
CHANGED
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Chip = void 0;
|
|
14
15
|
var React = require("react");
|
|
15
16
|
var PropTypes = require("prop-types");
|
|
16
17
|
var ChipList_1 = require("./ChipList");
|
|
@@ -26,10 +27,10 @@ var kendo_react_common_3 = require("@progress/kendo-react-common");
|
|
|
26
27
|
*/
|
|
27
28
|
exports.Chip = React.forwardRef(function (props, ref) {
|
|
28
29
|
var _a;
|
|
29
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
30
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
30
31
|
var target = React.useRef(null);
|
|
31
32
|
var chipRef = React.useRef(null);
|
|
32
|
-
var dir = kendo_react_common_1.useDir(chipRef, props.dir);
|
|
33
|
+
var dir = (0, kendo_react_common_1.useDir)(chipRef, props.dir);
|
|
33
34
|
React.useImperativeHandle(target, function () { return ({
|
|
34
35
|
element: chipRef.current,
|
|
35
36
|
props: props
|
|
@@ -107,27 +108,27 @@ exports.Chip = React.forwardRef(function (props, ref) {
|
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
}, [props.onBlur]);
|
|
110
|
-
var mouseProps = kendo_react_common_3.useMouse(props, target, { onClick: handleClick });
|
|
111
|
-
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 = {
|
|
112
113
|
'k-rtl': dir === 'rtl',
|
|
113
114
|
'k-disabled': props.disabled,
|
|
114
115
|
'k-selected': selected,
|
|
115
116
|
'k-focus': focused
|
|
116
117
|
},
|
|
117
|
-
_a["k-chip-"
|
|
118
|
-
_a["k-rounded-"
|
|
119
|
-
_a["k-chip-"
|
|
120
|
-
_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),
|
|
121
122
|
_a), props.className), "aria-checked": selected, "aria-disabled": props.disabled, "aria-describedby": props.ariaDescribedBy, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown }),
|
|
122
|
-
(selected && props.selectedIcon) && React.createElement("span", { className: kendo_react_common_1.classNames('k-chip-icon', 'k-icon', props.selectedIcon) }),
|
|
123
|
-
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) }),
|
|
124
125
|
React.createElement("span", { className: 'k-chip-content' }, props.children !== undefined
|
|
125
126
|
? props.children
|
|
126
127
|
: props.text &&
|
|
127
128
|
React.createElement("span", { "aria-label": props.text, className: 'k-chip-label' }, props.text)),
|
|
128
129
|
props.removable && (React.createElement("span", { className: "k-chip-actions" },
|
|
129
130
|
React.createElement("span", { className: "k-chip-action" },
|
|
130
|
-
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 }))))));
|
|
131
132
|
});
|
|
132
133
|
var propTypes = {
|
|
133
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>>;
|
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ChipList = exports.ChipListDataContext = exports.ChipListFocusContext = exports.ChipListSelectionContext = void 0;
|
|
14
15
|
var React = require("react");
|
|
15
16
|
var PropTypes = require("prop-types");
|
|
16
17
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -44,7 +45,7 @@ exports.ChipListDataContext = React.createContext([null, function (_args) {
|
|
|
44
45
|
var useSelection = function (defaultValue, args, callback) {
|
|
45
46
|
var _a = React.useState(defaultValue), state = _a[0], setState = _a[1];
|
|
46
47
|
var handleDispatchSelection = function (action) {
|
|
47
|
-
var newState = selection_reducer_1.selectionReducer(args.state || state, __assign({}, action, args));
|
|
48
|
+
var newState = (0, selection_reducer_1.selectionReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
48
49
|
if (callback) {
|
|
49
50
|
callback(newState, action.event);
|
|
50
51
|
}
|
|
@@ -58,7 +59,7 @@ var useSelection = function (defaultValue, args, callback) {
|
|
|
58
59
|
var useFocus = function (args) {
|
|
59
60
|
var _a = React.useState(null), state = _a[0], setState = _a[1];
|
|
60
61
|
var handleDispatchFocus = function (action) {
|
|
61
|
-
var newState = focus_reducer_1.focusReducer(action.payload, __assign({}, action, args));
|
|
62
|
+
var newState = (0, focus_reducer_1.focusReducer)(action.payload, __assign(__assign({}, action), args));
|
|
62
63
|
setState(newState);
|
|
63
64
|
};
|
|
64
65
|
return [state, handleDispatchFocus];
|
|
@@ -69,7 +70,7 @@ var useFocus = function (args) {
|
|
|
69
70
|
var useData = function (defaultData, args, callback) {
|
|
70
71
|
var _a = React.useState(defaultData), state = _a[0], setState = _a[1];
|
|
71
72
|
var handleDispatchData = function (action) {
|
|
72
|
-
var newState = data_reducer_1.dataReducer(args.state || state, __assign({}, action, args));
|
|
73
|
+
var newState = (0, data_reducer_1.dataReducer)(args.state || state, __assign(__assign({}, action), args));
|
|
73
74
|
if (callback) {
|
|
74
75
|
callback(newState, action.event);
|
|
75
76
|
}
|
|
@@ -82,10 +83,10 @@ var useData = function (defaultData, args, callback) {
|
|
|
82
83
|
*/
|
|
83
84
|
exports.ChipList = React.forwardRef(function (props, ref) {
|
|
84
85
|
var _a;
|
|
85
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
86
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
86
87
|
var target = React.useRef(null);
|
|
87
88
|
var chipListRef = React.useRef(null);
|
|
88
|
-
var dir = kendo_react_common_1.useDir(chipListRef, props.dir);
|
|
89
|
+
var dir = (0, kendo_react_common_1.useDir)(chipListRef, props.dir);
|
|
89
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;
|
|
90
91
|
var ChipComponent = React.useMemo(function () { return chip || Chip_1.Chip; }, [chip, Chip_1.Chip]);
|
|
91
92
|
React.useImperativeHandle(target, function () { return ({
|
|
@@ -126,18 +127,18 @@ exports.ChipList = React.forwardRef(function (props, ref) {
|
|
|
126
127
|
var data = React.useMemo(function () { return props.data || stateData; }, [props.data, stateData]);
|
|
127
128
|
var chipValue = React.useMemo(function () { return value || stateValue; }, [value, stateValue]);
|
|
128
129
|
var items = React.useMemo(function () { return data.reduce(itemsReducer, []); }, [data, itemsReducer]);
|
|
129
|
-
var valueGetter = React.useCallback(function (item) { return kendo_react_common_1.getter(valueField)(item); }, [valueField]);
|
|
130
|
-
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]);
|
|
131
132
|
var _j = useFocus({ items: items }), focus = _j[0], dispatchFocus = _j[1];
|
|
132
|
-
var mouseProps = kendo_react_common_1.useMouse(props, target);
|
|
133
|
+
var mouseProps = (0, kendo_react_common_1.useMouse)(props, target);
|
|
133
134
|
return (React.createElement(exports.ChipListSelectionContext.Provider, { value: [chipValue, dispatchStateValue] },
|
|
134
135
|
React.createElement(exports.ChipListFocusContext.Provider, { value: [focus, dispatchFocus] },
|
|
135
136
|
React.createElement(exports.ChipListDataContext.Provider, { value: [data, dispatchData] },
|
|
136
|
-
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 = {
|
|
137
138
|
'k-rtl': dir === 'rtl',
|
|
138
139
|
'k-disabled': disabled
|
|
139
140
|
},
|
|
140
|
-
_a["k-chip-list-"
|
|
141
|
+
_a["k-chip-list-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[size] || size)] = size,
|
|
141
142
|
_a), className), "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }), data.map(function (item, index) {
|
|
142
143
|
return (React.createElement(ChipComponent, { role: 'option', dataItem: item, size: size, key: [valueGetter(item), index].join('-'), text: textGetter(item), value: valueGetter(item) }));
|
|
143
144
|
}))))));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataReducer = exports.DATA_ACTION = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -12,7 +13,7 @@ var DATA_ACTION;
|
|
|
12
13
|
/**
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
var dataReducer = function (state, action) {
|
|
16
17
|
switch (action.type) {
|
|
17
18
|
case DATA_ACTION.add:
|
|
18
19
|
// TODO v2
|
|
@@ -26,3 +27,4 @@ exports.dataReducer = function (state, action) {
|
|
|
26
27
|
return state;
|
|
27
28
|
}
|
|
28
29
|
};
|
|
30
|
+
exports.dataReducer = dataReducer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.focusReducer = exports.FOCUS_ACTION = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -13,7 +14,7 @@ var FOCUS_ACTION;
|
|
|
13
14
|
/**
|
|
14
15
|
* @hidden
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
var focusReducer = function (state, action) {
|
|
17
18
|
var currentIndex = action.items.findIndex(function (i) { return i === state; });
|
|
18
19
|
switch (action.type) {
|
|
19
20
|
case FOCUS_ACTION.next:
|
|
@@ -32,3 +33,4 @@ exports.focusReducer = function (state, action) {
|
|
|
32
33
|
return state;
|
|
33
34
|
}
|
|
34
35
|
};
|
|
36
|
+
exports.focusReducer = focusReducer;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
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));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.selectionReducer = exports.SELECTION_ACTION = exports.SELECTION_TYPE = void 0;
|
|
3
13
|
/**
|
|
4
14
|
* @hidden
|
|
5
15
|
*/
|
|
@@ -20,7 +30,7 @@ var SELECTION_ACTION;
|
|
|
20
30
|
/**
|
|
21
31
|
* @hidden
|
|
22
32
|
*/
|
|
23
|
-
|
|
33
|
+
var selectionReducer = function (state, action) {
|
|
24
34
|
switch (action.selection) {
|
|
25
35
|
case SELECTION_TYPE.single:
|
|
26
36
|
switch (action.type) {
|
|
@@ -42,7 +52,7 @@ exports.selectionReducer = function (state, action) {
|
|
|
42
52
|
if (Array.isArray(state)) {
|
|
43
53
|
return state.some(function (i) { return i === action.payload; })
|
|
44
54
|
? state.filter(function (i) { return i !== action.payload; })
|
|
45
|
-
:
|
|
55
|
+
: __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
46
56
|
}
|
|
47
57
|
if (state === null) {
|
|
48
58
|
return [action.payload];
|
|
@@ -53,7 +63,7 @@ exports.selectionReducer = function (state, action) {
|
|
|
53
63
|
if (Array.isArray(state)) {
|
|
54
64
|
return state.some(function (i) { return i === action.payload; })
|
|
55
65
|
? state.filter(function (i) { return i !== action.payload; })
|
|
56
|
-
:
|
|
66
|
+
: __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
57
67
|
}
|
|
58
68
|
return state;
|
|
59
69
|
}
|
|
@@ -66,3 +76,4 @@ exports.selectionReducer = function (state, action) {
|
|
|
66
76
|
return state;
|
|
67
77
|
}
|
|
68
78
|
};
|
|
79
|
+
exports.selectionReducer = selectionReducer;
|
|
@@ -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>>;
|