shineout 1.11.4-beta.5 → 1.11.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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.IGNORE_BIND = exports.WITH_OUT_DISPATCH = exports.REMOVE_ERROR = exports.ERROR_TYPE = exports.IGNORE_VALIDATE = exports.FORCE_PASS = exports.RESET_TOPIC = exports.VALIDATE_TOPIC = exports.CHANGE_TOPIC = exports.updateSubscribe = exports.errorSubscribe = exports.changeSubscribe = void 0;
4
+ exports.SUBMIT_TOPIC = exports.IGNORE_BIND = exports.WITH_OUT_DISPATCH = exports.REMOVE_ERROR = exports.ERROR_TYPE = exports.IGNORE_VALIDATE = exports.FORCE_PASS = exports.RESET_TOPIC = exports.VALIDATE_TOPIC = exports.CHANGE_TOPIC = exports.updateSubscribe = exports.errorSubscribe = exports.changeSubscribe = void 0;
5
5
 
6
6
  // FLow chagne
7
7
  var changeSubscribe = function changeSubscribe(name) {
@@ -40,4 +40,6 @@ exports.REMOVE_ERROR = REMOVE_ERROR;
40
40
  var WITH_OUT_DISPATCH = '__WITH_OUT_DISPATCH__';
41
41
  exports.WITH_OUT_DISPATCH = WITH_OUT_DISPATCH;
42
42
  var IGNORE_BIND = '__IGNORE_BIND__';
43
- exports.IGNORE_BIND = IGNORE_BIND;
43
+ exports.IGNORE_BIND = IGNORE_BIND;
44
+ var SUBMIT_TOPIC = '__SUBMIT_TOPIC__';
45
+ exports.SUBMIT_TOPIC = SUBMIT_TOPIC;
package/css/Form/Form.js CHANGED
@@ -180,6 +180,7 @@ function (_Component) {
180
180
  var _document2 = document,
181
181
  activeElement = _document2.activeElement;
182
182
  if (activeElement) activeElement.blur();
183
+ datum.dispatch(_types.SUBMIT_TOPIC);
183
184
  setTimeout(function () {
184
185
  datum.validate(_types.IGNORE_BIND).then(function () {
185
186
  _this2.validating = false;
@@ -102,7 +102,6 @@ function (_PureComponent) {
102
102
  type = _this$props2.type,
103
103
  digits = _this$props2.digits,
104
104
  autoFix = _this$props2.autoFix,
105
- cancelChange = _this$props2.cancelChange,
106
105
  numType = _this$props2.numType;
107
106
  if (type !== 'number' || val === '') return val;
108
107
  if (/^[.-]+$/.test(val)) return '';
@@ -115,8 +114,6 @@ function (_PureComponent) {
115
114
  } else {
116
115
  fixVal = parseInt(fixVal, 10).toString();
117
116
  }
118
-
119
- if (cancelChange) cancelChange();
120
117
  }
121
118
 
122
119
  return fixVal;
@@ -150,7 +147,8 @@ function (_PureComponent) {
150
147
  _proto.handleChange = function handleChange(e, clearClick) {
151
148
  var _this$props4 = this.props,
152
149
  type = _this$props4.type,
153
- clearable = _this$props4.clearable;
150
+ clearable = _this$props4.clearable,
151
+ coin = _this$props4.coin;
154
152
 
155
153
  if (clearClick) {
156
154
  this.ref.focus();
@@ -167,6 +165,10 @@ function (_PureComponent) {
167
165
  if (type === 'number') {
168
166
  if (typeof value !== 'number') {
169
167
  value = String(value).replace(/。/g, '.');
168
+
169
+ if (coin) {
170
+ value = value.replaceAll(',', '');
171
+ }
170
172
  }
171
173
 
172
174
  if (!this.isValidNumber(value)) {
@@ -207,8 +209,8 @@ function (_PureComponent) {
207
209
  cancelChange = _this$props6.cancelChange;
208
210
  if (cancelChange) cancelChange();
209
211
  var newVal = this.fixValue(value);
210
- var canForceChange = !(clearToUndefined && newVal === '' && this.props.value === undefined);
211
- if (canForceChange && forceChange && !this.invalidNumber(newVal)) forceChange(newVal);
212
+ var isChange = !(clearToUndefined && newVal === '' && this.props.value === undefined);
213
+ if (isChange && forceChange && !this.invalidNumber(newVal)) forceChange(newVal);
212
214
  if (onBlur) onBlur(e);
213
215
  };
214
216
 
@@ -259,7 +261,8 @@ function (_PureComponent) {
259
261
  inputFocus = _this$props7.inputFocus,
260
262
  clearToUndefined = _this$props7.clearToUndefined,
261
263
  placeholder = _this$props7.placeholder,
262
- other = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["type", "defaultValue", "digits", "className", "clearable", "htmlName", "forceChange", "onEnterPress", "forwardedRef", "innerTitle", "inputFocus", "clearToUndefined", "placeholder"]);
264
+ coin = _this$props7.coin,
265
+ other = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["type", "defaultValue", "digits", "className", "clearable", "htmlName", "forceChange", "onEnterPress", "forwardedRef", "innerTitle", "inputFocus", "clearToUndefined", "placeholder", "coin"]);
263
266
  var value = this.props.value == null || this.props.value === undefined ? '' : this.props.value;
264
267
  var needClearUndefined = clearToUndefined && this.props.value !== undefined;
265
268
  var showClear = !other.disabled && clearable && (value !== '' || needClearUndefined);
@@ -318,7 +321,8 @@ Input.propTypes = {
318
321
  innerTitle: _propTypes.default.node,
319
322
  inputFocus: _propTypes.default.bool,
320
323
  clearToUndefined: _propTypes.default.bool,
321
- placeholder: _propTypes.default.string
324
+ placeholder: _propTypes.default.string,
325
+ coin: _propTypes.default.bool
322
326
  };
323
327
  Input.defaultProps = {
324
328
  type: 'text'
@@ -92,7 +92,7 @@ function (_PureComponent) {
92
92
 
93
93
  return _react.default.createElement("div", {
94
94
  className: (0, _styles.paginationClass)((0, _classname.getDirectionClass)('section'))
95
- }, txt[0], _react.default.createElement(_Input.default, {
95
+ }, txt[0] ? _react.default.createElement("span", null, txt[0]) : undefined, _react.default.createElement(_Input.default, {
96
96
  key: this.renderRequire,
97
97
  value: current,
98
98
  onChange: nofunc,
@@ -104,7 +104,7 @@ function (_PureComponent) {
104
104
  size: size,
105
105
  className: (0, _styles.paginationClass)(isSimple && 'simple-input'),
106
106
  delay: 400
107
- }), txt[1]);
107
+ }), txt[1] ? _react.default.createElement("span", null, txt[1]) : undefined);
108
108
  };
109
109
 
110
110
  return Jumper;
@@ -13,10 +13,14 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
13
13
 
14
14
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
15
 
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+
16
18
  var _react = _interopRequireDefault(require("react"));
17
19
 
18
20
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
21
 
22
+ var _types = require("shineout/Datum/types");
23
+
20
24
  var _component = require("../component");
21
25
 
22
26
  var _proptypes = require("../utils/proptypes");
@@ -62,6 +66,13 @@ function (_PureComponent) {
62
66
  var _this;
63
67
 
64
68
  _this = _PureComponent.call(this, props) || this;
69
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "forceChange", function () {
70
+ if (_this.inputBlurTimer && _this.blurHandler) {
71
+ clearTimeout(_this.inputBlurTimer);
72
+
73
+ _this.blurHandler();
74
+ }
75
+ });
65
76
  _this.state = {
66
77
  control: 'mouse',
67
78
  focus: false,
@@ -102,6 +113,16 @@ function (_PureComponent) {
102
113
 
103
114
  var _proto = Select.prototype;
104
115
 
116
+ _proto.componentDidMount = function componentDidMount() {
117
+ _PureComponent.prototype.componentDidMount.call(this);
118
+
119
+ var formDatum = this.props.formDatum;
120
+
121
+ if (formDatum) {
122
+ formDatum.subscribe(_types.SUBMIT_TOPIC, this.forceChange);
123
+ }
124
+ };
125
+
105
126
  _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
106
127
  var onFilter = this.props.onFilter; // clear filter
107
128
 
@@ -115,6 +136,12 @@ function (_PureComponent) {
115
136
  _proto.componentWillUnmount = function componentWillUnmount() {
116
137
  _PureComponent.prototype.componentWillUnmount.call(this);
117
138
 
139
+ var formDatum = this.props.formDatum;
140
+
141
+ if (formDatum) {
142
+ formDatum.unsubscribe(_types.SUBMIT_TOPIC, this.forceChange);
143
+ }
144
+
118
145
  this.clearClickAway();
119
146
  };
120
147
 
@@ -252,6 +279,7 @@ function (_PureComponent) {
252
279
  if (this.inputBlurTimer) {
253
280
  this.lastChangeIsOptionClick = true;
254
281
  clearTimeout(this.inputBlurTimer);
282
+ this.inputBlurTimer = null;
255
283
  }
256
284
 
257
285
  if (multiple) {
@@ -331,12 +359,19 @@ function (_PureComponent) {
331
359
 
332
360
  if (!onCreate) return;
333
361
  if (multiple && !text) return;
334
- if (this.lastChangeIsOptionClick) return; // if click option, ignore input blur
362
+ if (this.lastChangeIsOptionClick) return;
335
363
 
336
- this.inputBlurTimer = setTimeout(function () {
364
+ this.blurHandler = function () {
337
365
  var retData = onCreate(text);
338
366
 
339
367
  _this3.handleChange(null, retData, true);
368
+ }; // if click option, ignore input blur
369
+
370
+
371
+ this.inputBlurTimer = setTimeout(function () {
372
+ _this3.blurHandler();
373
+
374
+ _this3.blurHandler = null;
340
375
  }, 200);
341
376
  };
342
377
 
@@ -285,7 +285,7 @@ export interface UploadProps<T> extends StandardProps, OmitFormProps<T[]> {
285
285
  *
286
286
  * default: none
287
287
  */
288
- filesFilter?: (fileList: any[]) => boolean;
288
+ filesFilter?: (fileList: any[]) => any[];
289
289
 
290
290
  /**
291
291
  * remove update failed callback
package/css/hoc/coin.js CHANGED
@@ -120,7 +120,8 @@ var _default = function _default(coinType) {
120
120
  onMouseUp: this.handleMouseUp,
121
121
  value: this.getValue(),
122
122
  onFocus: this.handleFocus,
123
- onBlur: this.handleBlur
123
+ onBlur: this.handleBlur,
124
+ coin: true
124
125
  }));
125
126
  };
126
127
 
package/css/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as utils from './utils'
3
3
 
4
4
  declare const __default: {
5
5
  utils: typeof utils,
6
- version: '1.11.4-beta.5'
6
+ version: '1.11.4'
7
7
  }
8
8
 
9
9
  export default __default
package/css/index.js CHANGED
@@ -224,6 +224,6 @@ exports.Upload = _Upload.default;
224
224
  // Created by scripts/src-index.js.
225
225
  var _default = {
226
226
  utils: utils,
227
- version: '1.11.4-beta.5'
227
+ version: '1.11.4'
228
228
  };
229
229
  exports.default = _default;
@@ -19,11 +19,6 @@ html {
19
19
  -webkit-text-size-adjust: 100%;
20
20
  -ms-text-size-adjust: 100%;
21
21
  }
22
- @at-root {
23
- @-ms-viewport {
24
- width: device-width;
25
- }
26
- }
27
22
  article,
28
23
  aside,
29
24
  dialog,