@progress/kendo-themes-html 4.43.1-dev.1 → 4.43.1-dev.5
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 -1
- package/package.json +7 -7
- package/src/autocomplete/autocomplete.jsx +2 -2
- package/src/avatar/README.md +1 -1
- package/src/avatar/avatar.jsx +17 -20
- package/src/button/button.jsx +2 -2
- package/src/checkbox/checkbox.jsx +2 -2
- 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 +27 -20
- package/src/colorpicker/colorpicker.jsx +5 -7
- package/src/combobox/combobox.jsx +5 -7
- package/src/dateinput/dateinput.jsx +5 -7
- package/src/datepicker/datepicker.jsx +5 -7
- package/src/datetimepicker/datetimepicker.jsx +5 -7
- package/src/dropdownlist/dropdownlist.jsx +5 -7
- package/src/fab/README.md +19 -0
- package/src/fab/fab.jsx +154 -0
- package/src/fab/index.js +1 -0
- package/src/index.js +4 -3
- package/src/input/input.jsx +1 -1
- package/src/input/picker.jsx +3 -3
- package/src/list/README.md +14 -0
- package/src/list/list-content.jsx +18 -17
- package/src/list/list-header.jsx +2 -1
- package/src/maskedtextbox/maskedtextbox.jsx +8 -11
- 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/numerictextbox/numerictextbox.jsx +5 -7
- package/src/popup/popup.jsx +1 -1
- package/src/radio/radio.jsx +6 -2
- package/src/searchbox/searchbox.jsx +1 -1
- package/src/switch/README.md +3 -3
- package/src/switch/switch.jsx +4 -4
- package/src/textarea/textarea.jsx +1 -1
- package/src/textbox/textbox.jsx +1 -1
- package/src/timepicker/timepicker.jsx +5 -7
- 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/lib/jsx-runtime.js
CHANGED
|
@@ -37,7 +37,19 @@ const attrMap = {
|
|
|
37
37
|
onlabel: 'onLabel',
|
|
38
38
|
offlabel: 'offLabel',
|
|
39
39
|
trackrounded: 'trackRounded',
|
|
40
|
-
thumbrounded: 'thumbRounded'
|
|
40
|
+
thumbrounded: 'thumbRounded',
|
|
41
|
+
|
|
42
|
+
// Chip
|
|
43
|
+
showavatar: 'showAvatar',
|
|
44
|
+
|
|
45
|
+
// Hierarchy
|
|
46
|
+
haschildren: 'hasChildren',
|
|
47
|
+
|
|
48
|
+
// Treeview
|
|
49
|
+
leafclassname: 'leafClassName',
|
|
50
|
+
|
|
51
|
+
// Template
|
|
52
|
+
contenttemplate: 'contentTemplate'
|
|
41
53
|
};
|
|
42
54
|
|
|
43
55
|
const booleanAttr = new Set([
|
|
@@ -70,6 +82,14 @@ const booleanAttr = new Set([
|
|
|
70
82
|
'virtualization',
|
|
71
83
|
'root',
|
|
72
84
|
|
|
85
|
+
'open',
|
|
86
|
+
'expanded',
|
|
87
|
+
'hasChildren',
|
|
88
|
+
|
|
89
|
+
'showArrow',
|
|
90
|
+
|
|
91
|
+
'showAvatar',
|
|
92
|
+
|
|
73
93
|
'aria'
|
|
74
94
|
]);
|
|
75
95
|
|
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.5",
|
|
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": "ac48eb1c0df9b906d3bef3e7881332555f14a232"
|
|
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
|
|
@@ -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
|
@@ -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,29 @@ 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
|
+
{
|
|
52
|
+
'k-avatar-circle': rounded === 'full',
|
|
53
|
+
'k-avatar-rounded': rounded !== 'full' && rounded !== null
|
|
54
|
+
},
|
|
55
|
+
styles.sizeClass( size, 'k-avatar' ),
|
|
56
|
+
styles.fillModeClass( fillMode, 'k-avatar' ),
|
|
57
|
+
styles.borderedClass( bordered, 'k-avatar' ),
|
|
58
|
+
];
|
|
59
|
+
|
|
61
60
|
return (
|
|
62
61
|
<span className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
|
|
63
62
|
<span className={`k-avatar-${type}`}>
|
|
@@ -85,8 +84,7 @@ AvatarStatic.defaultProps = {
|
|
|
85
84
|
type: '',
|
|
86
85
|
|
|
87
86
|
size: 'medium',
|
|
88
|
-
|
|
89
|
-
rounded: 'circle',
|
|
87
|
+
rounded: 'full',
|
|
90
88
|
bordered: false,
|
|
91
89
|
|
|
92
90
|
fillMode: 'solid',
|
|
@@ -99,9 +97,8 @@ AvatarStatic.propTypes = {
|
|
|
99
97
|
|
|
100
98
|
type: typeof '',
|
|
101
99
|
|
|
102
|
-
size: typeof [ null, 'small', 'medium', 'large'
|
|
103
|
-
|
|
104
|
-
rounded: typeof [ null, '0', 'small', 'medium', 'large' ],
|
|
100
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
101
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
105
102
|
bordered: typeof false,
|
|
106
103
|
|
|
107
104
|
fillMode: typeof [ null, 'solid', 'outline' ],
|
package/src/button/button.jsx
CHANGED
|
@@ -87,7 +87,7 @@ function ButtonStatic(props) {
|
|
|
87
87
|
if (legacy) {
|
|
88
88
|
return (
|
|
89
89
|
<button type={type} className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
|
|
90
|
-
<IconStatic name={icon} />
|
|
90
|
+
<IconStatic className="k-button-icon" name={icon} />
|
|
91
91
|
{ text }
|
|
92
92
|
</button>
|
|
93
93
|
);
|
|
@@ -125,7 +125,7 @@ ButtonStatic.propTypes = {
|
|
|
125
125
|
type: typeof [ 'button', 'submit', 'reset' ],
|
|
126
126
|
|
|
127
127
|
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
128
|
-
rounded: typeof [ null, '
|
|
128
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
129
129
|
shape: typeof [ null, 'rectangle', 'square' ],
|
|
130
130
|
|
|
131
131
|
fillMode: typeof [ null, 'solid', 'flat', 'outline', 'link' ],
|
|
@@ -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
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## Chip
|
|
2
|
+
|
|
3
|
+
```html
|
|
4
|
+
<!-- default rendering -->
|
|
5
|
+
<div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">
|
|
6
|
+
<span class="k-chip-text">Chip Text</span>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<!-- canonical rendering -->
|
|
10
|
+
<div class="
|
|
11
|
+
k-chip
|
|
12
|
+
k-chip-${size}
|
|
13
|
+
k-rounded-${rounded}
|
|
14
|
+
k-chip-${fillMode}
|
|
15
|
+
k-chip-${fillMode}-${themeColor}
|
|
16
|
+
|
|
17
|
+
${disabled && 'k-disabled'}>
|
|
18
|
+
{icon !== '' && <span class="k-chip-icon k-icon k-i-${icon}"></span>}
|
|
19
|
+
{avatar !== '' && <span class="k-chip-avatar k-avatar"></span>}
|
|
20
|
+
<span className="k-chip-content">
|
|
21
|
+
{ children.length
|
|
22
|
+
? children
|
|
23
|
+
: text &&
|
|
24
|
+
<span className="k-chip-label">{text}</span>}
|
|
25
|
+
</span>
|
|
26
|
+
{removable && <span class="k-chip-icon k-icon k-i-${removeIcon}"></span>}
|
|
27
|
+
</div>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ChipList
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<!-- default rendering -->
|
|
34
|
+
<div class="k-chip-list k-chip-list-md">
|
|
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
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- canonical rendering -->
|
|
41
|
+
<div class="
|
|
42
|
+
k-chip-list
|
|
43
|
+
k-chip-${size}">
|
|
44
|
+
<div class="k-chip" {...props}>...</div>
|
|
45
|
+
<div class="k-chip" {...props}>...</div>
|
|
46
|
+
</div>
|
|
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 };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AvatarStatic } from '../avatar/index';
|
|
2
|
+
|
|
3
|
+
function ChipAvatarStatic() {
|
|
4
|
+
|
|
5
|
+
return (
|
|
6
|
+
<AvatarStatic className="k-chip-avatar" type="image">
|
|
7
|
+
<img src="../../assets/avatar.jpg" />
|
|
8
|
+
</AvatarStatic>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ChipAvatarStatic };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
import * as styles from '../../utils/styles';
|
|
3
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
4
|
+
|
|
5
|
+
class ChipList extends Component {
|
|
6
|
+
render() {
|
|
7
|
+
return <ChipListStatic {...this.props} />;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function ChipListStatic(props) {
|
|
12
|
+
const {
|
|
13
|
+
className: ownClassName,
|
|
14
|
+
|
|
15
|
+
children,
|
|
16
|
+
|
|
17
|
+
size,
|
|
18
|
+
|
|
19
|
+
selection,
|
|
20
|
+
|
|
21
|
+
aria,
|
|
22
|
+
legacy,
|
|
23
|
+
|
|
24
|
+
...htmlAttributes
|
|
25
|
+
} = props;
|
|
26
|
+
|
|
27
|
+
let listClasses = [
|
|
28
|
+
ownClassName,
|
|
29
|
+
'k-chip-list',
|
|
30
|
+
styles.sizeClass( size, 'k-chip-list' ),
|
|
31
|
+
{
|
|
32
|
+
'k-selection-single': selection === 'single',
|
|
33
|
+
'k-selection-multiple': selection === 'multiple'
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
let legacyListClasses = [
|
|
39
|
+
ownClassName,
|
|
40
|
+
'k-chip-list'
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
let ariaAttr = aria
|
|
44
|
+
? {}
|
|
45
|
+
: {};
|
|
46
|
+
|
|
47
|
+
if (legacy) {
|
|
48
|
+
return (
|
|
49
|
+
<div className={legacyListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
50
|
+
{children}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className={listClasses} {...ariaAttr} {...htmlAttributes}>
|
|
57
|
+
{children}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ChipListStatic.defaultProps = {
|
|
63
|
+
...globalDefaultProps,
|
|
64
|
+
|
|
65
|
+
size: 'medium',
|
|
66
|
+
|
|
67
|
+
selection: 'none'
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
ChipListStatic.propTypes = {
|
|
71
|
+
className: typeof '',
|
|
72
|
+
children: typeof [],
|
|
73
|
+
|
|
74
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
75
|
+
|
|
76
|
+
selection: typeof [ null, 'single', 'multiple' ],
|
|
77
|
+
|
|
78
|
+
aria: typeof false,
|
|
79
|
+
legacy: typeof false,
|
|
80
|
+
|
|
81
|
+
htmlAttributes: typeof []
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { ChipList, ChipListStatic };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
|
+
import { IconStatic } from '../icon/index';
|
|
4
|
+
import { ChipAvatarStatic } from './chip-avatar.jsx';
|
|
5
|
+
import { ChipActionsStatic } from './chip-actions.jsx';
|
|
6
|
+
|
|
7
|
+
class Chip extends Component {
|
|
8
|
+
|
|
9
|
+
init() {
|
|
10
|
+
let actions = this._props.actions;
|
|
11
|
+
let newActions = [];
|
|
12
|
+
|
|
13
|
+
if (actions === undefined) {
|
|
14
|
+
this._props.actions = [];
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (Array.isArray(actions)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
actions.split(',').forEach(action => {
|
|
23
|
+
newActions.push(action.trim());
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
this._props.actions = newActions;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
render() {
|
|
30
|
+
return <ChipStatic {...this.props} />;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function ChipStatic(props) {
|
|
35
|
+
const {
|
|
36
|
+
className: ownClassName,
|
|
37
|
+
|
|
38
|
+
children,
|
|
39
|
+
|
|
40
|
+
text,
|
|
41
|
+
icon,
|
|
42
|
+
actions,
|
|
43
|
+
|
|
44
|
+
showAvatar,
|
|
45
|
+
|
|
46
|
+
size,
|
|
47
|
+
rounded,
|
|
48
|
+
|
|
49
|
+
fillMode,
|
|
50
|
+
themeColor,
|
|
51
|
+
|
|
52
|
+
hover,
|
|
53
|
+
focus,
|
|
54
|
+
active,
|
|
55
|
+
selected,
|
|
56
|
+
disabled,
|
|
57
|
+
|
|
58
|
+
aria,
|
|
59
|
+
legacy,
|
|
60
|
+
|
|
61
|
+
...htmlAttributes
|
|
62
|
+
} = props;
|
|
63
|
+
|
|
64
|
+
let chipClasses = [
|
|
65
|
+
ownClassName,
|
|
66
|
+
'k-chip',
|
|
67
|
+
styles.sizeClass( size, 'k-chip' ),
|
|
68
|
+
styles.roundedClass( rounded ),
|
|
69
|
+
styles.fillModeClass( fillMode, 'k-chip' ),
|
|
70
|
+
styles.themeColorClass( fillMode, themeColor, 'k-chip' ),
|
|
71
|
+
{
|
|
72
|
+
'k-hover': hover === true,
|
|
73
|
+
'k-focus': focus === true,
|
|
74
|
+
'k-active': active === true,
|
|
75
|
+
'k-selected': selected === true,
|
|
76
|
+
'k-disabled': disabled === true
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
// Augment attributes
|
|
81
|
+
htmlAttributes.disabled = disabled;
|
|
82
|
+
|
|
83
|
+
let ariaAttr = aria
|
|
84
|
+
? {}
|
|
85
|
+
: {};
|
|
86
|
+
|
|
87
|
+
if (legacy) {
|
|
88
|
+
|
|
89
|
+
let legacyClasses = [
|
|
90
|
+
ownClassName,
|
|
91
|
+
'k-chip',
|
|
92
|
+
`k-chip-${themeColor}`,
|
|
93
|
+
{
|
|
94
|
+
'k-chip-outline': fillMode === 'outline',
|
|
95
|
+
'k-chip-solid': fillMode === 'solid',
|
|
96
|
+
'k-state-hover': hover === true,
|
|
97
|
+
'k-state-focus': focus === true,
|
|
98
|
+
'k-state-active': active === true,
|
|
99
|
+
'k-state-selected': selected === true,
|
|
100
|
+
'k-state-disabled': disabled === true
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
|
|
106
|
+
<IconStatic className="k-chip-icon" name={icon} />
|
|
107
|
+
{showAvatar && <ChipAvatarStatic {...props} />}
|
|
108
|
+
<span className="k-chip-content">
|
|
109
|
+
{ children.length
|
|
110
|
+
? children
|
|
111
|
+
: text && <span className="k-chip-label">{text}</span>
|
|
112
|
+
}
|
|
113
|
+
</span>
|
|
114
|
+
{ actions.length > 0 && <ChipActionsStatic actions={actions} />}
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div className={chipClasses} {...ariaAttr} {...htmlAttributes}>
|
|
121
|
+
<IconStatic className="k-chip-icon" name={icon} />
|
|
122
|
+
{showAvatar && <ChipAvatarStatic {...props} />}
|
|
123
|
+
<span className="k-chip-content">
|
|
124
|
+
{ children.length
|
|
125
|
+
? children
|
|
126
|
+
: text && <span className="k-chip-label k-text-ellipsis">{text}</span>
|
|
127
|
+
}
|
|
128
|
+
</span>
|
|
129
|
+
{ actions.length > 0 && <ChipActionsStatic actions={actions} />}
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
ChipStatic.defaultProps = {
|
|
135
|
+
...globalDefaultProps,
|
|
136
|
+
|
|
137
|
+
children: [],
|
|
138
|
+
|
|
139
|
+
text: '',
|
|
140
|
+
icon: '',
|
|
141
|
+
actions: [],
|
|
142
|
+
showAvatar: false,
|
|
143
|
+
|
|
144
|
+
className: '',
|
|
145
|
+
|
|
146
|
+
size: 'medium',
|
|
147
|
+
rounded: 'medium',
|
|
148
|
+
|
|
149
|
+
fillMode: 'solid',
|
|
150
|
+
themeColor: 'base'
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
ChipStatic.propTypes = {
|
|
154
|
+
className: typeof '',
|
|
155
|
+
children: typeof [],
|
|
156
|
+
|
|
157
|
+
text: typeof '',
|
|
158
|
+
icon: typeof '',
|
|
159
|
+
actions: typeof [],
|
|
160
|
+
showAvatar: typeof false,
|
|
161
|
+
|
|
162
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
163
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
164
|
+
|
|
165
|
+
fillMode: typeof [ null, 'solid', 'outline' ],
|
|
166
|
+
themeColor: typeof [ null, 'base', 'error', 'warning', 'info', 'success' ],
|
|
167
|
+
|
|
168
|
+
hover: typeof false,
|
|
169
|
+
focus: typeof false,
|
|
170
|
+
active: typeof false,
|
|
171
|
+
selected: typeof false,
|
|
172
|
+
disabled: typeof false,
|
|
173
|
+
|
|
174
|
+
aria: typeof false,
|
|
175
|
+
legacy: typeof false,
|
|
176
|
+
|
|
177
|
+
htmlAttributes: typeof []
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export { Chip, ChipStatic };
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
```html
|
|
2
2
|
<!-- default rendering -->
|
|
3
|
-
<span class="k-
|
|
4
|
-
<
|
|
5
|
-
|
|
3
|
+
<span class="k-colorpicker k-icon-picker k-picker k-picker-md k-rounded-md k-picker-solid">
|
|
4
|
+
<span class="k-input-inner">
|
|
5
|
+
<span class="k-value-icon k-color-preview k-no-color">
|
|
6
|
+
<span class="k-color-preview-mask" style="background-color: red;"></span>
|
|
7
|
+
</span>
|
|
8
|
+
</span>
|
|
9
|
+
<button type="button" class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button">
|
|
6
10
|
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
7
11
|
</button>
|
|
8
12
|
</span>
|
|
9
13
|
|
|
10
14
|
<!-- canonical rendering -->
|
|
11
15
|
<span class="
|
|
12
|
-
k-
|
|
13
|
-
k-
|
|
14
|
-
k-
|
|
15
|
-
k-
|
|
16
|
-
k-
|
|
16
|
+
k-colorpicker
|
|
17
|
+
k-picker
|
|
18
|
+
k-icon-picker
|
|
19
|
+
k-picker-{size}
|
|
20
|
+
k-rounded-{rounded}
|
|
21
|
+
k-picker-{fillMode}
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
{valid && 'k-valid'}
|
|
24
|
+
{invalid && 'k-invalid'}
|
|
25
|
+
{required && 'k-required'}
|
|
26
|
+
{disabled && 'k-disabled'}
|
|
22
27
|
">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
{inputPrefix && <span class="k-input-prefix">...</span>}
|
|
29
|
+
<span class="k-input-inner">
|
|
30
|
+
<span class="k-value-icon k-color-preview k-no-color">
|
|
31
|
+
<span class="k-color-preview-mask" style={value}></span>
|
|
32
|
+
</span>
|
|
33
|
+
</span>
|
|
34
|
+
{inputSuffix && <span class="k-input-suffix">...</span>}
|
|
26
35
|
<button type="button" class="k-input-button k-button k-icon-button k-button-{size} k-button-{fillMode} k-button-{fillMode}-base">
|
|
27
36
|
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
28
37
|
</button>
|