@progress/kendo-react-buttons 6.1.1 → 7.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/es/Button.d.ts → Button.d.ts} +5 -1
- package/{dist/npm/ButtonGroup.d.ts → ButtonGroup.d.ts} +5 -1
- package/{dist/es/ButtonGroupInterface.d.ts → ButtonGroupInterface.d.ts} +4 -1
- package/{dist/npm/ButtonInterface.d.ts → ButtonInterface.d.ts} +4 -0
- package/{dist/npm/Chip → Chip}/Chip.d.ts +4 -0
- package/{dist/npm/Chip → Chip}/ChipList.d.ts +4 -12
- package/Chip/chip-list-contexts.d.ts +17 -0
- package/{dist/npm/Chip → Chip}/data-reducer.d.ts +5 -1
- package/{dist/es/Chip → Chip}/focus-reducer.d.ts +5 -2
- package/{dist/npm/Chip → Chip}/selection-reducer.d.ts +5 -1
- package/{dist/npm/FloatingActionButton → FloatingActionButton}/FloatingActionButton.d.ts +4 -0
- package/{dist/es/FloatingActionButton → FloatingActionButton}/FloatingActionButtonItem.d.ts +4 -0
- package/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +17 -0
- package/{dist/es/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonPopupSettings.d.ts +4 -0
- package/{dist/npm/FloatingActionButton → FloatingActionButton}/interfaces/FloatingActionButtonProps.d.ts +5 -2
- package/{dist/es/FloatingActionButton → FloatingActionButton}/models/align-offset.d.ts +4 -0
- package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/align.d.ts +4 -0
- package/{dist/es/FloatingActionButton → FloatingActionButton}/models/events.d.ts +5 -1
- package/FloatingActionButton/models/position-mode.d.ts +13 -0
- package/FloatingActionButton/models/rounded.d.ts +16 -0
- package/FloatingActionButton/models/size.d.ts +15 -0
- package/{dist/npm/FloatingActionButton → FloatingActionButton}/models/theme-color.d.ts +5 -1
- package/{dist/npm/FloatingActionButton → FloatingActionButton}/utils.d.ts +4 -0
- package/LICENSE.md +1 -1
- package/{dist/es/ListButton → ListButton}/ButtonItem.d.ts +4 -0
- package/{dist/es/ListButton → ListButton}/DropDownButton.d.ts +5 -1
- package/{dist/npm/ListButton → ListButton}/DropDownButtonItem.d.ts +4 -0
- package/{dist/npm/ListButton → ListButton}/SplitButton.d.ts +5 -1
- package/{dist/es/ListButton → ListButton}/SplitButtonItem.d.ts +4 -0
- package/{dist/npm/ListButton → ListButton}/models/ButtonItem.d.ts +4 -0
- package/{dist/npm/ListButton → ListButton}/models/ListButtonProps.d.ts +4 -1
- package/{dist/npm/ListButton → ListButton}/models/PopupSettings.d.ts +4 -0
- package/{dist/npm/ListButton → ListButton}/models/events.d.ts +4 -0
- package/ListButton/utils/navigation.d.ts +9 -0
- package/ListButton/utils/popup.d.ts +13 -0
- package/dist/cdn/js/kendo-react-buttons.js +5 -1
- package/index.d.ts +36 -0
- package/index.js +5 -0
- package/index.mjs +1877 -0
- package/{dist/npm/models → models}/index.d.ts +4 -1
- package/package-metadata.d.ts +9 -0
- package/package.json +28 -42
- package/{dist/es/toolbar → toolbar}/Toolbar.d.ts +5 -1
- package/{dist/es/toolbar → toolbar}/tools/ToolbarItem.d.ts +5 -1
- package/toolbar/tools/ToolbarSeparator.d.ts +20 -0
- package/{dist/es/toolbar → toolbar}/tools/ToolbarSpacer.d.ts +4 -0
- package/{dist/npm/util.d.ts → util.d.ts} +4 -0
- package/about.md +0 -3
- package/dist/es/Button.js +0 -171
- package/dist/es/ButtonGroup.d.ts +0 -32
- package/dist/es/ButtonGroup.js +0 -101
- package/dist/es/ButtonGroupInterface.js +0 -2
- package/dist/es/ButtonInterface.d.ts +0 -35
- package/dist/es/ButtonInterface.js +0 -3
- package/dist/es/Chip/Chip.d.ts +0 -234
- package/dist/es/Chip/Chip.js +0 -173
- package/dist/es/Chip/ChipList.d.ts +0 -123
- package/dist/es/Chip/ChipList.js +0 -177
- package/dist/es/Chip/data-reducer.d.ts +0 -22
- package/dist/es/Chip/data-reducer.js +0 -26
- package/dist/es/Chip/focus-reducer.js +0 -32
- package/dist/es/Chip/selection-reducer.d.ts +0 -30
- package/dist/es/Chip/selection-reducer.js +0 -75
- package/dist/es/FloatingActionButton/FloatingActionButton.d.ts +0 -17
- package/dist/es/FloatingActionButton/FloatingActionButton.js +0 -281
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +0 -82
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -1
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -1
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +0 -216
- package/dist/es/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -1
- package/dist/es/FloatingActionButton/models/align-offset.js +0 -1
- package/dist/es/FloatingActionButton/models/align.d.ts +0 -27
- package/dist/es/FloatingActionButton/models/align.js +0 -1
- package/dist/es/FloatingActionButton/models/events.js +0 -1
- package/dist/es/FloatingActionButton/models/position-mode.d.ts +0 -9
- package/dist/es/FloatingActionButton/models/position-mode.js +0 -1
- package/dist/es/FloatingActionButton/models/rounded.d.ts +0 -12
- package/dist/es/FloatingActionButton/models/rounded.js +0 -1
- package/dist/es/FloatingActionButton/models/size.d.ts +0 -11
- package/dist/es/FloatingActionButton/models/size.js +0 -1
- package/dist/es/FloatingActionButton/models/theme-color.d.ts +0 -18
- package/dist/es/FloatingActionButton/models/theme-color.js +0 -1
- package/dist/es/FloatingActionButton/utils.d.ts +0 -27
- package/dist/es/FloatingActionButton/utils.js +0 -93
- package/dist/es/ListButton/ButtonItem.js +0 -24
- package/dist/es/ListButton/DropDownButton.js +0 -325
- package/dist/es/ListButton/DropDownButtonItem.d.ts +0 -30
- package/dist/es/ListButton/DropDownButtonItem.js +0 -43
- package/dist/es/ListButton/SplitButton.d.ts +0 -120
- package/dist/es/ListButton/SplitButton.js +0 -334
- package/dist/es/ListButton/SplitButtonItem.js +0 -42
- package/dist/es/ListButton/models/ButtonItem.d.ts +0 -34
- package/dist/es/ListButton/models/ButtonItem.js +0 -3
- package/dist/es/ListButton/models/ListButtonProps.d.ts +0 -336
- package/dist/es/ListButton/models/ListButtonProps.js +0 -2
- package/dist/es/ListButton/models/PopupSettings.d.ts +0 -24
- package/dist/es/ListButton/models/PopupSettings.js +0 -1
- package/dist/es/ListButton/models/events.d.ts +0 -47
- package/dist/es/ListButton/models/events.js +0 -1
- package/dist/es/ListButton/utils/navigation.d.ts +0 -5
- package/dist/es/ListButton/utils/navigation.js +0 -29
- package/dist/es/ListButton/utils/popup.d.ts +0 -9
- package/dist/es/ListButton/utils/popup.js +0 -20
- package/dist/es/main.d.ts +0 -32
- package/dist/es/main.js +0 -17
- package/dist/es/models/index.d.ts +0 -89
- package/dist/es/models/index.js +0 -1
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/toolbar/Toolbar.js +0 -214
- package/dist/es/toolbar/tools/ToolbarItem.js +0 -56
- package/dist/es/toolbar/tools/ToolbarSeparator.d.ts +0 -16
- package/dist/es/toolbar/tools/ToolbarSeparator.js +0 -31
- package/dist/es/toolbar/tools/ToolbarSpacer.js +0 -20
- package/dist/es/util.d.ts +0 -27
- package/dist/es/util.js +0 -37
- package/dist/npm/Button.d.ts +0 -138
- package/dist/npm/Button.js +0 -174
- package/dist/npm/ButtonGroup.js +0 -104
- package/dist/npm/ButtonGroupInterface.d.ts +0 -33
- package/dist/npm/ButtonGroupInterface.js +0 -3
- package/dist/npm/ButtonInterface.js +0 -4
- package/dist/npm/Chip/Chip.js +0 -176
- package/dist/npm/Chip/ChipList.js +0 -180
- package/dist/npm/Chip/data-reducer.js +0 -30
- package/dist/npm/Chip/focus-reducer.d.ts +0 -25
- package/dist/npm/Chip/focus-reducer.js +0 -36
- package/dist/npm/Chip/selection-reducer.js +0 -79
- package/dist/npm/FloatingActionButton/FloatingActionButton.js +0 -284
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.d.ts +0 -105
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +0 -85
- package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +0 -13
- package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonHandle.js +0 -2
- package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +0 -24
- package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.js +0 -2
- package/dist/npm/FloatingActionButton/interfaces/FloatingActionButtonProps.js +0 -2
- package/dist/npm/FloatingActionButton/models/align-offset.d.ts +0 -20
- package/dist/npm/FloatingActionButton/models/align-offset.js +0 -2
- package/dist/npm/FloatingActionButton/models/align.js +0 -2
- package/dist/npm/FloatingActionButton/models/events.d.ts +0 -21
- package/dist/npm/FloatingActionButton/models/events.js +0 -2
- package/dist/npm/FloatingActionButton/models/position-mode.d.ts +0 -9
- package/dist/npm/FloatingActionButton/models/position-mode.js +0 -2
- package/dist/npm/FloatingActionButton/models/rounded.d.ts +0 -12
- package/dist/npm/FloatingActionButton/models/rounded.js +0 -2
- package/dist/npm/FloatingActionButton/models/size.d.ts +0 -11
- package/dist/npm/FloatingActionButton/models/size.js +0 -2
- package/dist/npm/FloatingActionButton/models/theme-color.js +0 -2
- package/dist/npm/FloatingActionButton/utils.js +0 -101
- package/dist/npm/ListButton/ButtonItem.d.ts +0 -30
- package/dist/npm/ListButton/ButtonItem.js +0 -28
- package/dist/npm/ListButton/DropDownButton.d.ts +0 -118
- package/dist/npm/ListButton/DropDownButton.js +0 -328
- package/dist/npm/ListButton/DropDownButtonItem.js +0 -46
- package/dist/npm/ListButton/SplitButton.js +0 -337
- package/dist/npm/ListButton/SplitButtonItem.d.ts +0 -25
- package/dist/npm/ListButton/SplitButtonItem.js +0 -45
- package/dist/npm/ListButton/models/ButtonItem.js +0 -4
- package/dist/npm/ListButton/models/ListButtonProps.js +0 -3
- package/dist/npm/ListButton/models/PopupSettings.js +0 -2
- package/dist/npm/ListButton/models/events.js +0 -2
- package/dist/npm/ListButton/utils/navigation.d.ts +0 -5
- package/dist/npm/ListButton/utils/navigation.js +0 -32
- package/dist/npm/ListButton/utils/popup.d.ts +0 -9
- package/dist/npm/ListButton/utils/popup.js +0 -25
- package/dist/npm/main.d.ts +0 -32
- package/dist/npm/main.js +0 -48
- package/dist/npm/models/index.js +0 -2
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/toolbar/Toolbar.d.ts +0 -171
- package/dist/npm/toolbar/Toolbar.js +0 -217
- package/dist/npm/toolbar/tools/ToolbarItem.d.ts +0 -38
- package/dist/npm/toolbar/tools/ToolbarItem.js +0 -59
- package/dist/npm/toolbar/tools/ToolbarSeparator.d.ts +0 -16
- package/dist/npm/toolbar/tools/ToolbarSeparator.js +0 -34
- package/dist/npm/toolbar/tools/ToolbarSpacer.d.ts +0 -23
- package/dist/npm/toolbar/tools/ToolbarSpacer.js +0 -23
- package/dist/npm/util.js +0 -40
- package/dist/systemjs/kendo-react-buttons.js +0 -1
- package/e2e-next/button.basic.tests.ts +0 -24
- package/e2e-next/buttongroup.basic.tests.ts +0 -24
- package/e2e-next/chip.basic.tests.ts +0 -24
- package/e2e-next/chiplist.basic.tests.ts +0 -24
- package/e2e-next/dropdownbutton.basic.tests.ts +0 -24
- package/e2e-next/floatingactionbutton.basic.tests.ts +0 -24
- package/e2e-next/splitbutton.basic.tests.ts +0 -24
- package/e2e-next/toolbar.basic.tests.ts +0 -24
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the `resize` event of the Toolbar.
|
|
6
|
-
*/
|
|
7
|
-
export interface ToolbarResizeEvent {
|
|
8
|
-
/**
|
|
9
|
-
* An event target.
|
|
10
|
-
*/
|
|
11
|
-
target: Toolbar;
|
|
12
|
-
/**
|
|
13
|
-
* The `offsetWidth` event of the Toolbar.
|
|
14
|
-
*/
|
|
15
|
-
offsetWidth: number;
|
|
16
|
-
/**
|
|
17
|
-
* The `offsetHeight` event of the Toolbar.
|
|
18
|
-
*/
|
|
19
|
-
offsetHeight: number;
|
|
20
|
-
/**
|
|
21
|
-
* A native DOM event.
|
|
22
|
-
*/
|
|
23
|
-
nativeEvent: any;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Represents the props of the [KendoReact Toolbar component]({% slug overview_toolbar %}).
|
|
27
|
-
*/
|
|
28
|
-
export interface ToolbarProps extends KendoReactComponentBaseProps {
|
|
29
|
-
/**
|
|
30
|
-
* Sets additional classes to the Toolbar.
|
|
31
|
-
*/
|
|
32
|
-
className?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Represents the `dir` HTML attribute.
|
|
35
|
-
*/
|
|
36
|
-
dir?: string;
|
|
37
|
-
/**
|
|
38
|
-
* The styles that are applied to the Toolbar.
|
|
39
|
-
*/
|
|
40
|
-
style?: React.CSSProperties;
|
|
41
|
-
/**
|
|
42
|
-
* Represents the label of the Toolbar component.
|
|
43
|
-
*/
|
|
44
|
-
ariaLabel?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Specifies the `tabIndex` of the Toolbar.
|
|
47
|
-
*/
|
|
48
|
-
tabIndex?: number;
|
|
49
|
-
/**
|
|
50
|
-
* The `resize` event of the Toolbar.
|
|
51
|
-
*/
|
|
52
|
-
onResize?: (event: ToolbarResizeEvent) => void;
|
|
53
|
-
/**
|
|
54
|
-
* If set to `false`, it will turn off the built-in keyboard navigation.
|
|
55
|
-
*/
|
|
56
|
-
keyboardNavigation?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* @hidden
|
|
59
|
-
*
|
|
60
|
-
* The CSS selectors of the toolbar HTML elements used by built-in keyboard navigation.
|
|
61
|
-
* Each selector needs to point to a focusable element.
|
|
62
|
-
* Defaults to [
|
|
63
|
-
* 'button',
|
|
64
|
-
* '.k-button-group > button',
|
|
65
|
-
* '.k-dropdown > .k-dropdown-wrap',
|
|
66
|
-
* '.k-colorpicker > .k-picker-wrap'
|
|
67
|
-
* ].
|
|
68
|
-
*/
|
|
69
|
-
buttons?: string[];
|
|
70
|
-
/**
|
|
71
|
-
* Configures the `size` of the Toolbar.
|
|
72
|
-
*
|
|
73
|
-
* The available options are:
|
|
74
|
-
* - small
|
|
75
|
-
* - medium
|
|
76
|
-
* - large
|
|
77
|
-
* - null—Does not set a size `className`.
|
|
78
|
-
*
|
|
79
|
-
* @default `medium`
|
|
80
|
-
*/
|
|
81
|
-
size?: null | 'small' | 'medium' | 'large';
|
|
82
|
-
/**
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
role?: string;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Represents the [KendoReact Toolbar component]({% slug overview_toolbar %}).
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```jsx
|
|
92
|
-
* class App extends React.Component {
|
|
93
|
-
* render() {
|
|
94
|
-
* return (
|
|
95
|
-
* <Toolbar>
|
|
96
|
-
* <ToolbarItem>
|
|
97
|
-
* <ButtonGroup>
|
|
98
|
-
* <Button togglable={true} icon="bold" />
|
|
99
|
-
* <Button togglable={true} icon="italic" />
|
|
100
|
-
* <Button togglable={true} icon="underline" />
|
|
101
|
-
* </ButtonGroup>
|
|
102
|
-
* </ToolbarItem>
|
|
103
|
-
* <ToolbarItem>
|
|
104
|
-
* <ButtonGroup>
|
|
105
|
-
* <Button icon="hyperlink">Insert Link</Button>
|
|
106
|
-
* <Button icon="image">Insert Image</Button>
|
|
107
|
-
* <Button icon="table">Insert Table</Button>
|
|
108
|
-
* </ButtonGroup>
|
|
109
|
-
* </ToolbarItem>
|
|
110
|
-
* </Toolbar>
|
|
111
|
-
* );
|
|
112
|
-
* }
|
|
113
|
-
* }
|
|
114
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
export declare class Toolbar extends React.Component<ToolbarProps> {
|
|
118
|
-
/**
|
|
119
|
-
* @hidden
|
|
120
|
-
*/
|
|
121
|
-
static propTypes: {
|
|
122
|
-
tabIndex: PropTypes.Requireable<number>;
|
|
123
|
-
dir: PropTypes.Requireable<string>;
|
|
124
|
-
keyboardNavigation: PropTypes.Requireable<boolean>;
|
|
125
|
-
style: PropTypes.Requireable<object>;
|
|
126
|
-
className: PropTypes.Requireable<string>;
|
|
127
|
-
role: PropTypes.Requireable<string>;
|
|
128
|
-
onResize: PropTypes.Requireable<(...args: any[]) => any>;
|
|
129
|
-
buttons: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
130
|
-
size: PropTypes.Requireable<string | null>;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* @hidden
|
|
134
|
-
*/
|
|
135
|
-
static defaultProps: {
|
|
136
|
-
tabIndex: number;
|
|
137
|
-
size: string;
|
|
138
|
-
};
|
|
139
|
-
private _element;
|
|
140
|
-
private offsetHeight;
|
|
141
|
-
private offsetWidth;
|
|
142
|
-
private buttons;
|
|
143
|
-
private focusedSelector;
|
|
144
|
-
constructor(props: ToolbarProps);
|
|
145
|
-
private get selectors();
|
|
146
|
-
private get focusedIndex();
|
|
147
|
-
/**
|
|
148
|
-
* Returns the HTML element of the Toolbar component.
|
|
149
|
-
*/
|
|
150
|
-
get element(): HTMLDivElement | null;
|
|
151
|
-
/**
|
|
152
|
-
* @hidden
|
|
153
|
-
*/
|
|
154
|
-
componentDidMount(): void;
|
|
155
|
-
/**
|
|
156
|
-
* @hidden
|
|
157
|
-
*/
|
|
158
|
-
componentDidUpdate(): void;
|
|
159
|
-
/**
|
|
160
|
-
* @hidden
|
|
161
|
-
*/
|
|
162
|
-
componentWillUnmount(): void;
|
|
163
|
-
/**
|
|
164
|
-
* @hidden
|
|
165
|
-
*/
|
|
166
|
-
render(): JSX.Element;
|
|
167
|
-
private setTabIndex;
|
|
168
|
-
private onKeyDown;
|
|
169
|
-
private focusButton;
|
|
170
|
-
private onWindowResize;
|
|
171
|
-
}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
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");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Toolbar = void 0;
|
|
30
|
-
var React = require("react");
|
|
31
|
-
var PropTypes = require("prop-types");
|
|
32
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
33
|
-
var util_1 = require("./../util");
|
|
34
|
-
var kendo_react_common_2 = require("@progress/kendo-react-common");
|
|
35
|
-
var package_metadata_1 = require("../package-metadata");
|
|
36
|
-
/**
|
|
37
|
-
* Represents the [KendoReact Toolbar component]({% slug overview_toolbar %}).
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```jsx
|
|
41
|
-
* class App extends React.Component {
|
|
42
|
-
* render() {
|
|
43
|
-
* return (
|
|
44
|
-
* <Toolbar>
|
|
45
|
-
* <ToolbarItem>
|
|
46
|
-
* <ButtonGroup>
|
|
47
|
-
* <Button togglable={true} icon="bold" />
|
|
48
|
-
* <Button togglable={true} icon="italic" />
|
|
49
|
-
* <Button togglable={true} icon="underline" />
|
|
50
|
-
* </ButtonGroup>
|
|
51
|
-
* </ToolbarItem>
|
|
52
|
-
* <ToolbarItem>
|
|
53
|
-
* <ButtonGroup>
|
|
54
|
-
* <Button icon="hyperlink">Insert Link</Button>
|
|
55
|
-
* <Button icon="image">Insert Image</Button>
|
|
56
|
-
* <Button icon="table">Insert Table</Button>
|
|
57
|
-
* </ButtonGroup>
|
|
58
|
-
* </ToolbarItem>
|
|
59
|
-
* </Toolbar>
|
|
60
|
-
* );
|
|
61
|
-
* }
|
|
62
|
-
* }
|
|
63
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
var Toolbar = /** @class */ (function (_super) {
|
|
67
|
-
__extends(Toolbar, _super);
|
|
68
|
-
function Toolbar(props) {
|
|
69
|
-
var _this = _super.call(this, props) || this;
|
|
70
|
-
_this._element = null;
|
|
71
|
-
_this.offsetHeight = 0;
|
|
72
|
-
_this.offsetWidth = 0;
|
|
73
|
-
_this.buttons = [];
|
|
74
|
-
_this.focusedSelector = _this.selectors.map(function (s) { return s + ':focus'; }).join(',');
|
|
75
|
-
_this.setTabIndex = function (focusedIndex) {
|
|
76
|
-
var _a = _this.props.tabIndex, tabIndex = _a === void 0 ? Toolbar.defaultProps.tabIndex : _a;
|
|
77
|
-
_this.buttons.forEach(function (button, index) {
|
|
78
|
-
button.tabIndex = (index === focusedIndex) ? tabIndex : -1;
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
_this.onKeyDown = function (event) {
|
|
82
|
-
var target = event.target;
|
|
83
|
-
var arrowKey = event.keyCode === kendo_react_common_1.Keys.left || event.keyCode === kendo_react_common_1.Keys.right;
|
|
84
|
-
if (!arrowKey || event.defaultPrevented || _this.buttons.findIndex(function (b) { return b === target; }) === -1) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
var focusedIndex = _this.focusedIndex;
|
|
88
|
-
if (event.keyCode === kendo_react_common_1.Keys.left) {
|
|
89
|
-
_this.focusButton(focusedIndex, focusedIndex - 1);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
_this.focusButton(focusedIndex, focusedIndex + 1);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
_this.onWindowResize = function (event) {
|
|
96
|
-
var element = _this.element;
|
|
97
|
-
if (!element) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
var offsetWidth = element.offsetWidth;
|
|
101
|
-
var offsetHeight = element.offsetHeight;
|
|
102
|
-
if (_this.offsetWidth !== offsetWidth || _this.offsetHeight !== offsetHeight) {
|
|
103
|
-
_this.offsetWidth = offsetWidth;
|
|
104
|
-
_this.offsetHeight = offsetHeight;
|
|
105
|
-
var newSizes = { offsetWidth: _this.offsetWidth, offsetHeight: _this.offsetHeight };
|
|
106
|
-
if (_this.props.onResize) {
|
|
107
|
-
_this.props.onResize.call(undefined, __assign(__assign({ target: _this }, newSizes), { nativeEvent: event }));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
112
|
-
return _this;
|
|
113
|
-
}
|
|
114
|
-
Object.defineProperty(Toolbar.prototype, "selectors", {
|
|
115
|
-
get: function () {
|
|
116
|
-
return this.props.buttons || util_1.toolbarButtons;
|
|
117
|
-
},
|
|
118
|
-
enumerable: false,
|
|
119
|
-
configurable: true
|
|
120
|
-
});
|
|
121
|
-
Object.defineProperty(Toolbar.prototype, "focusedIndex", {
|
|
122
|
-
get: function () {
|
|
123
|
-
var focused = this.element && this.element.querySelector(this.focusedSelector);
|
|
124
|
-
return Math.max(0, this.buttons.findIndex(function (e) { return e === focused; }));
|
|
125
|
-
},
|
|
126
|
-
enumerable: false,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(Toolbar.prototype, "element", {
|
|
130
|
-
/**
|
|
131
|
-
* Returns the HTML element of the Toolbar component.
|
|
132
|
-
*/
|
|
133
|
-
get: function () {
|
|
134
|
-
return this._element;
|
|
135
|
-
},
|
|
136
|
-
enumerable: false,
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
/**
|
|
140
|
-
* @hidden
|
|
141
|
-
*/
|
|
142
|
-
Toolbar.prototype.componentDidMount = function () {
|
|
143
|
-
window.addEventListener('resize', this.onWindowResize);
|
|
144
|
-
var element = this.element;
|
|
145
|
-
if (element) {
|
|
146
|
-
this.offsetWidth = element.offsetWidth;
|
|
147
|
-
this.offsetHeight = element.offsetHeight;
|
|
148
|
-
if (this.props.keyboardNavigation !== false) {
|
|
149
|
-
this.buttons = Array.from(element.querySelectorAll(this.selectors.join(',')));
|
|
150
|
-
this.setTabIndex(0);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* @hidden
|
|
156
|
-
*/
|
|
157
|
-
Toolbar.prototype.componentDidUpdate = function () {
|
|
158
|
-
var element = this.element;
|
|
159
|
-
if (!element || this.props.keyboardNavigation === false) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.buttons = Array.from(element.querySelectorAll(this.selectors.join(',')));
|
|
163
|
-
this.setTabIndex(this.focusedIndex);
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* @hidden
|
|
167
|
-
*/
|
|
168
|
-
Toolbar.prototype.componentWillUnmount = function () {
|
|
169
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
170
|
-
this.buttons.length = 0;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* @hidden
|
|
174
|
-
*/
|
|
175
|
-
Toolbar.prototype.render = function () {
|
|
176
|
-
var _a;
|
|
177
|
-
var _this = this;
|
|
178
|
-
return (React.createElement("div", { id: this.props.id, "aria-label": this.props.ariaLabel, className: (0, kendo_react_common_1.classNames)('k-toolbar', (_a = {},
|
|
179
|
-
_a["k-toolbar-".concat(kendo_react_common_1.kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
180
|
-
_a), this.props.className), style: this.props.style, role: this.props.role !== undefined ? (this.props.role || undefined) : 'toolbar', dir: this.props.dir, ref: function (element) { return _this._element = element; }, onKeyDown: this.props.keyboardNavigation !== false ? this.onKeyDown : undefined }, this.props.children));
|
|
181
|
-
};
|
|
182
|
-
Toolbar.prototype.focusButton = function (prevIndex, index) {
|
|
183
|
-
var _a = this.props.tabIndex, tabIndex = _a === void 0 ? Toolbar.defaultProps.tabIndex : _a;
|
|
184
|
-
var button = this.buttons[index];
|
|
185
|
-
if (button) {
|
|
186
|
-
button.tabIndex = tabIndex;
|
|
187
|
-
button.focus();
|
|
188
|
-
var prevButton = this.buttons[prevIndex];
|
|
189
|
-
if (prevButton) {
|
|
190
|
-
prevButton.tabIndex = -1;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* @hidden
|
|
196
|
-
*/
|
|
197
|
-
Toolbar.propTypes = {
|
|
198
|
-
tabIndex: PropTypes.number,
|
|
199
|
-
dir: PropTypes.string,
|
|
200
|
-
keyboardNavigation: PropTypes.bool,
|
|
201
|
-
style: PropTypes.object,
|
|
202
|
-
className: PropTypes.string,
|
|
203
|
-
role: PropTypes.string,
|
|
204
|
-
onResize: PropTypes.func,
|
|
205
|
-
buttons: PropTypes.arrayOf(PropTypes.string),
|
|
206
|
-
size: PropTypes.oneOf([null, 'small', 'medium', 'large'])
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* @hidden
|
|
210
|
-
*/
|
|
211
|
-
Toolbar.defaultProps = {
|
|
212
|
-
tabIndex: 0,
|
|
213
|
-
size: 'medium'
|
|
214
|
-
};
|
|
215
|
-
return Toolbar;
|
|
216
|
-
}(React.Component));
|
|
217
|
-
exports.Toolbar = Toolbar;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the props of KendoReact ToolbarItem component.
|
|
6
|
-
*/
|
|
7
|
-
export interface ToolbarItemProps extends KendoReactComponentBaseProps {
|
|
8
|
-
/**
|
|
9
|
-
* Sets additional classes to the ToolbarItem component.
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Sets additional styles to the ToolbarItem component.
|
|
14
|
-
*/
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Represents the KendoReact ToolbarItem component.
|
|
19
|
-
* To add a tool to the Toolbar, wrap it inside a ToolbarItem component
|
|
20
|
-
* ([see example]({% slug content_toolbar %})).
|
|
21
|
-
*/
|
|
22
|
-
export declare class ToolbarItem extends React.PureComponent<ToolbarItemProps> {
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
static propTypes: {
|
|
27
|
-
className: PropTypes.Requireable<string>;
|
|
28
|
-
};
|
|
29
|
-
private _element;
|
|
30
|
-
/**
|
|
31
|
-
* Returns the HTML element of the ToolbarItem component.
|
|
32
|
-
*/
|
|
33
|
-
get element(): HTMLSpanElement | null;
|
|
34
|
-
/**
|
|
35
|
-
* @hidden
|
|
36
|
-
*/
|
|
37
|
-
render(): JSX.Element;
|
|
38
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
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");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ToolbarItem = void 0;
|
|
19
|
-
var React = require("react");
|
|
20
|
-
var PropTypes = require("prop-types");
|
|
21
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
22
|
-
/**
|
|
23
|
-
* Represents the KendoReact ToolbarItem component.
|
|
24
|
-
* To add a tool to the Toolbar, wrap it inside a ToolbarItem component
|
|
25
|
-
* ([see example]({% slug content_toolbar %})).
|
|
26
|
-
*/
|
|
27
|
-
var ToolbarItem = /** @class */ (function (_super) {
|
|
28
|
-
__extends(ToolbarItem, _super);
|
|
29
|
-
function ToolbarItem() {
|
|
30
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
-
_this._element = null;
|
|
32
|
-
return _this;
|
|
33
|
-
}
|
|
34
|
-
Object.defineProperty(ToolbarItem.prototype, "element", {
|
|
35
|
-
/**
|
|
36
|
-
* Returns the HTML element of the ToolbarItem component.
|
|
37
|
-
*/
|
|
38
|
-
get: function () {
|
|
39
|
-
return this._element;
|
|
40
|
-
},
|
|
41
|
-
enumerable: false,
|
|
42
|
-
configurable: true
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* @hidden
|
|
46
|
-
*/
|
|
47
|
-
ToolbarItem.prototype.render = function () {
|
|
48
|
-
var _this = this;
|
|
49
|
-
return (React.createElement("div", { id: this.props.id, className: (0, kendo_react_common_1.classNames)('k-toolbar-item', this.props.className), style: this.props.style, ref: function (e) { return _this._element = e; } }, this.props.children));
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* @hidden
|
|
53
|
-
*/
|
|
54
|
-
ToolbarItem.propTypes = {
|
|
55
|
-
className: PropTypes.string
|
|
56
|
-
};
|
|
57
|
-
return ToolbarItem;
|
|
58
|
-
}(React.PureComponent));
|
|
59
|
-
exports.ToolbarItem = ToolbarItem;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the KendoReact Toolbar Separator component.
|
|
4
|
-
*/
|
|
5
|
-
export interface ToolbarSeparatorProps {
|
|
6
|
-
/**
|
|
7
|
-
* Sets additional classes to the ToolbarSeparator component.
|
|
8
|
-
*/
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class ToolbarSeparator extends React.PureComponent<ToolbarSeparatorProps> {
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
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");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ToolbarSeparator = void 0;
|
|
19
|
-
var React = require("react");
|
|
20
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
21
|
-
var ToolbarSeparator = /** @class */ (function (_super) {
|
|
22
|
-
__extends(ToolbarSeparator, _super);
|
|
23
|
-
function ToolbarSeparator() {
|
|
24
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
ToolbarSeparator.prototype.render = function () {
|
|
30
|
-
return (React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-separator', this.props.className) }));
|
|
31
|
-
};
|
|
32
|
-
return ToolbarSeparator;
|
|
33
|
-
}(React.PureComponent));
|
|
34
|
-
exports.ToolbarSeparator = ToolbarSeparator;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the props of KendoReact ToolbarSpacer component.
|
|
4
|
-
*/
|
|
5
|
-
export interface ToolbarSpacerProps {
|
|
6
|
-
/**
|
|
7
|
-
* Sets additional classes to the ToolbarSpacer component.
|
|
8
|
-
*/
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
/** @hidden */
|
|
12
|
-
export interface ToolbarSpacerHandle {
|
|
13
|
-
/**
|
|
14
|
-
* Returns the HTML element of the ToolbarSpacer component.
|
|
15
|
-
*/
|
|
16
|
-
element: HTMLDivElement | null;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Represents the KendoReact ToolbarSpacer component.
|
|
20
|
-
* To specify an empty space, provide a ToolbarSpacer component
|
|
21
|
-
* ([see example]({% slug content_toolbar %})).
|
|
22
|
-
*/
|
|
23
|
-
export declare const ToolbarSpacer: React.ForwardRefExoticComponent<ToolbarSpacerProps & React.RefAttributes<ToolbarSpacerHandle>>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolbarSpacer = void 0;
|
|
4
|
-
var React = require("react");
|
|
5
|
-
var PropTypes = require("prop-types");
|
|
6
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
7
|
-
/**
|
|
8
|
-
* Represents the KendoReact ToolbarSpacer component.
|
|
9
|
-
* To specify an empty space, provide a ToolbarSpacer component
|
|
10
|
-
* ([see example]({% slug content_toolbar %})).
|
|
11
|
-
*/
|
|
12
|
-
exports.ToolbarSpacer = React.forwardRef(function (props, ref) {
|
|
13
|
-
var element = React.useRef(null);
|
|
14
|
-
var spacer = React.useRef(null);
|
|
15
|
-
React.useImperativeHandle(spacer, function () { return ({ element: element.current }); });
|
|
16
|
-
React.useImperativeHandle(ref, function () { return ({ element: element.current }); });
|
|
17
|
-
var className = React.useMemo(function () { return (0, kendo_react_common_1.classNames)('k-spacer', props.className); }, [props.className]);
|
|
18
|
-
return (React.createElement("span", { ref: element, className: className }));
|
|
19
|
-
});
|
|
20
|
-
exports.ToolbarSpacer.displayName = 'KendoReactToolbarSpacer';
|
|
21
|
-
exports.ToolbarSpacer.propTypes = {
|
|
22
|
-
className: PropTypes.string
|
|
23
|
-
};
|
package/dist/npm/util.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toolbarButtons = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var styles = {
|
|
8
|
-
button: 'k-button',
|
|
9
|
-
'flat': 'k-flat',
|
|
10
|
-
'outline': 'k-outline',
|
|
11
|
-
'clear': 'k-button-clear',
|
|
12
|
-
'primary': 'k-primary',
|
|
13
|
-
'state-selected': 'k-selected',
|
|
14
|
-
'button-icon': 'k-button-icon',
|
|
15
|
-
'button-icontext': 'k-button-icontext',
|
|
16
|
-
'state-disabled': 'k-disabled',
|
|
17
|
-
'group-start': 'k-group-start',
|
|
18
|
-
'group-end': 'k-group-end',
|
|
19
|
-
'button-group': 'k-button-group',
|
|
20
|
-
'button-group-stretched': 'k-button-group-stretched',
|
|
21
|
-
'ltr': 'k-ltr',
|
|
22
|
-
'rtl': 'k-rtl'
|
|
23
|
-
};
|
|
24
|
-
// const notDisabled = ':not(.k-disabled):not([disabled]):not([disabled="true"])';
|
|
25
|
-
var noInnerButton = ':not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)';
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
exports.toolbarButtons = [
|
|
30
|
-
'button' + noInnerButton,
|
|
31
|
-
'.k-button-group > button' + noInnerButton,
|
|
32
|
-
'.k-colorpicker',
|
|
33
|
-
'.k-dropdownlist'
|
|
34
|
-
];
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
exports.default = {
|
|
39
|
-
styles: styles
|
|
40
|
-
};
|