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
|
@@ -89,8 +89,8 @@ export default function (List) {
|
|
|
89
89
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
90
90
|
var _this2 = this;
|
|
91
91
|
|
|
92
|
-
if (shallowEqual(prevProps.value, this.props.value)) return;
|
|
93
92
|
if (!this.props.focus) this.ajustdoc = false;
|
|
93
|
+
if (shallowEqual(prevProps.value, this.props.value)) return;
|
|
94
94
|
setTimeout(function () {
|
|
95
95
|
_this2.forceUpdate();
|
|
96
96
|
});
|
package/es/Button/Button.js
CHANGED
package/es/Cascader/Result.js
CHANGED
|
@@ -324,11 +324,12 @@ function (_PureComponent) {
|
|
|
324
324
|
compressed = _this$props8.compressed,
|
|
325
325
|
multiple = _this$props8.multiple;
|
|
326
326
|
var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
|
|
327
|
+
var clearEl = this.renderClear();
|
|
327
328
|
return React.createElement("div", {
|
|
328
329
|
ref: this.bindResult,
|
|
329
|
-
className: cascaderClass('result', multiple && compressed && 'compressed'),
|
|
330
|
+
className: cascaderClass('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
|
|
330
331
|
style: style
|
|
331
|
-
}, result, this.renderIndicator(),
|
|
332
|
+
}, result, this.renderIndicator(), clearEl);
|
|
332
333
|
};
|
|
333
334
|
|
|
334
335
|
return Result;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@list-prefix: ~'@{so-prefix}-list';
|
|
6
6
|
@checkinput-prefix: ~'@{so-prefix}-checkinput';
|
|
7
7
|
@input-prefix: ~'@{so-prefix}-input';
|
|
8
|
+
@select-prefix: ~'@{so-prefix}-select';
|
|
8
9
|
|
|
9
10
|
.@{cascader-prefix} {
|
|
10
11
|
position: relative;
|
|
@@ -127,13 +128,22 @@
|
|
|
127
128
|
background-color: inherit;
|
|
128
129
|
color: inherit;
|
|
129
130
|
}
|
|
131
|
+
.@{select-prefix}-multi {
|
|
132
|
+
visibility: visible;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
}
|
|
130
135
|
}
|
|
131
136
|
|
|
132
137
|
&:not(&-disabled) {
|
|
133
|
-
|
|
138
|
+
&.@{cascader-prefix}-focus .@{cascader-prefix}-close,
|
|
134
139
|
.@{cascader-prefix}-result:hover .@{cascader-prefix}-close {
|
|
135
140
|
display: block;
|
|
136
141
|
}
|
|
142
|
+
|
|
143
|
+
&.@{cascader-prefix}-focus .@{cascader-prefix}-result-clearable .@{select-prefix}-multi,
|
|
144
|
+
.@{cascader-prefix}-result-clearable:hover .@{select-prefix}-multi {
|
|
145
|
+
visibility: hidden;
|
|
146
|
+
}
|
|
137
147
|
}
|
|
138
148
|
|
|
139
149
|
&-multiple {
|
package/es/Checkbox/Group.js
CHANGED
|
@@ -89,12 +89,14 @@ function (_PureComponent) {
|
|
|
89
89
|
data = _this$props2.data,
|
|
90
90
|
datum = _this$props2.datum,
|
|
91
91
|
keygen = _this$props2.keygen,
|
|
92
|
-
children = _this$props2.children
|
|
92
|
+
children = _this$props2.children,
|
|
93
|
+
style = _this$props2.style;
|
|
93
94
|
var className = classnames(checkinputClass('group', ['no-block', 'block'][Number(block)]), this.props.className);
|
|
94
95
|
|
|
95
96
|
if (data === undefined) {
|
|
96
97
|
return React.createElement("div", {
|
|
97
|
-
className: className
|
|
98
|
+
className: className,
|
|
99
|
+
style: style
|
|
98
100
|
}, React.createElement(Provider, {
|
|
99
101
|
value: {
|
|
100
102
|
onRawChange: this.handleRawChange,
|
|
@@ -104,7 +106,8 @@ function (_PureComponent) {
|
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
return React.createElement("div", {
|
|
107
|
-
className: className
|
|
109
|
+
className: className,
|
|
110
|
+
style: style
|
|
108
111
|
}, data.map(function (d, i) {
|
|
109
112
|
return React.createElement(Checkbox, {
|
|
110
113
|
checked: datum.check(d),
|
package/es/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/es/DatePicker/Month.js
CHANGED
|
@@ -58,12 +58,17 @@ function (_PureComponent) {
|
|
|
58
58
|
type = _this$props3.type,
|
|
59
59
|
current = _this$props3.current,
|
|
60
60
|
index = _this$props3.index,
|
|
61
|
-
rangeDate = _this$props3.rangeDate
|
|
61
|
+
rangeDate = _this$props3.rangeDate,
|
|
62
|
+
max = _this$props3.max;
|
|
62
63
|
var date = utils.toDate(MONTHBASE);
|
|
63
64
|
date.setMonth(i);
|
|
64
65
|
date.setFullYear(current.getFullYear());
|
|
65
66
|
var isDisabled = min && utils.compareMonth(min, date, 1) >= 0;
|
|
66
67
|
|
|
68
|
+
if (!isDisabled) {
|
|
69
|
+
isDisabled = max && utils.compareMonth(date, max, 1) >= 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
if (!isDisabled && type === 'month' && typeof disabled === 'function') {
|
|
68
73
|
isDisabled = disabled(date);
|
|
69
74
|
}
|
|
@@ -117,6 +122,7 @@ Month.propTypes = {
|
|
|
117
122
|
current: PropTypes.object.isRequired,
|
|
118
123
|
disabled: PropTypes.func,
|
|
119
124
|
// max: PropTypes.object,
|
|
125
|
+
max: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
120
126
|
min: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
121
127
|
onChange: PropTypes.func.isRequired,
|
|
122
128
|
onModeChange: PropTypes.func.isRequired,
|
package/es/Datum/Tree.js
CHANGED
|
@@ -296,7 +296,8 @@ function () {
|
|
|
296
296
|
var id = _this5.getKey(d, path[path.length - 1], i);
|
|
297
297
|
|
|
298
298
|
if (_this5.dataMap.get(id)) {
|
|
299
|
-
console.
|
|
299
|
+
console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
|
|
300
|
+
return;
|
|
300
301
|
}
|
|
301
302
|
|
|
302
303
|
_this5.dataMap.set(id, d);
|
package/es/Menu/Item.js
CHANGED
|
@@ -35,7 +35,9 @@ function (_PureComponent) {
|
|
|
35
35
|
|
|
36
36
|
var key = _this.getKey(props);
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var noop = function noop() {};
|
|
39
|
+
|
|
40
|
+
var _props$bindItem = props.bindItem(_this.id, noop, noop, noop),
|
|
39
41
|
activeUpdate = _props$bindItem[0],
|
|
40
42
|
openUpdate = _props$bindItem[1],
|
|
41
43
|
inPathUpdate = _props$bindItem[2];
|
|
@@ -57,6 +59,12 @@ function (_PureComponent) {
|
|
|
57
59
|
|
|
58
60
|
var _proto = Item.prototype;
|
|
59
61
|
|
|
62
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
63
|
+
_PureComponent.prototype.componentDidMount.call(this);
|
|
64
|
+
|
|
65
|
+
this.props.bindItem(this.id, this.update.bind(this), this.updateOpen.bind(this), this.updateInPath.bind(this));
|
|
66
|
+
};
|
|
67
|
+
|
|
60
68
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
61
69
|
_PureComponent.prototype.componentWillUnmount.call(this);
|
|
62
70
|
|
package/es/Menu/Root.js
CHANGED
|
@@ -14,6 +14,7 @@ import List from './List';
|
|
|
14
14
|
import { Provider } from './context';
|
|
15
15
|
import { isArray } from '../utils/is';
|
|
16
16
|
import { isRTL } from '../config';
|
|
17
|
+
import { Component } from '../component';
|
|
17
18
|
var modeDirection = {
|
|
18
19
|
'vertical-auto': 'y',
|
|
19
20
|
vertical: 'y',
|
|
@@ -55,13 +56,13 @@ function keyToMap(keys, value) {
|
|
|
55
56
|
|
|
56
57
|
var Root =
|
|
57
58
|
/*#__PURE__*/
|
|
58
|
-
function (
|
|
59
|
-
_inheritsLoose(Root,
|
|
59
|
+
function (_Component) {
|
|
60
|
+
_inheritsLoose(Root, _Component);
|
|
60
61
|
|
|
61
62
|
function Root(props) {
|
|
62
63
|
var _this;
|
|
63
64
|
|
|
64
|
-
_this =
|
|
65
|
+
_this = _Component.call(this, props) || this;
|
|
65
66
|
_this.state = {
|
|
66
67
|
activeKey: null,
|
|
67
68
|
scrollTop: 0,
|
|
@@ -92,6 +93,8 @@ function (_React$Component) {
|
|
|
92
93
|
var _proto = Root.prototype;
|
|
93
94
|
|
|
94
95
|
_proto.componentDidMount = function componentDidMount() {
|
|
96
|
+
_Component.prototype.componentDidMount.call(this);
|
|
97
|
+
|
|
95
98
|
this.updateState();
|
|
96
99
|
};
|
|
97
100
|
|
|
@@ -101,6 +104,8 @@ function (_React$Component) {
|
|
|
101
104
|
|
|
102
105
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
103
106
|
this.container.removeEventListener('wheel', this.handleWheel);
|
|
107
|
+
|
|
108
|
+
_Component.prototype.componentWillUnmount.call(this);
|
|
104
109
|
};
|
|
105
110
|
|
|
106
111
|
_proto.getOpenKeys = function getOpenKeys() {
|
|
@@ -396,7 +401,7 @@ function (_React$Component) {
|
|
|
396
401
|
};
|
|
397
402
|
|
|
398
403
|
return Root;
|
|
399
|
-
}(
|
|
404
|
+
}(Component);
|
|
400
405
|
|
|
401
406
|
Root.propTypes = _objectSpread({}, getProps(PropTypes, 'style', 'keygen'), {
|
|
402
407
|
active: PropTypes.func,
|
package/es/Modal/events.js
CHANGED
|
@@ -101,10 +101,13 @@ export function open(props, isPortal) {
|
|
|
101
101
|
div.style.display = 'block';
|
|
102
102
|
var parsed = parseInt(zIndex, 10);
|
|
103
103
|
if (!Number.isNaN(parsed)) div.style.zIndex = parsed;
|
|
104
|
-
var scrollWidth = window.innerWidth - docSize.width;
|
|
105
104
|
var doc = document.body.parentNode;
|
|
106
|
-
|
|
107
|
-
doc.style.paddingRight
|
|
105
|
+
|
|
106
|
+
if (!doc.style.paddingRight) {
|
|
107
|
+
var scrollWidth = window.innerWidth - docSize.width;
|
|
108
|
+
doc.style.overflow = 'hidden';
|
|
109
|
+
doc.style.paddingRight = scrollWidth + "px";
|
|
110
|
+
}
|
|
108
111
|
|
|
109
112
|
var handleClose = function handleClose() {
|
|
110
113
|
if (onClose) onClose();
|
package/es/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/es/Scroll/Scroll.js
CHANGED
|
@@ -43,6 +43,7 @@ function (_PureComponent) {
|
|
|
43
43
|
_this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
44
44
|
_this.handleTouchMove = _this.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
45
45
|
_this.setStartPoint = _this.setStartPoint.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
46
|
+
_this.handleInnerScroll = _this.handleInnerScroll.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
46
47
|
return _this;
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -61,6 +62,7 @@ function (_PureComponent) {
|
|
|
61
62
|
this.wheelElement.addEventListener('touchmove', this.handleTouchMove, {
|
|
62
63
|
passive: false
|
|
63
64
|
});
|
|
65
|
+
this.inner.addEventListener('scroll', this.handleInnerScroll);
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
@@ -77,6 +79,7 @@ function (_PureComponent) {
|
|
|
77
79
|
this.wheelElement.removeEventListener('wheel', this.handleWheel);
|
|
78
80
|
this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
|
|
79
81
|
this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
|
|
82
|
+
this.inner.removeEventListener('scroll', this.handleInnerScroll);
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
_proto.getWheelRect = function getWheelRect() {
|
|
@@ -256,22 +259,39 @@ function (_PureComponent) {
|
|
|
256
259
|
|
|
257
260
|
this.setStartPoint(position);
|
|
258
261
|
this.boundleScroll();
|
|
259
|
-
}
|
|
262
|
+
} // inner scroll
|
|
263
|
+
;
|
|
260
264
|
|
|
261
|
-
_proto.
|
|
265
|
+
_proto.handleInnerScroll = function handleInnerScroll(e) {
|
|
266
|
+
var target = e.target;
|
|
262
267
|
var _this$props6 = this.props,
|
|
263
|
-
children = _this$props6.children,
|
|
264
|
-
scrollWidth = _this$props6.scrollWidth,
|
|
265
|
-
scrollHeight = _this$props6.scrollHeight,
|
|
266
268
|
left = _this$props6.left,
|
|
267
|
-
|
|
268
|
-
scrollX = _this$props6.scrollX,
|
|
269
|
-
scrollY = _this$props6.scrollY,
|
|
270
|
-
style = _this$props6.style;
|
|
269
|
+
scrollWidth = _this$props6.scrollWidth;
|
|
271
270
|
|
|
272
271
|
var _this$getWheelRect2 = this.getWheelRect(),
|
|
273
|
-
width = _this$getWheelRect2.width
|
|
274
|
-
|
|
272
|
+
width = _this$getWheelRect2.width;
|
|
273
|
+
|
|
274
|
+
if (target.scrollLeft) {
|
|
275
|
+
this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
|
|
276
|
+
target.scrollLeft = 0;
|
|
277
|
+
target.scrollTop = 0;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
_proto.render = function render() {
|
|
282
|
+
var _this$props7 = this.props,
|
|
283
|
+
children = _this$props7.children,
|
|
284
|
+
scrollWidth = _this$props7.scrollWidth,
|
|
285
|
+
scrollHeight = _this$props7.scrollHeight,
|
|
286
|
+
left = _this$props7.left,
|
|
287
|
+
top = _this$props7.top,
|
|
288
|
+
scrollX = _this$props7.scrollX,
|
|
289
|
+
scrollY = _this$props7.scrollY,
|
|
290
|
+
style = _this$props7.style;
|
|
291
|
+
|
|
292
|
+
var _this$getWheelRect3 = this.getWheelRect(),
|
|
293
|
+
width = _this$getWheelRect3.width,
|
|
294
|
+
height = _this$getWheelRect3.height;
|
|
275
295
|
|
|
276
296
|
var rtl = isRTL();
|
|
277
297
|
var className = classnames(scrollClass('_', scrollX && 'show-x', scrollY && 'show-y', rtl && 'rtl'), this.props.className);
|
package/es/Select/Result.js
CHANGED
|
@@ -338,18 +338,19 @@ function (_PureComponent) {
|
|
|
338
338
|
var showPlaceholder = this.isEmptyResult();
|
|
339
339
|
var result = showPlaceholder ? this.renderPlaceholder() : this.renderResult();
|
|
340
340
|
var rtl = isRTL();
|
|
341
|
+
var clearEl = this.renderClear();
|
|
341
342
|
|
|
342
343
|
if (rtl) {
|
|
343
344
|
return React.createElement("div", {
|
|
344
345
|
ref: this.bindResult,
|
|
345
|
-
className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
346
|
-
},
|
|
346
|
+
className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
347
|
+
}, clearEl, this.renderIndicator(), result);
|
|
347
348
|
}
|
|
348
349
|
|
|
349
350
|
return React.createElement("div", {
|
|
350
351
|
ref: this.bindResult,
|
|
351
|
-
className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
352
|
-
}, result, this.renderIndicator(),
|
|
352
|
+
className: selectClass('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
353
|
+
}, result, this.renderIndicator(), clearEl);
|
|
353
354
|
};
|
|
354
355
|
|
|
355
356
|
return Result;
|
|
@@ -176,9 +176,6 @@
|
|
|
176
176
|
margin-top: -5px;
|
|
177
177
|
|
|
178
178
|
&.@{select-prefix}-close {
|
|
179
|
-
box-sizing: content-box;
|
|
180
|
-
border-left: 1px solid #fff;
|
|
181
|
-
border-right: 1px solid #fff;
|
|
182
179
|
display: none;
|
|
183
180
|
.close(12px, @select-clear-bg-color);
|
|
184
181
|
}
|
|
@@ -221,6 +218,10 @@
|
|
|
221
218
|
&-result:hover &-close {
|
|
222
219
|
display: block;
|
|
223
220
|
}
|
|
221
|
+
&-focus &-result-clearable &-multi,
|
|
222
|
+
&-result-clearable:hover &-multi{
|
|
223
|
+
visibility: hidden;
|
|
224
|
+
}
|
|
224
225
|
&-focus .@{select-prefix}-caret {
|
|
225
226
|
transform: rotate(180deg);
|
|
226
227
|
}
|
|
@@ -509,6 +510,10 @@
|
|
|
509
510
|
display: none;
|
|
510
511
|
}
|
|
511
512
|
}
|
|
513
|
+
.@{select-prefix}-multi {
|
|
514
|
+
visibility: visible;
|
|
515
|
+
cursor: not-allowed;
|
|
516
|
+
}
|
|
512
517
|
}
|
|
513
518
|
}
|
|
514
519
|
|
|
@@ -314,13 +314,17 @@ function (_PureComponent) {
|
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
if (treeColumnsName && changedByExpand) {
|
|
317
|
+
// Blank space may appear after clicking the top or bottom collapse button
|
|
317
318
|
if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
if (fullHeight <= scrollHeight) {
|
|
320
|
+
index = 0;
|
|
321
|
+
} else {
|
|
322
|
+
this.tbody.style.marginTop = scrollHeight + "px";
|
|
323
|
+
setTranslate(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
|
|
324
|
+
this.lastScrollTop = fullHeight;
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
321
327
|
}
|
|
322
|
-
|
|
323
|
-
return;
|
|
324
328
|
}
|
|
325
329
|
|
|
326
330
|
if (index === 0) {
|
|
@@ -601,7 +605,8 @@ function (_PureComponent) {
|
|
|
601
605
|
rowHeight = _this$props7.rowHeight,
|
|
602
606
|
columnResizable = _this$props7.columnResizable,
|
|
603
607
|
innerScrollAttr = _this$props7.innerScrollAttr,
|
|
604
|
-
|
|
608
|
+
bordered = _this$props7.bordered,
|
|
609
|
+
others = _objectWithoutPropertiesLoose(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr", "bordered"]);
|
|
605
610
|
|
|
606
611
|
var _this$state3 = this.state,
|
|
607
612
|
colgroup = _this$state3.colgroup,
|
|
@@ -648,7 +653,7 @@ function (_PureComponent) {
|
|
|
648
653
|
height: prevHeight
|
|
649
654
|
}
|
|
650
655
|
}), React.createElement("table", {
|
|
651
|
-
className: tableClass(!colgroup && minWidthSup && 'init'),
|
|
656
|
+
className: tableClass(!colgroup && minWidthSup && 'init', bordered && 'table-bordered'),
|
|
652
657
|
style: {
|
|
653
658
|
width: width
|
|
654
659
|
},
|
|
@@ -690,7 +695,8 @@ function (_PureComponent) {
|
|
|
690
695
|
style: {
|
|
691
696
|
width: width
|
|
692
697
|
},
|
|
693
|
-
ref: this.bindThead
|
|
698
|
+
ref: this.bindThead,
|
|
699
|
+
className: tableClass('table-bordered')
|
|
694
700
|
}, React.createElement(Colgroup, {
|
|
695
701
|
colgroup: colgroup,
|
|
696
702
|
columns: columns,
|
package/es/Table/SimpleTable.js
CHANGED
|
@@ -145,14 +145,16 @@ function (_PureComponent) {
|
|
|
145
145
|
data = _this$props2.data,
|
|
146
146
|
onResize = _this$props2.onResize,
|
|
147
147
|
columnResizable = _this$props2.columnResizable,
|
|
148
|
-
sticky = _this$props2.sticky
|
|
148
|
+
sticky = _this$props2.sticky,
|
|
149
|
+
bordered = _this$props2.bordered;
|
|
149
150
|
var _this$state = this.state,
|
|
150
151
|
colgroup = _this$state.colgroup,
|
|
151
152
|
scrollAble = _this$state.scrollAble;
|
|
152
153
|
var inner = React.createElement("table", {
|
|
153
154
|
style: {
|
|
154
155
|
width: width
|
|
155
|
-
}
|
|
156
|
+
},
|
|
157
|
+
className: tableClass(bordered && 'table-bordered')
|
|
156
158
|
}, React.createElement(Colgroup, {
|
|
157
159
|
colgroup: colgroup,
|
|
158
160
|
columns: columns,
|
|
@@ -190,7 +192,8 @@ function (_PureComponent) {
|
|
|
190
192
|
width = _this$props3.width,
|
|
191
193
|
fixed = _this$props3.fixed,
|
|
192
194
|
columnResizable = _this$props3.columnResizable,
|
|
193
|
-
|
|
195
|
+
bordered = _this$props3.bordered,
|
|
196
|
+
others = _objectWithoutPropertiesLoose(_this$props3, ["columns", "width", "fixed", "columnResizable", "bordered"]);
|
|
194
197
|
|
|
195
198
|
var _this$state2 = this.state,
|
|
196
199
|
colgroup = _this$state2.colgroup,
|
|
@@ -207,7 +210,7 @@ function (_PureComponent) {
|
|
|
207
210
|
style: {
|
|
208
211
|
width: width
|
|
209
212
|
},
|
|
210
|
-
className: tableClass(!colgroup && minWidthSup && 'init')
|
|
213
|
+
className: tableClass(!colgroup && minWidthSup && 'init', bordered && 'table-bordered')
|
|
211
214
|
}, React.createElement(Colgroup, {
|
|
212
215
|
colgroup: colgroup,
|
|
213
216
|
columns: columns,
|
|
@@ -227,11 +230,13 @@ function (_PureComponent) {
|
|
|
227
230
|
columns = _this$props4.columns,
|
|
228
231
|
width = _this$props4.width,
|
|
229
232
|
children = _this$props4.children,
|
|
230
|
-
hideHeader = _this$props4.hideHeader
|
|
233
|
+
hideHeader = _this$props4.hideHeader,
|
|
234
|
+
bordered = _this$props4.bordered;
|
|
231
235
|
if (!columns || columns.length === 0) return React.createElement("table", {
|
|
232
236
|
style: {
|
|
233
237
|
width: width
|
|
234
|
-
}
|
|
238
|
+
},
|
|
239
|
+
className: tableClass(bordered && 'table-bordered')
|
|
235
240
|
}, children);
|
|
236
241
|
return [hideHeader ? null : this.renderHeader(), this.renderBody(), children];
|
|
237
242
|
};
|
|
@@ -250,7 +255,8 @@ SimpleTable.propTypes = {
|
|
|
250
255
|
dataChangeResize: PropTypes.bool,
|
|
251
256
|
columnResizable: PropTypes.bool,
|
|
252
257
|
sticky: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
253
|
-
hideHeader: PropTypes.bool
|
|
258
|
+
hideHeader: PropTypes.bool,
|
|
259
|
+
bordered: PropTypes.bool
|
|
254
260
|
};
|
|
255
261
|
SimpleTable.defaultProps = {
|
|
256
262
|
data: undefined,
|
package/es/Table/Table.js
CHANGED
|
@@ -135,7 +135,9 @@ function (_Component) {
|
|
|
135
135
|
className: className,
|
|
136
136
|
ref: this.bindTable,
|
|
137
137
|
style: newStyle
|
|
138
|
-
}, events), React.createElement(RenderTable,
|
|
138
|
+
}, events), React.createElement(RenderTable, _extends({}, props, {
|
|
139
|
+
bordered: bordered
|
|
140
|
+
})), loading && React.createElement("div", {
|
|
139
141
|
className: tableClass('loading')
|
|
140
142
|
}, typeof loading === 'boolean' ? React.createElement(Spin, {
|
|
141
143
|
size: 40
|
package/es/Table/resizable.js
CHANGED
|
@@ -64,7 +64,7 @@ export default (function (Table) {
|
|
|
64
64
|
var onColumnResize = this.props.onColumnResize;
|
|
65
65
|
var changed = immer(this.state, function (draft) {
|
|
66
66
|
var column = draft.columns[index];
|
|
67
|
-
draft.delta += parseFloat(width - (column.width || 0));
|
|
67
|
+
draft.delta += parseFloat(width - (column.width || colgroup[index] || 0));
|
|
68
68
|
colgroup[index] = width;
|
|
69
69
|
draft.columns.forEach(function (col, i) {
|
|
70
70
|
var w = colgroup[i];
|