shineout 1.8.0 → 1.8.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/AnimationList/AbsoluteList.js +1 -1
- package/css/Button/Button.js +1 -1
- package/css/Cascader/Result.js +3 -2
- package/css/Cascader/styles/cascader.css +9 -1
- package/css/Checkbox/Group.js +6 -3
- package/css/Checkbox/index.d.ts +1 -1
- package/css/DatePicker/Month.js +7 -1
- package/css/Datum/Tree.js +2 -1
- package/css/Menu/Item.js +9 -1
- package/css/Menu/Root.js +10 -4
- package/css/Modal/events.js +6 -3
- package/css/Rule/index.d.ts +26 -3
- package/css/Scroll/Scroll.js +31 -11
- package/css/Select/Result.js +5 -4
- package/css/Select/styles/select.css +8 -4
- package/css/Table/SeperateTable.js +14 -8
- package/css/Table/SimpleTable.js +13 -7
- package/css/Table/Table.js +3 -1
- package/css/Table/resizable.js +1 -1
- package/css/Table/styles/table.css +8 -8
- package/css/Textarea/index.d.ts +34 -23
- package/css/Tooltip/styles/tooltip.css +31 -31
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/dist/shineout.js +215 -149
- 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/AnimationList/AbsoluteList.js +1 -1
- package/es/Button/Button.js +1 -1
- package/es/Cascader/Result.js +3 -2
- package/es/Cascader/styles/cascader.less +11 -1
- package/es/Checkbox/Group.js +6 -3
- package/es/Checkbox/index.d.ts +1 -1
- package/es/DatePicker/Month.js +7 -1
- package/es/Datum/Tree.js +2 -1
- package/es/Menu/Item.js +9 -1
- package/es/Menu/Root.js +9 -4
- package/es/Modal/events.js +6 -3
- package/es/Rule/index.d.ts +26 -3
- package/es/Scroll/Scroll.js +31 -11
- package/es/Select/Result.js +5 -4
- package/es/Select/styles/select.less +8 -3
- package/es/Table/SeperateTable.js +14 -8
- package/es/Table/SimpleTable.js +13 -7
- package/es/Table/Table.js +3 -1
- package/es/Table/resizable.js +1 -1
- package/es/Table/styles/table.less +1 -1
- package/es/Textarea/index.d.ts +34 -23
- package/es/Tooltip/styles/tooltip.less +7 -5
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/styles/themes/base.less +1 -1
- package/es/styles/themes/shineout.less +1 -1
- package/lib/AnimationList/AbsoluteList.js +1 -1
- package/lib/Button/Button.js +1 -1
- package/lib/Cascader/Result.js +3 -2
- package/lib/Cascader/styles/cascader.less +11 -1
- package/lib/Checkbox/Group.js +6 -3
- package/lib/Checkbox/index.d.ts +1 -1
- package/lib/DatePicker/Month.js +7 -1
- package/lib/Datum/Tree.js +2 -1
- package/lib/Menu/Item.js +9 -1
- package/lib/Menu/Root.js +10 -4
- package/lib/Modal/events.js +6 -3
- package/lib/Rule/index.d.ts +26 -3
- package/lib/Scroll/Scroll.js +31 -11
- package/lib/Select/Result.js +5 -4
- package/lib/Select/styles/select.less +8 -3
- package/lib/Table/SeperateTable.js +14 -8
- package/lib/Table/SimpleTable.js +13 -7
- package/lib/Table/Table.js +3 -1
- package/lib/Table/resizable.js +1 -1
- package/lib/Table/styles/table.less +1 -1
- package/lib/Textarea/index.d.ts +34 -23
- package/lib/Tooltip/styles/tooltip.less +7 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/styles/themes/base.less +1 -1
- package/lib/styles/themes/shineout.less +1 -1
- package/package.json +1 -1
|
@@ -115,8 +115,8 @@ function _default(List) {
|
|
|
115
115
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
116
116
|
var _this2 = this;
|
|
117
117
|
|
|
118
|
-
if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
|
|
119
118
|
if (!this.props.focus) this.ajustdoc = false;
|
|
119
|
+
if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
|
|
120
120
|
setTimeout(function () {
|
|
121
121
|
_this2.forceUpdate();
|
|
122
122
|
});
|
package/css/Button/Button.js
CHANGED
package/css/Cascader/Result.js
CHANGED
|
@@ -349,11 +349,12 @@ function (_PureComponent) {
|
|
|
349
349
|
compressed = _this$props8.compressed,
|
|
350
350
|
multiple = _this$props8.multiple;
|
|
351
351
|
var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
|
|
352
|
+
var clearEl = this.renderClear();
|
|
352
353
|
return _react.default.createElement("div", {
|
|
353
354
|
ref: this.bindResult,
|
|
354
|
-
className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed'),
|
|
355
|
+
className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
|
|
355
356
|
style: style
|
|
356
|
-
}, result, this.renderIndicator(),
|
|
357
|
+
}, result, this.renderIndicator(), clearEl);
|
|
357
358
|
};
|
|
358
359
|
|
|
359
360
|
return Result;
|
|
@@ -127,10 +127,18 @@
|
|
|
127
127
|
background-color: inherit;
|
|
128
128
|
color: inherit;
|
|
129
129
|
}
|
|
130
|
-
.so-cascader
|
|
130
|
+
.so-cascader-disabled .so-cascader-result .so-select-multi {
|
|
131
|
+
visibility: visible;
|
|
132
|
+
cursor: not-allowed;
|
|
133
|
+
}
|
|
134
|
+
.so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-close,
|
|
131
135
|
.so-cascader:not(.so-cascader-disabled) .so-cascader-result:hover .so-cascader-close {
|
|
132
136
|
display: block;
|
|
133
137
|
}
|
|
138
|
+
.so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-result-clearable .so-select-multi,
|
|
139
|
+
.so-cascader:not(.so-cascader-disabled) .so-cascader-result-clearable:hover .so-select-multi {
|
|
140
|
+
visibility: hidden;
|
|
141
|
+
}
|
|
134
142
|
.so-cascader-multiple .so-cascader-close {
|
|
135
143
|
right: 19px;
|
|
136
144
|
}
|
package/css/Checkbox/Group.js
CHANGED
|
@@ -108,12 +108,14 @@ function (_PureComponent) {
|
|
|
108
108
|
data = _this$props2.data,
|
|
109
109
|
datum = _this$props2.datum,
|
|
110
110
|
keygen = _this$props2.keygen,
|
|
111
|
-
children = _this$props2.children
|
|
111
|
+
children = _this$props2.children,
|
|
112
|
+
style = _this$props2.style;
|
|
112
113
|
var className = (0, _classnames.default)((0, _styles.checkinputClass)('group', ['no-block', 'block'][Number(block)]), this.props.className);
|
|
113
114
|
|
|
114
115
|
if (data === undefined) {
|
|
115
116
|
return _react.default.createElement("div", {
|
|
116
|
-
className: className
|
|
117
|
+
className: className,
|
|
118
|
+
style: style
|
|
117
119
|
}, _react.default.createElement(_context.Provider, {
|
|
118
120
|
value: {
|
|
119
121
|
onRawChange: this.handleRawChange,
|
|
@@ -123,7 +125,8 @@ function (_PureComponent) {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
return _react.default.createElement("div", {
|
|
126
|
-
className: className
|
|
128
|
+
className: className,
|
|
129
|
+
style: style
|
|
127
130
|
}, data.map(function (d, i) {
|
|
128
131
|
return _react.default.createElement(_Checkbox.default, {
|
|
129
132
|
checked: datum.check(d),
|
package/css/Checkbox/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
|
|
|
47
47
|
|
|
48
48
|
// attention: checkbox group value is array
|
|
49
49
|
|
|
50
|
-
export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'
|
|
50
|
+
export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'>, StandardProps {
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The data item
|
package/css/DatePicker/Month.js
CHANGED
|
@@ -76,7 +76,8 @@ function (_PureComponent) {
|
|
|
76
76
|
type = _this$props3.type,
|
|
77
77
|
current = _this$props3.current,
|
|
78
78
|
index = _this$props3.index,
|
|
79
|
-
rangeDate = _this$props3.rangeDate
|
|
79
|
+
rangeDate = _this$props3.rangeDate,
|
|
80
|
+
max = _this$props3.max;
|
|
80
81
|
|
|
81
82
|
var date = _utils.default.toDate(MONTHBASE);
|
|
82
83
|
|
|
@@ -84,6 +85,10 @@ function (_PureComponent) {
|
|
|
84
85
|
date.setFullYear(current.getFullYear());
|
|
85
86
|
var isDisabled = min && _utils.default.compareMonth(min, date, 1) >= 0;
|
|
86
87
|
|
|
88
|
+
if (!isDisabled) {
|
|
89
|
+
isDisabled = max && _utils.default.compareMonth(date, max, 1) >= 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
if (!isDisabled && type === 'month' && typeof disabled === 'function') {
|
|
88
93
|
isDisabled = disabled(date);
|
|
89
94
|
}
|
|
@@ -137,6 +142,7 @@ Month.propTypes = {
|
|
|
137
142
|
current: _propTypes.default.object.isRequired,
|
|
138
143
|
disabled: _propTypes.default.func,
|
|
139
144
|
// max: PropTypes.object,
|
|
145
|
+
max: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
140
146
|
min: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
141
147
|
onChange: _propTypes.default.func.isRequired,
|
|
142
148
|
onModeChange: _propTypes.default.func.isRequired,
|
package/css/Datum/Tree.js
CHANGED
|
@@ -303,7 +303,8 @@ function () {
|
|
|
303
303
|
var id = _this5.getKey(d, path[path.length - 1], i);
|
|
304
304
|
|
|
305
305
|
if (_this5.dataMap.get(id)) {
|
|
306
|
-
console.
|
|
306
|
+
console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
|
|
307
|
+
return;
|
|
307
308
|
}
|
|
308
309
|
|
|
309
310
|
_this5.dataMap.set(id, d);
|
package/css/Menu/Item.js
CHANGED
|
@@ -57,7 +57,9 @@ function (_PureComponent) {
|
|
|
57
57
|
|
|
58
58
|
var key = _this.getKey(props);
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var noop = function noop() {};
|
|
61
|
+
|
|
62
|
+
var _props$bindItem = props.bindItem(_this.id, noop, noop, noop),
|
|
61
63
|
activeUpdate = _props$bindItem[0],
|
|
62
64
|
openUpdate = _props$bindItem[1],
|
|
63
65
|
inPathUpdate = _props$bindItem[2];
|
|
@@ -79,6 +81,12 @@ function (_PureComponent) {
|
|
|
79
81
|
|
|
80
82
|
var _proto = Item.prototype;
|
|
81
83
|
|
|
84
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
85
|
+
_PureComponent.prototype.componentDidMount.call(this);
|
|
86
|
+
|
|
87
|
+
this.props.bindItem(this.id, this.update.bind(this), this.updateOpen.bind(this), this.updateInPath.bind(this));
|
|
88
|
+
};
|
|
89
|
+
|
|
82
90
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
83
91
|
_PureComponent.prototype.componentWillUnmount.call(this);
|
|
84
92
|
|
package/css/Menu/Root.js
CHANGED
|
@@ -37,6 +37,8 @@ var _is = require("../utils/is");
|
|
|
37
37
|
|
|
38
38
|
var _config = require("../config");
|
|
39
39
|
|
|
40
|
+
var _component = require("../component");
|
|
41
|
+
|
|
40
42
|
var modeDirection = {
|
|
41
43
|
'vertical-auto': 'y',
|
|
42
44
|
vertical: 'y',
|
|
@@ -78,13 +80,13 @@ function keyToMap(keys, value) {
|
|
|
78
80
|
|
|
79
81
|
var Root =
|
|
80
82
|
/*#__PURE__*/
|
|
81
|
-
function (
|
|
82
|
-
(0, _inheritsLoose2.default)(Root,
|
|
83
|
+
function (_Component) {
|
|
84
|
+
(0, _inheritsLoose2.default)(Root, _Component);
|
|
83
85
|
|
|
84
86
|
function Root(props) {
|
|
85
87
|
var _this;
|
|
86
88
|
|
|
87
|
-
_this =
|
|
89
|
+
_this = _Component.call(this, props) || this;
|
|
88
90
|
_this.state = {
|
|
89
91
|
activeKey: null,
|
|
90
92
|
scrollTop: 0,
|
|
@@ -115,6 +117,8 @@ function (_React$Component) {
|
|
|
115
117
|
var _proto = Root.prototype;
|
|
116
118
|
|
|
117
119
|
_proto.componentDidMount = function componentDidMount() {
|
|
120
|
+
_Component.prototype.componentDidMount.call(this);
|
|
121
|
+
|
|
118
122
|
this.updateState();
|
|
119
123
|
};
|
|
120
124
|
|
|
@@ -124,6 +128,8 @@ function (_React$Component) {
|
|
|
124
128
|
|
|
125
129
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
126
130
|
this.container.removeEventListener('wheel', this.handleWheel);
|
|
131
|
+
|
|
132
|
+
_Component.prototype.componentWillUnmount.call(this);
|
|
127
133
|
};
|
|
128
134
|
|
|
129
135
|
_proto.getOpenKeys = function getOpenKeys() {
|
|
@@ -419,7 +425,7 @@ function (_React$Component) {
|
|
|
419
425
|
};
|
|
420
426
|
|
|
421
427
|
return Root;
|
|
422
|
-
}(
|
|
428
|
+
}(_component.Component);
|
|
423
429
|
|
|
424
430
|
Root.propTypes = (0, _objectSpread2.default)({}, (0, _proptypes.getProps)(_propTypes.default, 'style', 'keygen'), {
|
|
425
431
|
active: _propTypes.default.func,
|
package/css/Modal/events.js
CHANGED
|
@@ -129,10 +129,13 @@ function open(props, isPortal) {
|
|
|
129
129
|
div.style.display = 'block';
|
|
130
130
|
var parsed = parseInt(zIndex, 10);
|
|
131
131
|
if (!Number.isNaN(parsed)) div.style.zIndex = parsed;
|
|
132
|
-
var scrollWidth = window.innerWidth - _document.docSize.width;
|
|
133
132
|
var doc = document.body.parentNode;
|
|
134
|
-
|
|
135
|
-
doc.style.paddingRight
|
|
133
|
+
|
|
134
|
+
if (!doc.style.paddingRight) {
|
|
135
|
+
var scrollWidth = window.innerWidth - _document.docSize.width;
|
|
136
|
+
doc.style.overflow = 'hidden';
|
|
137
|
+
doc.style.paddingRight = scrollWidth + "px";
|
|
138
|
+
}
|
|
136
139
|
|
|
137
140
|
var handleClose = function handleClose() {
|
|
138
141
|
if (onClose) onClose();
|
package/css/Rule/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface RuleParams {
|
|
|
51
51
|
} | validFunc | any) ;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams
|
|
54
|
+
export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void) | object>
|
|
55
55
|
|
|
56
56
|
export interface RuleResult {
|
|
57
57
|
required (message?: string): Required;
|
|
@@ -82,8 +82,31 @@ export interface RuleResult {
|
|
|
82
82
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
export interface paramFunc<U> {
|
|
86
|
+
(args?: U ): {args: U, func: validFunc, message?: string}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare function Rule<U>() : RuleResult
|
|
90
|
+
|
|
91
|
+
declare function Rule<A extends RuleParams, U>(a: A) : {
|
|
92
|
+
[P in keyof A]: paramFunc<U>
|
|
93
|
+
} & RuleResult
|
|
94
|
+
|
|
95
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, U>(a: A, b: B) : {
|
|
96
|
+
[P in keyof (A & B)]: paramFunc<U>
|
|
97
|
+
} & RuleResult
|
|
98
|
+
|
|
99
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, U>(a: A, b: B, c: C) : {
|
|
100
|
+
[P in keyof (A & B & C)]: paramFunc<U>
|
|
101
|
+
} & RuleResult
|
|
102
|
+
|
|
103
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, D extends RuleParams, U>(a: A, b: B, c: C, d: D) : {
|
|
104
|
+
[P in keyof (A & B & C & D)]: paramFunc<U>
|
|
105
|
+
} & RuleResult
|
|
106
|
+
|
|
107
|
+
declare function Rule<
|
|
108
|
+
U>(...args: RuleParams[]) : {
|
|
109
|
+
[key: string]: paramFunc<U>
|
|
87
110
|
} & RuleResult
|
|
88
111
|
|
|
89
112
|
|
package/css/Scroll/Scroll.js
CHANGED
|
@@ -67,6 +67,7 @@ function (_PureComponent) {
|
|
|
67
67
|
_this.handleTouchStart = _this.handleTouchStart.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
68
68
|
_this.handleTouchMove = _this.handleTouchMove.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
69
69
|
_this.setStartPoint = _this.setStartPoint.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
70
|
+
_this.handleInnerScroll = _this.handleInnerScroll.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
70
71
|
return _this;
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -85,6 +86,7 @@ function (_PureComponent) {
|
|
|
85
86
|
this.wheelElement.addEventListener('touchmove', this.handleTouchMove, {
|
|
86
87
|
passive: false
|
|
87
88
|
});
|
|
89
|
+
this.inner.addEventListener('scroll', this.handleInnerScroll);
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
@@ -101,6 +103,7 @@ function (_PureComponent) {
|
|
|
101
103
|
this.wheelElement.removeEventListener('wheel', this.handleWheel);
|
|
102
104
|
this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
|
|
103
105
|
this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
|
|
106
|
+
this.inner.removeEventListener('scroll', this.handleInnerScroll);
|
|
104
107
|
};
|
|
105
108
|
|
|
106
109
|
_proto.getWheelRect = function getWheelRect() {
|
|
@@ -280,22 +283,39 @@ function (_PureComponent) {
|
|
|
280
283
|
|
|
281
284
|
this.setStartPoint(position);
|
|
282
285
|
this.boundleScroll();
|
|
283
|
-
}
|
|
286
|
+
} // inner scroll
|
|
287
|
+
;
|
|
284
288
|
|
|
285
|
-
_proto.
|
|
289
|
+
_proto.handleInnerScroll = function handleInnerScroll(e) {
|
|
290
|
+
var target = e.target;
|
|
286
291
|
var _this$props6 = this.props,
|
|
287
|
-
children = _this$props6.children,
|
|
288
|
-
scrollWidth = _this$props6.scrollWidth,
|
|
289
|
-
scrollHeight = _this$props6.scrollHeight,
|
|
290
292
|
left = _this$props6.left,
|
|
291
|
-
|
|
292
|
-
scrollX = _this$props6.scrollX,
|
|
293
|
-
scrollY = _this$props6.scrollY,
|
|
294
|
-
style = _this$props6.style;
|
|
293
|
+
scrollWidth = _this$props6.scrollWidth;
|
|
295
294
|
|
|
296
295
|
var _this$getWheelRect2 = this.getWheelRect(),
|
|
297
|
-
width = _this$getWheelRect2.width
|
|
298
|
-
|
|
296
|
+
width = _this$getWheelRect2.width;
|
|
297
|
+
|
|
298
|
+
if (target.scrollLeft) {
|
|
299
|
+
this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
|
|
300
|
+
target.scrollLeft = 0;
|
|
301
|
+
target.scrollTop = 0;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
_proto.render = function render() {
|
|
306
|
+
var _this$props7 = this.props,
|
|
307
|
+
children = _this$props7.children,
|
|
308
|
+
scrollWidth = _this$props7.scrollWidth,
|
|
309
|
+
scrollHeight = _this$props7.scrollHeight,
|
|
310
|
+
left = _this$props7.left,
|
|
311
|
+
top = _this$props7.top,
|
|
312
|
+
scrollX = _this$props7.scrollX,
|
|
313
|
+
scrollY = _this$props7.scrollY,
|
|
314
|
+
style = _this$props7.style;
|
|
315
|
+
|
|
316
|
+
var _this$getWheelRect3 = this.getWheelRect(),
|
|
317
|
+
width = _this$getWheelRect3.width,
|
|
318
|
+
height = _this$getWheelRect3.height;
|
|
299
319
|
|
|
300
320
|
var rtl = (0, _config.isRTL)();
|
|
301
321
|
var className = (0, _classnames.default)((0, _styles.scrollClass)('_', scrollX && 'show-x', scrollY && 'show-y', rtl && 'rtl'), this.props.className);
|
package/css/Select/Result.js
CHANGED
|
@@ -362,18 +362,19 @@ function (_PureComponent) {
|
|
|
362
362
|
var showPlaceholder = this.isEmptyResult();
|
|
363
363
|
var result = showPlaceholder ? this.renderPlaceholder() : this.renderResult();
|
|
364
364
|
var rtl = (0, _config.isRTL)();
|
|
365
|
+
var clearEl = this.renderClear();
|
|
365
366
|
|
|
366
367
|
if (rtl) {
|
|
367
368
|
return _react.default.createElement("div", {
|
|
368
369
|
ref: this.bindResult,
|
|
369
|
-
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
370
|
-
},
|
|
370
|
+
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
371
|
+
}, clearEl, this.renderIndicator(), result);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
return _react.default.createElement("div", {
|
|
374
375
|
ref: this.bindResult,
|
|
375
|
-
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
376
|
-
}, result, this.renderIndicator(),
|
|
376
|
+
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
377
|
+
}, result, this.renderIndicator(), clearEl);
|
|
377
378
|
};
|
|
378
379
|
|
|
379
380
|
return Result;
|
|
@@ -170,10 +170,6 @@
|
|
|
170
170
|
margin-top: -5px;
|
|
171
171
|
}
|
|
172
172
|
.so-select-indicator.so-select-close {
|
|
173
|
-
-webkit-box-sizing: content-box;
|
|
174
|
-
box-sizing: content-box;
|
|
175
|
-
border-left: 1px solid #fff;
|
|
176
|
-
border-right: 1px solid #fff;
|
|
177
173
|
display: none;
|
|
178
174
|
background: var(--select-clear-bg-color, #94a1ae);
|
|
179
175
|
border-radius: 6px;
|
|
@@ -247,6 +243,10 @@
|
|
|
247
243
|
.so-select-result:hover .so-select-close {
|
|
248
244
|
display: block;
|
|
249
245
|
}
|
|
246
|
+
.so-select-focus .so-select-result-clearable .so-select-multi,
|
|
247
|
+
.so-select-result-clearable:hover .so-select-multi {
|
|
248
|
+
visibility: hidden;
|
|
249
|
+
}
|
|
250
250
|
.so-select-focus .so-select-caret {
|
|
251
251
|
-webkit-transform: rotate(180deg);
|
|
252
252
|
-ms-transform: rotate(180deg);
|
|
@@ -512,6 +512,10 @@ span.so-select-option {
|
|
|
512
512
|
.so-select-disabled .so-select-result .so-select-item .so-select-close {
|
|
513
513
|
display: none;
|
|
514
514
|
}
|
|
515
|
+
.so-select-disabled .so-select-result .so-select-multi {
|
|
516
|
+
visibility: visible;
|
|
517
|
+
cursor: not-allowed;
|
|
518
|
+
}
|
|
515
519
|
.so-select-root {
|
|
516
520
|
position: absolute;
|
|
517
521
|
top: 0;
|
|
@@ -344,13 +344,17 @@ function (_PureComponent) {
|
|
|
344
344
|
|
|
345
345
|
|
|
346
346
|
if (treeColumnsName && changedByExpand) {
|
|
347
|
+
// Blank space may appear after clicking the top or bottom collapse button
|
|
347
348
|
if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
if (fullHeight <= scrollHeight) {
|
|
350
|
+
index = 0;
|
|
351
|
+
} else {
|
|
352
|
+
this.tbody.style.marginTop = scrollHeight + "px";
|
|
353
|
+
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
|
|
354
|
+
this.lastScrollTop = fullHeight;
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
351
357
|
}
|
|
352
|
-
|
|
353
|
-
return;
|
|
354
358
|
}
|
|
355
359
|
|
|
356
360
|
if (index === 0) {
|
|
@@ -631,7 +635,8 @@ function (_PureComponent) {
|
|
|
631
635
|
rowHeight = _this$props7.rowHeight,
|
|
632
636
|
columnResizable = _this$props7.columnResizable,
|
|
633
637
|
innerScrollAttr = _this$props7.innerScrollAttr,
|
|
634
|
-
|
|
638
|
+
bordered = _this$props7.bordered,
|
|
639
|
+
others = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr", "bordered"]);
|
|
635
640
|
var _this$state3 = this.state,
|
|
636
641
|
colgroup = _this$state3.colgroup,
|
|
637
642
|
scrollTop = _this$state3.scrollTop,
|
|
@@ -677,7 +682,7 @@ function (_PureComponent) {
|
|
|
677
682
|
height: prevHeight
|
|
678
683
|
}
|
|
679
684
|
}), _react.default.createElement("table", {
|
|
680
|
-
className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init'),
|
|
685
|
+
className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init', bordered && 'table-bordered'),
|
|
681
686
|
style: {
|
|
682
687
|
width: width
|
|
683
688
|
},
|
|
@@ -720,7 +725,8 @@ function (_PureComponent) {
|
|
|
720
725
|
style: {
|
|
721
726
|
width: width
|
|
722
727
|
},
|
|
723
|
-
ref: this.bindThead
|
|
728
|
+
ref: this.bindThead,
|
|
729
|
+
className: (0, _styles.tableClass)('table-bordered')
|
|
724
730
|
}, _react.default.createElement(_Colgroup.default, {
|
|
725
731
|
colgroup: colgroup,
|
|
726
732
|
columns: columns,
|
package/css/Table/SimpleTable.js
CHANGED
|
@@ -166,7 +166,8 @@ function (_PureComponent) {
|
|
|
166
166
|
data = _this$props2.data,
|
|
167
167
|
onResize = _this$props2.onResize,
|
|
168
168
|
columnResizable = _this$props2.columnResizable,
|
|
169
|
-
sticky = _this$props2.sticky
|
|
169
|
+
sticky = _this$props2.sticky,
|
|
170
|
+
bordered = _this$props2.bordered;
|
|
170
171
|
var _this$state = this.state,
|
|
171
172
|
colgroup = _this$state.colgroup,
|
|
172
173
|
scrollAble = _this$state.scrollAble;
|
|
@@ -174,7 +175,8 @@ function (_PureComponent) {
|
|
|
174
175
|
var inner = _react.default.createElement("table", {
|
|
175
176
|
style: {
|
|
176
177
|
width: width
|
|
177
|
-
}
|
|
178
|
+
},
|
|
179
|
+
className: (0, _styles.tableClass)(bordered && 'table-bordered')
|
|
178
180
|
}, _react.default.createElement(_Colgroup.default, {
|
|
179
181
|
colgroup: colgroup,
|
|
180
182
|
columns: columns,
|
|
@@ -214,7 +216,8 @@ function (_PureComponent) {
|
|
|
214
216
|
width = _this$props3.width,
|
|
215
217
|
fixed = _this$props3.fixed,
|
|
216
218
|
columnResizable = _this$props3.columnResizable,
|
|
217
|
-
|
|
219
|
+
bordered = _this$props3.bordered,
|
|
220
|
+
others = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["columns", "width", "fixed", "columnResizable", "bordered"]);
|
|
218
221
|
var _this$state2 = this.state,
|
|
219
222
|
colgroup = _this$state2.colgroup,
|
|
220
223
|
resize = _this$state2.resize;
|
|
@@ -230,7 +233,7 @@ function (_PureComponent) {
|
|
|
230
233
|
style: {
|
|
231
234
|
width: width
|
|
232
235
|
},
|
|
233
|
-
className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init')
|
|
236
|
+
className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init', bordered && 'table-bordered')
|
|
234
237
|
}, _react.default.createElement(_Colgroup.default, {
|
|
235
238
|
colgroup: colgroup,
|
|
236
239
|
columns: columns,
|
|
@@ -250,11 +253,13 @@ function (_PureComponent) {
|
|
|
250
253
|
columns = _this$props4.columns,
|
|
251
254
|
width = _this$props4.width,
|
|
252
255
|
children = _this$props4.children,
|
|
253
|
-
hideHeader = _this$props4.hideHeader
|
|
256
|
+
hideHeader = _this$props4.hideHeader,
|
|
257
|
+
bordered = _this$props4.bordered;
|
|
254
258
|
if (!columns || columns.length === 0) return _react.default.createElement("table", {
|
|
255
259
|
style: {
|
|
256
260
|
width: width
|
|
257
|
-
}
|
|
261
|
+
},
|
|
262
|
+
className: (0, _styles.tableClass)(bordered && 'table-bordered')
|
|
258
263
|
}, children);
|
|
259
264
|
return [hideHeader ? null : this.renderHeader(), this.renderBody(), children];
|
|
260
265
|
};
|
|
@@ -273,7 +278,8 @@ SimpleTable.propTypes = {
|
|
|
273
278
|
dataChangeResize: _propTypes.default.bool,
|
|
274
279
|
columnResizable: _propTypes.default.bool,
|
|
275
280
|
sticky: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.bool]),
|
|
276
|
-
hideHeader: _propTypes.default.bool
|
|
281
|
+
hideHeader: _propTypes.default.bool,
|
|
282
|
+
bordered: _propTypes.default.bool
|
|
277
283
|
};
|
|
278
284
|
SimpleTable.defaultProps = {
|
|
279
285
|
data: undefined,
|
package/css/Table/Table.js
CHANGED
|
@@ -163,7 +163,9 @@ function (_Component) {
|
|
|
163
163
|
className: className,
|
|
164
164
|
ref: this.bindTable,
|
|
165
165
|
style: newStyle
|
|
166
|
-
}, events), _react.default.createElement(RenderTable,
|
|
166
|
+
}, events), _react.default.createElement(RenderTable, (0, _extends2.default)({}, props, {
|
|
167
|
+
bordered: bordered
|
|
168
|
+
})), loading && _react.default.createElement("div", {
|
|
167
169
|
className: (0, _styles.tableClass)('loading')
|
|
168
170
|
}, typeof loading === 'boolean' ? _react.default.createElement(_Spin.default, {
|
|
169
171
|
size: 40
|
package/css/Table/resizable.js
CHANGED
|
@@ -79,7 +79,7 @@ var _default = function _default(Table) {
|
|
|
79
79
|
var onColumnResize = this.props.onColumnResize;
|
|
80
80
|
var changed = (0, _immer.default)(this.state, function (draft) {
|
|
81
81
|
var column = draft.columns[index];
|
|
82
|
-
draft.delta += parseFloat(width - (column.width || 0));
|
|
82
|
+
draft.delta += parseFloat(width - (column.width || colgroup[index] || 0));
|
|
83
83
|
colgroup[index] = width;
|
|
84
84
|
draft.columns.forEach(function (col, i) {
|
|
85
85
|
var w = colgroup[i];
|
|
@@ -237,19 +237,19 @@ table > thead > tr > th.so-table-condensed {
|
|
|
237
237
|
.so-table-bordered .so-table-head table {
|
|
238
238
|
border-bottom-width: 1px;
|
|
239
239
|
}
|
|
240
|
-
.so-table-bordered table > thead > tr > th,
|
|
241
|
-
.so-table-bordered table > tbody > tr > th,
|
|
242
|
-
.so-table-bordered table > tfoot > tr > th,
|
|
243
|
-
.so-table-bordered table > thead > tr > td,
|
|
244
|
-
.so-table-bordered table > tbody > tr > td,
|
|
245
|
-
.so-table-bordered table > tfoot > tr > td {
|
|
240
|
+
.so-table-bordered .so-table-table-bordered > thead > tr > th,
|
|
241
|
+
.so-table-bordered .so-table-table-bordered > tbody > tr > th,
|
|
242
|
+
.so-table-bordered .so-table-table-bordered > tfoot > tr > th,
|
|
243
|
+
.so-table-bordered .so-table-table-bordered > thead > tr > td,
|
|
244
|
+
.so-table-bordered .so-table-table-bordered > tbody > tr > td,
|
|
245
|
+
.so-table-bordered .so-table-table-bordered > tfoot > tr > td {
|
|
246
246
|
border-right: 1px solid var(--table-border-color, #ddd);
|
|
247
247
|
border-bottom-width: 1px;
|
|
248
248
|
}
|
|
249
|
-
.so-table-bordered table > tbody > tr > td.so-table-ignore-bottom-border {
|
|
249
|
+
.so-table-bordered .so-table-table-bordered > tbody > tr > td.so-table-ignore-bottom-border {
|
|
250
250
|
border-bottom: none;
|
|
251
251
|
}
|
|
252
|
-
.so-table-bordered table > thead + tbody > tr:first-child > td {
|
|
252
|
+
.so-table-bordered .so-table-table-bordered > thead + tbody > tr:first-child > td {
|
|
253
253
|
border-top-width: 1px;
|
|
254
254
|
}
|
|
255
255
|
.so-table-bordered .so-table-body table {
|