shineout 1.8.5 → 1.8.7-beta.2
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/Cascader/Result.js +3 -1
- package/css/DataList/List.js +6 -3
- package/css/EditableArea/EditableArea.js +1 -2
- package/css/Modal/Panel.js +2 -3
- package/css/Modal/styles/modal.css +6 -0
- 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/Select/Result.js +3 -1
- package/css/Table/SeperateTable.js +39 -45
- package/css/Table/SimpleTable.js +2 -1
- package/css/Table/TreeExpand.js +3 -2
- package/css/Table/index.d.ts +9 -0
- package/css/Table/index.js +1 -1
- package/css/TreeSelect/Result.js +3 -1
- 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/dom/element.js +3 -3
- package/css/utils/proptypes.js +1 -1
- package/css/utils/validate/index.js +6 -1
- package/dist/shineout.js +186 -132
- 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/Cascader/Result.js +3 -1
- package/es/DataList/List.js +6 -3
- package/es/EditableArea/EditableArea.js +1 -2
- package/es/Modal/Panel.js +2 -3
- package/es/Modal/styles/modal.less +12 -0
- 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/Select/Result.js +3 -1
- package/es/Table/SeperateTable.js +39 -45
- package/es/Table/SimpleTable.js +2 -1
- package/es/Table/TreeExpand.js +3 -2
- package/es/Table/index.d.ts +9 -0
- package/es/Table/index.js +1 -1
- package/es/TreeSelect/Result.js +3 -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/utils/dom/element.js +3 -3
- 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/Cascader/Result.js +3 -1
- package/lib/DataList/List.js +6 -3
- package/lib/EditableArea/EditableArea.js +1 -2
- package/lib/Modal/Panel.js +2 -3
- package/lib/Modal/styles/modal.less +12 -0
- 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/Select/Result.js +3 -1
- package/lib/Table/SeperateTable.js +39 -45
- package/lib/Table/SimpleTable.js +2 -1
- package/lib/Table/TreeExpand.js +3 -2
- package/lib/Table/index.d.ts +9 -0
- package/lib/Table/index.js +1 -1
- package/lib/TreeSelect/Result.js +3 -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/utils/dom/element.js +3 -3
- package/lib/utils/proptypes.js +1 -1
- package/lib/utils/validate/index.js +6 -1
- package/package.json +1 -1
package/css/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
|
|
@@ -134,7 +134,8 @@
|
|
|
134
134
|
fill: var(--success-color, #00cc66);
|
|
135
135
|
}
|
|
136
136
|
.so-alert-danger,
|
|
137
|
-
.so-alert-error
|
|
137
|
+
.so-alert-error,
|
|
138
|
+
.so-alert-confirmwarning {
|
|
138
139
|
border-color: var(--alert-danger-border-color, #ebccd1);
|
|
139
140
|
background-color: var(--alert-danger-bg, #f2dede);
|
|
140
141
|
color: var(--alert-danger-text-color, #a94442);
|
|
@@ -142,14 +143,17 @@
|
|
|
142
143
|
box-shadow: var(--alert-danger-box-shadow, 'none');
|
|
143
144
|
}
|
|
144
145
|
.so-alert-danger hr,
|
|
145
|
-
.so-alert-error hr
|
|
146
|
+
.so-alert-error hr,
|
|
147
|
+
.so-alert-confirmwarning hr {
|
|
146
148
|
border-top-color: var(--alert-danger-border-darken-5-color, #e4b9c0);
|
|
147
149
|
}
|
|
148
150
|
.so-alert-danger .alert-link,
|
|
149
|
-
.so-alert-error .alert-link
|
|
151
|
+
.so-alert-error .alert-link,
|
|
152
|
+
.so-alert-confirmwarning .alert-link {
|
|
150
153
|
color: var(--alert-danger-text-darken-10-color, #843534);
|
|
151
154
|
}
|
|
152
155
|
.so-alert-danger .so-alert-icon path,
|
|
153
|
-
.so-alert-error .so-alert-icon path
|
|
156
|
+
.so-alert-error .so-alert-icon path,
|
|
157
|
+
.so-alert-confirmwarning .so-alert-icon path {
|
|
154
158
|
fill: var(--danger-color, #f85555);
|
|
155
159
|
}
|
package/css/Cascader/Result.js
CHANGED
|
@@ -96,7 +96,9 @@ function (_PureComponent) {
|
|
|
96
96
|
var compressed = this.props.compressed;
|
|
97
97
|
|
|
98
98
|
if (compressed) {
|
|
99
|
-
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore
|
|
99
|
+
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore, {
|
|
100
|
+
direction: 'x'
|
|
101
|
+
});
|
|
100
102
|
}
|
|
101
103
|
};
|
|
102
104
|
|
package/css/DataList/List.js
CHANGED
|
@@ -133,7 +133,8 @@ function (_Component) {
|
|
|
133
133
|
keygen = _this$props2.keygen,
|
|
134
134
|
fixed = _this$props2.fixed,
|
|
135
135
|
rowsInView = _this$props2.rowsInView,
|
|
136
|
-
lineHeight = _this$props2.lineHeight
|
|
136
|
+
lineHeight = _this$props2.lineHeight,
|
|
137
|
+
value = _this$props2.value;
|
|
137
138
|
if (isEmpty) return _react.default.createElement("div", {
|
|
138
139
|
className: (0, _styles.listClass)('item', 'empty')
|
|
139
140
|
}, empty || (0, _locale.getLocale)('noData'));
|
|
@@ -143,7 +144,8 @@ function (_Component) {
|
|
|
143
144
|
data: data,
|
|
144
145
|
keygen: keygen,
|
|
145
146
|
renderItem: this.renderItem,
|
|
146
|
-
itemsInView: rowsInView
|
|
147
|
+
itemsInView: rowsInView,
|
|
148
|
+
force: value
|
|
147
149
|
});
|
|
148
150
|
};
|
|
149
151
|
|
|
@@ -210,7 +212,8 @@ Index.propTypes = {
|
|
|
210
212
|
fixed: _propTypes.default.bool,
|
|
211
213
|
rowsInView: _propTypes.default.number,
|
|
212
214
|
height: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
213
|
-
lineHeight: _propTypes.default.number
|
|
215
|
+
lineHeight: _propTypes.default.number,
|
|
216
|
+
value: _propTypes.default.array
|
|
214
217
|
};
|
|
215
218
|
Index.defaultProps = {
|
|
216
219
|
size: 'default',
|
|
@@ -110,7 +110,6 @@ function (_React$PureComponent) {
|
|
|
110
110
|
_proto.renderTextarea = function renderTextarea() {
|
|
111
111
|
var showTextarea = this.state.showTextarea;
|
|
112
112
|
var _this$props = this.props,
|
|
113
|
-
delay = _this$props.delay,
|
|
114
113
|
placeholder = _this$props.placeholder,
|
|
115
114
|
maxHeight = _this$props.maxHeight,
|
|
116
115
|
value = _this$props.value;
|
|
@@ -122,7 +121,7 @@ function (_React$PureComponent) {
|
|
|
122
121
|
autosize: true,
|
|
123
122
|
value: value,
|
|
124
123
|
rows: 1,
|
|
125
|
-
delay:
|
|
124
|
+
delay: 0,
|
|
126
125
|
onChange: this.onChange,
|
|
127
126
|
onBlur: this.onBlur,
|
|
128
127
|
onFocus: this.handleFocus,
|
package/css/Modal/Panel.js
CHANGED
|
@@ -222,10 +222,9 @@ function (_PureComponent) {
|
|
|
222
222
|
position = _this$props7.position,
|
|
223
223
|
bodyStyle = _this$props7.bodyStyle,
|
|
224
224
|
_this$props7$from = _this$props7.from,
|
|
225
|
-
from = _this$props7$from === void 0 ? null : _this$props7$from
|
|
226
|
-
type = _this$props7.type;
|
|
225
|
+
from = _this$props7$from === void 0 ? null : _this$props7$from;
|
|
227
226
|
var style = {
|
|
228
|
-
padding: noPadding === true
|
|
227
|
+
padding: noPadding === true ? 0 : padding
|
|
229
228
|
};
|
|
230
229
|
if (position) style.overflow = 'auto';
|
|
231
230
|
if (bodyStyle) style = Object.assign(style, bodyStyle);
|
|
@@ -314,6 +314,12 @@
|
|
|
314
314
|
width: var(--modal-divider-width, 100%);
|
|
315
315
|
background: var(--modal-divider-color, #ddd);
|
|
316
316
|
}
|
|
317
|
+
.so-modal-mask > .so-card.so-modal-normal .so-modal-body {
|
|
318
|
+
padding-left: var(--modal-icon-body-padding-right, 40px);
|
|
319
|
+
}
|
|
320
|
+
.so-modal-mask > .so-card.so-modal-normal.so-modal-rtl .so-modal-body {
|
|
321
|
+
padding-right: var(--modal-icon-body-padding-right, 40px);
|
|
322
|
+
}
|
|
317
323
|
.so-modal-mask > .so-card.so-modal-rtl {
|
|
318
324
|
direction: rtl;
|
|
319
325
|
text-align: right;
|
package/css/Popover/Confirm.js
CHANGED
|
@@ -138,7 +138,7 @@ Confirm.propTypes = (0, _objectSpread2.default)({}, (0, _proptypes.getProps)(_pr
|
|
|
138
138
|
icon: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.node])
|
|
139
139
|
});
|
|
140
140
|
Confirm.defaultProps = {
|
|
141
|
-
type: '
|
|
141
|
+
type: 'confirmwarning',
|
|
142
142
|
icon: true,
|
|
143
143
|
okType: 'danger'
|
|
144
144
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Panel = _interopRequireDefault(require("./Panel"));
|
|
13
|
+
|
|
14
|
+
function Content(props) {
|
|
15
|
+
// eslint-disable-next-line
|
|
16
|
+
return _react.default.createElement(_Panel.default, (0, _extends2.default)({}, props, {
|
|
17
|
+
useTextStyle: true
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var _default = Content;
|
|
22
|
+
exports.default = _default;
|
package/css/Popover/Panel.js
CHANGED
|
@@ -295,7 +295,8 @@ function (_Component) {
|
|
|
295
295
|
children = _this$props4.children,
|
|
296
296
|
type = _this$props4.type,
|
|
297
297
|
visible = _this$props4.visible,
|
|
298
|
-
showArrow = _this$props4.showArrow
|
|
298
|
+
showArrow = _this$props4.showArrow,
|
|
299
|
+
useTextStyle = _this$props4.useTextStyle;
|
|
299
300
|
var show = typeof visible === 'boolean' ? visible : this.state.show;
|
|
300
301
|
|
|
301
302
|
if (!this.isRendered && !show || !this.parentElement || !children) {
|
|
@@ -329,7 +330,7 @@ function (_Component) {
|
|
|
329
330
|
|
|
330
331
|
this.element.className = (0, _classnames.default)((0, _styles.popoverClass)('_', position, type), this.props.className, this.id);
|
|
331
332
|
var childrened = (0, _is.isFunc)(children) ? children(this.handleHide) : children;
|
|
332
|
-
if (typeof childrened === 'string') childrened = _react.default.createElement("span", {
|
|
333
|
+
if (typeof childrened === 'string' || useTextStyle) childrened = _react.default.createElement("span", {
|
|
333
334
|
className: (0, _styles.popoverClass)('text')
|
|
334
335
|
}, childrened);
|
|
335
336
|
return _reactDom.default.createPortal([showArrow && _react.default.createElement("div", {
|
|
@@ -373,7 +374,8 @@ Panel.propTypes = {
|
|
|
373
374
|
showArrow: _propTypes.default.bool,
|
|
374
375
|
bindChain: _propTypes.default.func,
|
|
375
376
|
zIndex: _propTypes.default.number,
|
|
376
|
-
clickToCancelDelay: _propTypes.default.bool
|
|
377
|
+
clickToCancelDelay: _propTypes.default.bool,
|
|
378
|
+
useTextStyle: _propTypes.default.bool
|
|
377
379
|
};
|
|
378
380
|
Panel.defaultProps = {
|
|
379
381
|
background: '',
|
package/css/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/css/Popover/index.js
CHANGED
|
@@ -17,6 +17,8 @@ var _Panel = _interopRequireDefault(require("./Panel"));
|
|
|
17
17
|
|
|
18
18
|
var _Confirm = _interopRequireDefault(require("./Confirm"));
|
|
19
19
|
|
|
20
|
+
var _Content = _interopRequireDefault(require("./Content"));
|
|
21
|
+
|
|
20
22
|
var Component = (0, _Container.default)(events);
|
|
21
23
|
|
|
22
24
|
function Popover(props) {
|
|
@@ -28,5 +30,6 @@ function Popover(props) {
|
|
|
28
30
|
Popover.displayName = 'ShineoutPopover';
|
|
29
31
|
Popover.Confirm = _Confirm.default;
|
|
30
32
|
Popover.Confirm.displayName = 'ShineoutPopoverConfirm';
|
|
33
|
+
Popover.Content = _Content.default;
|
|
31
34
|
var _default = Popover;
|
|
32
35
|
exports.default = _default;
|
|
@@ -308,9 +308,6 @@
|
|
|
308
308
|
margin-bottom: 8px;
|
|
309
309
|
font-size: var(--font-size-base, 14px);
|
|
310
310
|
}
|
|
311
|
-
.so-popover-confirm .so-popover-mention .so-alert-warning .so-alert-icon path {
|
|
312
|
-
fill: var(--danger-color, #f85555);
|
|
313
|
-
}
|
|
314
311
|
.so-popover-text {
|
|
315
312
|
display: inline-block;
|
|
316
313
|
max-width: var(--popover-text-max-width, 320px);
|
package/css/Select/Result.js
CHANGED
|
@@ -114,7 +114,9 @@ function (_PureComponent) {
|
|
|
114
114
|
var compressed = this.props.compressed;
|
|
115
115
|
|
|
116
116
|
if (compressed) {
|
|
117
|
-
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore
|
|
117
|
+
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore, {
|
|
118
|
+
direction: 'x'
|
|
119
|
+
});
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
|
|
@@ -225,6 +225,22 @@ function (_PureComponent) {
|
|
|
225
225
|
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
+
_proto.setTop = function setTop(scrollHeight, fullHeight, top) {
|
|
229
|
+
var _this2 = this;
|
|
230
|
+
|
|
231
|
+
var offsetLeft = this.state.offsetLeft;
|
|
232
|
+
this.tbody.style.marginTop = scrollHeight * top + "px";
|
|
233
|
+
this.lastScrollTop = fullHeight * top;
|
|
234
|
+
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + this.lastScrollTop + "px");
|
|
235
|
+
setTimeout(function () {
|
|
236
|
+
_this2.setState({
|
|
237
|
+
scrollTop: top
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
_this2.lastScrollArgs[1] = top;
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
|
|
228
244
|
_proto.checkScrollToIndex = function checkScrollToIndex(index, outerHeight) {
|
|
229
245
|
var _this$props3 = this.props,
|
|
230
246
|
data = _this$props3.data,
|
|
@@ -245,7 +261,7 @@ function (_PureComponent) {
|
|
|
245
261
|
};
|
|
246
262
|
|
|
247
263
|
_proto.ajustBottom = function ajustBottom(dataChange) {
|
|
248
|
-
var
|
|
264
|
+
var _this3 = this;
|
|
249
265
|
|
|
250
266
|
var reachBottom = this.lastScrollArgs[1] === 1;
|
|
251
267
|
var drag = this.lastScrollArgs[8];
|
|
@@ -254,7 +270,7 @@ function (_PureComponent) {
|
|
|
254
270
|
if (this.ajustBottomScroll) return;
|
|
255
271
|
this.ajustBottomScroll = true;
|
|
256
272
|
setTimeout(function () {
|
|
257
|
-
|
|
273
|
+
_this3.handleScroll.apply(_this3, _this3.lastScrollArgs);
|
|
258
274
|
});
|
|
259
275
|
}
|
|
260
276
|
};
|
|
@@ -314,11 +330,9 @@ function (_PureComponent) {
|
|
|
314
330
|
};
|
|
315
331
|
|
|
316
332
|
_proto.resetHeight = function resetHeight() {
|
|
317
|
-
var
|
|
333
|
+
var _this4 = this;
|
|
318
334
|
|
|
319
|
-
var
|
|
320
|
-
scrollTop = _this$state2.scrollTop,
|
|
321
|
-
offsetLeft = _this$state2.offsetLeft;
|
|
335
|
+
var scrollTop = this.state.scrollTop;
|
|
322
336
|
var _this$props4 = this.props,
|
|
323
337
|
treeColumnsName = _this$props4.treeColumnsName,
|
|
324
338
|
changedByExpand = _this$props4.changedByExpand;
|
|
@@ -349,32 +363,16 @@ function (_PureComponent) {
|
|
|
349
363
|
if (fullHeight <= scrollHeight) {
|
|
350
364
|
index = 0;
|
|
351
365
|
} else {
|
|
352
|
-
this.
|
|
353
|
-
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
|
|
354
|
-
this.lastScrollTop = fullHeight;
|
|
366
|
+
this.setTop(scrollHeight, fullHeight, 1);
|
|
355
367
|
return;
|
|
356
368
|
}
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
371
|
|
|
360
372
|
if (index === 0) {
|
|
361
|
-
this.
|
|
362
|
-
setTimeout(function () {
|
|
363
|
-
_this3.setState({
|
|
364
|
-
scrollTop: 0
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
this.tbody.style.marginTop = '0px';
|
|
368
|
-
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", '0px');
|
|
373
|
+
this.setTop(scrollHeight, fullHeight, 0);
|
|
369
374
|
} else if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
|
|
370
|
-
this.
|
|
371
|
-
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
|
|
372
|
-
this.lastScrollTop = fullHeight;
|
|
373
|
-
setTimeout(function () {
|
|
374
|
-
_this3.setState({
|
|
375
|
-
scrollTop: 1
|
|
376
|
-
});
|
|
377
|
-
});
|
|
375
|
+
this.setTop(scrollHeight, fullHeight, 1);
|
|
378
376
|
} else {
|
|
379
377
|
var keepTop = this.lastScrollTop - this.lastScrollArgs[1] * scrollHeight; // keepTop = scrollTopLength - scrollTopLength/fullHeight * scrollHeight
|
|
380
378
|
// keepTop = (1 - scrollHeight / fullHeight) * scrollTopLength
|
|
@@ -382,18 +380,14 @@ function (_PureComponent) {
|
|
|
382
380
|
var scrollTopLength = keepTop / (1 - scrollHeight / fullHeight);
|
|
383
381
|
this.lastScrollTop = scrollTopLength;
|
|
384
382
|
var st = this.lastScrollTop / fullHeight;
|
|
385
|
-
this.
|
|
386
|
-
(0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + this.lastScrollTop + "px");
|
|
387
|
-
setTimeout(function () {
|
|
388
|
-
_this3.setState({
|
|
389
|
-
scrollTop: st
|
|
390
|
-
});
|
|
391
|
-
});
|
|
383
|
+
this.setTop(scrollHeight, fullHeight, st);
|
|
392
384
|
}
|
|
393
385
|
} else if (this.lastScrollTop - height < 1) {
|
|
394
386
|
setTimeout(function () {
|
|
395
|
-
|
|
396
|
-
|
|
387
|
+
_this4.lastScrollArgs[1] = _this4.lastScrollTop / fullHeight;
|
|
388
|
+
|
|
389
|
+
_this4.setState({
|
|
390
|
+
scrollTop: _this4.lastScrollTop / fullHeight
|
|
397
391
|
});
|
|
398
392
|
});
|
|
399
393
|
}
|
|
@@ -637,14 +631,14 @@ function (_PureComponent) {
|
|
|
637
631
|
innerScrollAttr = _this$props7.innerScrollAttr,
|
|
638
632
|
bordered = _this$props7.bordered,
|
|
639
633
|
others = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr", "bordered"]);
|
|
640
|
-
var _this$
|
|
641
|
-
colgroup = _this$
|
|
642
|
-
scrollTop = _this$
|
|
643
|
-
scrollLeft = _this$
|
|
644
|
-
offsetLeft = _this$
|
|
645
|
-
offsetRight = _this$
|
|
646
|
-
currentIndex = _this$
|
|
647
|
-
resize = _this$
|
|
634
|
+
var _this$state2 = this.state,
|
|
635
|
+
colgroup = _this$state2.colgroup,
|
|
636
|
+
scrollTop = _this$state2.scrollTop,
|
|
637
|
+
scrollLeft = _this$state2.scrollLeft,
|
|
638
|
+
offsetLeft = _this$state2.offsetLeft,
|
|
639
|
+
offsetRight = _this$state2.offsetRight,
|
|
640
|
+
currentIndex = _this$state2.currentIndex,
|
|
641
|
+
resize = _this$state2.resize;
|
|
648
642
|
var contentWidth = this.getContentWidth();
|
|
649
643
|
var minWidthSup = columns.find(function (d) {
|
|
650
644
|
return d.minWidth;
|
|
@@ -753,9 +747,9 @@ function (_PureComponent) {
|
|
|
753
747
|
var _this$props9 = this.props,
|
|
754
748
|
fixed = _this$props9.fixed,
|
|
755
749
|
hideHeader = _this$props9.hideHeader;
|
|
756
|
-
var _this$
|
|
757
|
-
scrollLeft = _this$
|
|
758
|
-
floatFixed = _this$
|
|
750
|
+
var _this$state3 = this.state,
|
|
751
|
+
scrollLeft = _this$state3.scrollLeft,
|
|
752
|
+
floatFixed = _this$state3.floatFixed;
|
|
759
753
|
var floatClass = [];
|
|
760
754
|
|
|
761
755
|
if (floatFixed) {
|
package/css/Table/SimpleTable.js
CHANGED
|
@@ -100,6 +100,7 @@ function (_PureComponent) {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
_proto.resetColGroup = function resetColGroup() {
|
|
103
|
+
this.lastColGroup = this.state.colgroup || this.lastColGroup;
|
|
103
104
|
this.setState({
|
|
104
105
|
colgroup: undefined,
|
|
105
106
|
resize: true
|
|
@@ -178,7 +179,7 @@ function (_PureComponent) {
|
|
|
178
179
|
},
|
|
179
180
|
className: (0, _styles.tableClass)(bordered && 'table-bordered')
|
|
180
181
|
}, _react.default.createElement(_Colgroup.default, {
|
|
181
|
-
colgroup: colgroup,
|
|
182
|
+
colgroup: colgroup || this.lastColGroup,
|
|
182
183
|
columns: columns,
|
|
183
184
|
resizable: columnResizable
|
|
184
185
|
}), _react.default.createElement(_Thead.default, (0, _extends2.default)({}, this.props, {
|
package/css/Table/TreeExpand.js
CHANGED
|
@@ -169,7 +169,7 @@ var _default = function _default(WrappedComponent) {
|
|
|
169
169
|
}).length === 0;
|
|
170
170
|
var treeIndent = this.getTreeIndent();
|
|
171
171
|
return _react.default.createElement(WrappedComponent, (0, _extends2.default)({}, this.props, {
|
|
172
|
-
changedByExpand: this.changedByExpand,
|
|
172
|
+
changedByExpand: this.changedByExpand || this.props.changedByExpand,
|
|
173
173
|
data: data,
|
|
174
174
|
onTreeExpand: this.handleTreeExpand,
|
|
175
175
|
treeExpandKeys: expandKeys,
|
|
@@ -187,7 +187,8 @@ var _default = function _default(WrappedComponent) {
|
|
|
187
187
|
treeColumnsName: _propTypes.default.string,
|
|
188
188
|
defaultTreeExpandKeys: _propTypes.default.array,
|
|
189
189
|
treeExpandKeys: _propTypes.default.array,
|
|
190
|
-
onTreeExpand: _propTypes.default.func
|
|
190
|
+
onTreeExpand: _propTypes.default.func,
|
|
191
|
+
changedByExpand: _propTypes.default.bool
|
|
191
192
|
});
|
|
192
193
|
TreeExpand.defaultProps = {
|
|
193
194
|
defaultTreeExpandKeys: []
|
package/css/Table/index.d.ts
CHANGED
|
@@ -542,6 +542,15 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
|
|
|
542
542
|
*/
|
|
543
543
|
columnResizable?: boolean
|
|
544
544
|
|
|
545
|
+
/**
|
|
546
|
+
* Enable in specific scenarios (tree data expansion is controlled) Used to change the default behavior of scroll reset
|
|
547
|
+
*
|
|
548
|
+
* 在特定场景(树形数据展开受控)下开启 用来改变滚动条重置的默认行为
|
|
549
|
+
*
|
|
550
|
+
* default: false
|
|
551
|
+
*/
|
|
552
|
+
changedByExpand?: boolean
|
|
553
|
+
|
|
545
554
|
}
|
|
546
555
|
|
|
547
556
|
declare class Table<Value = any, TRD = TableRowData> extends React.Component<TableProps<Value, TRD>, {}> {
|
package/css/Table/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var _TreeExpand = _interopRequireDefault(require("./TreeExpand"));
|
|
|
33
33
|
|
|
34
34
|
var TableWithPagination = (0, _pagable.default)(_Table.default);
|
|
35
35
|
var TableWithTree = (0, _TreeExpand.default)(_Table.default);
|
|
36
|
-
var TableWithPT = (0, _func.compose)(
|
|
36
|
+
var TableWithPT = (0, _func.compose)(_pagable.default, _TreeExpand.default)(_Table.default);
|
|
37
37
|
|
|
38
38
|
var _default =
|
|
39
39
|
/*#__PURE__*/
|
package/css/TreeSelect/Result.js
CHANGED
|
@@ -89,7 +89,9 @@ function (_PureComponent) {
|
|
|
89
89
|
var compressed = this.props.compressed;
|
|
90
90
|
|
|
91
91
|
if (compressed) {
|
|
92
|
-
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore
|
|
92
|
+
this.cancelResizeObserver = (0, _element.addResizeObserver)(this.resultEl, this.resetMore, {
|
|
93
|
+
direction: 'x'
|
|
94
|
+
});
|
|
93
95
|
}
|
|
94
96
|
};
|
|
95
97
|
|
|
@@ -294,7 +294,9 @@ function (_PureComponent) {
|
|
|
294
294
|
data = _this$props7.data,
|
|
295
295
|
absolute = _this$props7.absolute,
|
|
296
296
|
height = _this$props7.height,
|
|
297
|
-
zIndex = _this$props7.zIndex
|
|
297
|
+
zIndex = _this$props7.zIndex,
|
|
298
|
+
compressed = _this$props7.compressed,
|
|
299
|
+
value = _this$props7.value;
|
|
298
300
|
var props = {};
|
|
299
301
|
['mode', 'data', 'datum', 'defaultExpanded', 'defaultExpandAll', 'disabled', 'expanded', 'keygen', 'loader', 'onExpand', 'renderItem', 'line', 'parentClickExpand', 'childrenKey', 'expandIcons'].forEach(function (k) {
|
|
300
302
|
props[k] = _this3.props[k];
|
|
@@ -331,7 +333,8 @@ function (_PureComponent) {
|
|
|
331
333
|
overflowY: 'auto'
|
|
332
334
|
},
|
|
333
335
|
fixed: "min",
|
|
334
|
-
zIndex: zIndex
|
|
336
|
+
zIndex: zIndex,
|
|
337
|
+
value: multiple && !compressed ? value : undefined
|
|
335
338
|
}, _react.default.createElement("div", {
|
|
336
339
|
className: (0, _styles.treeSelectClass)('tree-wrapper')
|
|
337
340
|
}, content));
|
package/css/icons/index.js
CHANGED
package/css/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import './styles/normalize.less'
|
|
3
3
|
import * as utils from './utils'
|
|
4
4
|
|
|
5
|
-
export default { utils, version: '1.8.
|
|
5
|
+
export default { utils, version: '1.8.7-beta.2' }
|
|
6
6
|
export { utils }
|
|
7
7
|
export { setLocale } from './locale'
|
|
8
8
|
export { color, style } from './utils/expose'
|
package/css/index.js
CHANGED
package/css/utils/dom/element.js
CHANGED
|
@@ -214,15 +214,15 @@ var addResizeObserver = function addResizeObserver(el, handler, options) {
|
|
|
214
214
|
width = _entry$0$contentRect.width,
|
|
215
215
|
height = _entry$0$contentRect.height;
|
|
216
216
|
|
|
217
|
-
if (direction === 'x') {
|
|
217
|
+
if (width && direction === 'x') {
|
|
218
218
|
if (lastWidth !== width) {
|
|
219
219
|
handler(entry);
|
|
220
220
|
}
|
|
221
221
|
} else if (direction === 'y') {
|
|
222
|
-
if (lastHeight !== height) {
|
|
222
|
+
if (height && lastHeight !== height) {
|
|
223
223
|
handler(entry);
|
|
224
224
|
}
|
|
225
|
-
} else {
|
|
225
|
+
} else if (width && height) {
|
|
226
226
|
handler(entry, {
|
|
227
227
|
x: lastWidth !== width,
|
|
228
228
|
y: lastHeight !== height
|
package/css/utils/proptypes.js
CHANGED
|
@@ -15,7 +15,7 @@ function getProps(PropTypes) {
|
|
|
15
15
|
grid: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
|
|
16
16
|
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
17
17
|
size: PropTypes.oneOf(['small', 'default', 'large']),
|
|
18
|
-
type: PropTypes.oneOf(['primary', 'default', 'secondary', 'success', 'info', 'warning', 'error', 'danger', 'link'])
|
|
18
|
+
type: PropTypes.oneOf(['primary', 'default', 'secondary', 'success', 'info', 'warning', 'error', 'danger', 'link', 'confirmwarning'])
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
|
|
9
|
+
|
|
8
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
11
|
|
|
10
12
|
var _Datum = _interopRequireDefault(require("../../Datum"));
|
|
@@ -58,7 +60,10 @@ function getRule(rules, props) {
|
|
|
58
60
|
|
|
59
61
|
if (other.min !== undefined || other.max !== undefined) {
|
|
60
62
|
if (type === 'number' || type === 'integer') {
|
|
61
|
-
return (0, _range.default)(props
|
|
63
|
+
return (0, _range.default)((0, _objectSpread2.default)({}, props, {
|
|
64
|
+
min: other.min,
|
|
65
|
+
max: other.max
|
|
66
|
+
}));
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
return (0, _rangeLength.default)(props);
|