@progress/kendo-themes-html 5.0.0-alpha.3 → 5.0.0-beta.3
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/lib/jsx-runtime.js +48 -3
- package/package.json +7 -7
- package/src/autocomplete/autocomplete.jsx +4 -4
- package/src/avatar/README.md +21 -0
- package/src/avatar/avatar.jsx +113 -0
- package/src/avatar/index.js +1 -0
- package/src/button/button.jsx +7 -7
- package/src/checkbox/checkbox.jsx +3 -3
- package/src/chip/README.md +47 -0
- package/src/chip/chip-actions.jsx +80 -0
- package/src/chip/chip-avatar.jsx +13 -0
- package/src/chip/chip-list.jsx +84 -0
- package/src/chip/chip.jsx +180 -0
- package/src/chip/index.js +4 -0
- package/src/colorpicker/README.md +24 -15
- package/src/colorpicker/color-preview.jsx +33 -22
- package/src/colorpicker/colorpicker.jsx +12 -13
- package/src/combobox/combobox.jsx +9 -11
- package/src/{component.js → component/component.jsx} +4 -2
- package/src/component/index.js +1 -0
- package/src/dateinput/dateinput.jsx +9 -11
- package/src/datepicker/datepicker.jsx +9 -11
- package/src/datetimepicker/datetimepicker.jsx +9 -11
- package/src/dropdownbutton/README.md +60 -0
- package/src/dropdownbutton/dropdownbutton.jsx +145 -0
- package/src/dropdownbutton/index.js +1 -0
- package/src/dropdownlist/dropdownlist.jsx +13 -12
- package/src/fab/README.md +19 -0
- package/src/fab/fab.jsx +154 -0
- package/src/fab/index.js +1 -0
- package/src/icon/icon.jsx +1 -1
- package/src/index.js +47 -4
- package/src/input/input-clear-value.jsx +1 -1
- package/src/input/input-inner-input.jsx +1 -1
- package/src/input/input-inner-span.jsx +1 -1
- package/src/input/input-inner-textarea.jsx +1 -1
- package/src/input/input-prefix.jsx +1 -1
- package/src/input/input-suffix.jsx +1 -1
- package/src/input/input.jsx +4 -4
- package/src/input/picker.jsx +6 -6
- package/src/list/README.md +107 -0
- package/src/list/index.js +5 -0
- package/src/list/list-content.jsx +95 -0
- package/src/list/list-group-item.jsx +66 -0
- package/src/list/list-header.jsx +67 -0
- package/src/list/list-item.jsx +117 -0
- package/src/list/list.jsx +182 -0
- package/src/maskedtextbox/maskedtextbox.jsx +11 -14
- package/src/menu/README.md +40 -0
- package/src/menu/index.js +3 -0
- package/src/menu/menu-item-content.jsx +48 -0
- package/src/menu/menu-item.jsx +174 -0
- package/src/menu/menu-list.jsx +74 -0
- package/src/menulist/menulist.jsx +67 -0
- package/src/multiselect/README.md +37 -0
- package/src/multiselect/index.js +2 -0
- package/src/multiselect/multiselect-chip-list.jsx +55 -0
- package/src/multiselect/multiselect.jsx +189 -0
- package/src/nodata/index.js +1 -0
- package/src/nodata/nodata.jsx +64 -0
- package/src/numerictextbox/numerictextbox.jsx +5 -5
- package/src/popup/README.md +15 -0
- package/src/popup/index.js +1 -0
- package/src/popup/popup.jsx +80 -0
- package/src/radio/radio.jsx +2 -2
- package/src/searchbar/searchbar.jsx +1 -1
- package/src/searchbox/searchbox.jsx +4 -4
- package/src/spinbutton/spinbutton.jsx +9 -3
- package/src/splitbutton/README.md +76 -0
- package/src/splitbutton/index.js +1 -0
- package/src/splitbutton/splitbutton.jsx +152 -0
- package/src/switch/README.md +3 -3
- package/src/switch/switch.jsx +6 -6
- package/src/textarea/textarea.jsx +4 -4
- package/src/textbox/textbox.jsx +4 -4
- package/src/timepicker/timepicker.jsx +9 -11
- package/src/treeview/README.md +0 -0
- package/src/treeview/index.js +4 -0
- package/src/treeview/treeview-group.jsx +70 -0
- package/src/treeview/treeview-item.jsx +142 -0
- package/src/treeview/treeview-leaf.jsx +99 -0
- package/src/treeview/treeview.jsx +125 -0
- package/utils/styles.js +23 -5
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { TreeviewGroupStatic } from './treeview-group.jsx';
|
|
3
|
+
import { TreeviewLeafStatic } from './treeview-leaf.jsx';
|
|
4
|
+
import { IconStatic } from '../icon/index';
|
|
5
|
+
import { CheckboxStatic } from '../checkbox/index';
|
|
6
|
+
|
|
7
|
+
class TreeviewItem extends Component {
|
|
8
|
+
render() {
|
|
9
|
+
return <TreeviewItemStatic {...this.props} />;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function TreeviewItemStatic(props) {
|
|
14
|
+
const {
|
|
15
|
+
className: ownClassName,
|
|
16
|
+
leafClassName,
|
|
17
|
+
|
|
18
|
+
items,
|
|
19
|
+
expanded,
|
|
20
|
+
hasChildren: _hasChildren,
|
|
21
|
+
|
|
22
|
+
text,
|
|
23
|
+
|
|
24
|
+
showIcon,
|
|
25
|
+
iconName,
|
|
26
|
+
showCheckbox,
|
|
27
|
+
checked,
|
|
28
|
+
|
|
29
|
+
hover,
|
|
30
|
+
focus,
|
|
31
|
+
selected,
|
|
32
|
+
disabled,
|
|
33
|
+
|
|
34
|
+
aria,
|
|
35
|
+
legacy,
|
|
36
|
+
|
|
37
|
+
...htmlAttributes
|
|
38
|
+
} = props;
|
|
39
|
+
|
|
40
|
+
const leafProps = {
|
|
41
|
+
className: leafClassName,
|
|
42
|
+
text,
|
|
43
|
+
showIcon,
|
|
44
|
+
iconName,
|
|
45
|
+
hover,
|
|
46
|
+
focus,
|
|
47
|
+
selected
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const hasChildren = _hasChildren || items.length > 0;
|
|
51
|
+
|
|
52
|
+
let treeviewItemClasses = [
|
|
53
|
+
ownClassName,
|
|
54
|
+
'k-treeview-item',
|
|
55
|
+
{
|
|
56
|
+
'k-disabled': disabled === true
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
let ariaAttr = aria
|
|
61
|
+
? {}
|
|
62
|
+
: {};
|
|
63
|
+
|
|
64
|
+
if (legacy) {
|
|
65
|
+
|
|
66
|
+
let legacyTreeviewItemClasses = [
|
|
67
|
+
ownClassName,
|
|
68
|
+
'k-item',
|
|
69
|
+
{
|
|
70
|
+
'k-state-disabled': disabled === true
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<li className={legacyTreeviewItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
76
|
+
<span className="k-mid">
|
|
77
|
+
{hasChildren && <span className="k-treeview-toggle"><IconStatic name={expanded ? 'collapse' : 'expand'} /></span>}
|
|
78
|
+
{showCheckbox && <span className="k-checkbox-wrap"><CheckboxStatic checked={checked} /></span>}
|
|
79
|
+
<TreeviewLeafStatic {...leafProps} />
|
|
80
|
+
</span>
|
|
81
|
+
{expanded && hasChildren && <TreeviewGroupStatic items={items} />}
|
|
82
|
+
</li>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<li className={treeviewItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
88
|
+
<span className="k-treeview-mid">
|
|
89
|
+
{hasChildren && <span className="k-treeview-toggle"><IconStatic name={expanded ? 'collapse' : 'expand'} /></span>}
|
|
90
|
+
{showCheckbox && <span className="k-checkbox-wrap"><CheckboxStatic checked={checked} /></span>}
|
|
91
|
+
<TreeviewLeafStatic {...leafProps} />
|
|
92
|
+
</span>
|
|
93
|
+
{expanded && hasChildren && <TreeviewGroupStatic items={items} />}
|
|
94
|
+
</li>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
TreeviewItemStatic.defaultProps = {
|
|
99
|
+
...globalDefaultProps,
|
|
100
|
+
|
|
101
|
+
leafClassName: '',
|
|
102
|
+
|
|
103
|
+
text: '',
|
|
104
|
+
|
|
105
|
+
items: [],
|
|
106
|
+
expanded: false,
|
|
107
|
+
hasChildren: false,
|
|
108
|
+
|
|
109
|
+
showIcon: false,
|
|
110
|
+
iconName: '',
|
|
111
|
+
showCheckbox: false,
|
|
112
|
+
checked: false,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
TreeviewItemStatic.propTypes = {
|
|
116
|
+
children: typeof [],
|
|
117
|
+
className: typeof '',
|
|
118
|
+
leafClassName: typeof '',
|
|
119
|
+
|
|
120
|
+
text: typeof '',
|
|
121
|
+
|
|
122
|
+
items: [],
|
|
123
|
+
expanded: typeof false,
|
|
124
|
+
hasChildren: typeof false,
|
|
125
|
+
|
|
126
|
+
showIcon: typeof false,
|
|
127
|
+
iconName: typeof '',
|
|
128
|
+
showCheckbox: typeof false,
|
|
129
|
+
checked: typeof false,
|
|
130
|
+
|
|
131
|
+
hover: typeof false,
|
|
132
|
+
focus: typeof false,
|
|
133
|
+
selected: typeof false,
|
|
134
|
+
disabled: typeof false,
|
|
135
|
+
|
|
136
|
+
aria: typeof false,
|
|
137
|
+
legacy: typeof false,
|
|
138
|
+
|
|
139
|
+
htmlAttributes: typeof []
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { TreeviewItem, TreeviewItemStatic };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { IconStatic } from '../icon/index';
|
|
3
|
+
|
|
4
|
+
class TreeviewLeaf extends Component {
|
|
5
|
+
render() {
|
|
6
|
+
return <TreeviewLeafStatic {...this.props} />;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function TreeviewLeafStatic(props) {
|
|
11
|
+
const {
|
|
12
|
+
className: ownClassName,
|
|
13
|
+
|
|
14
|
+
text,
|
|
15
|
+
|
|
16
|
+
showIcon,
|
|
17
|
+
iconName,
|
|
18
|
+
|
|
19
|
+
hover,
|
|
20
|
+
focus,
|
|
21
|
+
selected,
|
|
22
|
+
|
|
23
|
+
aria,
|
|
24
|
+
legacy,
|
|
25
|
+
|
|
26
|
+
...htmlAttributes
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
let treeviewLeafClasses = [
|
|
30
|
+
ownClassName,
|
|
31
|
+
'k-treeview-leaf',
|
|
32
|
+
{
|
|
33
|
+
'k-hover': hover === true,
|
|
34
|
+
'k-focus': focus === true,
|
|
35
|
+
'k-selected': selected === true
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
let ariaAttr = aria
|
|
40
|
+
? {}
|
|
41
|
+
: {};
|
|
42
|
+
|
|
43
|
+
if (legacy) {
|
|
44
|
+
|
|
45
|
+
let legacyTreeviewLeafClasses = [
|
|
46
|
+
ownClassName,
|
|
47
|
+
'k-in',
|
|
48
|
+
{
|
|
49
|
+
'k-state-hover': hover === true,
|
|
50
|
+
'k-state-focus': focus === true,
|
|
51
|
+
'k-state-selected': selected === true
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<span className={legacyTreeviewLeafClasses} {...ariaAttr} {...htmlAttributes}>
|
|
57
|
+
{showIcon && <IconStatic name={iconName} />}
|
|
58
|
+
<span className="k-treeview-leaf-text">{text}</span>
|
|
59
|
+
</span>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<span className={treeviewLeafClasses} {...ariaAttr} {...htmlAttributes}>
|
|
65
|
+
{showIcon && <IconStatic name={iconName} />}
|
|
66
|
+
<span className="k-treeview-leaf-text">{text}</span>
|
|
67
|
+
</span>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
TreeviewLeafStatic.defaultProps = {
|
|
72
|
+
...globalDefaultProps,
|
|
73
|
+
|
|
74
|
+
text: '',
|
|
75
|
+
|
|
76
|
+
showIcon: false,
|
|
77
|
+
iconName: ''
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
TreeviewLeafStatic.propTypes = {
|
|
81
|
+
children: typeof [],
|
|
82
|
+
className: typeof '',
|
|
83
|
+
|
|
84
|
+
text: typeof '',
|
|
85
|
+
|
|
86
|
+
showIcon: typeof false,
|
|
87
|
+
iconName: typeof '',
|
|
88
|
+
|
|
89
|
+
hover: typeof false,
|
|
90
|
+
focus: typeof false,
|
|
91
|
+
selected: typeof false,
|
|
92
|
+
|
|
93
|
+
aria: typeof false,
|
|
94
|
+
legacy: typeof false,
|
|
95
|
+
|
|
96
|
+
htmlAttributes: typeof []
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export { TreeviewLeaf, TreeviewLeafStatic };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
|
+
import { TreeviewGroupStatic } from './treeview-group.jsx';
|
|
4
|
+
import { TreeviewItemStatic } from './treeview-item.jsx';
|
|
5
|
+
|
|
6
|
+
class Treeview extends Component {
|
|
7
|
+
|
|
8
|
+
static transformUL( ul ) {
|
|
9
|
+
let children = ul.props.children;
|
|
10
|
+
let items = [];
|
|
11
|
+
|
|
12
|
+
children.filter( child => child.type === 'LI' ).forEach( li => {
|
|
13
|
+
items.push( Treeview.transformLI( li ) );
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return items;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static transformLI( li ) {
|
|
20
|
+
let children = li.props.children;
|
|
21
|
+
let text = li.props.text || '';
|
|
22
|
+
let items = [];
|
|
23
|
+
|
|
24
|
+
children.forEach( child => {
|
|
25
|
+
if (text === '' && child.type === '#text') {
|
|
26
|
+
text = child.props.text;
|
|
27
|
+
}
|
|
28
|
+
if (child.type === 'UL') {
|
|
29
|
+
items.push( ...Treeview.transformUL( child ) );
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
li.props.children = [];
|
|
34
|
+
li.props.text = text;
|
|
35
|
+
li.props.items = items;
|
|
36
|
+
|
|
37
|
+
return <TreeviewItemStatic {...li.props} />;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
init() {
|
|
41
|
+
let children = this._props.children;
|
|
42
|
+
let items = [];
|
|
43
|
+
|
|
44
|
+
children.filter( child => child.type === 'LI' ).forEach( li => {
|
|
45
|
+
items.push( Treeview.transformLI( li ) );
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
this._props.children = [];
|
|
49
|
+
this._props.items = items;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
render() {
|
|
53
|
+
return <TreeviewStatic {...this.props} />;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function TreeviewStatic(props) {
|
|
58
|
+
const {
|
|
59
|
+
className: ownClassName,
|
|
60
|
+
|
|
61
|
+
items,
|
|
62
|
+
|
|
63
|
+
size,
|
|
64
|
+
|
|
65
|
+
aria,
|
|
66
|
+
legacy,
|
|
67
|
+
|
|
68
|
+
...htmlAttributes
|
|
69
|
+
} = props;
|
|
70
|
+
|
|
71
|
+
let treeviewClasses = [
|
|
72
|
+
ownClassName,
|
|
73
|
+
'k-treeview',
|
|
74
|
+
styles.sizeClass( size, 'k-treeview' )
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
let ariaAttr = aria
|
|
78
|
+
? {}
|
|
79
|
+
: {};
|
|
80
|
+
|
|
81
|
+
if (legacy) {
|
|
82
|
+
|
|
83
|
+
let legacyTreeviewClasses = [
|
|
84
|
+
ownClassName,
|
|
85
|
+
'k-treeview'
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className={legacyTreeviewClasses} {...ariaAttr} {...htmlAttributes}>
|
|
90
|
+
<TreeviewGroupStatic className="k-treeview-lines" items={items} />
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div className={treeviewClasses} {...ariaAttr} {...htmlAttributes}>
|
|
97
|
+
<TreeviewGroupStatic className="k-treeview-lines" items={items} />
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
TreeviewStatic.defaultProps = {
|
|
103
|
+
...globalDefaultProps,
|
|
104
|
+
|
|
105
|
+
children: [],
|
|
106
|
+
items: [],
|
|
107
|
+
|
|
108
|
+
size: 'medium'
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
TreeviewStatic.propTypes = {
|
|
112
|
+
children: typeof [],
|
|
113
|
+
className: typeof '',
|
|
114
|
+
|
|
115
|
+
items: typeof [],
|
|
116
|
+
|
|
117
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
118
|
+
|
|
119
|
+
aria: typeof false,
|
|
120
|
+
legacy: typeof false,
|
|
121
|
+
|
|
122
|
+
htmlAttributes: typeof []
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export { Treeview, TreeviewStatic };
|
package/utils/styles.js
CHANGED
|
@@ -25,7 +25,7 @@ function lookup( map, key ) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function sizeClass( size, prefix ) {
|
|
28
|
-
if ( size ===
|
|
28
|
+
if ( size === null ) {
|
|
29
29
|
return '';
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ function sizeClass( size, prefix ) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function roundedClass( rounded ) {
|
|
36
|
-
if ( rounded ===
|
|
36
|
+
if ( rounded === null ) {
|
|
37
37
|
return '';
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ function roundedClass( rounded ) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function shapeClass( shape, prefix ) {
|
|
44
|
-
if ( shape ===
|
|
44
|
+
if ( shape === null ) {
|
|
45
45
|
return '';
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ function shapeClass( shape, prefix ) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function fillModeClass( fill, prefix ) {
|
|
52
|
-
if ( fill ===
|
|
52
|
+
if ( fill === null) {
|
|
53
53
|
return '';
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,13 +57,29 @@ function fillModeClass( fill, prefix ) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function themeColorClass( fill, color, prefix ) {
|
|
60
|
-
if ( fill ===
|
|
60
|
+
if ( fill === null || color === null) {
|
|
61
61
|
return '';
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return `${prefix}-${fill}-${color}`;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
function borderedClass( bordered, prefix ) {
|
|
68
|
+
if ( !bordered ) {
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return `${prefix}-bordered`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function positionClass( position, prefix ) {
|
|
76
|
+
if ( position === null ) {
|
|
77
|
+
return '';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return `k-pos-absolute ${prefix}-${position}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
67
83
|
function classNames( ...args ) {
|
|
68
84
|
|
|
69
85
|
/* eslint-disable arrow-body-style, no-nested-ternary */
|
|
@@ -122,6 +138,8 @@ export {
|
|
|
122
138
|
shapeClass,
|
|
123
139
|
fillModeClass,
|
|
124
140
|
themeColorClass,
|
|
141
|
+
borderedClass,
|
|
142
|
+
positionClass,
|
|
125
143
|
|
|
126
144
|
classNames,
|
|
127
145
|
cssStyle,
|