@progress/kendo-themes-html 5.0.0-next.5 → 5.1.2-dev.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 +54 -3
- package/package.json +8 -8
- package/src/autocomplete/README.md +15 -9
- package/src/autocomplete/autocomplete.jsx +17 -12
- 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 +8 -8
- package/src/button/button.jsx +44 -26
- package/src/checkbox/README.md +8 -8
- package/src/checkbox/checkbox.jsx +5 -5
- 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 +33 -22
- package/src/colorpicker/colorpicker.jsx +14 -16
- package/src/combobox/README.md +15 -9
- package/src/combobox/combobox.jsx +20 -17
- package/src/{component.js → component/component.jsx} +4 -2
- 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 +23 -14
- package/src/dropdownlist/dropdownlist.jsx +26 -18
- package/src/fab/README.md +19 -0
- package/src/fab/fab.jsx +150 -0
- package/src/fab/index.js +1 -0
- package/src/icon/icon.jsx +1 -1
- package/src/index.js +51 -5
- package/src/input/index.js +3 -0
- package/src/input/input-clear-value.jsx +31 -0
- package/src/input/input-inner-input.jsx +1 -1
- package/src/input/input-inner-span.jsx +11 -10
- package/src/input/input-inner-textarea.jsx +1 -1
- package/src/input/input-loading-icon.jsx +28 -0
- package/src/input/input-prefix.jsx +1 -1
- package/src/input/input-suffix.jsx +1 -1
- package/src/input/input-validation-icon.jsx +37 -0
- package/src/input/input.jsx +6 -4
- package/src/input/picker.jsx +6 -6
- 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 +15 -9
- package/src/maskedtextbox/maskedtextbox.jsx +29 -19
- 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 +15 -9
- package/src/numerictextbox/numerictextbox.jsx +25 -16
- 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 +7 -7
- package/src/radio/radio.jsx +8 -4
- package/src/searchbar/searchbar.jsx +1 -1
- package/src/searchbox/README.md +16 -12
- package/src/searchbox/searchbox.jsx +23 -14
- package/src/spinbutton/spinbutton.jsx +9 -3
- 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 +3 -3
- package/src/switch/switch.jsx +6 -6
- package/src/textarea/README.md +17 -11
- package/src/textarea/textarea.jsx +4 -4
- package/src/textbox/README.md +15 -9
- package/src/textbox/textbox.jsx +21 -4
- 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 +23 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { globalDefaultProps } from '../component';
|
|
1
|
+
import { globalDefaultProps } from '../component/index';
|
|
2
2
|
import { Input, InputStatic, InputInnerInputStatic } 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
|
|
|
@@ -19,8 +20,6 @@ function ComboboxStatic(props) {
|
|
|
19
20
|
placeholder,
|
|
20
21
|
autocomplete,
|
|
21
22
|
|
|
22
|
-
showClearButton,
|
|
23
|
-
|
|
24
23
|
prefix,
|
|
25
24
|
suffix,
|
|
26
25
|
|
|
@@ -77,26 +76,24 @@ function ComboboxStatic(props) {
|
|
|
77
76
|
'k-widget',
|
|
78
77
|
'k-combobox',
|
|
79
78
|
{
|
|
79
|
+
'k-state-hover': hover === true,
|
|
80
|
+
'k-state-focus': focus === true,
|
|
81
|
+
'k-state-invalid': invalid === true,
|
|
80
82
|
'k-state-disabled': disabled === true
|
|
81
83
|
}
|
|
82
84
|
];
|
|
83
85
|
|
|
84
86
|
let legacyWrapClasses = [
|
|
85
|
-
'k-dropdown-wrap'
|
|
86
|
-
{
|
|
87
|
-
'k-state-hover': hover === true,
|
|
88
|
-
'k-state-focused': focus === true,
|
|
89
|
-
'k-state-invalid': invalid === true
|
|
90
|
-
}
|
|
87
|
+
'k-dropdown-wrap'
|
|
91
88
|
];
|
|
92
89
|
|
|
93
90
|
return (
|
|
94
91
|
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
95
92
|
<span className={legacyWrapClasses}>
|
|
96
|
-
{prefix}
|
|
97
93
|
<input type={type} className="k-input" {...inputAttributes} />
|
|
98
|
-
|
|
99
|
-
{
|
|
94
|
+
<InputValidationIconStatic {...props} />
|
|
95
|
+
<InputLoadingIconStatic {...props} />
|
|
96
|
+
<InputClearValueStatic {...props} />
|
|
100
97
|
<span className="k-select"><IconStatic name="arrow-s" /></span>
|
|
101
98
|
</span>
|
|
102
99
|
</InputStatic>
|
|
@@ -107,9 +104,11 @@ function ComboboxStatic(props) {
|
|
|
107
104
|
<InputStatic className={comboboxClasses} {...ariaAttr} {...htmlAttributes}>
|
|
108
105
|
{prefix}
|
|
109
106
|
<InputInnerInputStatic {...inputAttributes} />
|
|
110
|
-
{!disabled && showClearButton && value !== '' && <span className="k-clear-value"><IconStatic name="x" /></span>}
|
|
111
107
|
{suffix}
|
|
112
|
-
<
|
|
108
|
+
<InputValidationIconStatic {...props} />
|
|
109
|
+
<InputLoadingIconStatic {...props} />
|
|
110
|
+
<InputClearValueStatic {...props} />
|
|
111
|
+
<ButtonStatic className="k-input-button" icon="arrow-s" shape={null} rounded={null} size={size} fillMode={fillMode}></ButtonStatic>
|
|
113
112
|
</InputStatic>
|
|
114
113
|
);
|
|
115
114
|
}
|
|
@@ -122,6 +121,8 @@ ComboboxStatic.defaultProps = {
|
|
|
122
121
|
placeholder: '',
|
|
123
122
|
autocomplete: 'off',
|
|
124
123
|
|
|
124
|
+
showValidationIcon: true,
|
|
125
|
+
showLoadingIcon: true,
|
|
125
126
|
showClearButton: true,
|
|
126
127
|
|
|
127
128
|
size: 'medium',
|
|
@@ -139,15 +140,17 @@ ComboboxStatic.propTypes = {
|
|
|
139
140
|
placeholder: typeof '',
|
|
140
141
|
autocomplete: typeof [ 'on', 'off' ],
|
|
141
142
|
|
|
143
|
+
showValidationIcon: typeof true,
|
|
144
|
+
showLoadingIcon: typeof true,
|
|
142
145
|
showClearButton: typeof true,
|
|
143
146
|
|
|
144
147
|
prefix: typeof '#fragment',
|
|
145
148
|
suffix: typeof '#fragment',
|
|
146
149
|
|
|
147
|
-
size: typeof [
|
|
148
|
-
rounded: typeof [
|
|
150
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
151
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
149
152
|
|
|
150
|
-
fillMode: typeof [
|
|
153
|
+
fillMode: typeof [ null, 'solid', 'flat', 'outline' ],
|
|
151
154
|
|
|
152
155
|
hover: typeof false,
|
|
153
156
|
focus: typeof false,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { isFunction } from '
|
|
2
|
-
import { renderDOM, htmlToProps } from '
|
|
1
|
+
import { isFunction } from '../../utils/object';
|
|
2
|
+
import { renderDOM, htmlToProps } from '../../lib/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
const globalDefaultProps = {
|
|
5
5
|
legacy: false,
|
|
6
6
|
|
|
7
|
+
framework: 'universal',
|
|
8
|
+
|
|
7
9
|
className: '',
|
|
8
10
|
|
|
9
11
|
aria: false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component.jsx';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-dateinput 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-dateinput
|
|
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
|
+
{loading && 'k-loading'}
|
|
26
|
+
{required && 'k-required'}
|
|
27
|
+
{disabled && 'k-disabled'}
|
|
28
|
+
">
|
|
29
|
+
{showInputIcon && inputIconName !== '' && <span class="k-input-icon k-i-icon k-i-{inputIconName}"></span>}
|
|
30
|
+
{inputPrefix && <span class="k-input-prefix">...</span>}
|
|
31
|
+
<input type={type} class="k-input-inner" value={value} placeholder={placeholder} disabled={disabled} />
|
|
32
|
+
{inputPrefix && <span class="k-input-suffix">...</span>}
|
|
33
|
+
{showValidationIcon && valid && <span class="k-validation-icon k-icon k-i-check"></span>}
|
|
34
|
+
{showValidationIcon && invalid && <span class="k-validation-icon k-icon k-i-warning"></span>}
|
|
35
|
+
{showLoadingIcon && loading && <span class="k-icon k-i-loading"></span>}
|
|
36
|
+
{showClearValue && text !== '' && <span class="k-clear-value"><span class="k-icon k-i-x"></span></span>}
|
|
37
|
+
{showSpinButton &&
|
|
38
|
+
<span class="k-input-spinner k-spin-button">
|
|
39
|
+
<button class="k-spinner-increase k-button k-icon-button k-button-solid k-button-solid-base">
|
|
40
|
+
<span class="k-button-icon k-icon k-i-arrow-n"></span>
|
|
41
|
+
</button>
|
|
42
|
+
<button class="k-spinner-decrease k-button k-icon-button k-button-solid k-button-solid-base">
|
|
43
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
44
|
+
</button>
|
|
45
|
+
</span>
|
|
46
|
+
}
|
|
47
|
+
</span>
|
|
48
|
+
```
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { Component, globalDefaultProps } from '../component/index';
|
|
2
|
+
import { InputStatic, InputInnerInputStatic } from '../input/index';
|
|
3
|
+
import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
|
|
4
|
+
import { SpinButtonStatic } from '../spinbutton/index';
|
|
5
|
+
|
|
6
|
+
class DateInput extends Component {
|
|
7
|
+
render() {
|
|
8
|
+
return <DateInputStatic {...this.props} />;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function DateInputStatic(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 dateInputClasses = [
|
|
63
|
+
ownClassName,
|
|
64
|
+
'k-dateinput'
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
let ariaAttr = aria
|
|
68
|
+
? {}
|
|
69
|
+
: {};
|
|
70
|
+
|
|
71
|
+
if (legacy) {
|
|
72
|
+
|
|
73
|
+
let legacyClasses = [
|
|
74
|
+
ownClassName,
|
|
75
|
+
'k-widget',
|
|
76
|
+
'k-dateinput',
|
|
77
|
+
{
|
|
78
|
+
'k-state-hover': hover === true,
|
|
79
|
+
'k-state-focus': focus === true,
|
|
80
|
+
'k-state-invalid': invalid === true,
|
|
81
|
+
'k-state-disabled': disabled === true
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
let legacyWrapClasses = [
|
|
86
|
+
'k-dateinput-wrap'
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
let legacyInputClasses = [
|
|
90
|
+
'k-input'
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
95
|
+
<span className={legacyWrapClasses}>
|
|
96
|
+
<input type={type} className={legacyInputClasses} {...inputAttributes} />
|
|
97
|
+
<InputValidationIconStatic {...props} />
|
|
98
|
+
<InputLoadingIconStatic {...props} />
|
|
99
|
+
<InputClearValueStatic {...props} />
|
|
100
|
+
{showSpinButton === true && <SpinButtonStatic />}
|
|
101
|
+
</span>
|
|
102
|
+
</InputStatic>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<InputStatic className={dateInputClasses} {...ariaAttr} {...htmlAttributes}>
|
|
108
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
109
|
+
<InputValidationIconStatic {...props} />
|
|
110
|
+
<InputLoadingIconStatic {...props} />
|
|
111
|
+
<InputClearValueStatic {...props} />
|
|
112
|
+
{showSpinButton === true && <SpinButtonStatic className="k-input-spinner" size={size} fillMode={fillMode} />}
|
|
113
|
+
</InputStatic>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
DateInputStatic.defaultProps = {
|
|
118
|
+
...globalDefaultProps,
|
|
119
|
+
|
|
120
|
+
value: '',
|
|
121
|
+
placeholder: '',
|
|
122
|
+
autocomplete: 'off',
|
|
123
|
+
|
|
124
|
+
showSpinButton: true,
|
|
125
|
+
|
|
126
|
+
showValidationIcon: true,
|
|
127
|
+
showLoadingIcon: true,
|
|
128
|
+
showClearButton: true,
|
|
129
|
+
|
|
130
|
+
size: 'medium',
|
|
131
|
+
rounded: 'medium',
|
|
132
|
+
|
|
133
|
+
fillMode: 'solid'
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
DateInputStatic.propTypes = {
|
|
137
|
+
type: typeof [ 'text' ],
|
|
138
|
+
value: typeof '',
|
|
139
|
+
placeholder: typeof '',
|
|
140
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
141
|
+
|
|
142
|
+
showSpinButton: typeof true,
|
|
143
|
+
|
|
144
|
+
showValidationIcon: typeof true,
|
|
145
|
+
showLoadingIcon: typeof true,
|
|
146
|
+
showClearButton: typeof true,
|
|
147
|
+
|
|
148
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
149
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
150
|
+
|
|
151
|
+
fillMode: typeof [ null, 'solid', 'flat', 'outline' ],
|
|
152
|
+
|
|
153
|
+
hover: typeof false,
|
|
154
|
+
focus: typeof false,
|
|
155
|
+
valid: typeof false,
|
|
156
|
+
invalid: typeof false,
|
|
157
|
+
required: typeof false,
|
|
158
|
+
disabled: typeof false,
|
|
159
|
+
|
|
160
|
+
aria: typeof false,
|
|
161
|
+
legacy: typeof false,
|
|
162
|
+
|
|
163
|
+
className: typeof '',
|
|
164
|
+
htmlAttributes: typeof []
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export { DateInput, DateInputStatic };
|
|
168
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dateinput.jsx';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
```html
|
|
2
|
+
<!-- default rendering -->
|
|
3
|
+
<span class="k-datepicker 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-datepicker
|
|
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,168 @@
|
|
|
1
|
+
import { globalDefaultProps } from '../component/index';
|
|
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-hover': hover === true,
|
|
80
|
+
'k-state-focus': focus === true,
|
|
81
|
+
'k-state-invalid': invalid === true,
|
|
82
|
+
'k-state-disabled': disabled === true
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
let legacyWrapClasses = [
|
|
87
|
+
'k-picker-wrap'
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<InputStatic className={legacyClasses} {...htmlAttributes}>
|
|
92
|
+
<span className={legacyWrapClasses}>
|
|
93
|
+
<input type={type} className="k-input" {...inputAttributes} />
|
|
94
|
+
<InputValidationIconStatic {...props} />
|
|
95
|
+
<InputLoadingIconStatic {...props} />
|
|
96
|
+
<InputClearValueStatic {...props} />
|
|
97
|
+
<span className="k-select"><IconStatic name="calendar" /></span>
|
|
98
|
+
</span>
|
|
99
|
+
</InputStatic>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<InputStatic className={datepickerClasses} {...ariaAttr} {...htmlAttributes}>
|
|
105
|
+
{prefix}
|
|
106
|
+
<InputInnerInputStatic {...inputAttributes} />
|
|
107
|
+
{suffix}
|
|
108
|
+
<InputValidationIconStatic {...props} />
|
|
109
|
+
<InputLoadingIconStatic {...props} />
|
|
110
|
+
<InputClearValueStatic {...props} />
|
|
111
|
+
<ButtonStatic className="k-input-button" icon="calendar" shape={null} rounded={null} size={size} fillMode={fillMode}></ButtonStatic>
|
|
112
|
+
</InputStatic>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
DatePickerStatic.defaultProps = {
|
|
117
|
+
...globalDefaultProps,
|
|
118
|
+
|
|
119
|
+
type: 'text',
|
|
120
|
+
value: '',
|
|
121
|
+
placeholder: '',
|
|
122
|
+
autocomplete: 'off',
|
|
123
|
+
|
|
124
|
+
showValidationIcon: true,
|
|
125
|
+
showLoadingIcon: true,
|
|
126
|
+
showClearButton: true,
|
|
127
|
+
|
|
128
|
+
size: 'medium',
|
|
129
|
+
rounded: 'medium',
|
|
130
|
+
|
|
131
|
+
fillMode: 'solid'
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
DatePickerStatic.propTypes = {
|
|
135
|
+
children: typeof [],
|
|
136
|
+
className: typeof '',
|
|
137
|
+
|
|
138
|
+
type: typeof [ 'text', 'password' ],
|
|
139
|
+
value: typeof '',
|
|
140
|
+
placeholder: typeof '',
|
|
141
|
+
autocomplete: typeof [ 'on', 'off' ],
|
|
142
|
+
|
|
143
|
+
showValidationIcon: typeof true,
|
|
144
|
+
showLoadingIcon: typeof true,
|
|
145
|
+
showClearButton: typeof true,
|
|
146
|
+
|
|
147
|
+
prefix: typeof '#fragment',
|
|
148
|
+
suffix: typeof '#fragment',
|
|
149
|
+
|
|
150
|
+
size: typeof [ null, 'small', 'medium', 'large' ],
|
|
151
|
+
rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
|
|
152
|
+
|
|
153
|
+
fillMode: typeof [ null, 'solid', 'flat', 'outline' ],
|
|
154
|
+
|
|
155
|
+
hover: typeof false,
|
|
156
|
+
focus: typeof false,
|
|
157
|
+
valid: typeof false,
|
|
158
|
+
invalid: typeof false,
|
|
159
|
+
required: typeof false,
|
|
160
|
+
disabled: typeof false,
|
|
161
|
+
|
|
162
|
+
aria: typeof false,
|
|
163
|
+
legacy: typeof false,
|
|
164
|
+
|
|
165
|
+
htmlAttributes: typeof []
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
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
|
+
```
|