shineout 1.8.4 → 1.8.5
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/css/Form/Field.js +11 -6
- package/css/Select/Input.js +16 -3
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/dist/shineout.js +31 -11
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/es/Form/Field.js +11 -6
- package/es/Select/Input.js +16 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/Form/Field.js +11 -6
- package/lib/Select/Input.js +16 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/es/Form/Field.js
CHANGED
|
@@ -53,13 +53,18 @@ function (_Component) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
var cloneProps = {
|
|
57
|
+
value: value,
|
|
58
|
+
error: error,
|
|
59
|
+
onChange: this.handleChange
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (disabled !== undefined) {
|
|
63
|
+
cloneProps.disabled = disabled;
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
if (isValidElement(children)) {
|
|
57
|
-
return cloneElement(children,
|
|
58
|
-
value: value,
|
|
59
|
-
error: error,
|
|
60
|
-
onChange: this.handleChange,
|
|
61
|
-
disabled: disabled
|
|
62
|
-
});
|
|
67
|
+
return cloneElement(children, cloneProps);
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
console.error(new Error('Form.Field expect a single ReactElement or a function.'));
|
package/es/Select/Input.js
CHANGED
|
@@ -29,7 +29,9 @@ function (_Component) {
|
|
|
29
29
|
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
30
30
|
_this.geHandleMax = _this.geHandleMax.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
31
31
|
_this.handlePaste = _this.handlePaste.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
32
|
-
_this.focusInput = _this.focusInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
32
|
+
_this.focusInput = _this.focusInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
33
|
+
_this.handleCompositionStart = _this.handleCompositionStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
34
|
+
_this.handleCompositionEnd = _this.handleCompositionEnd.bind(_assertThisInitialized(_assertThisInitialized(_this))); // for mutiple select
|
|
33
35
|
|
|
34
36
|
_this.props.setInputReset(_this.reset.bind(_assertThisInitialized(_assertThisInitialized(_this)))); // set focus func to Select
|
|
35
37
|
|
|
@@ -81,7 +83,7 @@ function (_Component) {
|
|
|
81
83
|
_proto.geHandleMax = function geHandleMax(e) {
|
|
82
84
|
var maxLength = this.props.maxLength;
|
|
83
85
|
|
|
84
|
-
if (!maxLength) {
|
|
86
|
+
if (!maxLength || this.composition) {
|
|
85
87
|
return true;
|
|
86
88
|
}
|
|
87
89
|
|
|
@@ -202,6 +204,15 @@ function (_Component) {
|
|
|
202
204
|
this.props.onInputBlur(text);
|
|
203
205
|
};
|
|
204
206
|
|
|
207
|
+
_proto.handleCompositionStart = function handleCompositionStart() {
|
|
208
|
+
this.composition = true;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
_proto.handleCompositionEnd = function handleCompositionEnd(e) {
|
|
212
|
+
this.composition = false;
|
|
213
|
+
this.handleInput(e);
|
|
214
|
+
};
|
|
215
|
+
|
|
205
216
|
_proto.render = function render() {
|
|
206
217
|
var _this$props = this.props,
|
|
207
218
|
text = _this$props.text,
|
|
@@ -216,7 +227,9 @@ function (_Component) {
|
|
|
216
227
|
contentEditable: focus || this.state.editable,
|
|
217
228
|
onFocus: handleFocus,
|
|
218
229
|
onBlur: this.handleBlur,
|
|
219
|
-
title: !focus && isString(value) ? value : null
|
|
230
|
+
title: !focus && isString(value) ? value : null,
|
|
231
|
+
onCompositionStart: this.handleCompositionStart,
|
|
232
|
+
onCompositionEnd: this.handleCompositionEnd
|
|
220
233
|
};
|
|
221
234
|
|
|
222
235
|
if (isValidElement(value)) {
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/lib/Form/Field.js
CHANGED
|
@@ -64,13 +64,18 @@ function (_Component) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
var cloneProps = {
|
|
68
|
+
value: value,
|
|
69
|
+
error: error,
|
|
70
|
+
onChange: this.handleChange
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
if (disabled !== undefined) {
|
|
74
|
+
cloneProps.disabled = disabled;
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
if ((0, _react.isValidElement)(children)) {
|
|
68
|
-
return (0, _react.cloneElement)(children,
|
|
69
|
-
value: value,
|
|
70
|
-
error: error,
|
|
71
|
-
onChange: this.handleChange,
|
|
72
|
-
disabled: disabled
|
|
73
|
-
});
|
|
78
|
+
return (0, _react.cloneElement)(children, cloneProps);
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
console.error(new Error('Form.Field expect a single ReactElement or a function.'));
|
package/lib/Select/Input.js
CHANGED
|
@@ -46,7 +46,9 @@ function (_Component) {
|
|
|
46
46
|
_this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
47
47
|
_this.geHandleMax = _this.geHandleMax.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
48
48
|
_this.handlePaste = _this.handlePaste.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
49
|
-
_this.focusInput = _this.focusInput.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
49
|
+
_this.focusInput = _this.focusInput.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
50
|
+
_this.handleCompositionStart = _this.handleCompositionStart.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
51
|
+
_this.handleCompositionEnd = _this.handleCompositionEnd.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))); // for mutiple select
|
|
50
52
|
|
|
51
53
|
_this.props.setInputReset(_this.reset.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)))); // set focus func to Select
|
|
52
54
|
|
|
@@ -98,7 +100,7 @@ function (_Component) {
|
|
|
98
100
|
_proto.geHandleMax = function geHandleMax(e) {
|
|
99
101
|
var maxLength = this.props.maxLength;
|
|
100
102
|
|
|
101
|
-
if (!maxLength) {
|
|
103
|
+
if (!maxLength || this.composition) {
|
|
102
104
|
return true;
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -219,6 +221,15 @@ function (_Component) {
|
|
|
219
221
|
this.props.onInputBlur(text);
|
|
220
222
|
};
|
|
221
223
|
|
|
224
|
+
_proto.handleCompositionStart = function handleCompositionStart() {
|
|
225
|
+
this.composition = true;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
_proto.handleCompositionEnd = function handleCompositionEnd(e) {
|
|
229
|
+
this.composition = false;
|
|
230
|
+
this.handleInput(e);
|
|
231
|
+
};
|
|
232
|
+
|
|
222
233
|
_proto.render = function render() {
|
|
223
234
|
var _this$props = this.props,
|
|
224
235
|
text = _this$props.text,
|
|
@@ -233,7 +244,9 @@ function (_Component) {
|
|
|
233
244
|
contentEditable: focus || this.state.editable,
|
|
234
245
|
onFocus: handleFocus,
|
|
235
246
|
onBlur: this.handleBlur,
|
|
236
|
-
title: !focus && (0, _is.isString)(value) ? value : null
|
|
247
|
+
title: !focus && (0, _is.isString)(value) ? value : null,
|
|
248
|
+
onCompositionStart: this.handleCompositionStart,
|
|
249
|
+
onCompositionEnd: this.handleCompositionEnd
|
|
237
250
|
};
|
|
238
251
|
|
|
239
252
|
if ((0, _react.isValidElement)(value)) {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED