@douyinfe/semi-ui 2.39.0 → 2.39.1
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/umd/semi-ui.js +88 -419
- 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/_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.js +0 -3
- package/lib/cjs/datePicker/datePicker.js +1 -3
- package/lib/cjs/datePicker/month.js +0 -4
- package/lib/cjs/datePicker/monthsGrid.js +1 -5
- package/lib/cjs/datePicker/yearAndMonth.js +0 -2
- package/lib/cjs/form/arrayField.js +0 -2
- package/lib/cjs/form/baseForm.js +0 -2
- package/lib/cjs/form/context.js +0 -2
- package/lib/cjs/form/errorMessage.js +0 -2
- 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.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 +25 -32
- package/lib/cjs/image/interface.d.ts +2 -1
- package/lib/cjs/image/previewInner.d.ts +2 -2
- package/lib/cjs/image/previewInner.js +0 -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.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.js +1 -1
- 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.js +0 -6
- 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.js +0 -3
- 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 +0 -2
- 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.js +0 -3
- package/lib/es/datePicker/datePicker.js +0 -3
- package/lib/es/datePicker/month.js +0 -4
- package/lib/es/datePicker/monthsGrid.js +1 -5
- package/lib/es/datePicker/yearAndMonth.js +0 -1
- package/lib/es/form/arrayField.js +0 -1
- package/lib/es/form/baseForm.js +0 -1
- package/lib/es/form/context.js +0 -1
- package/lib/es/form/errorMessage.js +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.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 +25 -32
- package/lib/es/image/interface.d.ts +2 -1
- package/lib/es/image/previewInner.d.ts +2 -2
- package/lib/es/image/previewInner.js +0 -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.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.js +0 -1
- 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.js +0 -6
- 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.js +0 -2
- 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 +0 -1
- package/package.json +8 -8
|
@@ -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
|
@@ -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() {
|
|
@@ -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, {
|
|
@@ -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';
|
|
@@ -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';
|
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';
|
package/lib/es/form/context.js
CHANGED
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);
|
package/lib/es/form/interface.js
CHANGED
package/lib/es/form/section.js
CHANGED
package/lib/es/form/slot.js
CHANGED
|
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable max-lines-per-function, prefer-destructuring, prefer-const, @typescript-eslint/no-unused-vars */
|
|
13
12
|
import React, { useContext } from 'react';
|
|
14
13
|
import classNames from 'classnames';
|
|
15
14
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/form/constants';
|
|
@@ -30,7 +29,6 @@ const FormSlot = props => {
|
|
|
30
29
|
labelAlign = formProps.labelAlign;
|
|
31
30
|
labelPosition = formProps.labelPosition ? formProps.labelPosition : labelPosition;
|
|
32
31
|
} catch (error) {}
|
|
33
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
34
32
|
props.labelPosition ? labelPosition = props.labelPosition : null;
|
|
35
33
|
let {
|
|
36
34
|
children,
|
package/lib/es/image/image.js
CHANGED
|
@@ -9,8 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
13
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
14
12
|
import React from "react";
|
|
15
13
|
import BaseComponent from "../_base/baseComponent";
|
|
16
14
|
import PropTypes from "prop-types";
|
|
@@ -174,36 +172,31 @@ export default class Image extends BaseComponent {
|
|
|
174
172
|
const showPreviewCursor = preview && loadStatus === "success";
|
|
175
173
|
const previewSrc = _isObject(preview) ? (_a = preview.src) !== null && _a !== void 0 ? _a : src : src;
|
|
176
174
|
const previewProps = _isObject(preview) ? preview : {};
|
|
177
|
-
return (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
visible: previewVisible,
|
|
203
|
-
onVisibleChange: this.handlePreviewVisibleChange,
|
|
204
|
-
crossOrigin: !_isUndefined(crossOrigin) ? crossOrigin : previewProps === null || previewProps === void 0 ? void 0 : previewProps.crossOrigin
|
|
205
|
-
})))
|
|
206
|
-
);
|
|
175
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
style: outerStyle,
|
|
177
|
+
className: outerCls,
|
|
178
|
+
onClick: this.handleClick
|
|
179
|
+
}, /*#__PURE__*/React.createElement("img", Object.assign({
|
|
180
|
+
ref: this.imgRef
|
|
181
|
+
}, restProps, {
|
|
182
|
+
src: this.isInGroup() && this.isLazyLoad() ? undefined : src,
|
|
183
|
+
"data-src": src,
|
|
184
|
+
alt: alt,
|
|
185
|
+
className: cls(`${prefixCls}-img`, {
|
|
186
|
+
[`${prefixCls}-img-preview`]: showPreviewCursor,
|
|
187
|
+
[`${prefixCls}-img-error`]: loadStatus === "error"
|
|
188
|
+
}),
|
|
189
|
+
width: width,
|
|
190
|
+
height: height,
|
|
191
|
+
crossOrigin: crossOrigin,
|
|
192
|
+
onError: this.handleError,
|
|
193
|
+
onLoad: this.handleLoaded
|
|
194
|
+
})), loadStatus !== "success" && this.renderExtra(), canPreview && /*#__PURE__*/React.createElement(PreviewInner, Object.assign({}, previewProps, {
|
|
195
|
+
src: previewSrc,
|
|
196
|
+
visible: previewVisible,
|
|
197
|
+
onVisibleChange: this.handlePreviewVisibleChange,
|
|
198
|
+
crossOrigin: !_isUndefined(crossOrigin) ? crossOrigin : previewProps === null || previewProps === void 0 ? void 0 : previewProps.crossOrigin
|
|
199
|
+
})));
|
|
207
200
|
}
|
|
208
201
|
}
|
|
209
202
|
Image.isSemiImage = true;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BaseProps } from "_base/baseComponent";
|
|
3
|
+
import { RatioType } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
3
4
|
import React from "react";
|
|
5
|
+
export type { RatioType };
|
|
4
6
|
export interface ImageStates {
|
|
5
7
|
src: string;
|
|
6
8
|
loadStatus: "loading" | "success" | "error";
|
|
@@ -84,7 +86,6 @@ export interface MenuProps {
|
|
|
84
86
|
onRotateLeft?: () => void;
|
|
85
87
|
onRotateRight?: () => void;
|
|
86
88
|
}
|
|
87
|
-
export type RatioType = "adaptation" | "realSize";
|
|
88
89
|
export interface PreviewInnerStates {
|
|
89
90
|
imgSrc?: string[];
|
|
90
91
|
imgLoadStatus?: Map<string, boolean>;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import BaseComponent from "../_base/baseComponent";
|
|
3
3
|
import { PreviewProps as PreviewInnerProps, PreviewInnerStates } from "./interface";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import PreviewInnerFoundation, { PreviewInnerAdapter } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
5
|
+
import PreviewInnerFoundation, { PreviewInnerAdapter, RatioType } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
6
6
|
import { PreviewContextProps } from "./previewContext";
|
|
7
7
|
export default class PreviewInner extends BaseComponent<PreviewInnerProps, PreviewInnerStates> {
|
|
8
8
|
static contextType: React.Context<PreviewContextProps>;
|
|
@@ -77,7 +77,7 @@ export default class PreviewInner extends BaseComponent<PreviewInnerProps, Previ
|
|
|
77
77
|
handleSwitchImage: (direction: string) => void;
|
|
78
78
|
handleDownload: () => void;
|
|
79
79
|
handlePreviewClose: () => void;
|
|
80
|
-
handleAdjustRatio: (type:
|
|
80
|
+
handleAdjustRatio: (type: RatioType) => void;
|
|
81
81
|
handleRotateImage: (direction: any) => void;
|
|
82
82
|
handleZoomImage: (newZoom: number) => void;
|
|
83
83
|
handleMouseUp: (e: any) => void;
|
package/lib/es/input/index.js
CHANGED
|
@@ -10,7 +10,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
/* eslint-disable no-unused-vars, max-len, @typescript-eslint/no-unused-vars */
|
|
14
13
|
import React from 'react';
|
|
15
14
|
import cls from 'classnames';
|
|
16
15
|
import PropTypes from 'prop-types';
|
|
@@ -8,7 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
8
|
}
|
|
9
9
|
return t;
|
|
10
10
|
};
|
|
11
|
-
/* eslint-disable max-len */
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import cls from 'classnames';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
@@ -20,7 +19,6 @@ const prefixCls = cssClasses.PREFIX;
|
|
|
20
19
|
const sizeSet = strings.SIZE;
|
|
21
20
|
export default class inputGroup extends BaseComponent {
|
|
22
21
|
renderGroupWithLabel(inner) {
|
|
23
|
-
// eslint-disable-next-line no-unused-vars
|
|
24
22
|
const _a = this.props,
|
|
25
23
|
{
|
|
26
24
|
size,
|
package/lib/es/input/textarea.js
CHANGED
|
@@ -10,11 +10,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
13
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14
|
-
/* eslint-disable no-unused-vars */
|
|
15
|
-
/* eslint-disable max-depth */
|
|
16
|
-
/* eslint-disable react/no-did-update-set-state */
|
|
17
|
-
/* eslint-disable max-len */
|
|
18
13
|
import React from 'react';
|
|
19
14
|
import PropTypes from 'prop-types';
|
|
20
15
|
import classnames from 'classnames';
|
|
@@ -6,8 +6,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
-
/* eslint-disable react/destructuring-assignment */
|
|
10
|
-
/* eslint-disable eqeqeq */
|
|
11
9
|
import React, { useState, useCallback } from 'react';
|
|
12
10
|
import cls from 'classnames';
|
|
13
11
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/modal/constants';
|
package/lib/es/modal/Modal.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, prefer-const, @typescript-eslint/no-unused-vars */
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/modal/constants';
|
|
13
12
|
import Button from '../button';
|
|
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable eqeqeq */
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
15
14
|
import cls from 'classnames';
|
|
@@ -18,7 +17,6 @@ import ConfigContext from '../configProvider/context';
|
|
|
18
17
|
import Button from '../iconButton';
|
|
19
18
|
import Typography from '../typography';
|
|
20
19
|
import BaseComponent from '../_base/baseComponent';
|
|
21
|
-
// eslint-disable-next-line max-len
|
|
22
20
|
import ModalContentFoundation from '@douyinfe/semi-foundation/lib/es/modal/modalContentFoundation';
|
|
23
21
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
24
22
|
import FocusTrapHandle from '@douyinfe/semi-foundation/lib/es/utils/FocusHandle';
|
|
@@ -308,7 +306,6 @@ export default class ModalContent extends BaseComponent {
|
|
|
308
306
|
onClick: maskClosable ? this.onMaskClick : null,
|
|
309
307
|
onMouseUp: maskClosable ? this.onMaskMouseUp : null
|
|
310
308
|
}, this.props.contentExtraProps), this.getDialogElement()));
|
|
311
|
-
// eslint-disable-next-line max-len
|
|
312
309
|
return containerContext && containerContext.Provider ? /*#__PURE__*/React.createElement(containerContext.Provider, {
|
|
313
310
|
value: containerContext.value
|
|
314
311
|
}, elem) : elem;
|
package/lib/es/modal/confirm.js
CHANGED
|
@@ -14,12 +14,10 @@ function usePatchElement() {
|
|
|
14
14
|
}
|
|
15
15
|
export default function useModal() {
|
|
16
16
|
const [elements, patchElement] = usePatchElement();
|
|
17
|
-
// eslint-disable-next-line max-len
|
|
18
17
|
function getConfirmFunc(withFunc) {
|
|
19
18
|
return function hookConfirm(config) {
|
|
20
19
|
uuid += 1;
|
|
21
20
|
const modalRef = /*#__PURE__*/React.createRef();
|
|
22
|
-
// eslint-disable-next-line prefer-const
|
|
23
21
|
let closeFunc;
|
|
24
22
|
const modal = /*#__PURE__*/React.createElement(HookModal, {
|
|
25
23
|
key: `semi-modal-${uuid}`,
|
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable no-unreachable */
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import cls from 'classnames';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
@@ -128,39 +127,35 @@ class Notice extends BaseComponent {
|
|
|
128
127
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
129
128
|
});
|
|
130
129
|
const titleID = getUuidShort({});
|
|
131
|
-
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
size: "small",
|
|
161
|
-
onClick: this.close
|
|
162
|
-
})))
|
|
163
|
-
);
|
|
130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: wrapper,
|
|
132
|
+
style: style,
|
|
133
|
+
onMouseEnter: this.clearCloseTimer,
|
|
134
|
+
onMouseLeave: this.startCloseTimer,
|
|
135
|
+
onClick: this.notifyClick,
|
|
136
|
+
"aria-labelledby": titleID,
|
|
137
|
+
role: 'alert',
|
|
138
|
+
onAnimationEnd: this.props.onAnimationEnd,
|
|
139
|
+
onAnimationStart: this.props.onAnimationStart
|
|
140
|
+
}, /*#__PURE__*/React.createElement("div", null, this.renderTypeIcon()), /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: `${prefixCls}-inner`
|
|
142
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: `${prefixCls}-content-wrapper`
|
|
144
|
+
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
id: titleID,
|
|
146
|
+
className: `${prefixCls}-title`,
|
|
147
|
+
"x-semi-prop": "title"
|
|
148
|
+
}, title) : '', content ? /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: `${prefixCls}-content`,
|
|
150
|
+
"x-semi-prop": "content"
|
|
151
|
+
}, content) : ''), showClose && /*#__PURE__*/React.createElement(Button, {
|
|
152
|
+
className: `${prefixCls}-icon-close`,
|
|
153
|
+
type: "tertiary",
|
|
154
|
+
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
155
|
+
theme: "borderless",
|
|
156
|
+
size: "small",
|
|
157
|
+
onClick: this.close
|
|
158
|
+
})));
|
|
164
159
|
}
|
|
165
160
|
}
|
|
166
161
|
Notice.contextType = ConfigContext;
|
|
@@ -52,6 +52,7 @@ function usePatchElement() {
|
|
|
52
52
|
const pos = obj[0];
|
|
53
53
|
const notices = obj[1];
|
|
54
54
|
// @ts-ignore
|
|
55
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
55
56
|
return Array.isArray(notices) && notices.length ? /*#__PURE__*/React.createElement("div", {
|
|
56
57
|
key: pos,
|
|
57
58
|
className: cls(cssClasses.LIST),
|
|
@@ -69,7 +70,6 @@ export default function useNotification() {
|
|
|
69
70
|
const mergeConfig = Object.assign(Object.assign({}, config), {
|
|
70
71
|
id
|
|
71
72
|
});
|
|
72
|
-
// eslint-disable-next-line prefer-const
|
|
73
73
|
let closeFunc;
|
|
74
74
|
const ref = ele => {
|
|
75
75
|
noticeRef.set(id, ele);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
2
|
import _isFunction from "lodash/isFunction";
|
|
3
3
|
import _isEqual from "lodash/isEqual";
|
|
4
|
-
/* eslint-disable arrow-body-style */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import cls from 'classnames';
|
|
7
6
|
import BaseComponent from '../_base/baseComponent';
|