@progress/kendo-themes-html 4.41.3-dev.3 → 5.0.0-alpha.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 +112 -11
- package/package.json +6 -6
- package/src/autocomplete/README.md +24 -0
- package/src/autocomplete/autocomplete.jsx +160 -0
- package/src/autocomplete/index.js +1 -0
- package/src/button/README.md +22 -0
- package/src/button/button.jsx +3 -1
- package/src/checkbox/README.md +22 -0
- package/src/checkbox/checkbox.jsx +123 -0
- package/src/checkbox/index.js +1 -0
- package/src/colorpicker/README.md +30 -0
- package/src/colorpicker/color-preview.jsx +90 -0
- package/src/colorpicker/colorpicker.jsx +152 -0
- package/src/colorpicker/index.js +2 -0
- package/src/combobox/README.md +30 -0
- package/src/combobox/combobox.jsx +170 -0
- package/src/combobox/index.js +1 -0
- package/src/component.js +3 -3
- package/src/dropdownlist/README.md +30 -0
- package/src/dropdownlist/dropdownlist.jsx +190 -0
- package/src/dropdownlist/index.js +1 -0
- package/src/icon/icon.jsx +29 -7
- package/src/index.js +34 -5
- package/src/input/index.js +5 -0
- package/src/input/input-clear-value.jsx +30 -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 +1 -4
- package/src/input/input-suffix.jsx +1 -4
- package/src/input/input-validation-icon.jsx +37 -0
- package/src/input/input.jsx +90 -32
- package/src/input/picker.jsx +145 -0
- package/src/maskedtextbox/README.md +24 -0
- package/src/maskedtextbox/index.js +1 -0
- package/src/maskedtextbox/maskedtextbox.jsx +155 -0
- package/src/numerictextbox/README.md +42 -0
- package/src/numerictextbox/index.js +1 -0
- package/src/numerictextbox/numerictextbox.jsx +171 -0
- package/src/radio/README.md +21 -0
- package/src/radio/index.js +1 -0
- package/src/radio/radio.jsx +103 -0
- package/src/searchbox/README.md +26 -0
- package/src/searchbox/index.js +1 -0
- package/src/searchbox/searchbox.jsx +171 -0
- package/src/spinbutton/spinbutton.jsx +2 -2
- 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 +24 -0
- package/src/textarea/textarea.jsx +44 -65
- package/src/textbox/README.md +24 -0
- package/src/textbox/textbox.jsx +64 -66
- package/utils/styles.js +29 -2
- package/src/masked/README.md +0 -0
- package/src/masked/index.js +0 -1
- package/src/masked/masked.jsx +0 -139
- package/src/numeric/README.md +0 -0
- package/src/numeric/index.js +0 -1
- package/src/numeric/numeric.jsx +0 -149
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component';
|
|
3
|
+
|
|
4
|
+
class Picker extends Component {
|
|
5
|
+
|
|
6
|
+
init() {
|
|
7
|
+
let prefix = <></>;
|
|
8
|
+
let suffix = <></>;
|
|
9
|
+
let children = this._props.children;
|
|
10
|
+
let newChildren = [];
|
|
11
|
+
|
|
12
|
+
children.forEach( child => {
|
|
13
|
+
let component = child._component;
|
|
14
|
+
|
|
15
|
+
if (component === 'InputPrefix') {
|
|
16
|
+
prefix.props.children.push( child );
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (component === 'InputSuffix') {
|
|
21
|
+
suffix.props.children.push( child );
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
newChildren.push( child );
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
this._props.prefix = prefix;
|
|
29
|
+
this._props.suffix = suffix;
|
|
30
|
+
this._props.children = newChildren;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
return (
|
|
35
|
+
<PickerStatic {...this.props} />
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function PickerStatic(props) {
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
className: ownClassName,
|
|
44
|
+
|
|
45
|
+
size,
|
|
46
|
+
rounded,
|
|
47
|
+
|
|
48
|
+
fillMode,
|
|
49
|
+
|
|
50
|
+
hover,
|
|
51
|
+
focus,
|
|
52
|
+
invalid,
|
|
53
|
+
required,
|
|
54
|
+
disabled,
|
|
55
|
+
|
|
56
|
+
aria,
|
|
57
|
+
legacy,
|
|
58
|
+
|
|
59
|
+
...htmlAttributes
|
|
60
|
+
} = props;
|
|
61
|
+
|
|
62
|
+
let pickerClasses = [
|
|
63
|
+
ownClassName,
|
|
64
|
+
'k-picker',
|
|
65
|
+
styles.sizeClass( size, 'k-input' ),
|
|
66
|
+
styles.roundedClass( rounded ),
|
|
67
|
+
styles.fillModeClass( fillMode, 'k-input' ),
|
|
68
|
+
{
|
|
69
|
+
'k-hover': hover === true,
|
|
70
|
+
'k-focus': focus === true,
|
|
71
|
+
'k-invalid': invalid === true,
|
|
72
|
+
'k-required': required === true,
|
|
73
|
+
'k-disabled': disabled === true
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
let ariaAttr = aria
|
|
78
|
+
? {}
|
|
79
|
+
: {};
|
|
80
|
+
|
|
81
|
+
if ( legacy ) {
|
|
82
|
+
|
|
83
|
+
let legacyClasses = [
|
|
84
|
+
ownClassName
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<span className={legacyClasses} {...htmlAttributes}>
|
|
89
|
+
{props.children}
|
|
90
|
+
</span>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<span className={pickerClasses} {...ariaAttr} {...htmlAttributes}>
|
|
96
|
+
{props.children}
|
|
97
|
+
</span>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
PickerStatic.defaultProps = {
|
|
102
|
+
...globalDefaultProps,
|
|
103
|
+
|
|
104
|
+
type: 'text',
|
|
105
|
+
value: '',
|
|
106
|
+
placeholder: '',
|
|
107
|
+
autocomplete: 'off',
|
|
108
|
+
|
|
109
|
+
size: 'medium',
|
|
110
|
+
rounded: 'medium',
|
|
111
|
+
|
|
112
|
+
fillMode: 'solid'
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
PickerStatic.propTypes = {
|
|
116
|
+
children: typeof [],
|
|
117
|
+
className: typeof '',
|
|
118
|
+
|
|
119
|
+
type: typeof [],
|
|
120
|
+
value: typeof '',
|
|
121
|
+
placeholder: typeof '',
|
|
122
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
123
|
+
|
|
124
|
+
prefix: typeof '#fragment',
|
|
125
|
+
suffix: typeof '#fragment',
|
|
126
|
+
|
|
127
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
128
|
+
rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
|
|
129
|
+
|
|
130
|
+
fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
|
|
131
|
+
|
|
132
|
+
hover: typeof false,
|
|
133
|
+
focus: typeof false,
|
|
134
|
+
valid: typeof false,
|
|
135
|
+
invalid: typeof false,
|
|
136
|
+
required: typeof false,
|
|
137
|
+
disabled: typeof false,
|
|
138
|
+
|
|
139
|
+
aria: typeof false,
|
|
140
|
+
legacy: typeof false,
|
|
141
|
+
|
|
142
|
+
htmlAttributes: typeof []
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export { Picker, PickerStatic };
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
${required && 'k-required'}
|
|
18
|
+
${disabled && 'k-disabled'}
|
|
19
|
+
">
|
|
20
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />
|
|
21
|
+
{valid && <span class="k-input-icon k-icon k-i-check"></span>}
|
|
22
|
+
{invalid && <span class="k-input-icon k-icon k-i-check"></span>}
|
|
23
|
+
</span>
|
|
24
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './maskedtextbox.jsx';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component';
|
|
2
|
+
import { InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
|
+
|
|
5
|
+
class MaskedTextbox extends Component {
|
|
6
|
+
render() {
|
|
7
|
+
return <MaskedTextboxStatic {...this.props} />;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function MaskedTextboxStatic(props) {
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
className: ownClassName,
|
|
15
|
+
|
|
16
|
+
type,
|
|
17
|
+
value,
|
|
18
|
+
placeholder,
|
|
19
|
+
autocomplete,
|
|
20
|
+
|
|
21
|
+
size,
|
|
22
|
+
rounded,
|
|
23
|
+
|
|
24
|
+
fillMode,
|
|
25
|
+
|
|
26
|
+
hover,
|
|
27
|
+
focus,
|
|
28
|
+
valid,
|
|
29
|
+
invalid,
|
|
30
|
+
required,
|
|
31
|
+
disabled,
|
|
32
|
+
|
|
33
|
+
aria,
|
|
34
|
+
legacy,
|
|
35
|
+
|
|
36
|
+
...htmlAttributes
|
|
37
|
+
|
|
38
|
+
} = props;
|
|
39
|
+
|
|
40
|
+
htmlAttributes.size = size;
|
|
41
|
+
htmlAttributes.rounded = rounded;
|
|
42
|
+
htmlAttributes.fillMode = fillMode;
|
|
43
|
+
htmlAttributes.hover = hover;
|
|
44
|
+
htmlAttributes.focus = focus;
|
|
45
|
+
htmlAttributes.valid = valid;
|
|
46
|
+
htmlAttributes.invalid = invalid;
|
|
47
|
+
htmlAttributes.required = required;
|
|
48
|
+
htmlAttributes.disabled = disabled;
|
|
49
|
+
|
|
50
|
+
const inputAttributes = {
|
|
51
|
+
type,
|
|
52
|
+
value,
|
|
53
|
+
placeholder,
|
|
54
|
+
autocomplete,
|
|
55
|
+
|
|
56
|
+
disabled
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
let maskedClasses = [
|
|
60
|
+
ownClassName,
|
|
61
|
+
'k-maskedtextbox'
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
let ariaAttr = aria
|
|
65
|
+
? {}
|
|
66
|
+
: {};
|
|
67
|
+
|
|
68
|
+
if (legacy) {
|
|
69
|
+
|
|
70
|
+
let legacyClasses = [
|
|
71
|
+
ownClassName,
|
|
72
|
+
'k-widget',
|
|
73
|
+
'k-maskedtextbox',
|
|
74
|
+
{
|
|
75
|
+
'k-state-disabled': disabled === true
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
let legacyInputClasses = [
|
|
80
|
+
'k-textbox',
|
|
81
|
+
{
|
|
82
|
+
'k-state-hover': hover === true,
|
|
83
|
+
'k-state-focused': focus === true,
|
|
84
|
+
'k-state-invalid': invalid === true
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
90
|
+
<input type={type} className={legacyInputClasses} {...inputAttributes} />
|
|
91
|
+
</InputStatic>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<InputStatic className={maskedClasses} {...ariaAttr} {...htmlAttributes}>
|
|
97
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
98
|
+
<InputValidationIconStatic {...props} />
|
|
99
|
+
<InputLoadingIconStatic {...props} />
|
|
100
|
+
<InputClearValueStatic {...props} />
|
|
101
|
+
</InputStatic>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
MaskedTextboxStatic.defaultProps = {
|
|
106
|
+
...globalDefaultProps,
|
|
107
|
+
|
|
108
|
+
type: 'text',
|
|
109
|
+
value: '',
|
|
110
|
+
placeholder: '',
|
|
111
|
+
autocomplete: 'off',
|
|
112
|
+
|
|
113
|
+
showValidationIcon: true,
|
|
114
|
+
showLoadingIcon: true,
|
|
115
|
+
showClearButton: true,
|
|
116
|
+
|
|
117
|
+
size: 'medium',
|
|
118
|
+
rounded: 'medium',
|
|
119
|
+
|
|
120
|
+
fillMode: 'solid'
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
MaskedTextboxStatic.propTypes = {
|
|
124
|
+
className: typeof '',
|
|
125
|
+
|
|
126
|
+
type: typeof [ 'text' ],
|
|
127
|
+
value: typeof '',
|
|
128
|
+
placeholder: typeof '',
|
|
129
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
130
|
+
|
|
131
|
+
showValidationIcon: typeof true,
|
|
132
|
+
showLoadingIcon: typeof true,
|
|
133
|
+
showClearButton: typeof true,
|
|
134
|
+
|
|
135
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
136
|
+
rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
|
|
137
|
+
|
|
138
|
+
fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
|
|
139
|
+
|
|
140
|
+
hover: typeof false,
|
|
141
|
+
focus: typeof false,
|
|
142
|
+
valid: typeof false,
|
|
143
|
+
invalid: typeof false,
|
|
144
|
+
loading: typeof false,
|
|
145
|
+
required: typeof false,
|
|
146
|
+
disabled: typeof false,
|
|
147
|
+
|
|
148
|
+
aria: typeof false,
|
|
149
|
+
legacy: typeof false,
|
|
150
|
+
|
|
151
|
+
htmlAttributes: typeof []
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export { MaskedTextbox, MaskedTextboxStatic };
|
|
155
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-numerictextbox k-input k-input-md k-rounded-md k-input-solid">
|
|
4
|
+
<input type="text" class="k-input-inner" value="..." placeholder="..." />
|
|
5
|
+
<span class="k-input-spinner k-spin-button">
|
|
6
|
+
<button class="k-spinner-increase k-button k-icon-button k-button-solid k-button-solid-base">
|
|
7
|
+
<span class="k-button-icon k-icon k-i-arrow-n"></span>
|
|
8
|
+
</button>
|
|
9
|
+
<button class="k-spinner-decrease k-button k-icon-button k-button-solid k-button-solid-base">
|
|
10
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
11
|
+
</button>
|
|
12
|
+
</span>
|
|
13
|
+
</span>
|
|
14
|
+
|
|
15
|
+
<!-- canonical rendering -->
|
|
16
|
+
<span class="
|
|
17
|
+
k-numerictextbox
|
|
18
|
+
k-input
|
|
19
|
+
k-input-${size}
|
|
20
|
+
k-rounded-${rounded}
|
|
21
|
+
k-input-${fillMode}
|
|
22
|
+
|
|
23
|
+
${valid && 'k-valid'}
|
|
24
|
+
${invalid && 'k-invalid'}
|
|
25
|
+
${required && 'k-required'}
|
|
26
|
+
${disabled && 'k-disabled'}
|
|
27
|
+
">
|
|
28
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />
|
|
29
|
+
{valid && <span class="k-input-icon k-icon k-i-check"></span>}
|
|
30
|
+
{invalid && <span class="k-input-icon k-icon k-i-check"></span>}
|
|
31
|
+
{showSpinButton &&
|
|
32
|
+
<span class="k-input-spinner k-spin-button">
|
|
33
|
+
<button class="k-spinner-increase k-button k-icon-button k-button-solid k-button-solid-base">
|
|
34
|
+
<span class="k-button-icon k-icon k-i-arrow-n"></span>
|
|
35
|
+
</button>
|
|
36
|
+
<button class="k-spinner-decrease k-button k-icon-button k-button-solid k-button-solid-base">
|
|
37
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
38
|
+
</button>
|
|
39
|
+
</span>
|
|
40
|
+
}
|
|
41
|
+
</span>
|
|
42
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './numerictextbox.jsx';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component';
|
|
2
|
+
import { InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
|
+
import { SpinButtonStatic } from '../spinbutton/index';
|
|
5
|
+
|
|
6
|
+
class NumericTextbox extends Component {
|
|
7
|
+
render() {
|
|
8
|
+
return <NumericTextboxStatic {...this.props} />;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function NumericTextboxStatic(props) {
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
className: ownClassName,
|
|
16
|
+
|
|
17
|
+
type,
|
|
18
|
+
value,
|
|
19
|
+
placeholder,
|
|
20
|
+
autocomplete,
|
|
21
|
+
|
|
22
|
+
showSpinButton,
|
|
23
|
+
|
|
24
|
+
size,
|
|
25
|
+
rounded,
|
|
26
|
+
|
|
27
|
+
fillMode,
|
|
28
|
+
|
|
29
|
+
hover,
|
|
30
|
+
focus,
|
|
31
|
+
valid,
|
|
32
|
+
invalid,
|
|
33
|
+
required,
|
|
34
|
+
disabled,
|
|
35
|
+
|
|
36
|
+
aria,
|
|
37
|
+
legacy,
|
|
38
|
+
|
|
39
|
+
...htmlAttributes
|
|
40
|
+
|
|
41
|
+
} = props;
|
|
42
|
+
|
|
43
|
+
htmlAttributes.size = size;
|
|
44
|
+
htmlAttributes.rounded = rounded;
|
|
45
|
+
htmlAttributes.fillMode = fillMode;
|
|
46
|
+
htmlAttributes.hover = hover;
|
|
47
|
+
htmlAttributes.focus = focus;
|
|
48
|
+
htmlAttributes.valid = valid;
|
|
49
|
+
htmlAttributes.invalid = invalid;
|
|
50
|
+
htmlAttributes.required = required;
|
|
51
|
+
htmlAttributes.disabled = disabled;
|
|
52
|
+
|
|
53
|
+
const inputAttributes = {
|
|
54
|
+
type: 'text',
|
|
55
|
+
value,
|
|
56
|
+
placeholder,
|
|
57
|
+
autocomplete,
|
|
58
|
+
|
|
59
|
+
disabled
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
let numericClasses = [
|
|
63
|
+
ownClassName,
|
|
64
|
+
'k-numerictextbox'
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
let ariaAttr = aria
|
|
68
|
+
? {}
|
|
69
|
+
: {};
|
|
70
|
+
|
|
71
|
+
if (legacy) {
|
|
72
|
+
|
|
73
|
+
let legacyClasses = [
|
|
74
|
+
ownClassName,
|
|
75
|
+
'k-widget',
|
|
76
|
+
'k-numerictextbox',
|
|
77
|
+
{
|
|
78
|
+
'k-state-disabled': disabled === true
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
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
|
+
}
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
let legacyInputClasses = [
|
|
92
|
+
'k-input',
|
|
93
|
+
'k-formatted-value'
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
98
|
+
<span className={legacyWrapClasses}>
|
|
99
|
+
<input type={type} className={legacyInputClasses} {...inputAttributes} />
|
|
100
|
+
<InputValidationIconStatic {...props} />
|
|
101
|
+
<InputLoadingIconStatic {...props} />
|
|
102
|
+
<InputClearValueStatic {...props} />
|
|
103
|
+
{showSpinButton === true && <SpinButtonStatic />}
|
|
104
|
+
</span>
|
|
105
|
+
</InputStatic>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<InputStatic className={numericClasses} {...ariaAttr} {...htmlAttributes}>
|
|
111
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
112
|
+
<InputValidationIconStatic {...props} />
|
|
113
|
+
<InputLoadingIconStatic {...props} />
|
|
114
|
+
<InputClearValueStatic {...props} />
|
|
115
|
+
{showSpinButton === true && <SpinButtonStatic className="k-input-spinner" />}
|
|
116
|
+
</InputStatic>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
NumericTextboxStatic.defaultProps = {
|
|
121
|
+
...globalDefaultProps,
|
|
122
|
+
|
|
123
|
+
value: '',
|
|
124
|
+
placeholder: '',
|
|
125
|
+
autocomplete: 'off',
|
|
126
|
+
|
|
127
|
+
showSpinButton: true,
|
|
128
|
+
|
|
129
|
+
showValidationIcon: true,
|
|
130
|
+
showLoadingIcon: true,
|
|
131
|
+
showClearButton: true,
|
|
132
|
+
|
|
133
|
+
size: 'medium',
|
|
134
|
+
rounded: 'medium',
|
|
135
|
+
|
|
136
|
+
fillMode: 'solid'
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
NumericTextboxStatic.propTypes = {
|
|
140
|
+
type: typeof [ 'text' ],
|
|
141
|
+
value: typeof '',
|
|
142
|
+
placeholder: typeof '',
|
|
143
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
144
|
+
|
|
145
|
+
showSpinButton: typeof true,
|
|
146
|
+
|
|
147
|
+
showValidationIcon: typeof true,
|
|
148
|
+
showLoadingIcon: typeof true,
|
|
149
|
+
showClearButton: typeof true,
|
|
150
|
+
|
|
151
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
152
|
+
rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
|
|
153
|
+
|
|
154
|
+
fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
|
|
155
|
+
|
|
156
|
+
hover: typeof false,
|
|
157
|
+
focus: typeof false,
|
|
158
|
+
valid: typeof false,
|
|
159
|
+
invalid: typeof false,
|
|
160
|
+
required: typeof false,
|
|
161
|
+
disabled: typeof false,
|
|
162
|
+
|
|
163
|
+
aria: typeof false,
|
|
164
|
+
legacy: typeof false,
|
|
165
|
+
|
|
166
|
+
className: typeof '',
|
|
167
|
+
htmlAttributes: typeof []
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { NumericTextbox, NumericTextboxStatic };
|
|
171
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<input type="radio" class="k-radio k-radio-md k-rounded-md" />
|
|
4
|
+
|
|
5
|
+
<!-- canonical rendering -->
|
|
6
|
+
<input type="radio"
|
|
7
|
+
class="
|
|
8
|
+
k-radio
|
|
9
|
+
k-radio-${size}
|
|
10
|
+
k-rounded-${rounded}
|
|
11
|
+
|
|
12
|
+
${checked && 'k-checked'}
|
|
13
|
+
|
|
14
|
+
${valid && 'k-valid'}
|
|
15
|
+
${invalid && 'k-invalid'}
|
|
16
|
+
${required && 'k-required'}
|
|
17
|
+
${disabled && 'k-disabled'}
|
|
18
|
+
"
|
|
19
|
+
disabled={disabled}
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './radio.jsx';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as styles from '../../utils/styles';
|
|
2
|
+
import { Component, globalDefaultProps } from '../component';
|
|
3
|
+
|
|
4
|
+
class Radio extends Component {
|
|
5
|
+
render() {
|
|
6
|
+
return <RadioStatic {...this.props} />;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function RadioStatic(props) {
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
className: ownClassName,
|
|
14
|
+
|
|
15
|
+
checked,
|
|
16
|
+
|
|
17
|
+
size,
|
|
18
|
+
|
|
19
|
+
hover,
|
|
20
|
+
focus,
|
|
21
|
+
invalid,
|
|
22
|
+
disabled,
|
|
23
|
+
|
|
24
|
+
aria,
|
|
25
|
+
legacy,
|
|
26
|
+
|
|
27
|
+
...htmlAttributes
|
|
28
|
+
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
htmlAttributes.checked = checked;
|
|
32
|
+
htmlAttributes.disabled = disabled;
|
|
33
|
+
|
|
34
|
+
let ariaAttr = aria
|
|
35
|
+
? {}
|
|
36
|
+
: {};
|
|
37
|
+
|
|
38
|
+
let radioClasses = [
|
|
39
|
+
ownClassName,
|
|
40
|
+
'k-radio',
|
|
41
|
+
styles.sizeClass( size, 'k-radio' ),
|
|
42
|
+
{
|
|
43
|
+
'k-hover': hover === true,
|
|
44
|
+
'k-focus': focus === true,
|
|
45
|
+
'k-invalid': invalid === true,
|
|
46
|
+
'k-disabled': disabled === true,
|
|
47
|
+
'k-checked': checked === true,
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
if (legacy) {
|
|
52
|
+
|
|
53
|
+
let legacyClasses = [
|
|
54
|
+
ownClassName,
|
|
55
|
+
'k-radio',
|
|
56
|
+
{
|
|
57
|
+
'k-state-hover': hover === true,
|
|
58
|
+
'k-state-focus': focus === true,
|
|
59
|
+
'k-state-invalid': invalid === true,
|
|
60
|
+
'k-state-disabled': disabled === true,
|
|
61
|
+
'k-state-checked': checked === true,
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
return <input type="radio" className={legacyClasses} {...ariaAttr} {...htmlAttributes}/>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return <input type="radio" className={radioClasses} {...ariaAttr} {...htmlAttributes}/>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
RadioStatic.defaultProps = {
|
|
72
|
+
...globalDefaultProps,
|
|
73
|
+
|
|
74
|
+
id: '',
|
|
75
|
+
name: '',
|
|
76
|
+
|
|
77
|
+
size: 'medium'
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
RadioStatic.propTypes = {
|
|
81
|
+
className: typeof '',
|
|
82
|
+
|
|
83
|
+
id: typeof '',
|
|
84
|
+
name: typeof '',
|
|
85
|
+
value: typeof '',
|
|
86
|
+
|
|
87
|
+
checked: typeof false,
|
|
88
|
+
|
|
89
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
90
|
+
|
|
91
|
+
hover: typeof false,
|
|
92
|
+
focus: typeof false,
|
|
93
|
+
valid: typeof false,
|
|
94
|
+
invalid: typeof false,
|
|
95
|
+
disabled: typeof false,
|
|
96
|
+
|
|
97
|
+
aria: typeof false,
|
|
98
|
+
legacy: typeof false,
|
|
99
|
+
|
|
100
|
+
htmlAttributes: typeof []
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { Radio, RadioStatic };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-searchbox k-input k-input-md k-rounded-md k-input-solid">
|
|
4
|
+
<input type="text" class="k-input-inner" value="..." placeholder="..." />
|
|
5
|
+
<span class="k-input-icon k-icon k-i-search"></span>
|
|
6
|
+
</span>
|
|
7
|
+
|
|
8
|
+
<!-- canonical rendering -->
|
|
9
|
+
<span class="
|
|
10
|
+
k-searchbox
|
|
11
|
+
k-input
|
|
12
|
+
k-input-${size}
|
|
13
|
+
k-rounded-${rounded}
|
|
14
|
+
k-input-${fillMode}
|
|
15
|
+
|
|
16
|
+
${valid && 'k-valid'}
|
|
17
|
+
${invalid && 'k-invalid'}
|
|
18
|
+
${required && 'k-required'}
|
|
19
|
+
${disabled && 'k-disabled'}
|
|
20
|
+
">
|
|
21
|
+
{showIcon && iconPosition === 'leading' && <span class="k-input-icon k-icon k-i-{iconName}"></span>}
|
|
22
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />}
|
|
23
|
+
{text !== '' <span class="k-clear-value"></span>}
|
|
24
|
+
{showIcon && iconPosition === 'trailing' && <span class="k-input-icon k-icon k-i-{iconName}"></span>}
|
|
25
|
+
</span>
|
|
26
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './searchbox.jsx';
|