@progress/kendo-themes-html 5.0.0-next.4 → 5.1.0
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 +231 -14
- package/package.json +8 -8
- package/src/autocomplete/README.md +30 -0
- package/src/autocomplete/autocomplete.jsx +160 -0
- package/src/autocomplete/index.js +1 -0
- package/src/avatar/README.md +21 -0
- package/src/avatar/avatar.jsx +110 -0
- package/src/avatar/index.js +1 -0
- package/src/button/README.md +22 -0
- package/src/button/button.jsx +165 -0
- package/src/button/index.js +1 -0
- package/src/checkbox/README.md +22 -0
- package/src/checkbox/checkbox.jsx +123 -0
- package/src/checkbox/index.js +1 -0
- 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 +39 -0
- package/src/colorpicker/color-preview.jsx +101 -0
- package/src/colorpicker/colorpicker.jsx +151 -0
- package/src/colorpicker/index.js +2 -0
- package/src/combobox/README.md +36 -0
- package/src/combobox/combobox.jsx +168 -0
- package/src/combobox/index.js +1 -0
- package/src/{component.js → component/component.jsx} +10 -7
- package/src/component/index.js +1 -0
- package/src/dateinput/README.md +48 -0
- package/src/dateinput/dateinput.jsx +168 -0
- package/src/dateinput/index.js +1 -0
- package/src/datepicker/README.md +36 -0
- package/src/datepicker/datepicker.jsx +168 -0
- package/src/datepicker/index.js +1 -0
- package/src/datetimepicker/README.md +36 -0
- package/src/datetimepicker/datetimepicker.jsx +168 -0
- package/src/datetimepicker/index.js +1 -0
- package/src/dropdownlist/README.md +39 -0
- package/src/dropdownlist/dropdownlist.jsx +191 -0
- package/src/dropdownlist/index.js +1 -0
- package/src/fab/README.md +19 -0
- package/src/fab/fab.jsx +150 -0
- package/src/fab/index.js +1 -0
- package/src/icon/README.md +0 -0
- package/src/icon/icon.jsx +59 -0
- package/src/icon/index.js +1 -0
- package/src/index.js +90 -8
- package/src/input/README.md +0 -0
- package/src/input/index.js +8 -0
- package/src/input/input-clear-value.jsx +31 -0
- package/src/input/input-inner-input.jsx +77 -0
- package/src/input/input-inner-span.jsx +91 -0
- package/src/input/input-inner-textarea.jsx +74 -0
- package/src/input/input-inner.jsx +3 -0
- package/src/input/input-loading-icon.jsx +28 -0
- package/src/input/input-prefix.jsx +48 -0
- package/src/input/input-suffix.jsx +48 -0
- package/src/input/input-validation-icon.jsx +37 -0
- package/src/input/input.jsx +147 -0
- package/src/input/picker.jsx +145 -0
- 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/README.md +30 -0
- package/src/maskedtextbox/index.js +1 -0
- package/src/maskedtextbox/maskedtextbox.jsx +152 -0
- 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/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/README.md +48 -0
- package/src/numerictextbox/index.js +1 -0
- package/src/numerictextbox/numerictextbox.jsx +169 -0
- package/src/popup/README.md +15 -0
- package/src/popup/index.js +1 -0
- package/src/popup/popup.jsx +80 -0
- package/src/radio/README.md +21 -0
- package/src/radio/index.js +1 -0
- package/src/radio/radio.jsx +107 -0
- package/src/searchbar/README.md +0 -0
- package/src/searchbar/index.js +1 -0
- package/src/searchbar/searchbar.jsx +55 -0
- package/src/searchbox/README.md +30 -0
- package/src/searchbox/index.js +1 -0
- package/src/searchbox/searchbox.jsx +171 -0
- package/src/spinbutton/README.md +0 -0
- package/src/spinbutton/index.js +1 -0
- package/src/spinbutton/spinbutton.jsx +71 -0
- 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 +28 -0
- package/src/switch/index.js +1 -0
- package/src/switch/switch.jsx +132 -0
- package/src/textarea/README.md +30 -0
- package/src/textarea/index.js +1 -0
- package/src/textarea/textarea.jsx +137 -0
- package/src/textbox/README.md +30 -0
- package/src/textbox/index.js +1 -0
- package/src/textbox/textbox.jsx +162 -0
- package/src/timepicker/README.md +36 -0
- package/src/timepicker/index.js +1 -0
- package/src/timepicker/timepicker.jsx +168 -0
- 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 +52 -7
- package/src/button.jsx +0 -114
- package/src/icon.jsx +0 -37
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- jquery / react / vue rendering -->
|
|
3
|
+
<div class="k-list k-list-md">
|
|
4
|
+
<div class="k-list-header"><span class="k-list-header-text">Group 1</span></div>
|
|
5
|
+
<div class="k-list-content">
|
|
6
|
+
<ul class="k-list-ul">
|
|
7
|
+
<li class="k-list-item">
|
|
8
|
+
<span class="k-list-item-text">Item 1.1</span>
|
|
9
|
+
</li>
|
|
10
|
+
<li class="k-list-item">
|
|
11
|
+
<span class="k-list-item-text">Item 1.2</span>
|
|
12
|
+
</li>
|
|
13
|
+
<li class="k-list-item k-first">
|
|
14
|
+
<span class="k-list-item-text">Item 2.1</span>
|
|
15
|
+
<span class="k-list-group-label">Group 2</span>
|
|
16
|
+
</li>
|
|
17
|
+
<li class="k-list-item">
|
|
18
|
+
<span class="k-list-item-text">Item 2.2</span>
|
|
19
|
+
</li>
|
|
20
|
+
</ul>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- jquery / react / vue rendering w/ virtualization -->
|
|
25
|
+
<div class="k-list k-virtual-list k-list-md">
|
|
26
|
+
<div class="k-list-header"><span class="k-list-header-text">Group 1</span></div>
|
|
27
|
+
<div class="k-list-content">
|
|
28
|
+
<ul class="k-list-ul">
|
|
29
|
+
<li class="k-list-item">
|
|
30
|
+
<span class="k-list-item-text">Item 1.1</span>
|
|
31
|
+
</li>
|
|
32
|
+
<li class="k-list-item">
|
|
33
|
+
<span class="k-list-item-text">Item 1.2</span>
|
|
34
|
+
</li>
|
|
35
|
+
<li class="k-list-item k-first">
|
|
36
|
+
<span class="k-list-item-text">Item 2.1</span>
|
|
37
|
+
<span class="k-list-group-label">Group 2</span>
|
|
38
|
+
</li>
|
|
39
|
+
<li class="k-list-item">
|
|
40
|
+
<span class="k-list-item-text">Item 2.2</span>
|
|
41
|
+
</li>
|
|
42
|
+
</ul>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- angular / blazor rendering -->
|
|
47
|
+
<div class="k-list k-list-md">
|
|
48
|
+
<div class="k-list-header"><span class="k-list-header-text">Group 1</span></div>
|
|
49
|
+
<div class="k-list-content">
|
|
50
|
+
<ul class="k-list-ul">
|
|
51
|
+
<li class="k-list-item">
|
|
52
|
+
<span class="k-list-item-text">Item 1.1</span>
|
|
53
|
+
</li>
|
|
54
|
+
<li class="k-list-item">
|
|
55
|
+
<span class="k-list-item-text">Item 1.2</span>
|
|
56
|
+
</li>
|
|
57
|
+
<li class="k-list-group-item">
|
|
58
|
+
<span class="k-list-item-text">Group 2</span>
|
|
59
|
+
</li>
|
|
60
|
+
<li class="k-list-item">
|
|
61
|
+
<span class="k-list-item-text">Item 2.1</span>
|
|
62
|
+
</li>
|
|
63
|
+
<li class="k-list-item">
|
|
64
|
+
<span class="k-list-item-text">Item 2.2</span>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<!-- angular / blazor rendering w/ virtualization -->
|
|
71
|
+
<div class="k-list k-virtual-list k-list-md">
|
|
72
|
+
<div class="k-list-header"><span class="k-list-header-text">Group 1</span></div>
|
|
73
|
+
<div class="k-list-content">
|
|
74
|
+
<ul class="k-list-ul">
|
|
75
|
+
<li class="k-list-item">
|
|
76
|
+
<span class="k-list-item-text">Item 1.1</span>
|
|
77
|
+
</li>
|
|
78
|
+
<li class="k-list-item">
|
|
79
|
+
<span class="k-list-item-text">Item 1.2</span>
|
|
80
|
+
</li>
|
|
81
|
+
<li class="k-list-group-item">
|
|
82
|
+
<span class="k-list-item-text">Group 2</span>
|
|
83
|
+
</li>
|
|
84
|
+
<li class="k-list-item">
|
|
85
|
+
<span class="k-list-item-text">Item 2.1</span>
|
|
86
|
+
</li>
|
|
87
|
+
<li class="k-list-item">
|
|
88
|
+
<span class="k-list-item-text">Item 2.2</span>
|
|
89
|
+
</li>
|
|
90
|
+
</ul>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- filter -->
|
|
95
|
+
<div class="k-list-filter">
|
|
96
|
+
<span class="k-searchbox k-input k-input-md k-rounded-md k-input-solid" type="text" autocomplete="off">
|
|
97
|
+
<span class="k-input-icon k-icon k-i-search"></span>
|
|
98
|
+
<input type="text" class="k-input-inner" placeholder="Filter..." autocomplete="off">
|
|
99
|
+
</span>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<!-- no data template -->
|
|
103
|
+
<div class="k-list k-list-md">
|
|
104
|
+
<div class="k-no-data">No data found.</div>
|
|
105
|
+
</div>
|
|
106
|
+
```
|
|
107
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
|
|
3
|
+
class ListContent extends Component {
|
|
4
|
+
render() {
|
|
5
|
+
return <ListContentStatic {...this.props} />;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function ListContentStatic(props) {
|
|
10
|
+
const {
|
|
11
|
+
className: ownClassName,
|
|
12
|
+
|
|
13
|
+
children,
|
|
14
|
+
|
|
15
|
+
virtualization,
|
|
16
|
+
|
|
17
|
+
aria,
|
|
18
|
+
legacy,
|
|
19
|
+
|
|
20
|
+
...htmlAttributes
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
let listContentClasses = [
|
|
24
|
+
ownClassName,
|
|
25
|
+
'k-list-content'
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
let listULClasses = [
|
|
29
|
+
'k-list-ul'
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
let ariaAttr = aria
|
|
33
|
+
? {}
|
|
34
|
+
: {};
|
|
35
|
+
|
|
36
|
+
if (legacy) {
|
|
37
|
+
|
|
38
|
+
let legacyListContentClasses = [
|
|
39
|
+
ownClassName,
|
|
40
|
+
'k-list-content',
|
|
41
|
+
{
|
|
42
|
+
'k-list-scroller': virtualization === false || virtualization === undefined,
|
|
43
|
+
'k-virtual-content': virtualization === true
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
let legacyListULClasses = [
|
|
48
|
+
'k-list',
|
|
49
|
+
'k-reset',
|
|
50
|
+
{
|
|
51
|
+
'k-virtual-list': virtualization === true
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className={legacyListContentClasses} {...ariaAttr} {...htmlAttributes}>
|
|
57
|
+
<ul className={legacyListULClasses}>
|
|
58
|
+
{children}
|
|
59
|
+
</ul>
|
|
60
|
+
{ virtualization && <div className="k-height-container"><div></div></div> }
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div className={listContentClasses} {...ariaAttr} {...htmlAttributes}>
|
|
67
|
+
<ul className={listULClasses}>
|
|
68
|
+
{children}
|
|
69
|
+
</ul>
|
|
70
|
+
{ virtualization && <div className="k-height-container"><div></div></div> }
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
ListContentStatic.defaultProps = {
|
|
76
|
+
...globalDefaultProps,
|
|
77
|
+
|
|
78
|
+
children: [],
|
|
79
|
+
|
|
80
|
+
virtualization: false
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
ListContentStatic.propTypes = {
|
|
84
|
+
children: typeof [],
|
|
85
|
+
className: typeof '',
|
|
86
|
+
|
|
87
|
+
virtualization: typeof false,
|
|
88
|
+
|
|
89
|
+
aria: typeof false,
|
|
90
|
+
legacy: typeof false,
|
|
91
|
+
|
|
92
|
+
htmlAttributes: typeof []
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { ListContent, ListContentStatic };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
|
|
3
|
+
class ListGroupItem extends Component {
|
|
4
|
+
render() {
|
|
5
|
+
return <ListGroupItemStatic {...this.props} />;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function ListGroupItemStatic(props) {
|
|
10
|
+
const {
|
|
11
|
+
className: ownClassName,
|
|
12
|
+
|
|
13
|
+
children,
|
|
14
|
+
|
|
15
|
+
aria,
|
|
16
|
+
legacy,
|
|
17
|
+
|
|
18
|
+
...htmlAttributes
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
let listGroupItemClasses = [
|
|
22
|
+
ownClassName,
|
|
23
|
+
'k-list-group-item'
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
let legacyListGroupItemClasses = [
|
|
27
|
+
ownClassName,
|
|
28
|
+
'k-group-header'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
let ariaAttr = aria
|
|
32
|
+
? {}
|
|
33
|
+
: {};
|
|
34
|
+
|
|
35
|
+
if (legacy) {
|
|
36
|
+
return (
|
|
37
|
+
<li className={legacyListGroupItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
38
|
+
{children}
|
|
39
|
+
</li>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<li className={listGroupItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
45
|
+
<span className="k-list-item-text">{children}</span>
|
|
46
|
+
</li>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ListGroupItemStatic.defaultProps = {
|
|
51
|
+
...globalDefaultProps,
|
|
52
|
+
|
|
53
|
+
children: []
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
ListGroupItemStatic.propTypes = {
|
|
57
|
+
children: typeof [],
|
|
58
|
+
className: typeof '',
|
|
59
|
+
|
|
60
|
+
aria: typeof false,
|
|
61
|
+
legacy: typeof false,
|
|
62
|
+
|
|
63
|
+
htmlAttributes: typeof []
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { ListGroupItem, ListGroupItemStatic };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
|
|
3
|
+
class ListHeader extends Component {
|
|
4
|
+
render() {
|
|
5
|
+
return <ListHeaderStatic {...this.props} />;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function ListHeaderStatic(props) {
|
|
10
|
+
const {
|
|
11
|
+
className: ownClassName,
|
|
12
|
+
|
|
13
|
+
children,
|
|
14
|
+
|
|
15
|
+
aria,
|
|
16
|
+
legacy,
|
|
17
|
+
|
|
18
|
+
...htmlAttributes
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
let listHeaderClasses = [
|
|
22
|
+
ownClassName,
|
|
23
|
+
// 'k-list-header',
|
|
24
|
+
'k-list-group-sticky-header'
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
let legacyListHeaderClasses = [
|
|
28
|
+
ownClassName,
|
|
29
|
+
'k-group-header'
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
let ariaAttr = aria
|
|
33
|
+
? {}
|
|
34
|
+
: {};
|
|
35
|
+
|
|
36
|
+
if (legacy) {
|
|
37
|
+
return (
|
|
38
|
+
<div className={legacyListHeaderClasses} {...ariaAttr} {...htmlAttributes}>
|
|
39
|
+
{children}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={listHeaderClasses} {...ariaAttr} {...htmlAttributes}>
|
|
46
|
+
<div className="k-list-header-text">{children}</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ListHeaderStatic.defaultProps = {
|
|
52
|
+
...globalDefaultProps,
|
|
53
|
+
|
|
54
|
+
children: []
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
ListHeaderStatic.propTypes = {
|
|
58
|
+
children: typeof [],
|
|
59
|
+
className: typeof '',
|
|
60
|
+
|
|
61
|
+
aria: typeof false,
|
|
62
|
+
legacy: typeof false,
|
|
63
|
+
|
|
64
|
+
htmlAttributes: typeof []
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { ListHeader, ListHeaderStatic };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { CheckboxStatic } from '../checkbox/index';
|
|
3
|
+
import { IconStatic } from '../icon/index';
|
|
4
|
+
|
|
5
|
+
class ListItem extends Component {
|
|
6
|
+
render() {
|
|
7
|
+
return <ListItemStatic {...this.props} />;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function ListItemStatic(props) {
|
|
12
|
+
const {
|
|
13
|
+
className: ownClassName,
|
|
14
|
+
children,
|
|
15
|
+
|
|
16
|
+
groupLabel,
|
|
17
|
+
|
|
18
|
+
showIcon,
|
|
19
|
+
iconName,
|
|
20
|
+
showCheckbox,
|
|
21
|
+
checked,
|
|
22
|
+
|
|
23
|
+
hover,
|
|
24
|
+
focus,
|
|
25
|
+
selected,
|
|
26
|
+
disabled,
|
|
27
|
+
|
|
28
|
+
aria,
|
|
29
|
+
legacy,
|
|
30
|
+
|
|
31
|
+
...htmlAttributes
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
let listItemClasses = [
|
|
35
|
+
ownClassName,
|
|
36
|
+
'k-list-item',
|
|
37
|
+
{
|
|
38
|
+
'k-hover': hover === true,
|
|
39
|
+
'k-focus': focus === true,
|
|
40
|
+
'k-selected': selected === true,
|
|
41
|
+
'k-disabled': disabled === true
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
let legacyListItemClasses = [
|
|
47
|
+
ownClassName,
|
|
48
|
+
'k-item',
|
|
49
|
+
{
|
|
50
|
+
'k-state-hover': hover === true,
|
|
51
|
+
'k-state-focused': focus === true,
|
|
52
|
+
'k-state-selected': selected === true,
|
|
53
|
+
'k-state-disabled': disabled === true
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
let ariaAttr = aria
|
|
58
|
+
? {}
|
|
59
|
+
: {};
|
|
60
|
+
|
|
61
|
+
if (legacy) {
|
|
62
|
+
return (
|
|
63
|
+
<li className={legacyListItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
64
|
+
{showCheckbox && <CheckboxStatic checked={checked} />}
|
|
65
|
+
{showIcon && <IconStatic name={iconName} />}
|
|
66
|
+
<span className="k-list-item-text">{children}</span>
|
|
67
|
+
{groupLabel !== '' && <div className="k-group">{groupLabel}</div>}
|
|
68
|
+
</li>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<li className={listItemClasses} {...ariaAttr} {...htmlAttributes}>
|
|
74
|
+
{showCheckbox && <CheckboxStatic checked={checked} />}
|
|
75
|
+
{showIcon && <IconStatic name={iconName} />}
|
|
76
|
+
<span className="k-list-item-text">{children}</span>
|
|
77
|
+
{groupLabel !== '' && <div className="k-list-item-group-label">{groupLabel}</div>}
|
|
78
|
+
</li>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ListItemStatic.defaultProps = {
|
|
83
|
+
...globalDefaultProps,
|
|
84
|
+
|
|
85
|
+
children: [],
|
|
86
|
+
|
|
87
|
+
groupLabel: '',
|
|
88
|
+
|
|
89
|
+
showIcon: false,
|
|
90
|
+
iconName: '',
|
|
91
|
+
showCheckbox: false,
|
|
92
|
+
checked: false,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
ListItemStatic.propTypes = {
|
|
96
|
+
children: typeof [],
|
|
97
|
+
className: typeof '',
|
|
98
|
+
|
|
99
|
+
groupLabel: typeof '',
|
|
100
|
+
|
|
101
|
+
showIcon: typeof false,
|
|
102
|
+
iconName: typeof '',
|
|
103
|
+
showCheckbox: typeof false,
|
|
104
|
+
checked: typeof false,
|
|
105
|
+
|
|
106
|
+
hover: typeof false,
|
|
107
|
+
focus: typeof false,
|
|
108
|
+
selected: typeof false,
|
|
109
|
+
disabled: typeof false,
|
|
110
|
+
|
|
111
|
+
aria: typeof false,
|
|
112
|
+
legacy: typeof false,
|
|
113
|
+
|
|
114
|
+
htmlAttributes: typeof []
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export { ListItem, ListItemStatic };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
3
|
+
import { ListHeaderStatic } from './list-header.jsx';
|
|
4
|
+
import { ListContentStatic } from './list-content.jsx';
|
|
5
|
+
import { ListGroupItemStatic } from './list-group-item.jsx';
|
|
6
|
+
import { ListItemStatic } from './list-item.jsx';
|
|
7
|
+
import { NoDataStatic } from '../nodata/index';
|
|
8
|
+
|
|
9
|
+
class List extends Component {
|
|
10
|
+
|
|
11
|
+
_transformChildrenUniversal() {
|
|
12
|
+
let virtualization = this._props.virtualization;
|
|
13
|
+
let children = this._props.children;
|
|
14
|
+
let listHeader;
|
|
15
|
+
let listContent;
|
|
16
|
+
let listChildren = [];
|
|
17
|
+
let newChildren = [];
|
|
18
|
+
|
|
19
|
+
children.forEach( child => {
|
|
20
|
+
if ( child.type === 'OPTGROUP') {
|
|
21
|
+
if (child.props.root === true) {
|
|
22
|
+
listHeader = <ListHeaderStatic {...child.props}>{child.props.label}</ListHeaderStatic>;
|
|
23
|
+
|
|
24
|
+
child.props.children.forEach( optChild => {
|
|
25
|
+
listChildren.push( <ListItemStatic {...optChild.props} /> );
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
child.props.children.forEach( ( optChild, index ) => {
|
|
29
|
+
let groupLabel = '';
|
|
30
|
+
|
|
31
|
+
if ( index === 0 ) {
|
|
32
|
+
groupLabel = child.props.label;
|
|
33
|
+
optChild.props.className = [ optChild.props.className, 'k-first' ];
|
|
34
|
+
}
|
|
35
|
+
listChildren.push( <ListItemStatic {...optChild.props} groupLabel={groupLabel} /> );
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
} else if ( child.type === 'OPTION' ) {
|
|
39
|
+
listChildren.push( <ListItemStatic {...child.props} /> );
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
listContent = <ListContentStatic virtualization={virtualization}>{listChildren}</ListContentStatic>;
|
|
44
|
+
|
|
45
|
+
newChildren.push( listHeader );
|
|
46
|
+
newChildren.push( listContent );
|
|
47
|
+
|
|
48
|
+
this._props.children = newChildren;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_transformChildrenAngular() {
|
|
52
|
+
let virtualization = this._props.virtualization;
|
|
53
|
+
let children = this._props.children;
|
|
54
|
+
let listHeader;
|
|
55
|
+
let listContent;
|
|
56
|
+
let listChildren = [];
|
|
57
|
+
let newChildren = [];
|
|
58
|
+
|
|
59
|
+
children.forEach( child => {
|
|
60
|
+
if ( child.type === 'OPTGROUP') {
|
|
61
|
+
if (child.props.root === true) {
|
|
62
|
+
listHeader = <ListHeaderStatic {...child.props}>{child.props.label}</ListHeaderStatic>;
|
|
63
|
+
|
|
64
|
+
child.props.children.forEach( optChild => {
|
|
65
|
+
listChildren.push( <ListItemStatic {...optChild.props} /> );
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
listChildren.push( <ListGroupItemStatic {...child.props}>{child.props.label}</ListGroupItemStatic> );
|
|
69
|
+
|
|
70
|
+
child.props.children.forEach( optChild => {
|
|
71
|
+
listChildren.push( <ListItemStatic {...optChild.props} /> );
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
} else if ( child.type === 'OPTION' ) {
|
|
75
|
+
listChildren.push( <ListItemStatic {...child.props} /> );
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
listContent = <ListContentStatic virtualization={virtualization}>{listChildren}</ListContentStatic>;
|
|
80
|
+
|
|
81
|
+
newChildren.push( listHeader );
|
|
82
|
+
newChildren.push( listContent );
|
|
83
|
+
|
|
84
|
+
this._props.children = newChildren;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
init() {
|
|
88
|
+
let framework = this._props.framework;
|
|
89
|
+
|
|
90
|
+
if ( this._props.children.length === 0 ) {
|
|
91
|
+
this._props.children.push( <NoDataStatic /> );
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if ( framework === 'angular' || framework === 'blazor' ) {
|
|
96
|
+
this._transformChildrenAngular();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
this._transformChildrenUniversal();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
render() {
|
|
104
|
+
return <ListStatic {...this.props} />;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function ListStatic(props) {
|
|
109
|
+
const {
|
|
110
|
+
className: ownClassName,
|
|
111
|
+
children,
|
|
112
|
+
|
|
113
|
+
size,
|
|
114
|
+
|
|
115
|
+
virtualization,
|
|
116
|
+
|
|
117
|
+
aria,
|
|
118
|
+
legacy,
|
|
119
|
+
|
|
120
|
+
...htmlAttributes
|
|
121
|
+
} = props;
|
|
122
|
+
|
|
123
|
+
let listClasses = [
|
|
124
|
+
ownClassName,
|
|
125
|
+
'k-list',
|
|
126
|
+
styles.sizeClass( size, 'k-list' ),
|
|
127
|
+
{
|
|
128
|
+
'k-virtual-list': virtualization === true
|
|
129
|
+
}
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
let legacyListClasses = [
|
|
134
|
+
ownClassName,
|
|
135
|
+
'k-list-container'
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
let ariaAttr = aria
|
|
139
|
+
? {}
|
|
140
|
+
: {};
|
|
141
|
+
|
|
142
|
+
if (legacy) {
|
|
143
|
+
return (
|
|
144
|
+
<div className={legacyListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
145
|
+
{children}
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div className={listClasses} {...ariaAttr} {...htmlAttributes}>
|
|
152
|
+
{children}
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
ListStatic.defaultProps = {
|
|
158
|
+
...globalDefaultProps,
|
|
159
|
+
|
|
160
|
+
children: [],
|
|
161
|
+
|
|
162
|
+
size: 'medium',
|
|
163
|
+
|
|
164
|
+
virtualization: false
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
ListStatic.propTypes = {
|
|
168
|
+
framework: typeof [ 'universal', 'angular' ],
|
|
169
|
+
children: typeof [],
|
|
170
|
+
className: typeof '',
|
|
171
|
+
|
|
172
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
173
|
+
|
|
174
|
+
virtualization: typeof false,
|
|
175
|
+
|
|
176
|
+
aria: typeof false,
|
|
177
|
+
legacy: typeof false,
|
|
178
|
+
|
|
179
|
+
htmlAttributes: typeof []
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export { List, ListStatic };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-maskedtextbox k-input k-input-md k-rounded-md k-input-solid">
|
|
4
|
+
<input type="text" class="k-input-inner" value="..." placeholder="..." />
|
|
5
|
+
</span>
|
|
6
|
+
|
|
7
|
+
<!-- canonical rendering -->
|
|
8
|
+
<span class="
|
|
9
|
+
k-maskedtextbox
|
|
10
|
+
k-input
|
|
11
|
+
k-input-{size}
|
|
12
|
+
k-rounded-{rounded}
|
|
13
|
+
k-input-{fillMode}
|
|
14
|
+
|
|
15
|
+
{valid && 'k-valid'}
|
|
16
|
+
{invalid && 'k-invalid'}
|
|
17
|
+
{loading && 'k-loading'}
|
|
18
|
+
{required && 'k-required'}
|
|
19
|
+
{disabled && 'k-disabled'}
|
|
20
|
+
">
|
|
21
|
+
{showInputIcon && inputIconName !== '' && <span class="k-input-icon k-i-icon k-i-{inputIconName}"></span>}
|
|
22
|
+
{inputPrefix && <span class="k-input-prefix">...</span>}
|
|
23
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />
|
|
24
|
+
{inputPrefix && <span class="k-input-suffix">...</span>}
|
|
25
|
+
{showValidationIcon && valid && <span class="k-validation-icon k-icon k-i-check"></span>}
|
|
26
|
+
{showValidationIcon && invalid && <span class="k-validation-icon k-icon k-i-warning"></span>}
|
|
27
|
+
{showLoadingIcon && loading && <span class="k-icon k-i-loading"></span>}
|
|
28
|
+
{showClearValue && text !== '' && <span class="k-clear-value"><span class="k-icon k-i-x"></span></span>}
|
|
29
|
+
</span>
|
|
30
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './maskedtextbox.jsx';
|