shineout 1.8.2 → 1.8.6
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/Alert/index.d.ts +15 -15
- package/css/Alert/styles/alert.css +8 -4
- package/css/AnimationList/AbsoluteList.js +1 -1
- package/css/Button/Button.js +1 -1
- package/css/DataList/List.js +6 -3
- package/css/Form/Field.js +11 -6
- package/css/Menu/Item.js +9 -1
- package/css/Popover/Confirm.js +1 -1
- package/css/Popover/Content.js +22 -0
- package/css/Popover/Panel.js +5 -3
- package/css/Popover/index.d.ts +9 -2
- package/css/Popover/index.js +3 -0
- package/css/Popover/styles/popover.css +0 -3
- package/css/Scroll/Scroll.js +31 -11
- package/css/Select/Input.js +16 -3
- package/css/Table/SeperateTable.js +5 -3
- 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/TreeSelect/TreeSelect.js +5 -2
- package/css/icons/index.js +2 -1
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/css/utils/proptypes.js +1 -1
- package/css/utils/validate/index.js +6 -1
- package/dist/shineout.js +224 -112
- 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/Alert/index.d.ts +15 -15
- package/es/Alert/styles/alert.less +2 -1
- package/es/AnimationList/AbsoluteList.js +1 -1
- package/es/Button/Button.js +1 -1
- package/es/DataList/List.js +6 -3
- package/es/Form/Field.js +11 -6
- package/es/Menu/Item.js +9 -1
- package/es/Popover/Confirm.js +1 -1
- package/es/Popover/Content.js +12 -0
- package/es/Popover/Panel.js +5 -3
- package/es/Popover/index.d.ts +9 -2
- package/es/Popover/index.js +2 -0
- package/es/Popover/styles/popover.less +0 -4
- package/es/Scroll/Scroll.js +31 -11
- package/es/Select/Input.js +16 -3
- package/es/Table/SeperateTable.js +5 -3
- 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/TreeSelect/TreeSelect.js +5 -2
- package/es/icons/index.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/styles/themes/shineout.less +1 -1
- package/es/utils/proptypes.js +1 -1
- package/es/utils/validate/index.js +5 -1
- package/lib/Alert/index.d.ts +15 -15
- package/lib/Alert/styles/alert.less +2 -1
- package/lib/AnimationList/AbsoluteList.js +1 -1
- package/lib/Button/Button.js +1 -1
- package/lib/DataList/List.js +6 -3
- package/lib/Form/Field.js +11 -6
- package/lib/Menu/Item.js +9 -1
- package/lib/Popover/Confirm.js +1 -1
- package/lib/Popover/Content.js +22 -0
- package/lib/Popover/Panel.js +5 -3
- package/lib/Popover/index.d.ts +9 -2
- package/lib/Popover/index.js +3 -0
- package/lib/Popover/styles/popover.less +0 -4
- package/lib/Scroll/Scroll.js +31 -11
- package/lib/Select/Input.js +16 -3
- package/lib/Table/SeperateTable.js +5 -3
- 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/TreeSelect/TreeSelect.js +5 -2
- package/lib/icons/index.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/styles/themes/shineout.less +1 -1
- package/lib/utils/proptypes.js +1 -1
- package/lib/utils/validate/index.js +6 -1
- package/package.json +1 -1
package/es/Alert/index.d.ts
CHANGED
|
@@ -5,59 +5,59 @@ export interface AlertProps extends StandardProps {
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Content, text or react component
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* 内容,文字或react组件
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* default: -
|
|
12
12
|
*/
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* When the type is true, the status icon is displayed according to the type property. If you need to display a custom icon, pass in ReactElement.
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* 为true时,根据type属性显示状态图标。如果需要显示自定义图标,传入ReactElement。
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
20
|
* default: -
|
|
21
21
|
*/
|
|
22
22
|
icon?: React.ReactElement | boolean;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The size for icon
|
|
26
|
-
*
|
|
26
|
+
*
|
|
27
27
|
* icon 的尺寸
|
|
28
|
-
*
|
|
28
|
+
*
|
|
29
29
|
* default: 14
|
|
30
30
|
*/
|
|
31
31
|
iconSize?: number;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* When onClose is empty, no close is displayed. If you need to close and do not need to handle callbacks, set it true.
|
|
35
|
-
*
|
|
35
|
+
*
|
|
36
36
|
* 当 onClose 为空时,不显示关闭。如果需要关闭又不需要处理回调,设置为true即可
|
|
37
|
-
*
|
|
37
|
+
*
|
|
38
38
|
* default: -
|
|
39
39
|
*/
|
|
40
40
|
onClose?: (() => void) | boolean;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* types
|
|
44
|
-
*
|
|
44
|
+
*
|
|
45
45
|
* 类型
|
|
46
|
-
*
|
|
46
|
+
*
|
|
47
47
|
* default: *warning*
|
|
48
|
-
*
|
|
48
|
+
*
|
|
49
49
|
*/
|
|
50
|
-
type?: 'success' | 'info' | 'warning' | 'danger' | 'error';
|
|
50
|
+
type?: 'success' | 'info' | 'warning' | 'danger' | 'error' | 'confirmwarning';
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* show close button
|
|
54
|
-
*
|
|
54
|
+
*
|
|
55
55
|
* 是否隐藏关闭按钮
|
|
56
|
-
*
|
|
56
|
+
*
|
|
57
57
|
* default: false
|
|
58
58
|
*/
|
|
59
59
|
hideClose?: boolean,
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
declare class Alert extends React.Component<AlertProps> {}
|
|
63
|
-
export default Alert
|
|
63
|
+
export default Alert
|
|
@@ -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/DataList/List.js
CHANGED
|
@@ -109,7 +109,8 @@ function (_Component) {
|
|
|
109
109
|
keygen = _this$props2.keygen,
|
|
110
110
|
fixed = _this$props2.fixed,
|
|
111
111
|
rowsInView = _this$props2.rowsInView,
|
|
112
|
-
lineHeight = _this$props2.lineHeight
|
|
112
|
+
lineHeight = _this$props2.lineHeight,
|
|
113
|
+
value = _this$props2.value;
|
|
113
114
|
if (isEmpty) return React.createElement("div", {
|
|
114
115
|
className: listClass('item', 'empty')
|
|
115
116
|
}, empty || getLocale('noData'));
|
|
@@ -119,7 +120,8 @@ function (_Component) {
|
|
|
119
120
|
data: data,
|
|
120
121
|
keygen: keygen,
|
|
121
122
|
renderItem: this.renderItem,
|
|
122
|
-
itemsInView: rowsInView
|
|
123
|
+
itemsInView: rowsInView,
|
|
124
|
+
force: value
|
|
123
125
|
});
|
|
124
126
|
};
|
|
125
127
|
|
|
@@ -186,7 +188,8 @@ Index.propTypes = {
|
|
|
186
188
|
fixed: PropTypes.bool,
|
|
187
189
|
rowsInView: PropTypes.number,
|
|
188
190
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
189
|
-
lineHeight: PropTypes.number
|
|
191
|
+
lineHeight: PropTypes.number,
|
|
192
|
+
value: PropTypes.array
|
|
190
193
|
};
|
|
191
194
|
Index.defaultProps = {
|
|
192
195
|
size: 'default',
|
package/es/Form/Field.js
CHANGED
|
@@ -53,13 +53,18 @@ function (_Component) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
var cloneProps = {
|
|
57
|
+
value: value,
|
|
58
|
+
error: error,
|
|
59
|
+
onChange: this.handleChange
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (disabled !== undefined) {
|
|
63
|
+
cloneProps.disabled = disabled;
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
if (isValidElement(children)) {
|
|
57
|
-
return cloneElement(children,
|
|
58
|
-
value: value,
|
|
59
|
-
error: error,
|
|
60
|
-
onChange: this.handleChange,
|
|
61
|
-
disabled: disabled
|
|
62
|
-
});
|
|
67
|
+
return cloneElement(children, cloneProps);
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
console.error(new Error('Form.Field expect a single ReactElement or a function.'));
|
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/Popover/Confirm.js
CHANGED
|
@@ -119,7 +119,7 @@ Confirm.propTypes = _objectSpread({}, getProps(PropTypes, 'type'), {
|
|
|
119
119
|
icon: PropTypes.oneOfType([PropTypes.bool, PropTypes.node])
|
|
120
120
|
});
|
|
121
121
|
Confirm.defaultProps = {
|
|
122
|
-
type: '
|
|
122
|
+
type: 'confirmwarning',
|
|
123
123
|
icon: true,
|
|
124
124
|
okType: 'danger'
|
|
125
125
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Panel from './Panel';
|
|
4
|
+
|
|
5
|
+
function Content(props) {
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
return React.createElement(Panel, _extends({}, props, {
|
|
8
|
+
useTextStyle: true
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default Content;
|
package/es/Popover/Panel.js
CHANGED
|
@@ -270,7 +270,8 @@ function (_Component) {
|
|
|
270
270
|
children = _this$props4.children,
|
|
271
271
|
type = _this$props4.type,
|
|
272
272
|
visible = _this$props4.visible,
|
|
273
|
-
showArrow = _this$props4.showArrow
|
|
273
|
+
showArrow = _this$props4.showArrow,
|
|
274
|
+
useTextStyle = _this$props4.useTextStyle;
|
|
274
275
|
var show = typeof visible === 'boolean' ? visible : this.state.show;
|
|
275
276
|
|
|
276
277
|
if (!this.isRendered && !show || !this.parentElement || !children) {
|
|
@@ -304,7 +305,7 @@ function (_Component) {
|
|
|
304
305
|
|
|
305
306
|
this.element.className = classnames(popoverClass('_', position, type), this.props.className, this.id);
|
|
306
307
|
var childrened = isFunc(children) ? children(this.handleHide) : children;
|
|
307
|
-
if (typeof childrened === 'string') childrened = React.createElement("span", {
|
|
308
|
+
if (typeof childrened === 'string' || useTextStyle) childrened = React.createElement("span", {
|
|
308
309
|
className: popoverClass('text')
|
|
309
310
|
}, childrened);
|
|
310
311
|
return ReactDOM.createPortal([showArrow && React.createElement("div", {
|
|
@@ -348,7 +349,8 @@ Panel.propTypes = {
|
|
|
348
349
|
showArrow: PropTypes.bool,
|
|
349
350
|
bindChain: PropTypes.func,
|
|
350
351
|
zIndex: PropTypes.number,
|
|
351
|
-
clickToCancelDelay: PropTypes.bool
|
|
352
|
+
clickToCancelDelay: PropTypes.bool,
|
|
353
|
+
useTextStyle: PropTypes.bool
|
|
352
354
|
};
|
|
353
355
|
Panel.defaultProps = {
|
|
354
356
|
background: '',
|
package/es/Popover/index.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ export interface PopoverProps extends StandardProps {
|
|
|
131
131
|
*
|
|
132
132
|
* default: none
|
|
133
133
|
*/
|
|
134
|
-
type?: 'success' | 'info' | 'warning' | 'danger';
|
|
134
|
+
type?: 'success' | 'info' | 'warning' | 'danger' | 'confirmwarning';
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Old API, out of date
|
|
@@ -232,8 +232,15 @@ declare class PopoverConfirm extends React.Component<PopoverConfirmProps, {}> {
|
|
|
232
232
|
render(): JSX.Element;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
declare class
|
|
235
|
+
declare class PopoverContent extends React.Component<PopoverProps, {}> {
|
|
236
|
+
render(): JSX.Element;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type ContentProps = Omit<PopoverProps, 'content'>;
|
|
240
|
+
|
|
241
|
+
declare class Popover extends React.Component<ContentProps, {}> {
|
|
236
242
|
static Confirm: typeof PopoverConfirm;
|
|
243
|
+
static Content: typeof PopoverContent;
|
|
237
244
|
|
|
238
245
|
render(): JSX.Element;
|
|
239
246
|
}
|
package/es/Popover/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import Container from '../Tooltip/Container';
|
|
|
3
3
|
import * as events from './events';
|
|
4
4
|
import Panel from './Panel';
|
|
5
5
|
import Confirm from './Confirm';
|
|
6
|
+
import Content from './Content';
|
|
6
7
|
var Component = Container(events);
|
|
7
8
|
|
|
8
9
|
function Popover(props) {
|
|
@@ -14,4 +15,5 @@ function Popover(props) {
|
|
|
14
15
|
Popover.displayName = 'ShineoutPopover';
|
|
15
16
|
Popover.Confirm = Confirm;
|
|
16
17
|
Popover.Confirm.displayName = 'ShineoutPopoverConfirm';
|
|
18
|
+
Popover.Content = Content;
|
|
17
19
|
export default Popover;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@import '../../styles/themes/@{so-theme}.less';
|
|
3
3
|
|
|
4
4
|
@popover-prefix: ~'@{so-prefix}-popover';
|
|
5
|
-
@alert-prefix: ~'@{so-prefix}-alert';
|
|
6
5
|
@popover-arrow-size: 12px;
|
|
7
6
|
|
|
8
7
|
.@{popover-prefix} {
|
|
@@ -276,9 +275,6 @@
|
|
|
276
275
|
margin-bottom: 8px;
|
|
277
276
|
font-size: @font-size-base;
|
|
278
277
|
}
|
|
279
|
-
.@{popover-prefix}-mention .@{alert-prefix}-warning .@{alert-prefix}-icon path {
|
|
280
|
-
fill: @colors-danger;
|
|
281
|
-
}
|
|
282
278
|
}
|
|
283
279
|
|
|
284
280
|
&-text {
|
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/Input.js
CHANGED
|
@@ -29,7 +29,9 @@ function (_Component) {
|
|
|
29
29
|
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
30
30
|
_this.geHandleMax = _this.geHandleMax.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
31
31
|
_this.handlePaste = _this.handlePaste.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
32
|
-
_this.focusInput = _this.focusInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
32
|
+
_this.focusInput = _this.focusInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
33
|
+
_this.handleCompositionStart = _this.handleCompositionStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
34
|
+
_this.handleCompositionEnd = _this.handleCompositionEnd.bind(_assertThisInitialized(_assertThisInitialized(_this))); // for mutiple select
|
|
33
35
|
|
|
34
36
|
_this.props.setInputReset(_this.reset.bind(_assertThisInitialized(_assertThisInitialized(_this)))); // set focus func to Select
|
|
35
37
|
|
|
@@ -81,7 +83,7 @@ function (_Component) {
|
|
|
81
83
|
_proto.geHandleMax = function geHandleMax(e) {
|
|
82
84
|
var maxLength = this.props.maxLength;
|
|
83
85
|
|
|
84
|
-
if (!maxLength) {
|
|
86
|
+
if (!maxLength || this.composition) {
|
|
85
87
|
return true;
|
|
86
88
|
}
|
|
87
89
|
|
|
@@ -202,6 +204,15 @@ function (_Component) {
|
|
|
202
204
|
this.props.onInputBlur(text);
|
|
203
205
|
};
|
|
204
206
|
|
|
207
|
+
_proto.handleCompositionStart = function handleCompositionStart() {
|
|
208
|
+
this.composition = true;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
_proto.handleCompositionEnd = function handleCompositionEnd(e) {
|
|
212
|
+
this.composition = false;
|
|
213
|
+
this.handleInput(e);
|
|
214
|
+
};
|
|
215
|
+
|
|
205
216
|
_proto.render = function render() {
|
|
206
217
|
var _this$props = this.props,
|
|
207
218
|
text = _this$props.text,
|
|
@@ -216,7 +227,9 @@ function (_Component) {
|
|
|
216
227
|
contentEditable: focus || this.state.editable,
|
|
217
228
|
onFocus: handleFocus,
|
|
218
229
|
onBlur: this.handleBlur,
|
|
219
|
-
title: !focus && isString(value) ? value : null
|
|
230
|
+
title: !focus && isString(value) ? value : null,
|
|
231
|
+
onCompositionStart: this.handleCompositionStart,
|
|
232
|
+
onCompositionEnd: this.handleCompositionEnd
|
|
220
233
|
};
|
|
221
234
|
|
|
222
235
|
if (isValidElement(value)) {
|
|
@@ -605,7 +605,8 @@ function (_PureComponent) {
|
|
|
605
605
|
rowHeight = _this$props7.rowHeight,
|
|
606
606
|
columnResizable = _this$props7.columnResizable,
|
|
607
607
|
innerScrollAttr = _this$props7.innerScrollAttr,
|
|
608
|
-
|
|
608
|
+
bordered = _this$props7.bordered,
|
|
609
|
+
others = _objectWithoutPropertiesLoose(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr", "bordered"]);
|
|
609
610
|
|
|
610
611
|
var _this$state3 = this.state,
|
|
611
612
|
colgroup = _this$state3.colgroup,
|
|
@@ -652,7 +653,7 @@ function (_PureComponent) {
|
|
|
652
653
|
height: prevHeight
|
|
653
654
|
}
|
|
654
655
|
}), React.createElement("table", {
|
|
655
|
-
className: tableClass(!colgroup && minWidthSup && 'init'),
|
|
656
|
+
className: tableClass(!colgroup && minWidthSup && 'init', bordered && 'table-bordered'),
|
|
656
657
|
style: {
|
|
657
658
|
width: width
|
|
658
659
|
},
|
|
@@ -694,7 +695,8 @@ function (_PureComponent) {
|
|
|
694
695
|
style: {
|
|
695
696
|
width: width
|
|
696
697
|
},
|
|
697
|
-
ref: this.bindThead
|
|
698
|
+
ref: this.bindThead,
|
|
699
|
+
className: tableClass('table-bordered')
|
|
698
700
|
}, React.createElement(Colgroup, {
|
|
699
701
|
colgroup: colgroup,
|
|
700
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];
|
|
@@ -269,7 +269,9 @@ function (_PureComponent) {
|
|
|
269
269
|
data = _this$props7.data,
|
|
270
270
|
absolute = _this$props7.absolute,
|
|
271
271
|
height = _this$props7.height,
|
|
272
|
-
zIndex = _this$props7.zIndex
|
|
272
|
+
zIndex = _this$props7.zIndex,
|
|
273
|
+
compressed = _this$props7.compressed,
|
|
274
|
+
value = _this$props7.value;
|
|
273
275
|
var props = {};
|
|
274
276
|
['mode', 'data', 'datum', 'defaultExpanded', 'defaultExpandAll', 'disabled', 'expanded', 'keygen', 'loader', 'onExpand', 'renderItem', 'line', 'parentClickExpand', 'childrenKey', 'expandIcons'].forEach(function (k) {
|
|
275
277
|
props[k] = _this3.props[k];
|
|
@@ -306,7 +308,8 @@ function (_PureComponent) {
|
|
|
306
308
|
overflowY: 'auto'
|
|
307
309
|
},
|
|
308
310
|
fixed: "min",
|
|
309
|
-
zIndex: zIndex
|
|
311
|
+
zIndex: zIndex,
|
|
312
|
+
value: multiple && !compressed ? value : undefined
|
|
310
313
|
}, React.createElement("div", {
|
|
311
314
|
className: treeSelectClass('tree-wrapper')
|
|
312
315
|
}, content));
|
package/es/icons/index.js
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import './bootstrap.less';
|
|
2
2
|
@import './cssvar.less';
|
|
3
3
|
|
|
4
|
-
@font-family-sans-serif:
|
|
4
|
+
@font-family-sans-serif: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Helvetica, PingFang SC, Hiragino KaKu Gothic Pro, Microsoft YaHei, Arial, sans-serif;
|
|
5
5
|
|
|
6
6
|
@colors-primary-value: #197AFA;
|
|
7
7
|
@colors-primary: var(--primary-color, @colors-primary-value);
|
package/es/utils/proptypes.js
CHANGED
|
@@ -9,7 +9,7 @@ export function getProps(PropTypes) {
|
|
|
9
9
|
grid: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
|
|
10
10
|
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
11
11
|
size: PropTypes.oneOf(['small', 'default', 'large']),
|
|
12
|
-
type: PropTypes.oneOf(['primary', 'default', 'secondary', 'success', 'info', 'warning', 'error', 'danger', 'link'])
|
|
12
|
+
type: PropTypes.oneOf(['primary', 'default', 'secondary', 'success', 'info', 'warning', 'error', 'danger', 'link', 'confirmwarning'])
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread";
|
|
1
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
2
3
|
import Datum from '../../Datum';
|
|
3
4
|
import { wrapFormError } from '../../utils/errors';
|
|
@@ -44,7 +45,10 @@ function getRule(rules, props) {
|
|
|
44
45
|
|
|
45
46
|
if (other.min !== undefined || other.max !== undefined) {
|
|
46
47
|
if (type === 'number' || type === 'integer') {
|
|
47
|
-
return range(props
|
|
48
|
+
return range(_objectSpread({}, props, {
|
|
49
|
+
min: other.min,
|
|
50
|
+
max: other.max
|
|
51
|
+
}));
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
return rangeLength(props);
|