@progress/kendo-themes-html 4.43.1-dev.2 → 4.43.1-dev.6

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.
@@ -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,3 @@
1
+ export * from './menu-list.jsx';
2
+ export * from './menu-item.jsx';
3
+ export * from './menu-item-content.jsx';
@@ -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 };
@@ -75,17 +75,15 @@ function NumericTextboxStatic(props) {
75
75
  'k-widget',
76
76
  'k-numerictextbox',
77
77
  {
78
+ 'k-state-hover': hover === true,
79
+ 'k-state-focus': focus === true,
80
+ 'k-state-invalid': invalid === true,
78
81
  'k-state-disabled': disabled === true
79
82
  }
80
83
  ];
81
84
 
82
85
  let legacyWrapClasses = [
83
- 'k-numeric-wrap',
84
- {
85
- 'k-state-hover': hover === true,
86
- 'k-state-focused': focus === true,
87
- 'k-state-invalid': invalid === true
88
- }
86
+ 'k-numeric-wrap'
89
87
  ];
90
88
 
91
89
  let legacyInputClasses = [
@@ -62,10 +62,14 @@ function RadioStatic(props) {
62
62
  }
63
63
  ];
64
64
 
65
- return <input type="radio" className={legacyClasses} {...ariaAttr} {...htmlAttributes}/>;
65
+ return (
66
+ <span className="k-radio-wrap"><input type="radio" className={legacyClasses} {...ariaAttr} {...htmlAttributes}/></span>
67
+ );
66
68
  }
67
69
 
68
- return <input type="radio" className={radioClasses} {...ariaAttr} {...htmlAttributes}/>;
70
+ return (
71
+ <span className="k-radio-wrap"><input type="radio" className={radioClasses} {...ariaAttr} {...htmlAttributes}/></span>
72
+ );
69
73
  }
70
74
 
71
75
  RadioStatic.defaultProps = {
@@ -1,12 +1,12 @@
1
1
  ```html
2
2
  <!-- default rendering -->
3
- <span class="k-switch k-switch-on k-switch-md k-rounded-pill">
4
- <span class="k-switch-track k-rounded-pill">
3
+ <span class="k-switch k-switch-on k-switch-md k-rounded-full">
4
+ <span class="k-switch-track k-rounded-full">
5
5
  <span class="k-switch-label-on">On</span>
6
6
  <span class="k-switch-label-off">Off</span>
7
7
  </span>
8
8
  <span class="k-switch-thumb-wrap">
9
- <span class="k-switch-thumb k-rounded-pill"></span>
9
+ <span class="k-switch-thumb k-rounded-full"></span>
10
10
  </span>
11
11
  </span>
12
12
 
File without changes
@@ -0,0 +1,4 @@
1
+ export * from './treeview.jsx';
2
+ export * from './treeview-group.jsx';
3
+ export * from './treeview-item.jsx';
4
+ export * from './treeview-leaf.jsx';
@@ -0,0 +1,70 @@
1
+ import { Component, globalDefaultProps } from '../component/index';
2
+
3
+ class TreeviewGroup extends Component {
4
+ render() {
5
+ return <TreeviewGroupStatic {...this.props} />;
6
+ }
7
+ }
8
+
9
+ function TreeviewGroupStatic(props) {
10
+ const {
11
+ className: ownClassName,
12
+
13
+ items,
14
+
15
+ aria,
16
+ legacy,
17
+
18
+ ...htmlAttributes
19
+ } = props;
20
+
21
+ let treeviewULClasses = [
22
+ ownClassName,
23
+ 'k-treeview-group'
24
+ ];
25
+
26
+ let ariaAttr = aria
27
+ ? {}
28
+ : {};
29
+
30
+ if (legacy) {
31
+
32
+ let legacyTreeviewULClasses = [
33
+ ownClassName,
34
+ 'k-group',
35
+ ];
36
+
37
+ return (
38
+ <ul className={legacyTreeviewULClasses} {...ariaAttr} {...htmlAttributes}>
39
+ {items}
40
+ </ul>
41
+ );
42
+ }
43
+
44
+ return (
45
+ <ul className={treeviewULClasses} {...ariaAttr} {...htmlAttributes}>
46
+ {items}
47
+ </ul>
48
+ );
49
+ }
50
+
51
+ TreeviewGroupStatic.defaultProps = {
52
+ ...globalDefaultProps,
53
+
54
+ children: [],
55
+ items: []
56
+ };
57
+
58
+ TreeviewGroupStatic.propTypes = {
59
+ children: typeof [],
60
+ className: typeof '',
61
+
62
+ items: typeof [],
63
+
64
+ aria: typeof false,
65
+ legacy: typeof false,
66
+
67
+ htmlAttributes: typeof []
68
+ };
69
+
70
+ export { TreeviewGroup, TreeviewGroupStatic };
@@ -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 && <CheckboxStatic checked={checked} />}
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 && <CheckboxStatic checked={checked} />}
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 };