shineout 1.10.8-beta.3 → 1.10.10
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/Button/Button.js +2 -2
- package/css/Datum/Form.js +18 -4
- package/css/Datum/List.js +4 -0
- package/css/Datum/Tree.js +6 -0
- package/css/Datum/hoc.js +5 -0
- package/css/Form/index.d.ts +1 -1
- package/css/Form/styles/form.css +1 -0
- package/css/Select/Result.js +1 -1
- package/css/Select/Select.js +11 -4
- package/css/Table/SimpleTable.js +5 -1
- package/css/Tree/Content.js +23 -1
- package/css/TreeSelect/Result.js +1 -1
- package/css/TreeSelect/datum.js +2 -1
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/dist/shineout.js +159 -87
- 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/@types/common.d.ts +11 -4
- package/es/Button/Button.js +1 -1
- package/es/Datum/Form.js +18 -4
- package/es/Datum/List.js +4 -0
- package/es/Datum/Tree.js +6 -0
- package/es/Datum/hoc.js +5 -0
- package/es/Form/index.d.ts +1 -1
- package/es/Form/styles/form.less +1 -0
- package/es/Select/Result.js +1 -1
- package/es/Select/Select.js +11 -4
- package/es/Table/SimpleTable.js +5 -1
- package/es/Tree/Content.js +22 -1
- package/es/TreeSelect/Result.js +1 -1
- package/es/TreeSelect/datum.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/@types/common.d.ts +11 -4
- package/lib/Button/Button.js +2 -2
- package/lib/Datum/Form.js +18 -4
- package/lib/Datum/List.js +4 -0
- package/lib/Datum/Tree.js +6 -0
- package/lib/Datum/hoc.js +5 -0
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/styles/form.less +1 -0
- package/lib/Select/Result.js +1 -1
- package/lib/Select/Select.js +11 -4
- package/lib/Table/SimpleTable.js +5 -1
- package/lib/Tree/Content.js +23 -1
- package/lib/TreeSelect/Result.js +1 -1
- package/lib/TreeSelect/datum.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -11
package/css/Button/Button.js
CHANGED
|
@@ -31,7 +31,7 @@ var _styles = require("./styles");
|
|
|
31
31
|
|
|
32
32
|
var _config = require("../config");
|
|
33
33
|
|
|
34
|
-
var _classname =
|
|
34
|
+
var _classname = require("../utils/classname");
|
|
35
35
|
|
|
36
36
|
var Button =
|
|
37
37
|
/*#__PURE__*/
|
|
@@ -104,7 +104,7 @@ function (_PureComponent) {
|
|
|
104
104
|
type: htmlType,
|
|
105
105
|
className: className
|
|
106
106
|
}), loading && _react.default.createElement("span", {
|
|
107
|
-
className: (0, _styles.buttonClass)((0, _classname.
|
|
107
|
+
className: (0, _styles.buttonClass)((0, _classname.getDirectionClass)('spin'))
|
|
108
108
|
}, _react.default.createElement(_Spin.default, {
|
|
109
109
|
size: 12,
|
|
110
110
|
name: "ring",
|
package/css/Datum/Form.js
CHANGED
|
@@ -51,6 +51,7 @@ function () {
|
|
|
51
51
|
this.$events = {}; // handle global errors
|
|
52
52
|
|
|
53
53
|
this.$errors = {};
|
|
54
|
+
this.updateLock = false;
|
|
54
55
|
this.deepSetOptions = {
|
|
55
56
|
removeUndefined: removeUndefined,
|
|
56
57
|
forceSet: true
|
|
@@ -73,6 +74,10 @@ function () {
|
|
|
73
74
|
this.dispatch(_types.RESET_TOPIC);
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
_proto.setLock = function setLock(lock) {
|
|
78
|
+
this.updateLock = lock;
|
|
79
|
+
};
|
|
80
|
+
|
|
76
81
|
_proto.get = function get(name) {
|
|
77
82
|
var _this = this;
|
|
78
83
|
|
|
@@ -243,13 +248,20 @@ function () {
|
|
|
243
248
|
return (0, _clone.deepClone)(this.$values);
|
|
244
249
|
};
|
|
245
250
|
|
|
246
|
-
_proto.setValue = function setValue(
|
|
251
|
+
_proto.setValue = function setValue(v, type, forceSet) {
|
|
247
252
|
var _this6 = this;
|
|
248
253
|
|
|
249
|
-
if (
|
|
250
|
-
|
|
254
|
+
if (v === void 0) {
|
|
255
|
+
v = {};
|
|
251
256
|
}
|
|
252
257
|
|
|
258
|
+
var values = (0, _is.isObject)(v) ? v : {};
|
|
259
|
+
|
|
260
|
+
if (values !== v) {
|
|
261
|
+
console.warn('Form value must be an Object');
|
|
262
|
+
} // 兼容 value 传入 null 等错误等值
|
|
263
|
+
|
|
264
|
+
|
|
253
265
|
if (!forceSet && (0, _deepEql.default)(values, this.$values)) return;
|
|
254
266
|
this.$values = (0, _clone.deepClone)(values); // wait render end.
|
|
255
267
|
|
|
@@ -299,7 +311,9 @@ function () {
|
|
|
299
311
|
delete this.$inputNames[name];
|
|
300
312
|
delete this.$validator[name];
|
|
301
313
|
delete this.$errors[name];
|
|
302
|
-
delete this.$defaultValues[name];
|
|
314
|
+
delete this.$defaultValues[name]; // when setData due to unmount not delete value
|
|
315
|
+
|
|
316
|
+
if (this.updateLock) return;
|
|
303
317
|
if (!(0, _objects.deepHas)(this.$values, name)) return;
|
|
304
318
|
(0, _objects.deepRemove)(this.$values, name);
|
|
305
319
|
|
package/css/Datum/List.js
CHANGED
package/css/Datum/Tree.js
CHANGED
|
@@ -69,6 +69,12 @@ function () {
|
|
|
69
69
|
|
|
70
70
|
var _proto = _default.prototype;
|
|
71
71
|
|
|
72
|
+
_proto.updateDisabled = function updateDisabled(dis) {
|
|
73
|
+
this.disabled = dis || function () {
|
|
74
|
+
return false;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
72
78
|
_proto.bind = function bind(id, update) {
|
|
73
79
|
this.events[id] = update;
|
|
74
80
|
};
|
package/css/Datum/hoc.js
CHANGED
|
@@ -97,11 +97,14 @@ var _default = (0, _func.curry)(function (options, Origin) {
|
|
|
97
97
|
var _proto = _class.prototype;
|
|
98
98
|
|
|
99
99
|
_proto.componentDidMount = function componentDidMount() {
|
|
100
|
+
this.datum.setLock(false);
|
|
100
101
|
this.prevValues = this.props[key];
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
104
105
|
// update datum.onchange
|
|
106
|
+
this.datum.setLock(false);
|
|
107
|
+
|
|
105
108
|
if (prevProps.onChange !== this.props.onChange) {
|
|
106
109
|
this.datum.onChange = this.props.onChange;
|
|
107
110
|
}
|
|
@@ -126,7 +129,9 @@ var _default = (0, _func.curry)(function (options, Origin) {
|
|
|
126
129
|
var values = this.props[key];
|
|
127
130
|
|
|
128
131
|
if (type === 'form' && values !== this.prevValues) {
|
|
132
|
+
debugger;
|
|
129
133
|
this.setValue(this.props.initValidate ? undefined : _types.IGNORE_VALIDATE);
|
|
134
|
+
this.datum.setLock(true);
|
|
130
135
|
this.prevValues = values;
|
|
131
136
|
}
|
|
132
137
|
|
package/css/Form/index.d.ts
CHANGED
package/css/Form/styles/form.css
CHANGED
package/css/Select/Result.js
CHANGED
package/css/Select/Select.js
CHANGED
|
@@ -123,6 +123,14 @@ function (_PureComponent) {
|
|
|
123
123
|
return this.props.text[key] || (0, _locale.getLocale)(key);
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
_proto.getDisabledStatus = function getDisabledStatus() {
|
|
127
|
+
if (typeof this.props.disabled == 'function') {
|
|
128
|
+
return this.props.disabled;
|
|
129
|
+
} else {
|
|
130
|
+
return !!this.props.disabled;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
126
134
|
_proto.getFocusSelected = function getFocusSelected() {
|
|
127
135
|
var _this$props = this.props,
|
|
128
136
|
reFocus = _this$props.reFocus,
|
|
@@ -204,7 +212,7 @@ function (_PureComponent) {
|
|
|
204
212
|
};
|
|
205
213
|
|
|
206
214
|
_proto.handleState = function handleState(focus, e) {
|
|
207
|
-
if (this.
|
|
215
|
+
if (this.getDisabledStatus() === true) return;
|
|
208
216
|
if (focus === this.state.focus) return; // click close icon
|
|
209
217
|
|
|
210
218
|
if (focus && e && e.target.classList.contains((0, _styles.selectClass)('close'))) return;
|
|
@@ -239,13 +247,12 @@ function (_PureComponent) {
|
|
|
239
247
|
var _this$props4 = this.props,
|
|
240
248
|
datum = _this$props4.datum,
|
|
241
249
|
multiple = _this$props4.multiple,
|
|
242
|
-
disabled = _this$props4.disabled,
|
|
243
250
|
emptyAfterSelect = _this$props4.emptyAfterSelect,
|
|
244
251
|
onFilter = _this$props4.onFilter,
|
|
245
252
|
filterText = _this$props4.filterText,
|
|
246
253
|
onCreate = _this$props4.onCreate,
|
|
247
254
|
reFocus = _this$props4.reFocus;
|
|
248
|
-
if (
|
|
255
|
+
if (this.getDisabledStatus() === true) return; // if click option, ignore blur event
|
|
249
256
|
|
|
250
257
|
if (this.inputBlurTimer) {
|
|
251
258
|
this.lastChangeIsOptionClick = true;
|
|
@@ -591,7 +598,6 @@ function (_PureComponent) {
|
|
|
591
598
|
placeholder = _this$props12.placeholder,
|
|
592
599
|
multiple = _this$props12.multiple,
|
|
593
600
|
clearable = _this$props12.clearable,
|
|
594
|
-
disabled = _this$props12.disabled,
|
|
595
601
|
size = _this$props12.size,
|
|
596
602
|
onFilter = _this$props12.onFilter,
|
|
597
603
|
datum = _this$props12.datum,
|
|
@@ -608,6 +614,7 @@ function (_PureComponent) {
|
|
|
608
614
|
innerTitle = _this$props12.innerTitle,
|
|
609
615
|
keygen = _this$props12.keygen,
|
|
610
616
|
data = _this$props12.data;
|
|
617
|
+
var disabled = this.getDisabledStatus();
|
|
611
618
|
var className = (0, _styles.selectClass)('inner', size, this.state.focus && 'focus', this.state.position, multiple && 'multiple', disabled === true && (0, _classname.getDirectionClass)('disabled'), !trim && 'pre');
|
|
612
619
|
return _react.default.createElement("div", {
|
|
613
620
|
// eslint-disable-next-line
|
package/css/Table/SimpleTable.js
CHANGED
|
@@ -70,7 +70,11 @@ function (_PureComponent) {
|
|
|
70
70
|
|
|
71
71
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
72
72
|
this.scrollCheck();
|
|
73
|
-
var resize = prevProps.data.length === 0 && this.props.data.length;
|
|
73
|
+
var resize = prevProps.data.length === 0 && this.props.data.length; // when resize
|
|
74
|
+
|
|
75
|
+
if (resize && this.body) this.handleScroll({
|
|
76
|
+
currentTarget: this.body
|
|
77
|
+
});
|
|
74
78
|
var shouldResetColgroup = this.props.dataChangeResize && this.props.data !== prevProps.data;
|
|
75
79
|
|
|
76
80
|
if (resize || shouldResetColgroup || !(0, _shallowEqual.compareColumns)(prevProps.columns, this.props.columns)) {
|
package/css/Tree/Content.js
CHANGED
|
@@ -27,6 +27,8 @@ var _Spin = _interopRequireDefault(require("../Spin"));
|
|
|
27
27
|
|
|
28
28
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
29
29
|
|
|
30
|
+
var _types = require("../Datum/types");
|
|
31
|
+
|
|
30
32
|
var loading = _react.default.createElement("span", {
|
|
31
33
|
className: (0, _styles.treeClass)('icon-loading')
|
|
32
34
|
}, _react.default.createElement(_Spin.default, {
|
|
@@ -46,11 +48,26 @@ function (_PureComponent) {
|
|
|
46
48
|
_this.handleNodeClick = _this.handleNodeClick.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
47
49
|
_this.handleNodeExpand = _this.handleNodeExpand.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
48
50
|
_this.handleIndicatorClick = _this.handleIndicatorClick.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
51
|
+
_this.handleUpdate = _this.handleUpdate.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
49
52
|
return _this;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
var _proto = Content.prototype;
|
|
53
56
|
|
|
57
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
58
|
+
_PureComponent.prototype.componentDidMount.call(this);
|
|
59
|
+
|
|
60
|
+
var datum = this.props.datum;
|
|
61
|
+
datum.subscribe(_types.CHANGE_TOPIC, this.handleUpdate);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
65
|
+
_PureComponent.prototype.componentWillUnmount.call(this);
|
|
66
|
+
|
|
67
|
+
var datum = this.props.datum;
|
|
68
|
+
datum.unsubscribe(_types.CHANGE_TOPIC, this.handleUpdate);
|
|
69
|
+
};
|
|
70
|
+
|
|
54
71
|
_proto.handleNodeClick = function handleNodeClick() {
|
|
55
72
|
var _this$props = this.props,
|
|
56
73
|
data = _this$props.data,
|
|
@@ -67,6 +84,10 @@ function (_PureComponent) {
|
|
|
67
84
|
}
|
|
68
85
|
};
|
|
69
86
|
|
|
87
|
+
_proto.handleUpdate = function handleUpdate() {
|
|
88
|
+
this.forceUpdate();
|
|
89
|
+
};
|
|
90
|
+
|
|
70
91
|
_proto.handleNodeExpand = function handleNodeExpand() {
|
|
71
92
|
var _this$props2 = this.props,
|
|
72
93
|
data = _this$props2.data,
|
|
@@ -176,7 +197,8 @@ Content.propTypes = {
|
|
|
176
197
|
setFetching: _propTypes.default.func,
|
|
177
198
|
fetching: _propTypes.default.bool,
|
|
178
199
|
doubleClickExpand: _propTypes.default.bool,
|
|
179
|
-
iconClass: _propTypes.default.string
|
|
200
|
+
iconClass: _propTypes.default.string,
|
|
201
|
+
datum: _propTypes.default.object
|
|
180
202
|
};
|
|
181
203
|
var _default = Content;
|
|
182
204
|
exports.default = _default;
|
package/css/TreeSelect/Result.js
CHANGED
|
@@ -252,7 +252,7 @@ function (_PureComponent) {
|
|
|
252
252
|
key: "more",
|
|
253
253
|
className: (0, _styles.treeSelectClass)((0, _classname.getDirectionClass)('item'), 'item-compressed'),
|
|
254
254
|
popoverClassName: (0, _styles.treeSelectClass)('popover'),
|
|
255
|
-
contentClassName: (0, _classname.getDirectionClass)('result'),
|
|
255
|
+
contentClassName: (0, _styles.treeSelectClass)((0, _classname.getDirectionClass)('result')),
|
|
256
256
|
compressed: compressed,
|
|
257
257
|
data: items,
|
|
258
258
|
cls: _styles.treeSelectClass,
|
package/css/TreeSelect/datum.js
CHANGED
|
@@ -55,7 +55,8 @@ function datum(Origin) {
|
|
|
55
55
|
|
|
56
56
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
57
57
|
if (!(0, _shallowEqual.default)(prevProps.data, this.props.data)) {
|
|
58
|
-
this.datum.
|
|
58
|
+
this.datum.updateDisabled(this.props.disabled);
|
|
59
|
+
this.datum.setData(this.props.data, true);
|
|
59
60
|
this.forceUpdate();
|
|
60
61
|
}
|
|
61
62
|
};
|
package/css/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Created by scripts/src-index.js.
|
|
2
2
|
import * as utils from './utils'
|
|
3
3
|
|
|
4
|
-
export default { utils, version: '1.10.
|
|
4
|
+
export default { utils, version: '1.10.10' }
|
|
5
5
|
export { utils }
|
|
6
6
|
export { setLocale } from './locale'
|
|
7
7
|
export { color, style } from './utils/expose'
|