@progress/kendo-themes-html 5.0.0-beta.0 → 5.0.0-beta.4
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 +21 -10
- package/package.json +7 -7
- package/src/autocomplete/autocomplete.jsx +3 -3
- package/src/avatar/README.md +1 -1
- package/src/avatar/avatar.jsx +15 -21
- package/src/button/button.jsx +40 -22
- package/src/checkbox/checkbox.jsx +3 -3
- package/src/chip/README.md +5 -5
- package/src/chip/chip-actions.jsx +80 -0
- package/src/chip/chip-avatar.jsx +2 -10
- package/src/chip/chip-list.jsx +9 -6
- package/src/chip/chip.jsx +56 -39
- package/src/chip/index.js +2 -3
- package/src/colorpicker/README.md +24 -15
- package/src/colorpicker/color-preview.jsx +28 -21
- package/src/colorpicker/colorpicker.jsx +6 -8
- package/src/combobox/combobox.jsx +6 -8
- package/src/{component.js → component/component.jsx} +4 -2
- package/src/component/index.js +1 -0
- package/src/dateinput/dateinput.jsx +6 -8
- package/src/datepicker/datepicker.jsx +6 -8
- package/src/datetimepicker/datetimepicker.jsx +6 -8
- package/src/dropdownlist/dropdownlist.jsx +6 -8
- 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 +43 -6
- package/src/input/input-inner-input.jsx +1 -1
- package/src/input/input-inner-span.jsx +2 -2
- 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 +2 -2
- package/src/input/picker.jsx +4 -4
- package/src/list/README.md +75 -26
- package/src/list/index.js +1 -3
- package/src/list/list-content.jsx +37 -61
- package/src/list/list-group-item.jsx +66 -0
- package/src/list/list-header.jsx +13 -7
- package/src/list/list-item.jsx +37 -16
- package/src/list/list.jsx +109 -6
- package/src/maskedtextbox/maskedtextbox.jsx +9 -12
- package/src/menu/README.md +40 -0
- package/src/{menuitem → menu}/index.js +1 -0
- package/src/{menuitem → menu}/menu-item-content.jsx +1 -1
- package/src/{menuitem → menu}/menu-item.jsx +28 -23
- package/src/{menulist/menulist.jsx → menu/menu-list.jsx} +12 -11
- package/src/{dropdownbutton → menubutton}/README.md +20 -20
- package/src/menubutton/index.js +1 -0
- package/src/menubutton/menubutton.jsx +161 -0
- package/src/multiselect/README.md +37 -0
- package/src/multiselect/multiselect-chip-list.jsx +1 -1
- package/src/multiselect/multiselect.jsx +10 -4
- package/src/nodata/index.js +1 -0
- package/src/nodata/nodata.jsx +64 -0
- package/src/numerictextbox/numerictextbox.jsx +6 -8
- 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 +7 -3
- package/src/searchbar/searchbar.jsx +1 -1
- package/src/searchbox/searchbox.jsx +2 -2
- package/src/spinbutton/spinbutton.jsx +1 -1
- package/src/splitbutton/README.md +2 -2
- package/src/splitbutton/splitbutton.jsx +58 -34
- package/src/switch/README.md +3 -3
- package/src/switch/switch.jsx +5 -5
- package/src/textarea/textarea.jsx +2 -2
- package/src/textbox/textbox.jsx +2 -2
- package/src/timepicker/timepicker.jsx +6 -8
- 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 +9 -0
- package/src/chip/chip-remove-icon.jsx +0 -45
- package/src/chip/chip-selected-icon.jsx +0 -47
- package/src/dropdownbutton/dropdownbutton.jsx +0 -149
- package/src/dropdownbutton/index.js +0 -1
- package/src/list/list-footer.jsx +0 -61
- package/src/list/list-group-header.jsx +0 -92
- package/src/list/list-item-text.jsx +0 -62
- package/src/menuitem/README.md +0 -26
- package/src/menulist/README.md +0 -11
- package/src/menulist/index.js +0 -1
package/lib/jsx-runtime.js
CHANGED
|
@@ -31,19 +31,25 @@ const attrMap = {
|
|
|
31
31
|
showclearbutton: 'showClearButton',
|
|
32
32
|
clearbutton: 'clearButton',
|
|
33
33
|
|
|
34
|
+
showcheckbox: 'showCheckbox',
|
|
35
|
+
|
|
34
36
|
// Switch
|
|
35
37
|
onlabel: 'onLabel',
|
|
36
38
|
offlabel: 'offLabel',
|
|
37
39
|
trackrounded: 'trackRounded',
|
|
38
40
|
thumbrounded: 'thumbRounded',
|
|
39
41
|
|
|
40
|
-
// Menu list
|
|
41
|
-
contenttemplate: 'contentTemplate',
|
|
42
|
-
|
|
43
42
|
// Chip
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
showavatar: 'showAvatar',
|
|
44
|
+
|
|
45
|
+
// Hierarchy
|
|
46
|
+
haschildren: 'hasChildren',
|
|
47
|
+
|
|
48
|
+
// Treeview
|
|
49
|
+
leafclassname: 'leafClassName',
|
|
50
|
+
|
|
51
|
+
// Template
|
|
52
|
+
contenttemplate: 'contentTemplate'
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
const booleanAttr = new Set([
|
|
@@ -72,12 +78,17 @@ const booleanAttr = new Set([
|
|
|
72
78
|
'showSpinButton',
|
|
73
79
|
'showArrow',
|
|
74
80
|
|
|
81
|
+
'showCheckbox',
|
|
82
|
+
|
|
75
83
|
'virtualization',
|
|
76
|
-
'
|
|
77
|
-
|
|
84
|
+
'root',
|
|
85
|
+
|
|
86
|
+
'open',
|
|
87
|
+
'expanded',
|
|
88
|
+
'hasChildren',
|
|
89
|
+
|
|
90
|
+
'showArrow',
|
|
78
91
|
|
|
79
|
-
'showRemoveIcon',
|
|
80
|
-
'showSelectedIcon',
|
|
81
92
|
'showAvatar',
|
|
82
93
|
|
|
83
94
|
'aria'
|
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": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.4",
|
|
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": "1e906bdc564c2df671a6c1552c81dd56bc08d1c4"
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { globalDefaultProps } from '../component';
|
|
1
|
+
import { globalDefaultProps } from '../component/index';
|
|
2
2
|
import { Input, InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
3
|
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
4
|
|
|
@@ -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
|
|
@@ -139,7 +139,7 @@ AutocompleteStatic.propTypes = {
|
|
|
139
139
|
suffix: typeof '#fragment',
|
|
140
140
|
|
|
141
141
|
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
142
|
-
rounded: typeof [ null, 'small', 'medium', 'large', '
|
|
142
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
143
143
|
|
|
144
144
|
fillMode: typeof [ null, 'solid', 'flat', 'outline' ],
|
|
145
145
|
|
package/src/avatar/README.md
CHANGED
package/src/avatar/avatar.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as styles from '../../utils/styles';
|
|
2
|
-
import { Component, globalDefaultProps } from '../component';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
3
|
|
|
4
4
|
class Avatar extends Component {
|
|
5
5
|
render() {
|
|
@@ -16,7 +16,6 @@ function AvatarStatic(props) {
|
|
|
16
16
|
type,
|
|
17
17
|
|
|
18
18
|
size,
|
|
19
|
-
shape,
|
|
20
19
|
rounded,
|
|
21
20
|
bordered,
|
|
22
21
|
|
|
@@ -35,29 +34,26 @@ function AvatarStatic(props) {
|
|
|
35
34
|
styles.sizeClass( size, 'k-avatar' ),
|
|
36
35
|
styles.roundedClass( rounded ),
|
|
37
36
|
styles.fillModeClass( fillMode, 'k-avatar' ),
|
|
38
|
-
styles.shapeClass( shape, 'k-avatar' ),
|
|
39
37
|
styles.themeColorClass( fillMode, themeColor, 'k-avatar' ),
|
|
40
38
|
styles.borderedClass( bordered, 'k-avatar' ),
|
|
41
39
|
];
|
|
42
40
|
|
|
43
|
-
let legacyClasses = [
|
|
44
|
-
ownClassName,
|
|
45
|
-
'k-avatar',
|
|
46
|
-
`k-avatar-${themeColor}`,
|
|
47
|
-
{
|
|
48
|
-
'k-avatar-circle': rounded === 'circle',
|
|
49
|
-
'k-avatar-rounded': rounded !== 'circle' && rounded !== null
|
|
50
|
-
},
|
|
51
|
-
styles.sizeClass( size, 'k-avatar' ),
|
|
52
|
-
styles.fillModeClass( fillMode, 'k-avatar' ),
|
|
53
|
-
styles.borderedClass( bordered, 'k-avatar' ),
|
|
54
|
-
];
|
|
55
|
-
|
|
56
41
|
let ariaAttr = aria
|
|
57
42
|
? {}
|
|
58
43
|
: {};
|
|
59
44
|
|
|
60
45
|
if (legacy) {
|
|
46
|
+
|
|
47
|
+
let legacyClasses = [
|
|
48
|
+
ownClassName,
|
|
49
|
+
'k-avatar',
|
|
50
|
+
`k-avatar-${themeColor}`,
|
|
51
|
+
styles.roundedClass( rounded ),
|
|
52
|
+
styles.sizeClass( size, 'k-avatar' ),
|
|
53
|
+
styles.fillModeClass( fillMode, 'k-avatar' ),
|
|
54
|
+
styles.borderedClass( bordered, 'k-avatar' ),
|
|
55
|
+
];
|
|
56
|
+
|
|
61
57
|
return (
|
|
62
58
|
<span className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
|
|
63
59
|
<span className={`k-avatar-${type}`}>
|
|
@@ -85,8 +81,7 @@ AvatarStatic.defaultProps = {
|
|
|
85
81
|
type: '',
|
|
86
82
|
|
|
87
83
|
size: 'medium',
|
|
88
|
-
|
|
89
|
-
rounded: 'circle',
|
|
84
|
+
rounded: 'full',
|
|
90
85
|
bordered: false,
|
|
91
86
|
|
|
92
87
|
fillMode: 'solid',
|
|
@@ -99,9 +94,8 @@ AvatarStatic.propTypes = {
|
|
|
99
94
|
|
|
100
95
|
type: typeof '',
|
|
101
96
|
|
|
102
|
-
size: typeof [ null, 'small', 'medium', 'large'
|
|
103
|
-
|
|
104
|
-
rounded: typeof [ null, '0', 'small', 'medium', 'large' ],
|
|
97
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
98
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
105
99
|
bordered: typeof false,
|
|
106
100
|
|
|
107
101
|
fillMode: typeof [ null, 'solid', 'outline' ],
|
package/src/button/button.jsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as styles from '../../utils/styles';
|
|
2
|
-
import { Component, globalDefaultProps } from '../component';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
3
|
import { IconStatic } from '../icon/index';
|
|
4
4
|
|
|
5
5
|
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,13 +136,14 @@ ButtonStatic.defaultProps = {
|
|
|
119
136
|
};
|
|
120
137
|
|
|
121
138
|
ButtonStatic.propTypes = {
|
|
139
|
+
children: typeof [],
|
|
122
140
|
text: typeof '',
|
|
123
141
|
icon: typeof '',
|
|
124
142
|
|
|
125
143
|
type: typeof [ 'button', 'submit', 'reset' ],
|
|
126
144
|
|
|
127
145
|
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
128
|
-
rounded: typeof [ null, '
|
|
146
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
129
147
|
shape: typeof [ null, 'rectangle', 'square' ],
|
|
130
148
|
|
|
131
149
|
fillMode: typeof [ null, 'solid', 'flat', 'outline', 'link' ],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as styles from '../../utils/styles';
|
|
2
|
-
import { Component, globalDefaultProps } from '../component';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
3
|
|
|
4
4
|
class Checkbox extends Component {
|
|
5
5
|
render() {
|
|
@@ -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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
```html
|
|
4
4
|
<!-- default rendering -->
|
|
5
|
-
<div class="k-chip k-chip-md k-rounded-
|
|
5
|
+
<div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">
|
|
6
6
|
<span class="k-chip-text">Chip Text</span>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
```html
|
|
33
33
|
<!-- default rendering -->
|
|
34
34
|
<div class="k-chip-list k-chip-list-md">
|
|
35
|
-
<div class="k-chip k-chip-md k-rounded-
|
|
36
|
-
<div class="k-chip k-chip-md k-rounded-
|
|
37
|
-
<div class="k-chip k-chip-md k-rounded-
|
|
35
|
+
<div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
|
|
36
|
+
<div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
|
|
37
|
+
<div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
|
|
38
38
|
</div>
|
|
39
39
|
|
|
40
40
|
<!-- canonical rendering -->
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
<div class="k-chip" {...props}>...</div>
|
|
45
45
|
<div class="k-chip" {...props}>...</div>
|
|
46
46
|
</div>
|
|
47
|
-
```
|
|
47
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { IconStatic } from '../icon/index';
|
|
3
|
+
|
|
4
|
+
function transformActions(actions) {
|
|
5
|
+
let newActions = [];
|
|
6
|
+
|
|
7
|
+
actions.forEach(action => {
|
|
8
|
+
if (action === 'more') {
|
|
9
|
+
newActions.push(
|
|
10
|
+
<span className="k-chip-action k-chip-more-action">
|
|
11
|
+
<IconStatic name="more-vertical" />
|
|
12
|
+
</span>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (action === 'remove') {
|
|
19
|
+
newActions.push(
|
|
20
|
+
<span className="k-chip-action k-chip-remove-action">
|
|
21
|
+
<IconStatic name="x-circle" />
|
|
22
|
+
</span>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
newActions.push(
|
|
29
|
+
<span className={`k-chip-action k-chip-${action}-action`}>
|
|
30
|
+
<IconStatic name={action} />
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return newActions;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class ChipActions extends Component {
|
|
39
|
+
render() {
|
|
40
|
+
return <ChipActionsStatic {...this.props} />;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ChipActionsStatic(props) {
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
actions
|
|
48
|
+
} = props;
|
|
49
|
+
|
|
50
|
+
if (actions.length === 0) {
|
|
51
|
+
return <></>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<span className="k-chip-actions">
|
|
56
|
+
{transformActions( actions )}
|
|
57
|
+
</span>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ChipActionsStatic.defaultProps = {
|
|
63
|
+
...globalDefaultProps,
|
|
64
|
+
|
|
65
|
+
actions: []
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
ChipActionsStatic.propTypes = {
|
|
69
|
+
className: typeof '',
|
|
70
|
+
children: typeof [],
|
|
71
|
+
|
|
72
|
+
actions: typeof [],
|
|
73
|
+
|
|
74
|
+
aria: typeof false,
|
|
75
|
+
legacy: typeof false,
|
|
76
|
+
|
|
77
|
+
htmlAttributes: typeof []
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { ChipActions, ChipActionsStatic };
|
package/src/chip/chip-avatar.jsx
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { AvatarStatic } from '../avatar/index';
|
|
2
2
|
|
|
3
|
-
function ChipAvatarStatic(
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
showAvatar
|
|
7
|
-
} = chipProps;
|
|
8
|
-
|
|
9
|
-
if (!showAvatar) {
|
|
10
|
-
return <></>;
|
|
11
|
-
}
|
|
3
|
+
function ChipAvatarStatic() {
|
|
12
4
|
|
|
13
5
|
return (
|
|
14
6
|
<AvatarStatic className="k-chip-avatar" type="image">
|
|
15
|
-
<img src="../../assets/avatar.jpg"/>
|
|
7
|
+
<img src="../../assets/avatar.jpg" />
|
|
16
8
|
</AvatarStatic>
|
|
17
9
|
);
|
|
18
10
|
|
package/src/chip/chip-list.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import * as styles from '../../utils/styles';
|
|
3
|
-
import { Component, globalDefaultProps } from '../component';
|
|
3
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
4
4
|
|
|
5
5
|
class ChipList extends Component {
|
|
6
6
|
render() {
|
|
@@ -12,6 +12,8 @@ function ChipListStatic(props) {
|
|
|
12
12
|
const {
|
|
13
13
|
className: ownClassName,
|
|
14
14
|
|
|
15
|
+
children,
|
|
16
|
+
|
|
15
17
|
size,
|
|
16
18
|
|
|
17
19
|
selection,
|
|
@@ -35,6 +37,7 @@ function ChipListStatic(props) {
|
|
|
35
37
|
|
|
36
38
|
let legacyListClasses = [
|
|
37
39
|
ownClassName,
|
|
40
|
+
'k-chip-list'
|
|
38
41
|
];
|
|
39
42
|
|
|
40
43
|
let ariaAttr = aria
|
|
@@ -44,14 +47,14 @@ function ChipListStatic(props) {
|
|
|
44
47
|
if (legacy) {
|
|
45
48
|
return (
|
|
46
49
|
<div className={legacyListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
47
|
-
|
|
50
|
+
{children}
|
|
48
51
|
</div>
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
return (
|
|
53
56
|
<div className={listClasses} {...ariaAttr} {...htmlAttributes}>
|
|
54
|
-
|
|
57
|
+
{children}
|
|
55
58
|
</div>
|
|
56
59
|
);
|
|
57
60
|
}
|
|
@@ -59,14 +62,15 @@ function ChipListStatic(props) {
|
|
|
59
62
|
ChipListStatic.defaultProps = {
|
|
60
63
|
...globalDefaultProps,
|
|
61
64
|
|
|
62
|
-
className: '',
|
|
63
|
-
|
|
64
65
|
size: 'medium',
|
|
65
66
|
|
|
66
67
|
selection: 'none'
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
ChipListStatic.propTypes = {
|
|
71
|
+
className: typeof '',
|
|
72
|
+
children: typeof [],
|
|
73
|
+
|
|
70
74
|
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
71
75
|
|
|
72
76
|
selection: typeof [ null, 'single', 'multiple' ],
|
|
@@ -74,7 +78,6 @@ ChipListStatic.propTypes = {
|
|
|
74
78
|
aria: typeof false,
|
|
75
79
|
legacy: typeof false,
|
|
76
80
|
|
|
77
|
-
className: typeof '',
|
|
78
81
|
htmlAttributes: typeof []
|
|
79
82
|
};
|
|
80
83
|
|