@douyinfe/semi-ui 2.40.0-alpha.0 → 2.40.0-beta.0
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/dist/css/semi.css +3 -36
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +280 -537
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/_portal/index.d.ts +3 -2
- package/lib/cjs/_portal/index.js +33 -26
- package/lib/cjs/_utils/index.js +0 -3
- package/lib/cjs/autoComplete/index.js +0 -2
- package/lib/cjs/autoComplete/option.js +0 -2
- package/lib/cjs/avatar/avatarGroup.js +0 -1
- package/lib/cjs/avatar/index.js +0 -1
- package/lib/cjs/backtop/index.js +0 -1
- package/lib/cjs/badge/index.js +0 -1
- package/lib/cjs/banner/index.js +0 -3
- package/lib/cjs/breadcrumb/index.js +0 -3
- package/lib/cjs/button/Button.js +8 -14
- package/lib/cjs/calendar/dayCalendar.js +4 -9
- package/lib/cjs/calendar/dayCol.js +1 -1
- package/lib/cjs/calendar/monthCalendar.js +5 -12
- package/lib/cjs/calendar/rangeCalendar.js +0 -2
- package/lib/cjs/carousel/index.js +0 -2
- package/lib/cjs/checkbox/checkbox.js +0 -2
- package/lib/cjs/checkbox/checkboxGroup.js +0 -3
- package/lib/cjs/checkbox/checkboxInner.js +0 -2
- package/lib/cjs/collapse/index.js +0 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.js +0 -3
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +1 -3
- package/lib/cjs/datePicker/month.js +0 -4
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.js +1 -5
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +0 -2
- package/lib/cjs/form/arrayField.js +0 -2
- package/lib/cjs/form/baseForm.d.ts +0 -1
- package/lib/cjs/form/baseForm.js +5 -7
- package/lib/cjs/form/context.js +0 -2
- package/lib/cjs/form/errorMessage.js +0 -2
- package/lib/cjs/form/field.d.ts +0 -1
- package/lib/cjs/form/field.js +0 -2
- package/lib/cjs/form/group.js +0 -2
- package/lib/cjs/form/hoc/withField.js +2 -6
- package/lib/cjs/form/interface.d.ts +4 -4
- package/lib/cjs/form/interface.js +0 -3
- package/lib/cjs/form/section.js +0 -2
- package/lib/cjs/form/slot.js +0 -3
- package/lib/cjs/iconButton/index.js +0 -2
- package/lib/cjs/image/image.js +29 -34
- package/lib/cjs/image/interface.d.ts +4 -1
- package/lib/cjs/image/preview.js +5 -3
- package/lib/cjs/image/previewContext.d.ts +1 -0
- package/lib/cjs/image/previewFooter.d.ts +5 -1
- package/lib/cjs/image/previewFooter.js +66 -38
- package/lib/cjs/image/previewInner.d.ts +2 -2
- package/lib/cjs/image/previewInner.js +4 -2
- package/lib/cjs/input/index.js +0 -2
- package/lib/cjs/input/inputGroup.js +0 -3
- package/lib/cjs/input/textarea.js +0 -2
- package/lib/cjs/inputNumber/index.js +1 -5
- package/lib/cjs/modal/ConfirmModal.js +0 -2
- package/lib/cjs/modal/Modal.js +0 -2
- package/lib/cjs/modal/ModalContent.js +0 -5
- package/lib/cjs/modal/confirm.d.ts +12 -12
- package/lib/cjs/modal/confirm.js +0 -1
- package/lib/cjs/modal/useModal/HookModal.js +0 -1
- package/lib/cjs/modal/useModal/index.js +0 -2
- package/lib/cjs/navigation/Item.js +0 -3
- package/lib/cjs/navigation/SubNav.js +0 -3
- package/lib/cjs/navigation/index.js +0 -2
- package/lib/cjs/notification/notice.js +29 -35
- package/lib/cjs/notification/useNotification/index.js +1 -1
- package/lib/cjs/overflowList/index.js +0 -2
- package/lib/cjs/pagination/index.d.ts +2 -0
- package/lib/cjs/pagination/index.js +29 -13
- package/lib/cjs/popconfirm/index.js +0 -2
- package/lib/cjs/progress/index.js +0 -1
- package/lib/cjs/radio/radio.js +0 -2
- package/lib/cjs/rating/index.js +0 -1
- package/lib/cjs/resizeObserver/index.js +0 -1
- package/lib/cjs/scrollList/scrollItem.js +0 -3
- package/lib/cjs/select/index.d.ts +0 -1
- package/lib/cjs/select/index.js +3 -12
- package/lib/cjs/select/option.js +0 -2
- package/lib/cjs/select/utils.js +0 -2
- package/lib/cjs/sideSheet/index.js +0 -2
- package/lib/cjs/slider/index.js +0 -3
- package/lib/cjs/spin/icon.js +0 -2
- package/lib/cjs/switch/index.js +0 -2
- package/lib/cjs/table/Body/BaseRow.js +0 -2
- package/lib/cjs/table/Body/ExpandedRow.js +0 -3
- package/lib/cjs/table/Body/SectionRow.js +0 -3
- package/lib/cjs/table/Body/index.js +0 -8
- package/lib/cjs/table/ColGroup.js +0 -1
- package/lib/cjs/table/ColumnFilter.js +0 -3
- package/lib/cjs/table/ColumnSelection.js +0 -2
- package/lib/cjs/table/HeadTable.js +0 -2
- package/lib/cjs/table/ResizableTable.js +1 -4
- package/lib/cjs/table/Table.js +1 -10
- package/lib/cjs/table/TableCell.js +0 -4
- package/lib/cjs/table/TableHeader.js +0 -4
- package/lib/cjs/table/TableHeaderRow.js +0 -2
- package/lib/cjs/table/TablePagination.js +0 -2
- package/lib/cjs/table/table-context.js +0 -2
- package/lib/cjs/tabs/TabBar.js +0 -2
- package/lib/cjs/tag/index.js +1 -3
- package/lib/cjs/tagInput/index.js +0 -2
- package/lib/cjs/timePicker/Combobox.js +0 -4
- package/lib/cjs/timePicker/TimeInput.js +0 -2
- package/lib/cjs/timePicker/TimePicker.js +0 -2
- package/lib/cjs/toast/index.js +0 -2
- package/lib/cjs/toast/toast.js +0 -2
- package/lib/cjs/toast/useToast/index.js +0 -1
- package/lib/cjs/tooltip/index.js +0 -6
- package/lib/cjs/transfer/index.js +0 -3
- package/lib/cjs/tree/index.d.ts +2 -1
- package/lib/cjs/tree/index.js +11 -14
- package/lib/cjs/tree/treeNode.js +0 -3
- package/lib/cjs/treeSelect/index.js +0 -7
- package/lib/cjs/trigger/index.js +0 -2
- package/lib/cjs/typography/util.js +1 -3
- package/lib/cjs/upload/index.js +1 -6
- package/lib/es/_portal/index.d.ts +3 -2
- package/lib/es/_portal/index.js +33 -26
- package/lib/es/_utils/index.js +0 -2
- package/lib/es/autoComplete/index.js +0 -1
- package/lib/es/autoComplete/option.js +0 -1
- package/lib/es/avatar/avatarGroup.js +0 -1
- package/lib/es/avatar/index.js +0 -1
- package/lib/es/backtop/index.js +0 -1
- package/lib/es/badge/index.js +0 -1
- package/lib/es/banner/index.js +0 -2
- package/lib/es/breadcrumb/index.js +0 -2
- package/lib/es/button/Button.js +8 -13
- package/lib/es/calendar/dayCalendar.js +4 -9
- package/lib/es/calendar/dayCol.js +1 -1
- package/lib/es/calendar/monthCalendar.js +5 -11
- package/lib/es/calendar/rangeCalendar.js +0 -1
- package/lib/es/carousel/index.js +0 -1
- package/lib/es/checkbox/checkbox.js +0 -1
- package/lib/es/checkbox/checkboxGroup.js +0 -2
- package/lib/es/checkbox/checkboxInner.js +0 -1
- package/lib/es/collapse/index.js +0 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +0 -3
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +0 -3
- package/lib/es/datePicker/month.js +0 -4
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.js +1 -5
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +0 -1
- package/lib/es/form/arrayField.js +0 -1
- package/lib/es/form/baseForm.d.ts +0 -1
- package/lib/es/form/baseForm.js +5 -6
- package/lib/es/form/context.js +0 -1
- package/lib/es/form/errorMessage.js +0 -1
- package/lib/es/form/field.d.ts +0 -1
- package/lib/es/form/field.js +0 -1
- package/lib/es/form/group.js +0 -1
- package/lib/es/form/hoc/withField.js +2 -6
- package/lib/es/form/interface.d.ts +4 -4
- package/lib/es/form/interface.js +0 -2
- package/lib/es/form/section.js +0 -1
- package/lib/es/form/slot.js +0 -2
- package/lib/es/iconButton/index.js +0 -1
- package/lib/es/image/image.js +29 -34
- package/lib/es/image/interface.d.ts +4 -1
- package/lib/es/image/preview.js +5 -3
- package/lib/es/image/previewContext.d.ts +1 -0
- package/lib/es/image/previewFooter.d.ts +5 -1
- package/lib/es/image/previewFooter.js +66 -38
- package/lib/es/image/previewInner.d.ts +2 -2
- package/lib/es/image/previewInner.js +4 -1
- package/lib/es/input/index.js +0 -1
- package/lib/es/input/inputGroup.js +0 -2
- package/lib/es/input/textarea.js +0 -1
- package/lib/es/inputNumber/index.js +0 -5
- package/lib/es/modal/ConfirmModal.js +0 -2
- package/lib/es/modal/Modal.js +0 -1
- package/lib/es/modal/ModalContent.js +0 -3
- package/lib/es/modal/confirm.d.ts +12 -12
- package/lib/es/modal/confirm.js +0 -1
- package/lib/es/modal/useModal/HookModal.js +0 -1
- package/lib/es/modal/useModal/index.js +0 -2
- package/lib/es/navigation/Item.js +0 -2
- package/lib/es/navigation/SubNav.js +0 -2
- package/lib/es/navigation/index.js +0 -1
- package/lib/es/notification/notice.js +29 -34
- package/lib/es/notification/useNotification/index.js +1 -1
- package/lib/es/overflowList/index.js +0 -1
- package/lib/es/pagination/index.d.ts +2 -0
- package/lib/es/pagination/index.js +28 -13
- package/lib/es/popconfirm/index.js +0 -1
- package/lib/es/progress/index.js +0 -1
- package/lib/es/radio/radio.js +0 -1
- package/lib/es/rating/index.js +0 -1
- package/lib/es/resizeObserver/index.js +0 -1
- package/lib/es/scrollList/scrollItem.js +0 -3
- package/lib/es/select/index.d.ts +0 -1
- package/lib/es/select/index.js +3 -12
- package/lib/es/select/option.js +0 -1
- package/lib/es/select/utils.js +0 -2
- package/lib/es/sideSheet/index.js +0 -1
- package/lib/es/slider/index.js +0 -3
- package/lib/es/spin/icon.js +0 -1
- package/lib/es/switch/index.js +0 -1
- package/lib/es/table/Body/BaseRow.js +0 -2
- package/lib/es/table/Body/ExpandedRow.js +0 -2
- package/lib/es/table/Body/SectionRow.js +0 -3
- package/lib/es/table/Body/index.js +0 -8
- package/lib/es/table/ColGroup.js +0 -1
- package/lib/es/table/ColumnFilter.js +0 -2
- package/lib/es/table/ColumnSelection.js +0 -1
- package/lib/es/table/HeadTable.js +0 -1
- package/lib/es/table/ResizableTable.js +0 -4
- package/lib/es/table/Table.js +0 -10
- package/lib/es/table/TableCell.js +0 -3
- package/lib/es/table/TableHeader.js +0 -3
- package/lib/es/table/TableHeaderRow.js +0 -1
- package/lib/es/table/TablePagination.js +0 -1
- package/lib/es/table/table-context.js +0 -1
- package/lib/es/tabs/TabBar.js +0 -2
- package/lib/es/tag/index.js +1 -2
- package/lib/es/tagInput/index.js +0 -2
- package/lib/es/timePicker/Combobox.js +0 -3
- package/lib/es/timePicker/TimeInput.js +0 -1
- package/lib/es/timePicker/TimePicker.js +0 -1
- package/lib/es/toast/index.js +0 -1
- package/lib/es/toast/toast.js +0 -1
- package/lib/es/toast/useToast/index.js +0 -1
- package/lib/es/tooltip/index.js +0 -5
- package/lib/es/transfer/index.js +0 -3
- package/lib/es/tree/index.d.ts +2 -1
- package/lib/es/tree/index.js +11 -13
- package/lib/es/tree/treeNode.js +0 -3
- package/lib/es/treeSelect/index.js +0 -7
- package/lib/es/trigger/index.js +0 -2
- package/lib/es/typography/util.js +1 -3
- package/lib/es/upload/index.js +1 -5
- package/package.json +8 -8
package/lib/es/_portal/index.js
CHANGED
|
@@ -7,10 +7,35 @@ import ConfigContext from '../configProvider/context';
|
|
|
7
7
|
import '@douyinfe/semi-foundation/lib/es/_portal/portal.css';
|
|
8
8
|
const defaultGetContainer = () => document.body;
|
|
9
9
|
class Portal extends PureComponent {
|
|
10
|
-
constructor(props) {
|
|
10
|
+
constructor(props, context) {
|
|
11
11
|
var _this;
|
|
12
12
|
super(props);
|
|
13
13
|
_this = this;
|
|
14
|
+
this.initContainer = function (context) {
|
|
15
|
+
let catchError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
16
|
+
var _a, _b;
|
|
17
|
+
let container = undefined;
|
|
18
|
+
if (!_this.el) {
|
|
19
|
+
_this.el = document.createElement('div');
|
|
20
|
+
}
|
|
21
|
+
if (!((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container)) {
|
|
22
|
+
try {
|
|
23
|
+
_this.el = document.createElement('div');
|
|
24
|
+
const getContainer = _this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
|
|
25
|
+
const portalContainer = getContainer();
|
|
26
|
+
portalContainer.appendChild(_this.el);
|
|
27
|
+
_this.addStyle(_this.props.style);
|
|
28
|
+
_this.addClass(_this.props.prefixCls, context, _this.props.className);
|
|
29
|
+
container = portalContainer;
|
|
30
|
+
return container;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if (!catchError) {
|
|
33
|
+
throw e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return (_b = _this.state) === null || _b === void 0 ? void 0 : _b.container;
|
|
38
|
+
};
|
|
14
39
|
this.addStyle = function () {
|
|
15
40
|
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
41
|
if (_this.el) {
|
|
@@ -20,11 +45,12 @@ class Portal extends PureComponent {
|
|
|
20
45
|
}
|
|
21
46
|
};
|
|
22
47
|
this.addClass = function (prefixCls) {
|
|
48
|
+
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.context;
|
|
23
49
|
const {
|
|
24
50
|
direction
|
|
25
|
-
} =
|
|
26
|
-
for (var _len = arguments.length, classNames = new Array(_len >
|
|
27
|
-
classNames[_key -
|
|
51
|
+
} = context;
|
|
52
|
+
for (var _len = arguments.length, classNames = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
53
|
+
classNames[_key - 2] = arguments[_key];
|
|
28
54
|
}
|
|
29
55
|
const cls = classnames(prefixCls, ...classNames, {
|
|
30
56
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
@@ -33,32 +59,13 @@ class Portal extends PureComponent {
|
|
|
33
59
|
_this.el.className = cls;
|
|
34
60
|
}
|
|
35
61
|
};
|
|
36
|
-
try {
|
|
37
|
-
this.el = document.createElement('div');
|
|
38
|
-
} catch (e) {}
|
|
39
62
|
this.state = {
|
|
40
|
-
container:
|
|
63
|
+
container: this.initContainer(context, true)
|
|
41
64
|
};
|
|
42
65
|
}
|
|
43
66
|
componentDidMount() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
const {
|
|
48
|
-
state,
|
|
49
|
-
props,
|
|
50
|
-
context
|
|
51
|
-
} = this;
|
|
52
|
-
const getContainer = props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
|
|
53
|
-
const container = getContainer();
|
|
54
|
-
if (container !== state.container) {
|
|
55
|
-
// const computedStyle = window.getComputedStyle(container);
|
|
56
|
-
// if (computedStyle.position !== 'relative') {
|
|
57
|
-
// container.style.position = 'relative';
|
|
58
|
-
// }
|
|
59
|
-
container.appendChild(this.el);
|
|
60
|
-
this.addStyle(props.style);
|
|
61
|
-
this.addClass(props.prefixCls, props.className);
|
|
67
|
+
const container = this.initContainer(this.context);
|
|
68
|
+
if (container !== this.state.container) {
|
|
62
69
|
this.setState({
|
|
63
70
|
container
|
|
64
71
|
});
|
package/lib/es/_utils/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
2
|
import _set from "lodash/set";
|
|
3
3
|
import _cloneDeepWith from "lodash/cloneDeepWith";
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
|
-
/* argus-disable unPkgSensitiveInfo */
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import warning from '@douyinfe/semi-foundation/lib/es/utils/warning';
|
|
8
6
|
import { findAll } from '@douyinfe/semi-foundation/lib/es/utils/getHighlight';
|
package/lib/es/avatar/index.js
CHANGED
package/lib/es/backtop/index.js
CHANGED
package/lib/es/badge/index.js
CHANGED
|
@@ -23,7 +23,6 @@ export default class Badge extends PureComponent {
|
|
|
23
23
|
} = this.context;
|
|
24
24
|
// DefaultPosition here, static can't get this
|
|
25
25
|
const defaultPosition = direction === 'rtl' ? 'leftTop' : 'rightTop';
|
|
26
|
-
// eslint-disable-next-line max-len
|
|
27
26
|
const _a = this.props,
|
|
28
27
|
{
|
|
29
28
|
count,
|
package/lib/es/banner/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import cls from 'classnames';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
@@ -169,7 +168,6 @@ Banner.propTypes = {
|
|
|
169
168
|
bordered: PropTypes.bool
|
|
170
169
|
};
|
|
171
170
|
Banner.defaultProps = {
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
173
171
|
onClose: () => {},
|
|
174
172
|
type: 'info',
|
|
175
173
|
fullMode: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _isFunction from "lodash/isFunction";
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import cls from 'classnames';
|
|
5
4
|
import propTypes from 'prop-types';
|
|
@@ -59,7 +58,6 @@ class Breadcrumb extends BaseComponent {
|
|
|
59
58
|
key: key,
|
|
60
59
|
active: idx === items.length - 1,
|
|
61
60
|
route: route._origin,
|
|
62
|
-
// eslint-disable-next-line max-len
|
|
63
61
|
shouldRenderSeparator: !(shouldCollapse && (hasRenderMore || moreTypeIsPopover) && inCollapseArea)
|
|
64
62
|
}), renderItem ? renderItem(route._origin) : route.name);
|
|
65
63
|
});
|
package/lib/es/button/Button.js
CHANGED
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable react/destructuring-assignment */
|
|
11
10
|
import React, { PureComponent } from 'react';
|
|
12
11
|
import classNames from 'classnames';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
@@ -60,18 +59,14 @@ export default class Button extends PureComponent {
|
|
|
60
59
|
if (!(className && className.includes('-with-icon'))) {
|
|
61
60
|
xSemiProps['x-semi-prop'] = this.props['x-semi-children-alias'] || 'children';
|
|
62
61
|
}
|
|
63
|
-
return (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
className: `${prefixCls}-content`,
|
|
72
|
-
onClick: e => disabled && e.stopPropagation()
|
|
73
|
-
}, xSemiProps), children))
|
|
74
|
-
);
|
|
62
|
+
return /*#__PURE__*/React.createElement("button", Object.assign({}, baseProps, {
|
|
63
|
+
onClick: this.props.onClick,
|
|
64
|
+
onMouseDown: this.props.onMouseDown,
|
|
65
|
+
style: style
|
|
66
|
+
}), /*#__PURE__*/React.createElement("span", Object.assign({
|
|
67
|
+
className: `${prefixCls}-content`,
|
|
68
|
+
onClick: e => disabled && e.stopPropagation()
|
|
69
|
+
}, xSemiProps), children));
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
72
|
Button.defaultProps = {
|
|
@@ -24,14 +24,10 @@ export default class DayCalendar extends BaseComponent {
|
|
|
24
24
|
children,
|
|
25
25
|
key
|
|
26
26
|
} = event;
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: `${cssClasses.PREFIX}-event-item ${cssClasses.PREFIX}-event-allday`,
|
|
32
|
-
key: key || `allDay-${ind}`
|
|
33
|
-
}, children)
|
|
34
|
-
);
|
|
27
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
28
|
+
className: `${cssClasses.PREFIX}-event-item ${cssClasses.PREFIX}-event-allday`,
|
|
29
|
+
key: key || `allDay-${ind}`
|
|
30
|
+
}, children);
|
|
35
31
|
});
|
|
36
32
|
return list;
|
|
37
33
|
};
|
|
@@ -112,7 +108,6 @@ export default class DayCalendar extends BaseComponent {
|
|
|
112
108
|
this.foundation.destroy();
|
|
113
109
|
}
|
|
114
110
|
render() {
|
|
115
|
-
// eslint-disable-next-line max-len
|
|
116
111
|
const {
|
|
117
112
|
dateGridRender,
|
|
118
113
|
displayValue,
|
|
@@ -5,7 +5,6 @@ import ReactDOM from 'react-dom';
|
|
|
5
5
|
import cls from 'classnames';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
8
|
-
// eslint-disable-next-line max-len
|
|
9
8
|
import CalendarFoundation from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
|
|
10
9
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/calendar/constants';
|
|
11
10
|
import LocaleConsumer from '../locale/localeConsumer';
|
|
@@ -180,15 +179,11 @@ export default class monthCalendar extends BaseComponent {
|
|
|
180
179
|
className: `${cssClasses.PREFIX}-today-date`
|
|
181
180
|
}, "\u00A0", date), locale.datestring));
|
|
182
181
|
}
|
|
183
|
-
return (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
189
|
-
className: `${cssClasses.PREFIX}-today-date`
|
|
190
|
-
}, date))
|
|
191
|
-
);
|
|
182
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
183
|
+
className: `${prefixCls}-date`
|
|
184
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
185
|
+
className: `${cssClasses.PREFIX}-today-date`
|
|
186
|
+
}, date));
|
|
192
187
|
};
|
|
193
188
|
this.renderCusDateGrid = date => {
|
|
194
189
|
const {
|
|
@@ -279,7 +274,6 @@ export default class monthCalendar extends BaseComponent {
|
|
|
279
274
|
registerClickOutsideHandler: (key, cb) => {
|
|
280
275
|
const clickOutsideHandler = e => {
|
|
281
276
|
const cardInstance = this.cardRef && this.cardRef.get(key);
|
|
282
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
283
277
|
const cardDom = ReactDOM.findDOMNode(cardInstance);
|
|
284
278
|
if (cardDom && !cardDom.contains(e.target)) {
|
|
285
279
|
cb();
|
|
@@ -2,7 +2,6 @@ import _isEqual from "lodash/isEqual";
|
|
|
2
2
|
import React, { Fragment } from 'react';
|
|
3
3
|
import cls from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
// eslint-disable-next-line max-len
|
|
6
5
|
import CalendarFoundation from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
|
|
7
6
|
import LocaleConsumer from '../locale/localeConsumer';
|
|
8
7
|
import localeContext from '../locale/context';
|
package/lib/es/carousel/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
2
|
import _debounce from "lodash/debounce";
|
|
3
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
4
3
|
import React, { Children, isValidElement } from 'react';
|
|
5
4
|
import cls from 'classnames';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import classnames from 'classnames';
|
|
@@ -140,7 +139,6 @@ CheckboxGroup.propTypes = {
|
|
|
140
139
|
};
|
|
141
140
|
CheckboxGroup.defaultProps = {
|
|
142
141
|
disabled: false,
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
144
142
|
onChange: () => {},
|
|
145
143
|
type: strings.TYPE_DEFAULT,
|
|
146
144
|
defaultValue: [],
|
package/lib/es/collapse/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
31
31
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
32
|
value: PropTypes.Requireable<any[]>;
|
|
33
33
|
disabled: PropTypes.Requireable<boolean>;
|
|
34
|
-
type: PropTypes.Requireable<"
|
|
34
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
35
35
|
showClear: PropTypes.Requireable<boolean>;
|
|
36
36
|
format: PropTypes.Requireable<string>;
|
|
37
37
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -9,8 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
};
|
|
10
10
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
11
11
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12
|
-
/* eslint-disable max-lines-per-function */
|
|
13
|
-
/* eslint-disable no-unused-vars */
|
|
14
12
|
import React from 'react';
|
|
15
13
|
import cls from 'classnames';
|
|
16
14
|
import PropTypes from 'prop-types';
|
|
@@ -104,7 +102,6 @@ export default class DateInput extends BaseComponent {
|
|
|
104
102
|
this.foundation.destroy();
|
|
105
103
|
}
|
|
106
104
|
formatText(value) {
|
|
107
|
-
// eslint-disable-next-line max-len
|
|
108
105
|
return value && value.length ? this.foundation.formatShowText(value) : '';
|
|
109
106
|
}
|
|
110
107
|
renderRangePrefix() {
|
|
@@ -58,7 +58,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
58
58
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
59
59
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
60
60
|
borderless: PropTypes.Requireable<boolean>;
|
|
61
|
-
type: PropTypes.Requireable<"
|
|
61
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
62
62
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
63
63
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
64
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
@@ -14,9 +14,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
14
14
|
return t;
|
|
15
15
|
};
|
|
16
16
|
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus */
|
|
17
|
-
/* eslint-disable max-len */
|
|
18
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
19
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
20
17
|
import React from 'react';
|
|
21
18
|
import classnames from 'classnames';
|
|
22
19
|
import PropTypes from 'prop-types';
|
|
@@ -2,7 +2,6 @@ import _isFunction from "lodash/isFunction";
|
|
|
2
2
|
import _stubFalse from "lodash/stubFalse";
|
|
3
3
|
import _noop from "lodash/noop";
|
|
4
4
|
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
|
|
5
|
-
/* eslint-disable max-len */
|
|
6
5
|
import React from 'react';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
@@ -112,7 +111,6 @@ export default class Month extends BaseComponent {
|
|
|
112
111
|
// The range selects the hover date, and the normal hover is .semi-datepicker-main: hover
|
|
113
112
|
const _isHoverDay = isSameDay(hoverDay, fullDate);
|
|
114
113
|
// When one is selected
|
|
115
|
-
// eslint-disable-next-line one-var
|
|
116
114
|
let _isHoverAfterStart, _isHoverBeforeEnd, isSelectedStart, isSelectedEnd, isHoverDayAroundOneSelected;
|
|
117
115
|
if (rangeStart) {
|
|
118
116
|
isSelectedStart = isSameDay(fullDate, rangeStart);
|
|
@@ -135,13 +133,11 @@ export default class Month extends BaseComponent {
|
|
|
135
133
|
if (!_isDateRangeSelected && _isDateRangeAnySelected) {
|
|
136
134
|
isHoverDayAroundOneSelected = _isHoverDay;
|
|
137
135
|
}
|
|
138
|
-
// eslint-disable-next-line one-var
|
|
139
136
|
let isHover;
|
|
140
137
|
if (!_isOffsetDateRangeAnyExist) {
|
|
141
138
|
isHover = _isHoverAfterStart || _isHoverBeforeEnd || _isHoverDay;
|
|
142
139
|
}
|
|
143
140
|
// Select all
|
|
144
|
-
// eslint-disable-next-line one-var
|
|
145
141
|
let isInRange, isSelectedStartAfterHover, isSelectedEndBeforeHover, isHoverDayInStartSelection, isHoverDayInEndSelection, isHoverDayInRange;
|
|
146
142
|
if (_isDateRangeSelected) {
|
|
147
143
|
isInRange = isBetween(fullDate, {
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<any[]>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import _stubFalse from "lodash/stubFalse";
|
|
2
2
|
import _noop from "lodash/noop";
|
|
3
|
-
/* eslint-disable jsx-a11y/interactive-supports-focus
|
|
4
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
5
|
-
/* eslint-disable react/no-did-update-set-state */
|
|
6
|
-
/* eslint-disable max-len */
|
|
7
|
-
/* eslint-disable no-nested-ternary */
|
|
3
|
+
/* eslint-disable jsx-a11y/interactive-supports-focus */
|
|
8
4
|
import React from 'react';
|
|
9
5
|
import classnames from 'classnames';
|
|
10
6
|
import PropTypes from 'prop-types';
|
|
@@ -24,7 +24,7 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
|
|
|
24
24
|
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
25
25
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
28
28
|
startYear: PropTypes.Requireable<number>;
|
|
29
29
|
endYear: PropTypes.Requireable<number>;
|
|
30
30
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
2
|
import _stubFalse from "lodash/stubFalse";
|
|
3
3
|
import _noop from "lodash/noop";
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
7
6
|
import YearAndMonthFoundation from '@douyinfe/semi-foundation/lib/es/datePicker/yearAndMonthFoundation';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _isUndefined from "lodash/isUndefined";
|
|
2
2
|
import _cloneDeep from "lodash/cloneDeep";
|
|
3
|
-
/* eslint-disable react/destructuring-assignment */
|
|
4
3
|
import React, { Component } from 'react';
|
|
5
4
|
import { getUuidv4 } from '@douyinfe/semi-foundation/lib/es/utils/uuid';
|
|
6
5
|
import { FormUpdaterContext, ArrayFieldContext } from './context';
|
|
@@ -65,7 +65,6 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
65
65
|
autoClearSearchValue?: boolean;
|
|
66
66
|
arrowIcon?: React.ReactNode;
|
|
67
67
|
borderless?: boolean;
|
|
68
|
-
showArrowInBorderless?: boolean;
|
|
69
68
|
clearIcon?: React.ReactNode;
|
|
70
69
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
71
70
|
value?: string | number | any[] | Record<string, any>;
|
package/lib/es/form/baseForm.js
CHANGED
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable prefer-template, max-len, @typescript-eslint/no-unused-vars */
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import classNames from 'classnames';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
@@ -54,11 +53,11 @@ class Form extends BaseComponent {
|
|
|
54
53
|
get adapter() {
|
|
55
54
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
56
55
|
cloneDeep,
|
|
57
|
-
notifySubmit: values => {
|
|
58
|
-
this.props.onSubmit(values);
|
|
56
|
+
notifySubmit: (values, e) => {
|
|
57
|
+
this.props.onSubmit(values, e);
|
|
59
58
|
},
|
|
60
|
-
notifySubmitFail: (errors, values) => {
|
|
61
|
-
this.props.onSubmitFail(errors, values);
|
|
59
|
+
notifySubmitFail: (errors, values, e) => {
|
|
60
|
+
this.props.onSubmitFail(errors, values, e);
|
|
62
61
|
},
|
|
63
62
|
forceUpdate: callback => {
|
|
64
63
|
this.forceUpdate(callback);
|
|
@@ -129,7 +128,7 @@ class Form extends BaseComponent {
|
|
|
129
128
|
}
|
|
130
129
|
submit(e) {
|
|
131
130
|
e.preventDefault();
|
|
132
|
-
this.foundation.submit();
|
|
131
|
+
this.foundation.submit(e);
|
|
133
132
|
}
|
|
134
133
|
reset(e) {
|
|
135
134
|
e.preventDefault();
|
package/lib/es/form/context.js
CHANGED
package/lib/es/form/field.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
13
13
|
autoClearSearchValue?: boolean;
|
|
14
14
|
arrowIcon?: import("react").ReactNode;
|
|
15
15
|
borderless?: boolean;
|
|
16
|
-
showArrowInBorderless?: boolean;
|
|
17
16
|
clearIcon?: import("react").ReactNode;
|
|
18
17
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
19
18
|
value?: string | number | any[] | Record<string, any>;
|
package/lib/es/form/field.js
CHANGED
package/lib/es/form/group.js
CHANGED
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable react/destructuring-assignment */
|
|
11
10
|
import React, { Component } from 'react';
|
|
12
11
|
import classNames from 'classnames';
|
|
13
12
|
import { isValid } from '@douyinfe/semi-foundation/lib/es/form/utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
import React, { useState, useLayoutEffect, useEffect, useMemo, useRef, forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/form/constants';
|
|
@@ -151,9 +151,7 @@ function withField(Component, opts) {
|
|
|
151
151
|
const rootPromise = new Promise((resolve, reject) => {
|
|
152
152
|
validator.validate(model, {
|
|
153
153
|
first: stopValidateWithError
|
|
154
|
-
},
|
|
155
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
156
|
-
(errors, fields) => {}).then(res => {
|
|
154
|
+
}, (errors, fields) => {}).then(res => {
|
|
157
155
|
if (validatePromise.current !== rootPromise) {
|
|
158
156
|
return;
|
|
159
157
|
}
|
|
@@ -172,7 +170,6 @@ function withField(Component, opts) {
|
|
|
172
170
|
if (errors && fields) {
|
|
173
171
|
let messages = errors.map(e => e.message);
|
|
174
172
|
if (messages.length === 1) {
|
|
175
|
-
// eslint-disable-next-line prefer-destructuring
|
|
176
173
|
messages = messages[0];
|
|
177
174
|
}
|
|
178
175
|
updateError(messages, callOpts);
|
|
@@ -349,7 +346,6 @@ function withField(Component, opts) {
|
|
|
349
346
|
useIsomorphicEffect(() => {
|
|
350
347
|
// register
|
|
351
348
|
if (typeof field === 'undefined') {
|
|
352
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
353
349
|
return () => {};
|
|
354
350
|
}
|
|
355
351
|
// log('register: ' + field);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Subtract } from 'utility-types';
|
|
3
3
|
import type { RuleItem } from 'async-validator';
|
|
4
|
-
import type { Options as
|
|
4
|
+
import type { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
|
5
5
|
import type { BaseFormApi as FormApi, FormState, WithFieldOption, AllErrors } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
6
6
|
import type { SelectProps } from '../select/index';
|
|
7
7
|
import Option from '../select/option';
|
|
@@ -83,8 +83,8 @@ export interface FormFCChild<K extends Record<string, any> = any> {
|
|
|
83
83
|
}
|
|
84
84
|
export interface BaseFormProps<Values extends Record<string, any> = any> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange' | 'onSubmit' | 'onReset'> {
|
|
85
85
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
86
|
-
onSubmit?: (values: Values) => void;
|
|
87
|
-
onSubmitFail?: (errors: Record<keyof Values, FieldError>, values: Partial<Values>) => void;
|
|
86
|
+
onSubmit?: (values: Values, e?: React.FormEvent<HTMLFormElement>) => void;
|
|
87
|
+
onSubmitFail?: (errors: Record<keyof Values, FieldError>, values: Partial<Values>, e?: React.FormEvent<HTMLFormElement>) => void;
|
|
88
88
|
onReset?: () => void;
|
|
89
89
|
onValueChange?: (values: Values, changedValue: Partial<Values>) => void;
|
|
90
90
|
onChange?: (formState: FormState<Values>) => void;
|
|
@@ -106,7 +106,7 @@ export interface BaseFormProps<Values extends Record<string, any> = any> extends
|
|
|
106
106
|
render?: (internalProps: FormFCChild) => React.ReactNode;
|
|
107
107
|
component?: React.FC<any> | React.ComponentClass<any>;
|
|
108
108
|
children?: React.ReactNode | ((internalProps: FormFCChild) => React.ReactNode);
|
|
109
|
-
autoScrollToError?: boolean |
|
|
109
|
+
autoScrollToError?: boolean | ScrollIntoViewOptions;
|
|
110
110
|
disabled?: boolean;
|
|
111
111
|
showValidateIcon?: boolean;
|
|
112
112
|
extraTextPosition?: 'middle' | 'bottom';
|
package/lib/es/form/interface.js
CHANGED
package/lib/es/form/section.js
CHANGED