@progress/kendo-themes-html 4.43.1-dev.4 → 4.43.1-dev.8
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 +18 -1
- package/package.json +7 -7
- package/src/autocomplete/autocomplete.jsx +1 -1
- package/src/avatar/README.md +1 -1
- package/src/avatar/avatar.jsx +1 -4
- package/src/button/button.jsx +38 -20
- package/src/checkbox/checkbox.jsx +2 -2
- package/src/chip/chip-avatar.jsx +1 -1
- package/src/fab/fab.jsx +1 -5
- package/src/index.js +4 -1
- package/src/input/input-inner-span.jsx +1 -1
- 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/menubutton/README.md +60 -0
- package/src/menubutton/index.js +1 -0
- package/src/menubutton/menubutton.jsx +161 -0
- package/src/numerictextbox/numerictextbox.jsx +4 -6
- package/src/radio/radio.jsx +6 -2
- package/src/splitbutton/README.md +76 -0
- package/src/splitbutton/index.js +1 -0
- package/src/splitbutton/splitbutton.jsx +176 -0
- package/src/switch/README.md +3 -3
- 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/lib/jsx-runtime.js
CHANGED
|
@@ -40,7 +40,16 @@ const attrMap = {
|
|
|
40
40
|
thumbrounded: 'thumbRounded',
|
|
41
41
|
|
|
42
42
|
// Chip
|
|
43
|
-
showavatar: 'showAvatar'
|
|
43
|
+
showavatar: 'showAvatar',
|
|
44
|
+
|
|
45
|
+
// Hierarchy
|
|
46
|
+
haschildren: 'hasChildren',
|
|
47
|
+
|
|
48
|
+
// Treeview
|
|
49
|
+
leafclassname: 'leafClassName',
|
|
50
|
+
|
|
51
|
+
// Template
|
|
52
|
+
contenttemplate: 'contentTemplate'
|
|
44
53
|
};
|
|
45
54
|
|
|
46
55
|
const booleanAttr = new Set([
|
|
@@ -67,12 +76,19 @@ const booleanAttr = new Set([
|
|
|
67
76
|
'showIcon',
|
|
68
77
|
'showClearButton',
|
|
69
78
|
'showSpinButton',
|
|
79
|
+
'showArrow',
|
|
70
80
|
|
|
71
81
|
'showCheckbox',
|
|
72
82
|
|
|
73
83
|
'virtualization',
|
|
74
84
|
'root',
|
|
75
85
|
|
|
86
|
+
'open',
|
|
87
|
+
'expanded',
|
|
88
|
+
'hasChildren',
|
|
89
|
+
|
|
90
|
+
'showArrow',
|
|
91
|
+
|
|
76
92
|
'showAvatar',
|
|
77
93
|
|
|
78
94
|
'aria'
|
|
@@ -80,6 +96,7 @@ const booleanAttr = new Set([
|
|
|
80
96
|
|
|
81
97
|
const nullAttr = new Set([
|
|
82
98
|
'size',
|
|
99
|
+
'shape',
|
|
83
100
|
'rounded',
|
|
84
101
|
'fillMode',
|
|
85
102
|
'themeColor',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-themes-html",
|
|
3
3
|
"description": "A collection of HTML helpers used for developing Kendo UI themes",
|
|
4
|
-
"version": "4.43.1-dev.
|
|
4
|
+
"version": "4.43.1-dev.8",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"dev": "rollup -cw"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.16.
|
|
38
|
-
"@babel/preset-env": "^7.16.
|
|
39
|
-
"@babel/preset-react": "^7.16.
|
|
37
|
+
"@babel/core": "^7.16.7",
|
|
38
|
+
"@babel/preset-env": "^7.16.7",
|
|
39
|
+
"@babel/preset-react": "^7.16.7",
|
|
40
40
|
"@rollup/plugin-babel": "^5.3.0",
|
|
41
41
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
42
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
43
|
-
"rollup": "^2.
|
|
42
|
+
"@rollup/plugin-node-resolve": "^13.1.2",
|
|
43
|
+
"rollup": "^2.62.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "cf8448a76498b1f53859522cfa29e66618cdba4c"
|
|
46
46
|
}
|
|
@@ -75,7 +75,7 @@ function AutocompleteStatic(props) {
|
|
|
75
75
|
'k-autocomplete',
|
|
76
76
|
{
|
|
77
77
|
'k-state-hover': hover === true,
|
|
78
|
-
'k-state-
|
|
78
|
+
'k-state-focus': focus === true,
|
|
79
79
|
'k-state-invalid': invalid === true,
|
|
80
80
|
'k-state-required': required === true,
|
|
81
81
|
'k-state-disabled': disabled === true
|
package/src/avatar/README.md
CHANGED
package/src/avatar/avatar.jsx
CHANGED
|
@@ -48,10 +48,7 @@ function AvatarStatic(props) {
|
|
|
48
48
|
ownClassName,
|
|
49
49
|
'k-avatar',
|
|
50
50
|
`k-avatar-${themeColor}`,
|
|
51
|
-
|
|
52
|
-
'k-avatar-circle': rounded === 'full',
|
|
53
|
-
'k-avatar-rounded': rounded !== 'full' && rounded !== null
|
|
54
|
-
},
|
|
51
|
+
styles.roundedClass( rounded ),
|
|
55
52
|
styles.sizeClass( size, 'k-avatar' ),
|
|
56
53
|
styles.fillModeClass( fillMode, 'k-avatar' ),
|
|
57
54
|
styles.borderedClass( bordered, 'k-avatar' ),
|
package/src/button/button.jsx
CHANGED
|
@@ -6,6 +6,7 @@ class Button extends Component {
|
|
|
6
6
|
|
|
7
7
|
init() {
|
|
8
8
|
this._props.text = this.element.innerHTML;
|
|
9
|
+
this._props.children = [];
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
render() {
|
|
@@ -16,6 +17,7 @@ class Button extends Component {
|
|
|
16
17
|
function ButtonStatic(props) {
|
|
17
18
|
const {
|
|
18
19
|
className: ownClassName,
|
|
20
|
+
children,
|
|
19
21
|
|
|
20
22
|
text,
|
|
21
23
|
type,
|
|
@@ -61,22 +63,6 @@ function ButtonStatic(props) {
|
|
|
61
63
|
}
|
|
62
64
|
];
|
|
63
65
|
|
|
64
|
-
let legacyClasses = [
|
|
65
|
-
ownClassName,
|
|
66
|
-
'k-button',
|
|
67
|
-
{
|
|
68
|
-
'k-primary': themeColor === 'primary',
|
|
69
|
-
'k-flat': fillMode === 'flat',
|
|
70
|
-
'k-outline': fillMode === 'outline',
|
|
71
|
-
'k-state-hover': hover === true,
|
|
72
|
-
'k-state-focus': focus === true,
|
|
73
|
-
'k-state-active': active === true,
|
|
74
|
-
'k-state-selected': selected === true,
|
|
75
|
-
'k-state-disabled': disabled === true,
|
|
76
|
-
'k-icon-button': Boolean( icon) === true && Boolean(text) === false
|
|
77
|
-
}
|
|
78
|
-
];
|
|
79
|
-
|
|
80
66
|
// Augment attributes
|
|
81
67
|
htmlAttributes.disabled = disabled;
|
|
82
68
|
|
|
@@ -85,18 +71,47 @@ function ButtonStatic(props) {
|
|
|
85
71
|
: {};
|
|
86
72
|
|
|
87
73
|
if (legacy) {
|
|
74
|
+
|
|
75
|
+
let legacyClasses = [
|
|
76
|
+
ownClassName,
|
|
77
|
+
'k-button',
|
|
78
|
+
styles.fillModeClass( fillMode, 'k-button' ),
|
|
79
|
+
styles.themeColorClass( fillMode, themeColor, 'k-button' ),
|
|
80
|
+
{
|
|
81
|
+
'k-primary': themeColor === 'primary',
|
|
82
|
+
'k-flat': fillMode === 'flat',
|
|
83
|
+
'k-outline': fillMode === 'outline',
|
|
84
|
+
'k-state-hover': hover === true,
|
|
85
|
+
'k-state-focus': focus === true,
|
|
86
|
+
'k-state-active': active === true,
|
|
87
|
+
'k-state-selected': selected === true,
|
|
88
|
+
'k-state-disabled': disabled === true,
|
|
89
|
+
'k-icon-button': Boolean( icon) === true && Boolean(text) === false
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
|
|
88
93
|
return (
|
|
89
94
|
<button type={type} className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
{ children.length === 0
|
|
96
|
+
? <>
|
|
97
|
+
<IconStatic className="k-button-icon" name={icon} />
|
|
98
|
+
{text && <span className="k-button-text">{text}</span>}
|
|
99
|
+
</>
|
|
100
|
+
: children
|
|
101
|
+
}
|
|
92
102
|
</button>
|
|
93
103
|
);
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
return (
|
|
97
107
|
<button type={type} className={buttonClasses} {...ariaAttr} {...htmlAttributes}>
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
{ children.length === 0
|
|
109
|
+
? <>
|
|
110
|
+
<IconStatic className="k-button-icon" name={icon} />
|
|
111
|
+
{text && <span className="k-button-text">{text}</span>}
|
|
112
|
+
</>
|
|
113
|
+
: children
|
|
114
|
+
}
|
|
100
115
|
</button>
|
|
101
116
|
);
|
|
102
117
|
}
|
|
@@ -104,6 +119,8 @@ function ButtonStatic(props) {
|
|
|
104
119
|
ButtonStatic.defaultProps = {
|
|
105
120
|
...globalDefaultProps,
|
|
106
121
|
|
|
122
|
+
children: [],
|
|
123
|
+
|
|
107
124
|
text: '',
|
|
108
125
|
icon: '',
|
|
109
126
|
|
|
@@ -119,6 +136,7 @@ ButtonStatic.defaultProps = {
|
|
|
119
136
|
};
|
|
120
137
|
|
|
121
138
|
ButtonStatic.propTypes = {
|
|
139
|
+
children: typeof [],
|
|
122
140
|
text: typeof '',
|
|
123
141
|
icon: typeof '',
|
|
124
142
|
|
|
@@ -74,12 +74,12 @@ function CheckboxStatic(props) {
|
|
|
74
74
|
];
|
|
75
75
|
|
|
76
76
|
return (
|
|
77
|
-
<input type="checkbox" className={legacyClasses} {...ariaAttr} {...htmlAttributes}
|
|
77
|
+
<span className="k-checkbox-wrap"><input type="checkbox" className={legacyClasses} {...ariaAttr} {...htmlAttributes} /></span>
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
|
-
<input type="checkbox" className={checkboxClasses} {...ariaAttr} {...htmlAttributes}
|
|
82
|
+
<span className="k-checkbox-wrap"><input type="checkbox" className={checkboxClasses} {...ariaAttr} {...htmlAttributes} /></span>
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
|
package/src/chip/chip-avatar.jsx
CHANGED
package/src/fab/fab.jsx
CHANGED
|
@@ -73,11 +73,7 @@ function FabStatic(props) {
|
|
|
73
73
|
ownClassName,
|
|
74
74
|
'k-fab',
|
|
75
75
|
`k-fab-${themeColor}`,
|
|
76
|
-
|
|
77
|
-
'k-fab-rectangle': rounded === null,
|
|
78
|
-
'k-fab-rounded': rounded !== 'full' && rounded !== null,
|
|
79
|
-
'k-fab-pill': rounded === 'full'
|
|
80
|
-
},
|
|
76
|
+
styles.roundedClass( rounded ),
|
|
81
77
|
{
|
|
82
78
|
'k-state-hover': hover === true,
|
|
83
79
|
'k-state-focus': focus === true,
|
package/src/index.js
CHANGED
|
@@ -38,6 +38,8 @@ export * from './chip/index';
|
|
|
38
38
|
|
|
39
39
|
// Native forms
|
|
40
40
|
export * from './button/index';
|
|
41
|
+
export * from './menubutton/index';
|
|
42
|
+
export * from './splitbutton/index';
|
|
41
43
|
export * from './textbox/index';
|
|
42
44
|
export * from './textarea/index';
|
|
43
45
|
export * from './checkbox/index';
|
|
@@ -70,7 +72,7 @@ export * from './switch/index';
|
|
|
70
72
|
// Command interfaces
|
|
71
73
|
// export * from './action-buttons/index';
|
|
72
74
|
export * from './fab/index';
|
|
73
|
-
|
|
75
|
+
export * from './menu/index';
|
|
74
76
|
// export * from './toolbar/index';
|
|
75
77
|
|
|
76
78
|
// Popups and modals
|
|
@@ -89,6 +91,7 @@ export * from './fab/index';
|
|
|
89
91
|
// export * from './pager/index';
|
|
90
92
|
// export * from './stepper/index';
|
|
91
93
|
// export * from './tabstrip/index';
|
|
94
|
+
export * from './treeview/index';
|
|
92
95
|
// export * from './wizard/index';
|
|
93
96
|
|
|
94
97
|
// Layout & containers
|
|
@@ -56,7 +56,7 @@ function InputInnerSpanStatic(props) {
|
|
|
56
56
|
{valueIcon}
|
|
57
57
|
{valueIcon === null && <IconStatic className="k-icon k-input-value-icon" name={valueIconName} />}
|
|
58
58
|
{showValue && value === '' && placeholder}
|
|
59
|
-
{showValue && value && <span className="k-value-text">{value}</span>}
|
|
59
|
+
{showValue && value && <span className="k-input-value-text">{value}</span>}
|
|
60
60
|
</span>
|
|
61
61
|
);
|
|
62
62
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<ul class="k-group k-menu-group k-reset"></ul>
|
|
4
|
+
|
|
5
|
+
<!-- canonical rendering -->
|
|
6
|
+
<ul class="
|
|
7
|
+
k-group k-menu-group k-reset
|
|
8
|
+
k-menulist-{size}
|
|
9
|
+
"
|
|
10
|
+
></ul>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!-- default rendering -->
|
|
15
|
+
<li class="k-item k-menu-item">
|
|
16
|
+
<span class="k-link k-menu-link">
|
|
17
|
+
{icon !== '' && <span class="k-icon k-i-{icon}"></span>}
|
|
18
|
+
{text !== '' && <span class="k-menu-link-text">Text</span>}
|
|
19
|
+
<span className="k-menu-expand-arrow k-icon k-i-{arrowIconName || 'none'}"></span>
|
|
20
|
+
</span>
|
|
21
|
+
</li>
|
|
22
|
+
|
|
23
|
+
<!-- canonical rendering -->
|
|
24
|
+
<li class="
|
|
25
|
+
k-item
|
|
26
|
+
k-menu-item
|
|
27
|
+
{hover && 'k-hover'}
|
|
28
|
+
{focus && 'k-focus'}
|
|
29
|
+
{active && 'k-active'}
|
|
30
|
+
{disabled && 'k-disabled'}
|
|
31
|
+
" disabled={disabled}>
|
|
32
|
+
<span class="k-link k-menu-link">
|
|
33
|
+
{icon !== '' && <span class="k-icon k-i-{icon}"></span>}
|
|
34
|
+
{text !== '' && <span class="k-menu-link-text">Text</span>}
|
|
35
|
+
{showArrow && <span className="k-menu-expand-arrow">
|
|
36
|
+
<span className="k-icon k-i-{arrowIconName || 'none'}"></span>
|
|
37
|
+
</span>}
|
|
38
|
+
</span>
|
|
39
|
+
</li>
|
|
40
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
|
|
3
|
+
class MenuItemContent extends Component {
|
|
4
|
+
render() {
|
|
5
|
+
return <MenuItemContentStatic {...this.props} />;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function MenuItemContentStatic(props) {
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
className: ownClassName,
|
|
13
|
+
|
|
14
|
+
children,
|
|
15
|
+
|
|
16
|
+
...htmlAttributes
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
let menuItemContentClasses = [
|
|
20
|
+
ownClassName,
|
|
21
|
+
'k-menu-item-content'
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
if (children.length === 0) {
|
|
25
|
+
return <></>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<span className={menuItemContentClasses} {...htmlAttributes}>
|
|
30
|
+
{children}
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
MenuItemContentStatic.defaultProps = {
|
|
36
|
+
...globalDefaultProps,
|
|
37
|
+
|
|
38
|
+
children: []
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
MenuItemContentStatic.propTypes = {
|
|
42
|
+
children: typeof [],
|
|
43
|
+
className: typeof '',
|
|
44
|
+
|
|
45
|
+
htmlAttributes: typeof []
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { MenuItemContent, MenuItemContentStatic };
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { IconStatic } from '../icon/index';
|
|
3
|
+
|
|
4
|
+
class MenuItem extends Component {
|
|
5
|
+
init() {
|
|
6
|
+
let subItem = <></>;
|
|
7
|
+
let contentTemplate = <></>;
|
|
8
|
+
let children = this._props.children;
|
|
9
|
+
let newChildren = [];
|
|
10
|
+
|
|
11
|
+
children.forEach( child => {
|
|
12
|
+
let component = child._component;
|
|
13
|
+
|
|
14
|
+
if (component === 'MenuItem') {
|
|
15
|
+
subItem.props.children.push( child );
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (component === 'MenuItemContent') {
|
|
20
|
+
contentTemplate.props.children.push( child );
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
newChildren.push( child );
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
this._props.subItem = subItem;
|
|
28
|
+
this._props.contentTemplate = contentTemplate;
|
|
29
|
+
this._props.children = newChildren;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return <MenuItemStatic {...this.props} />;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function MenuItemStatic(props) {
|
|
37
|
+
const {
|
|
38
|
+
className: ownClassName,
|
|
39
|
+
|
|
40
|
+
text,
|
|
41
|
+
|
|
42
|
+
icon,
|
|
43
|
+
|
|
44
|
+
showArrow,
|
|
45
|
+
arrowIconName,
|
|
46
|
+
|
|
47
|
+
contentTemplate,
|
|
48
|
+
|
|
49
|
+
hover,
|
|
50
|
+
focus,
|
|
51
|
+
active,
|
|
52
|
+
selected,
|
|
53
|
+
disabled,
|
|
54
|
+
|
|
55
|
+
dir,
|
|
56
|
+
|
|
57
|
+
aria,
|
|
58
|
+
legacy,
|
|
59
|
+
|
|
60
|
+
...htmlAttributes
|
|
61
|
+
} = props;
|
|
62
|
+
|
|
63
|
+
let menuItemClasses = [
|
|
64
|
+
ownClassName,
|
|
65
|
+
'k-item k-menu-item',
|
|
66
|
+
{
|
|
67
|
+
'k-disabled': disabled === true
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
let menuItemLinkClasses = [
|
|
72
|
+
'k-link k-menu-link',
|
|
73
|
+
{
|
|
74
|
+
'k-hover': hover === true,
|
|
75
|
+
'k-focus': focus === true,
|
|
76
|
+
'k-active': active === true,
|
|
77
|
+
'k-selected': selected === true,
|
|
78
|
+
'k-disabled': disabled === true
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
let expandArrowName = arrowIconName;
|
|
83
|
+
|
|
84
|
+
if ( expandArrowName === '' ) {
|
|
85
|
+
expandArrowName = dir === 'rtl'
|
|
86
|
+
? 'arrow-w'
|
|
87
|
+
: 'arrow-e';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Augment attributes
|
|
91
|
+
htmlAttributes.disabled = disabled;
|
|
92
|
+
|
|
93
|
+
let ariaAttr = aria
|
|
94
|
+
? {}
|
|
95
|
+
: {};
|
|
96
|
+
|
|
97
|
+
if (legacy) {
|
|
98
|
+
|
|
99
|
+
let legacyMenuItemClasses = [
|
|
100
|
+
ownClassName,
|
|
101
|
+
'k-item k-menu-item',
|
|
102
|
+
{
|
|
103
|
+
'k-state-hover': hover === true,
|
|
104
|
+
'k-state-focus': focus === true,
|
|
105
|
+
'k-state-selected': selected === true,
|
|
106
|
+
'k-state-disabled': disabled === true,
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<li className={legacyMenuItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
112
|
+
<span className={`k-link k-menu-link ${active === true ? 'k-state-active' : ''}`}>
|
|
113
|
+
{icon && <IconStatic className="k-menu-link-icon" name={icon} />}
|
|
114
|
+
<span className="k-menu-link-text">{text}</span>
|
|
115
|
+
{showArrow && <span className="k-menu-expand-arrow"><IconStatic name={expandArrowName} /></span>}
|
|
116
|
+
</span>
|
|
117
|
+
{contentTemplate}
|
|
118
|
+
</li>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<li className={menuItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
124
|
+
<span className={menuItemLinkClasses}>
|
|
125
|
+
{icon && <IconStatic className="k-menu-link-icon" name={icon} />}
|
|
126
|
+
<span className="k-menu-link-text">{text}</span>
|
|
127
|
+
{showArrow && <span className="k-menu-expand-arrow"><IconStatic name={expandArrowName} /></span>}
|
|
128
|
+
</span>
|
|
129
|
+
{contentTemplate}
|
|
130
|
+
</li>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
MenuItemStatic.defaultProps = {
|
|
135
|
+
...globalDefaultProps,
|
|
136
|
+
|
|
137
|
+
text: '',
|
|
138
|
+
icon: '',
|
|
139
|
+
|
|
140
|
+
className: '',
|
|
141
|
+
arrowIconName: '',
|
|
142
|
+
|
|
143
|
+
size: 'medium',
|
|
144
|
+
|
|
145
|
+
dir: 'ltr'
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
MenuItemStatic.propTypes = {
|
|
149
|
+
text: typeof '',
|
|
150
|
+
icon: typeof '',
|
|
151
|
+
|
|
152
|
+
showArrow: typeof false,
|
|
153
|
+
arrowIconName: typeof '',
|
|
154
|
+
|
|
155
|
+
contentTemplate: typeof '#fragment',
|
|
156
|
+
|
|
157
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
158
|
+
|
|
159
|
+
hover: typeof false,
|
|
160
|
+
focus: typeof false,
|
|
161
|
+
active: typeof false,
|
|
162
|
+
selected: typeof false,
|
|
163
|
+
disabled: typeof false,
|
|
164
|
+
|
|
165
|
+
aria: typeof false,
|
|
166
|
+
legacy: typeof false,
|
|
167
|
+
|
|
168
|
+
dir: typeof '',
|
|
169
|
+
|
|
170
|
+
className: typeof '',
|
|
171
|
+
htmlAttributes: typeof []
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export { MenuItem, MenuItemStatic };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
|
+
|
|
4
|
+
class MenuList extends Component {
|
|
5
|
+
render() {
|
|
6
|
+
return <MenuListStatic {...this.props} />;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function MenuListStatic(props) {
|
|
11
|
+
const {
|
|
12
|
+
className: ownClassName,
|
|
13
|
+
children,
|
|
14
|
+
|
|
15
|
+
size,
|
|
16
|
+
|
|
17
|
+
aria,
|
|
18
|
+
legacy,
|
|
19
|
+
|
|
20
|
+
...htmlAttributes
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
let menuListClasses = [
|
|
24
|
+
ownClassName,
|
|
25
|
+
'k-menu-group',
|
|
26
|
+
styles.sizeClass( size, 'k-menu-group' ),
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
let ariaAttr = aria
|
|
30
|
+
? {}
|
|
31
|
+
: {};
|
|
32
|
+
|
|
33
|
+
if (legacy) {
|
|
34
|
+
|
|
35
|
+
let legacyMenuListClasses = [
|
|
36
|
+
ownClassName,
|
|
37
|
+
'k-group k-menu-group k-reset',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ul className={legacyMenuListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
42
|
+
{children}
|
|
43
|
+
</ul>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ul className={menuListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
49
|
+
{children}
|
|
50
|
+
</ul>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
MenuListStatic.defaultProps = {
|
|
55
|
+
...globalDefaultProps,
|
|
56
|
+
|
|
57
|
+
className: '',
|
|
58
|
+
|
|
59
|
+
size: 'medium'
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
MenuListStatic.propTypes = {
|
|
63
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
64
|
+
|
|
65
|
+
children: typeof [],
|
|
66
|
+
|
|
67
|
+
aria: typeof false,
|
|
68
|
+
legacy: typeof false,
|
|
69
|
+
|
|
70
|
+
className: typeof '',
|
|
71
|
+
htmlAttributes: typeof []
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { MenuList, MenuListStatic };
|