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.
- package/css/Datum/types.js +4 -2
- package/css/Form/Form.js +1 -0
- package/css/Input/Input.js +12 -8
- package/css/Pagination/Jumper.js +2 -2
- package/css/Select/Select.js +37 -2
- package/css/Upload/index.d.ts +1 -1
- package/css/hoc/coin.js +2 -1
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/css/styles/normalize.css +0 -5
- package/dist/shineout.js +3867 -3321
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/theme.antd.css +1 -1
- package/dist/theme.antd2.css +1 -1
- package/dist/theme.default.css +1 -1
- package/dist/theme.shineout.css +1 -1
- package/es/Datum/types.js +2 -1
- package/es/Form/Form.js +2 -1
- package/es/Input/Input.js +12 -8
- package/es/Pagination/Jumper.js +2 -2
- package/es/Select/Select.js +37 -2
- package/es/Upload/index.d.ts +1 -1
- package/es/hoc/coin.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/styles/normalize.less +0 -7
- package/lib/Datum/types.js +4 -2
- package/lib/Form/Form.js +1 -0
- package/lib/Input/Input.js +12 -8
- package/lib/Pagination/Jumper.js +2 -2
- package/lib/Select/Select.js +37 -2
- package/lib/Upload/index.d.ts +1 -1
- package/lib/hoc/coin.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/styles/normalize.less +0 -7
- package/package.json +1 -1
package/css/Datum/types.js
CHANGED
|
@@ -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;
|
package/css/Input/Input.js
CHANGED
|
@@ -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
|
|
211
|
-
if (
|
|
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
|
-
|
|
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'
|
package/css/Pagination/Jumper.js
CHANGED
|
@@ -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;
|
package/css/Select/Select.js
CHANGED
|
@@ -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;
|
|
362
|
+
if (this.lastChangeIsOptionClick) return;
|
|
335
363
|
|
|
336
|
-
this.
|
|
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
|
|
package/css/Upload/index.d.ts
CHANGED
package/css/hoc/coin.js
CHANGED
package/css/index.d.ts
CHANGED
package/css/index.js
CHANGED