@progress/kendo-themes-html 4.42.1-dev.0 → 4.42.1-dev.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 +5 -0
- package/package.json +8 -8
- package/src/autocomplete/README.md +15 -9
- package/src/autocomplete/autocomplete.jsx +12 -7
- package/src/button/README.md +8 -8
- package/src/checkbox/README.md +8 -8
- package/src/colorpicker/colorpicker.jsx +3 -4
- package/src/combobox/README.md +15 -9
- package/src/combobox/combobox.jsx +11 -6
- package/src/dateinput/README.md +48 -0
- package/src/dateinput/dateinput.jsx +170 -0
- package/src/dateinput/index.js +1 -0
- package/src/datepicker/README.md +36 -0
- package/src/datepicker/datepicker.jsx +170 -0
- package/src/datepicker/index.js +1 -0
- package/src/datetimepicker/README.md +36 -0
- package/src/datetimepicker/datetimepicker.jsx +170 -0
- package/src/datetimepicker/index.js +1 -0
- package/src/dropdownlist/README.md +23 -14
- package/src/dropdownlist/dropdownlist.jsx +13 -6
- package/src/index.js +4 -1
- package/src/input/index.js +3 -0
- package/src/input/input-clear-value.jsx +31 -0
- package/src/input/input-inner-span.jsx +9 -8
- package/src/input/input-loading-icon.jsx +28 -0
- package/src/input/input-validation-icon.jsx +37 -0
- package/src/input/input.jsx +2 -0
- package/src/maskedtextbox/README.md +15 -9
- package/src/maskedtextbox/maskedtextbox.jsx +18 -5
- package/src/numerictextbox/README.md +15 -9
- package/src/numerictextbox/numerictextbox.jsx +16 -5
- package/src/radio/README.md +7 -7
- package/src/searchbox/README.md +16 -12
- package/src/searchbox/searchbox.jsx +19 -10
- package/src/textarea/README.md +17 -11
- package/src/textbox/README.md +15 -9
- package/src/textbox/textbox.jsx +17 -0
- package/src/timepicker/README.md +36 -0
- package/src/timepicker/index.js +1 -0
- package/src/timepicker/timepicker.jsx +170 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { globalDefaultProps } from '../component';
|
|
2
|
+
import { Input, InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
|
+
import { ButtonStatic } from '../button/index';
|
|
5
|
+
import { IconStatic } from '../icon/index';
|
|
6
|
+
|
|
7
|
+
class DatePicker extends Input {
|
|
8
|
+
render() {
|
|
9
|
+
return <DatePickerStatic {...this.props} />;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DatePickerStatic(props) {
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
className: ownClassName,
|
|
17
|
+
|
|
18
|
+
type,
|
|
19
|
+
value,
|
|
20
|
+
placeholder,
|
|
21
|
+
autocomplete,
|
|
22
|
+
|
|
23
|
+
prefix,
|
|
24
|
+
suffix,
|
|
25
|
+
|
|
26
|
+
size,
|
|
27
|
+
rounded,
|
|
28
|
+
|
|
29
|
+
fillMode,
|
|
30
|
+
|
|
31
|
+
hover,
|
|
32
|
+
focus,
|
|
33
|
+
valid,
|
|
34
|
+
invalid,
|
|
35
|
+
required,
|
|
36
|
+
disabled,
|
|
37
|
+
|
|
38
|
+
aria,
|
|
39
|
+
legacy,
|
|
40
|
+
|
|
41
|
+
...htmlAttributes
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
htmlAttributes.size = size;
|
|
45
|
+
htmlAttributes.rounded = rounded;
|
|
46
|
+
htmlAttributes.fillMode = fillMode;
|
|
47
|
+
htmlAttributes.hover = hover;
|
|
48
|
+
htmlAttributes.focus = focus;
|
|
49
|
+
htmlAttributes.valid = valid;
|
|
50
|
+
htmlAttributes.invalid = invalid;
|
|
51
|
+
htmlAttributes.required = required;
|
|
52
|
+
htmlAttributes.disabled = disabled;
|
|
53
|
+
|
|
54
|
+
const inputAttributes = {
|
|
55
|
+
type,
|
|
56
|
+
value,
|
|
57
|
+
placeholder,
|
|
58
|
+
autocomplete,
|
|
59
|
+
|
|
60
|
+
disabled
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
let datepickerClasses = [
|
|
64
|
+
ownClassName,
|
|
65
|
+
'k-datepicker'
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
let ariaAttr = aria
|
|
69
|
+
? {}
|
|
70
|
+
: {};
|
|
71
|
+
|
|
72
|
+
if (legacy) {
|
|
73
|
+
|
|
74
|
+
let legacyClasses = [
|
|
75
|
+
ownClassName,
|
|
76
|
+
'k-widget',
|
|
77
|
+
'k-datepicker',
|
|
78
|
+
{
|
|
79
|
+
'k-state-disabled': disabled === true
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
let legacyWrapClasses = [
|
|
84
|
+
'k-picker-wrap',
|
|
85
|
+
{
|
|
86
|
+
'k-state-hover': hover === true,
|
|
87
|
+
'k-state-focused': focus === true,
|
|
88
|
+
'k-state-invalid': invalid === true
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
94
|
+
<span className={legacyWrapClasses}>
|
|
95
|
+
<input type={type} className="k-input" {...inputAttributes} />
|
|
96
|
+
<InputValidationIconStatic {...props} />
|
|
97
|
+
<InputLoadingIconStatic {...props} />
|
|
98
|
+
<InputClearValueStatic {...props} />
|
|
99
|
+
<span className="k-select"><IconStatic name="calendar" /></span>
|
|
100
|
+
</span>
|
|
101
|
+
</InputStatic>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<InputStatic className={datepickerClasses} {...ariaAttr} {...htmlAttributes}>
|
|
107
|
+
{prefix}
|
|
108
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
109
|
+
{suffix}
|
|
110
|
+
<InputValidationIconStatic {...props} />
|
|
111
|
+
<InputLoadingIconStatic {...props} />
|
|
112
|
+
<InputClearValueStatic {...props} />
|
|
113
|
+
<ButtonStatic className="k-input-button" icon="calendar" rounded="none" size={size} fillMode={fillMode}></ButtonStatic>
|
|
114
|
+
</InputStatic>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
DatePickerStatic.defaultProps = {
|
|
119
|
+
...globalDefaultProps,
|
|
120
|
+
|
|
121
|
+
type: 'text',
|
|
122
|
+
value: '',
|
|
123
|
+
placeholder: '',
|
|
124
|
+
autocomplete: 'off',
|
|
125
|
+
|
|
126
|
+
showValidationIcon: true,
|
|
127
|
+
showLoadingIcon: true,
|
|
128
|
+
showClearButton: true,
|
|
129
|
+
|
|
130
|
+
size: 'medium',
|
|
131
|
+
rounded: 'medium',
|
|
132
|
+
|
|
133
|
+
fillMode: 'solid'
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
DatePickerStatic.propTypes = {
|
|
137
|
+
children: typeof [],
|
|
138
|
+
className: typeof '',
|
|
139
|
+
|
|
140
|
+
type: typeof [ 'text', 'password' ],
|
|
141
|
+
value: typeof '',
|
|
142
|
+
placeholder: typeof '',
|
|
143
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
144
|
+
|
|
145
|
+
showValidationIcon: typeof true,
|
|
146
|
+
showLoadingIcon: typeof true,
|
|
147
|
+
showClearButton: typeof true,
|
|
148
|
+
|
|
149
|
+
prefix: typeof '#fragment',
|
|
150
|
+
suffix: typeof '#fragment',
|
|
151
|
+
|
|
152
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
153
|
+
rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
|
|
154
|
+
|
|
155
|
+
fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
|
|
156
|
+
|
|
157
|
+
hover: typeof false,
|
|
158
|
+
focus: typeof false,
|
|
159
|
+
valid: typeof false,
|
|
160
|
+
invalid: typeof false,
|
|
161
|
+
required: typeof false,
|
|
162
|
+
disabled: typeof false,
|
|
163
|
+
|
|
164
|
+
aria: typeof false,
|
|
165
|
+
legacy: typeof false,
|
|
166
|
+
|
|
167
|
+
htmlAttributes: typeof []
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { DatePicker, DatePickerStatic };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './datepicker.jsx';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-datetimepicker k-input k-input-md k-rounded-md k-input-solid">
|
|
4
|
+
<input type="text" class="k-input-inner" value="..." placeholder="..." />
|
|
5
|
+
<button type="button" class="k-input-button k-button k-icon-button k-button-md k-button-solid k-button-solid-base">
|
|
6
|
+
<span class="k-button-icon k-icon k-i-calendar"></span>
|
|
7
|
+
</button>
|
|
8
|
+
</span>
|
|
9
|
+
|
|
10
|
+
<!-- canonical rendering -->
|
|
11
|
+
<span class="
|
|
12
|
+
k-datetimepicker
|
|
13
|
+
k-input
|
|
14
|
+
k-input-{size}
|
|
15
|
+
k-rounded-{rounded}
|
|
16
|
+
k-input-{fillMode}
|
|
17
|
+
|
|
18
|
+
{valid && 'k-valid'}
|
|
19
|
+
{invalid && 'k-invalid'}
|
|
20
|
+
{loading && 'k-loading'}
|
|
21
|
+
{required && 'k-required'}
|
|
22
|
+
{disabled && 'k-disabled'}
|
|
23
|
+
">
|
|
24
|
+
{showInputIcon && inputIconName !== '' && <span class="k-input-icon k-i-icon k-i-{inputIconName}"></span>}
|
|
25
|
+
{inputPrefix && <span class="k-input-prefix">...</span>}
|
|
26
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />
|
|
27
|
+
{inputPrefix && <span class="k-input-suffix">...</span>}
|
|
28
|
+
{showValidationIcon && valid && <span class="k-validation-icon k-icon k-i-check"></span>}
|
|
29
|
+
{showValidationIcon && invalid && <span class="k-validation-icon k-icon k-i-warning"></span>}
|
|
30
|
+
{showLoadingIcon && loading && <span class="k-icon k-i-loading"></span>}
|
|
31
|
+
{showClearValue && text !== '' && <span class="k-clear-value"><span class="k-icon k-i-x"></span></span>}
|
|
32
|
+
<button type="button" class="k-input-button k-button k-icon-button k-button-{size} k-button-{fillMode} k-button-{fillMode}-base">
|
|
33
|
+
<span class="k-button-icon k-icon k-i-calendar"></span>
|
|
34
|
+
</button>
|
|
35
|
+
</span>
|
|
36
|
+
```
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { globalDefaultProps } from '../component';
|
|
2
|
+
import { Input, InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
|
+
import { ButtonStatic } from '../button/index';
|
|
5
|
+
import { IconStatic } from '../icon/index';
|
|
6
|
+
|
|
7
|
+
class DateTimePicker extends Input {
|
|
8
|
+
render() {
|
|
9
|
+
return <DateTimePickerStatic {...this.props} />;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DateTimePickerStatic(props) {
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
className: ownClassName,
|
|
17
|
+
|
|
18
|
+
type,
|
|
19
|
+
value,
|
|
20
|
+
placeholder,
|
|
21
|
+
autocomplete,
|
|
22
|
+
|
|
23
|
+
prefix,
|
|
24
|
+
suffix,
|
|
25
|
+
|
|
26
|
+
size,
|
|
27
|
+
rounded,
|
|
28
|
+
|
|
29
|
+
fillMode,
|
|
30
|
+
|
|
31
|
+
hover,
|
|
32
|
+
focus,
|
|
33
|
+
valid,
|
|
34
|
+
invalid,
|
|
35
|
+
required,
|
|
36
|
+
disabled,
|
|
37
|
+
|
|
38
|
+
aria,
|
|
39
|
+
legacy,
|
|
40
|
+
|
|
41
|
+
...htmlAttributes
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
htmlAttributes.size = size;
|
|
45
|
+
htmlAttributes.rounded = rounded;
|
|
46
|
+
htmlAttributes.fillMode = fillMode;
|
|
47
|
+
htmlAttributes.hover = hover;
|
|
48
|
+
htmlAttributes.focus = focus;
|
|
49
|
+
htmlAttributes.valid = valid;
|
|
50
|
+
htmlAttributes.invalid = invalid;
|
|
51
|
+
htmlAttributes.required = required;
|
|
52
|
+
htmlAttributes.disabled = disabled;
|
|
53
|
+
|
|
54
|
+
const inputAttributes = {
|
|
55
|
+
type,
|
|
56
|
+
value,
|
|
57
|
+
placeholder,
|
|
58
|
+
autocomplete,
|
|
59
|
+
|
|
60
|
+
disabled
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
let dateTimePickerClasses = [
|
|
64
|
+
ownClassName,
|
|
65
|
+
'k-datetimepicker'
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
let ariaAttr = aria
|
|
69
|
+
? {}
|
|
70
|
+
: {};
|
|
71
|
+
|
|
72
|
+
if (legacy) {
|
|
73
|
+
|
|
74
|
+
let legacyClasses = [
|
|
75
|
+
ownClassName,
|
|
76
|
+
'k-widget',
|
|
77
|
+
'k-datetimepicker',
|
|
78
|
+
{
|
|
79
|
+
'k-state-disabled': disabled === true
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
let legacyWrapClasses = [
|
|
84
|
+
'k-picker-wrap',
|
|
85
|
+
{
|
|
86
|
+
'k-state-hover': hover === true,
|
|
87
|
+
'k-state-focused': focus === true,
|
|
88
|
+
'k-state-invalid': invalid === true
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
94
|
+
<span className={legacyWrapClasses}>
|
|
95
|
+
<input type={type} className="k-input" {...inputAttributes} />
|
|
96
|
+
<InputValidationIconStatic {...props} />
|
|
97
|
+
<InputLoadingIconStatic {...props} />
|
|
98
|
+
<InputClearValueStatic {...props} />
|
|
99
|
+
<span className="k-select"><span className="k-link"><IconStatic name="calendar" /></span></span>
|
|
100
|
+
</span>
|
|
101
|
+
</InputStatic>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<InputStatic className={dateTimePickerClasses} {...ariaAttr} {...htmlAttributes}>
|
|
107
|
+
{prefix}
|
|
108
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
109
|
+
{suffix}
|
|
110
|
+
<InputValidationIconStatic {...props} />
|
|
111
|
+
<InputLoadingIconStatic {...props} />
|
|
112
|
+
<InputClearValueStatic {...props} />
|
|
113
|
+
<ButtonStatic className="k-input-button" icon="calendar" rounded="none" size={size} fillMode={fillMode}></ButtonStatic>
|
|
114
|
+
</InputStatic>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
DateTimePickerStatic.defaultProps = {
|
|
119
|
+
...globalDefaultProps,
|
|
120
|
+
|
|
121
|
+
type: 'text',
|
|
122
|
+
value: '',
|
|
123
|
+
placeholder: '',
|
|
124
|
+
autocomplete: 'off',
|
|
125
|
+
|
|
126
|
+
showValidationIcon: true,
|
|
127
|
+
showLoadingIcon: true,
|
|
128
|
+
showClearButton: true,
|
|
129
|
+
|
|
130
|
+
size: 'medium',
|
|
131
|
+
rounded: 'medium',
|
|
132
|
+
|
|
133
|
+
fillMode: 'solid'
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
DateTimePickerStatic.propTypes = {
|
|
137
|
+
children: typeof [],
|
|
138
|
+
className: typeof '',
|
|
139
|
+
|
|
140
|
+
type: typeof [ 'text', 'password' ],
|
|
141
|
+
value: typeof '',
|
|
142
|
+
placeholder: typeof '',
|
|
143
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
144
|
+
|
|
145
|
+
showValidationIcon: typeof true,
|
|
146
|
+
showLoadingIcon: typeof true,
|
|
147
|
+
showClearButton: typeof true,
|
|
148
|
+
|
|
149
|
+
prefix: typeof '#fragment',
|
|
150
|
+
suffix: typeof '#fragment',
|
|
151
|
+
|
|
152
|
+
size: typeof [ 'none', 'small', 'medium', 'large' ],
|
|
153
|
+
rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
|
|
154
|
+
|
|
155
|
+
fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
|
|
156
|
+
|
|
157
|
+
hover: typeof false,
|
|
158
|
+
focus: typeof false,
|
|
159
|
+
valid: typeof false,
|
|
160
|
+
invalid: typeof false,
|
|
161
|
+
required: typeof false,
|
|
162
|
+
disabled: typeof false,
|
|
163
|
+
|
|
164
|
+
aria: typeof false,
|
|
165
|
+
legacy: typeof false,
|
|
166
|
+
|
|
167
|
+
htmlAttributes: typeof []
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { DateTimePicker, DateTimePickerStatic };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './datetimepicker.jsx';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
```html
|
|
2
2
|
<!-- default rendering -->
|
|
3
|
-
<span class="k-
|
|
4
|
-
<
|
|
3
|
+
<span class="k-dropdownlist k-picker k-picker-md k-rounded-md k-picker-solid">
|
|
4
|
+
<span class="k-input-inner"><span class="k-input-value-text"><span></span>
|
|
5
5
|
<button type="button" class="k-input-button k-button k-icon-button k-button-md k-button-solid k-button-solid-base">
|
|
6
6
|
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
7
7
|
</button>
|
|
@@ -9,20 +9,29 @@
|
|
|
9
9
|
|
|
10
10
|
<!-- canonical rendering -->
|
|
11
11
|
<span class="
|
|
12
|
-
k-
|
|
13
|
-
k-
|
|
14
|
-
k-
|
|
15
|
-
k-rounded
|
|
16
|
-
k-
|
|
12
|
+
k-dropdownlist
|
|
13
|
+
k-picker
|
|
14
|
+
k-picker-{size}
|
|
15
|
+
k-rounded-{rounded}
|
|
16
|
+
k-picker-{fillMode}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
{valid && 'k-valid'}
|
|
19
|
+
{invalid && 'k-invalid'}
|
|
20
|
+
{loading && 'k-loading'}
|
|
21
|
+
{required && 'k-required'}
|
|
22
|
+
{disabled && 'k-disabled'}
|
|
22
23
|
">
|
|
23
|
-
<
|
|
24
|
-
{
|
|
25
|
-
|
|
24
|
+
{showInputIcon && inputIconName !== '' && <span class="k-input-icon k-i-icon k-i-{inputIconName}"></span>}
|
|
25
|
+
{inputPrefix && <span class="k-input-prefix">...</span>}
|
|
26
|
+
<span class="k-input-inner">
|
|
27
|
+
<span class="k-input-value-icon k-icon k-i-{valueIcon}"><span>
|
|
28
|
+
<span class="k-input-value-text">{valueText}<span>
|
|
29
|
+
</span>
|
|
30
|
+
{inputPrefix && <span class="k-input-suffix">...</span>}
|
|
31
|
+
{showValidationIcon && valid && <span class="k-validation-icon k-icon k-i-check"></span>}
|
|
32
|
+
{showValidationIcon && invalid && <span class="k-validation-icon k-icon k-i-warning"></span>}
|
|
33
|
+
{showLoadingIcon && loading && <span class="k-icon k-i-loading"></span>}
|
|
34
|
+
{showClearValue && text !== '' && <span class="k-clear-value"><span class="k-icon k-i-x"></span></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>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { globalDefaultProps } from '../component';
|
|
2
2
|
import { Picker, PickerStatic, InputInnerSpanStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
3
4
|
import { ButtonStatic } from '../button/index';
|
|
4
5
|
import { IconStatic } from '../icon/index';
|
|
5
6
|
|
|
@@ -24,8 +25,6 @@ function DropdownListStatic(props) {
|
|
|
24
25
|
valueIconName,
|
|
25
26
|
arrowIconName,
|
|
26
27
|
|
|
27
|
-
showClearButton,
|
|
28
|
-
|
|
29
28
|
prefix,
|
|
30
29
|
suffix,
|
|
31
30
|
|
|
@@ -102,10 +101,10 @@ function DropdownListStatic(props) {
|
|
|
102
101
|
return (
|
|
103
102
|
<PickerStatic className={legacyClasses} {...htmlAttributes}>
|
|
104
103
|
<span className={legacyWrapClasses}>
|
|
105
|
-
{prefix}
|
|
106
104
|
<InputInnerSpanStatic {...inputAttributes} />
|
|
107
|
-
|
|
108
|
-
{
|
|
105
|
+
<InputValidationIconStatic {...props} />
|
|
106
|
+
<InputLoadingIconStatic {...props} />
|
|
107
|
+
<InputClearValueStatic {...props} />
|
|
109
108
|
<span className="k-select"><IconStatic name={arrowIconName} /></span>
|
|
110
109
|
</span>
|
|
111
110
|
</PickerStatic>
|
|
@@ -116,8 +115,10 @@ function DropdownListStatic(props) {
|
|
|
116
115
|
<PickerStatic className={dropdownListClasses} {...ariaAttr} {...htmlAttributes}>
|
|
117
116
|
{prefix}
|
|
118
117
|
<InputInnerSpanStatic {...inputAttributes} />
|
|
119
|
-
{!disabled && showClearButton && value !== '' && <span className="k-clear-value"><IconStatic name="x" /></span>}
|
|
120
118
|
{suffix}
|
|
119
|
+
<InputValidationIconStatic {...props} />
|
|
120
|
+
<InputLoadingIconStatic {...props} />
|
|
121
|
+
<InputClearValueStatic {...props} />
|
|
121
122
|
<ButtonStatic className="k-input-button" icon={arrowIconName} rounded="none" size={size} fillMode={fillMode}></ButtonStatic>
|
|
122
123
|
</PickerStatic>
|
|
123
124
|
);
|
|
@@ -132,9 +133,12 @@ DropdownListStatic.defaultProps = {
|
|
|
132
133
|
autocomplete: 'off',
|
|
133
134
|
|
|
134
135
|
showValue: true,
|
|
136
|
+
valueIcon: null,
|
|
135
137
|
valueIconName: '',
|
|
136
138
|
arrowIconName: 'arrow-s',
|
|
137
139
|
|
|
140
|
+
showValidationIcon: true,
|
|
141
|
+
showLoadingIcon: true,
|
|
138
142
|
showClearButton: false,
|
|
139
143
|
|
|
140
144
|
size: 'medium',
|
|
@@ -157,6 +161,8 @@ DropdownListStatic.propTypes = {
|
|
|
157
161
|
valueIconName: typeof '',
|
|
158
162
|
arrowIconName: typeof '',
|
|
159
163
|
|
|
164
|
+
showValidationIcon: typeof true,
|
|
165
|
+
showLoadingIcon: typeof true,
|
|
160
166
|
showClearButton: typeof true,
|
|
161
167
|
|
|
162
168
|
prefix: typeof '#fragment',
|
|
@@ -171,6 +177,7 @@ DropdownListStatic.propTypes = {
|
|
|
171
177
|
focus: typeof false,
|
|
172
178
|
valid: typeof false,
|
|
173
179
|
invalid: typeof false,
|
|
180
|
+
loading: typeof false,
|
|
174
181
|
required: typeof false,
|
|
175
182
|
disabled: typeof false,
|
|
176
183
|
|
package/src/index.js
CHANGED
|
@@ -42,7 +42,10 @@ export * from './autocomplete/index';
|
|
|
42
42
|
// export * from './captcha/index';
|
|
43
43
|
export * from './colorpicker/index';
|
|
44
44
|
export * from './combobox/index';
|
|
45
|
-
|
|
45
|
+
export * from './dateinput/index';
|
|
46
|
+
export * from './datepicker/index';
|
|
47
|
+
export * from './timepicker/index';
|
|
48
|
+
export * from './datetimepicker/index';
|
|
46
49
|
// export * from './dropdowngrid/index';
|
|
47
50
|
export * from './dropdownlist/index';
|
|
48
51
|
// export * from './dropdowntree/index';
|
package/src/input/index.js
CHANGED
|
@@ -3,3 +3,6 @@ export * from './picker.jsx';
|
|
|
3
3
|
export * from './input-inner.jsx';
|
|
4
4
|
export * from './input-prefix.jsx';
|
|
5
5
|
export * from './input-suffix.jsx';
|
|
6
|
+
export * from './input-validation-icon.jsx';
|
|
7
|
+
export * from './input-loading-icon.jsx';
|
|
8
|
+
export * from './input-clear-value.jsx';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IconStatic } from '../icon/index';
|
|
2
|
+
|
|
3
|
+
function InputClearValueStatic(inputProps) {
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
value,
|
|
7
|
+
|
|
8
|
+
showClearButton,
|
|
9
|
+
|
|
10
|
+
readonly,
|
|
11
|
+
loading,
|
|
12
|
+
disabled,
|
|
13
|
+
|
|
14
|
+
aria
|
|
15
|
+
} = inputProps;
|
|
16
|
+
|
|
17
|
+
if (disabled || readonly || loading || !showClearButton || value === '' ) {
|
|
18
|
+
return <></>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let ariaAttr = aria
|
|
22
|
+
? {}
|
|
23
|
+
: {};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<span className="k-clear-value" {...ariaAttr}><IconStatic name="x" /></span>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { InputClearValueStatic };
|
|
@@ -43,19 +43,19 @@ function InputInnerSpanStatic(props) {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<span className={legacyClasses} {...htmlAttributes}>
|
|
46
|
-
{
|
|
47
|
-
<IconStatic className="k-value-icon" name={valueIconName} />
|
|
48
|
-
{value === '' && placeholder}
|
|
49
|
-
{showValue && value && <span className="k-value-text">{value}</span>}
|
|
46
|
+
{valueIcon}
|
|
47
|
+
{valueIcon === null && <IconStatic className="k-icon k-input-value-icon" name={valueIconName} />}
|
|
48
|
+
{showValue && value === '' && placeholder}
|
|
49
|
+
{showValue && value && <span className="k-input-value-text">{value}</span>}
|
|
50
50
|
</span>
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
55
|
<span className={inputClasses} {...ariaAttr} {...htmlAttributes}>
|
|
56
|
-
{
|
|
57
|
-
<IconStatic className="k-value-icon" name={valueIconName} />
|
|
58
|
-
{value === '' && placeholder}
|
|
56
|
+
{valueIcon}
|
|
57
|
+
{valueIcon === null && <IconStatic className="k-icon k-input-value-icon" name={valueIconName} />}
|
|
58
|
+
{showValue && value === '' && placeholder}
|
|
59
59
|
{showValue && value && <span className="k-value-text">{value}</span>}
|
|
60
60
|
</span>
|
|
61
61
|
);
|
|
@@ -68,7 +68,8 @@ InputInnerSpanStatic.defaultProps = {
|
|
|
68
68
|
placeholder: '',
|
|
69
69
|
|
|
70
70
|
showValue: true,
|
|
71
|
-
|
|
71
|
+
valueIcon: null,
|
|
72
|
+
valueIconName: '',
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
InputInnerSpanStatic.propTypes = {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IconStatic } from '../icon/index';
|
|
2
|
+
|
|
3
|
+
function InputLoadingIconStatic(inputProps) {
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
showLoadingIcon,
|
|
7
|
+
|
|
8
|
+
loading,
|
|
9
|
+
disabled,
|
|
10
|
+
|
|
11
|
+
aria
|
|
12
|
+
} = inputProps;
|
|
13
|
+
|
|
14
|
+
if (disabled || !showLoadingIcon || !loading) {
|
|
15
|
+
return <></>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let ariaAttr = aria
|
|
19
|
+
? {}
|
|
20
|
+
: {};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<IconStatic name="loading" className="k-input-loading-icon" {...ariaAttr} />
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { InputLoadingIconStatic };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IconStatic } from '../icon/index';
|
|
2
|
+
|
|
3
|
+
function InputValidationIconStatic(inputProps) {
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
showValidationIcon,
|
|
7
|
+
|
|
8
|
+
valid,
|
|
9
|
+
invalid,
|
|
10
|
+
loading,
|
|
11
|
+
disabled,
|
|
12
|
+
|
|
13
|
+
aria
|
|
14
|
+
} = inputProps;
|
|
15
|
+
|
|
16
|
+
if (disabled || loading || !showValidationIcon ) {
|
|
17
|
+
return <></>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let iconName = invalid ? 'warning' : 'check';
|
|
21
|
+
let renderValidationIcon = Boolean( valid || invalid );
|
|
22
|
+
|
|
23
|
+
let ariaAttr = aria
|
|
24
|
+
? {}
|
|
25
|
+
: {};
|
|
26
|
+
|
|
27
|
+
if (renderValidationIcon === false) {
|
|
28
|
+
return <></>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<IconStatic name={iconName} className="k-input-validation-icon" {...ariaAttr} />
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { InputValidationIconStatic };
|
package/src/input/input.jsx
CHANGED
|
@@ -49,6 +49,7 @@ function InputStatic(props) {
|
|
|
49
49
|
|
|
50
50
|
hover,
|
|
51
51
|
focus,
|
|
52
|
+
valid,
|
|
52
53
|
invalid,
|
|
53
54
|
required,
|
|
54
55
|
disabled,
|
|
@@ -68,6 +69,7 @@ function InputStatic(props) {
|
|
|
68
69
|
{
|
|
69
70
|
'k-hover': hover === true,
|
|
70
71
|
'k-focus': focus === true,
|
|
72
|
+
'k-valid': valid === true,
|
|
71
73
|
'k-invalid': invalid === true,
|
|
72
74
|
'k-required': required === true,
|
|
73
75
|
'k-disabled': disabled === true
|