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 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.'));
@@ -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))); // for mutiple select
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/css/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.8.4' }
5
+ export default { utils, version: '1.8.5' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/css/index.js CHANGED
@@ -222,6 +222,6 @@ exports.Upload = _Upload.default;
222
222
  // Created by scripts/src-index.js.
223
223
  var _default = {
224
224
  utils: utils,
225
- version: '1.8.4'
225
+ version: '1.8.5'
226
226
  };
227
227
  exports.default = _default;
package/dist/shineout.js CHANGED
@@ -19878,17 +19878,22 @@ function (_Component) {
19878
19878
  });
19879
19879
  }
19880
19880
 
19881
+ var cloneProps = {
19882
+ value: value,
19883
+ error: error,
19884
+ onChange: this.handleChange
19885
+ };
19886
+
19887
+ if (disabled !== undefined) {
19888
+ cloneProps.disabled = disabled;
19889
+ }
19890
+
19881
19891
  if (
19882
19892
  /*#__PURE__*/
19883
19893
  Object(react__WEBPACK_IMPORTED_MODULE_6__["isValidElement"])(children)) {
19884
19894
  return (
19885
19895
  /*#__PURE__*/
19886
- Object(react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"])(children, {
19887
- value: value,
19888
- error: error,
19889
- onChange: this.handleChange,
19890
- disabled: disabled
19891
- })
19896
+ Object(react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"])(children, cloneProps)
19892
19897
  );
19893
19898
  }
19894
19899
 
@@ -34865,7 +34870,9 @@ function (_Component) {
34865
34870
  _this.handleBlur = _this.handleBlur.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
34866
34871
  _this.geHandleMax = _this.geHandleMax.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
34867
34872
  _this.handlePaste = _this.handlePaste.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
34868
- _this.focusInput = _this.focusInput.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this)); // for mutiple select
34873
+ _this.focusInput = _this.focusInput.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
34874
+ _this.handleCompositionStart = _this.handleCompositionStart.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
34875
+ _this.handleCompositionEnd = _this.handleCompositionEnd.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this)); // for mutiple select
34869
34876
 
34870
34877
  _this.props.setInputReset(_this.reset.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this))); // set focus func to Select
34871
34878
 
@@ -34922,7 +34929,7 @@ function (_Component) {
34922
34929
  value: function geHandleMax(e) {
34923
34930
  var maxLength = this.props.maxLength;
34924
34931
 
34925
- if (!maxLength) {
34932
+ if (!maxLength || this.composition) {
34926
34933
  return true;
34927
34934
  }
34928
34935
 
@@ -35048,6 +35055,17 @@ function (_Component) {
35048
35055
  if (text === txt) return;
35049
35056
  this.props.onInputBlur(text);
35050
35057
  }
35058
+ }, {
35059
+ key: "handleCompositionStart",
35060
+ value: function handleCompositionStart() {
35061
+ this.composition = true;
35062
+ }
35063
+ }, {
35064
+ key: "handleCompositionEnd",
35065
+ value: function handleCompositionEnd(e) {
35066
+ this.composition = false;
35067
+ this.handleInput(e);
35068
+ }
35051
35069
  }, {
35052
35070
  key: "render",
35053
35071
  value: function render() {
@@ -35064,7 +35082,9 @@ function (_Component) {
35064
35082
  contentEditable: focus || this.state.editable,
35065
35083
  onFocus: handleFocus,
35066
35084
  onBlur: this.handleBlur,
35067
- title: !focus && Object(_utils_is__WEBPACK_IMPORTED_MODULE_12__["isString"])(value) ? value : null
35085
+ title: !focus && Object(_utils_is__WEBPACK_IMPORTED_MODULE_12__["isString"])(value) ? value : null,
35086
+ onCompositionStart: this.handleCompositionStart,
35087
+ onCompositionEnd: this.handleCompositionEnd
35068
35088
  };
35069
35089
 
35070
35090
  if (
@@ -35089,7 +35109,7 @@ function (_Component) {
35089
35109
  __self: this,
35090
35110
  __source: {
35091
35111
  fileName: _jsxFileName,
35092
- lineNumber: 192,
35112
+ lineNumber: 205,
35093
35113
  columnNumber: 12
35094
35114
  }
35095
35115
  }))
@@ -60297,7 +60317,7 @@ __webpack_require__.r(__webpack_exports__);
60297
60317
 
60298
60318
  /* harmony default export */ __webpack_exports__["default"] = ({
60299
60319
  utils: _utils__WEBPACK_IMPORTED_MODULE_0__,
60300
- version: '1.8.4'
60320
+ version: '1.8.5'
60301
60321
  });
60302
60322
 
60303
60323