@douyinfe/semi-ui 2.29.0-beta.0 → 2.30.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 +16 -8
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +174 -106
- 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/cascader/index.d.ts +2 -0
- package/lib/cjs/cascader/index.js +8 -0
- package/lib/cjs/datePicker/datePicker.js +0 -24
- package/lib/cjs/locale/source/ar.js +5 -5
- package/lib/cjs/locale/source/de.js +5 -5
- package/lib/cjs/locale/source/en_GB.js +5 -5
- package/lib/cjs/locale/source/en_US.js +4 -4
- package/lib/cjs/locale/source/es.js +5 -5
- package/lib/cjs/locale/source/fr.js +5 -5
- package/lib/cjs/locale/source/id_ID.js +4 -4
- package/lib/cjs/locale/source/it.js +5 -5
- package/lib/cjs/locale/source/ja_JP.js +5 -5
- package/lib/cjs/locale/source/ko_KR.js +4 -4
- package/lib/cjs/locale/source/ms_MY.js +4 -4
- package/lib/cjs/locale/source/nl_NL.d.ts +1 -1
- package/lib/cjs/locale/source/nl_NL.js +6 -6
- package/lib/cjs/locale/source/pl_PL.js +4 -4
- package/lib/cjs/locale/source/pt_BR.js +5 -5
- package/lib/cjs/locale/source/ro.d.ts +13 -0
- package/lib/cjs/locale/source/ro.js +17 -4
- package/lib/cjs/locale/source/ru_RU.js +4 -4
- package/lib/cjs/locale/source/sv_SE.js +4 -4
- package/lib/cjs/locale/source/th_TH.js +5 -5
- package/lib/cjs/locale/source/tr_TR.js +5 -5
- package/lib/cjs/locale/source/vi_VN.js +5 -5
- package/lib/cjs/locale/source/zh_CN.js +4 -4
- package/lib/cjs/locale/source/zh_TW.js +4 -4
- package/lib/cjs/popconfirm/index.d.ts +11 -7
- package/lib/cjs/popconfirm/index.js +97 -60
- package/lib/cjs/popover/index.d.ts +7 -1
- package/lib/cjs/popover/index.js +15 -3
- package/lib/cjs/tooltip/index.d.ts +7 -3
- package/lib/cjs/tooltip/index.js +10 -0
- package/lib/es/cascader/index.d.ts +2 -0
- package/lib/es/cascader/index.js +8 -0
- package/lib/es/datePicker/datePicker.js +0 -24
- package/lib/es/locale/source/ar.js +5 -5
- package/lib/es/locale/source/de.js +5 -5
- package/lib/es/locale/source/en_GB.js +5 -5
- package/lib/es/locale/source/en_US.js +4 -4
- package/lib/es/locale/source/es.js +5 -5
- package/lib/es/locale/source/fr.js +5 -5
- package/lib/es/locale/source/id_ID.js +4 -4
- package/lib/es/locale/source/it.js +5 -5
- package/lib/es/locale/source/ja_JP.js +5 -5
- package/lib/es/locale/source/ko_KR.js +4 -4
- package/lib/es/locale/source/ms_MY.js +4 -4
- package/lib/es/locale/source/nl_NL.d.ts +1 -1
- package/lib/es/locale/source/nl_NL.js +6 -6
- package/lib/es/locale/source/pl_PL.js +4 -4
- package/lib/es/locale/source/pt_BR.js +5 -5
- package/lib/es/locale/source/ro.d.ts +13 -0
- package/lib/es/locale/source/ro.js +17 -4
- package/lib/es/locale/source/ru_RU.js +4 -4
- package/lib/es/locale/source/sv_SE.js +4 -4
- package/lib/es/locale/source/th_TH.js +5 -5
- package/lib/es/locale/source/tr_TR.js +5 -5
- package/lib/es/locale/source/vi_VN.js +5 -5
- package/lib/es/locale/source/zh_CN.js +4 -4
- package/lib/es/locale/source/zh_TW.js +4 -4
- package/lib/es/popconfirm/index.d.ts +11 -7
- package/lib/es/popconfirm/index.js +95 -60
- package/lib/es/popover/index.d.ts +7 -1
- package/lib/es/popover/index.js +15 -3
- package/lib/es/tooltip/index.d.ts +7 -3
- package/lib/es/tooltip/index.js +10 -0
- package/package.json +9 -9
package/dist/umd/semi-ui.js
CHANGED
|
@@ -19401,7 +19401,7 @@ class foundation_Tooltip extends foundation {
|
|
|
19401
19401
|
*/
|
|
19402
19402
|
|
|
19403
19403
|
|
|
19404
|
-
|
|
19404
|
+
focusTrigger() {
|
|
19405
19405
|
const {
|
|
19406
19406
|
trigger,
|
|
19407
19407
|
returnFocusOnClose,
|
|
@@ -19427,8 +19427,7 @@ class foundation_Tooltip extends foundation {
|
|
|
19427
19427
|
if (trigger !== 'custom') {
|
|
19428
19428
|
// Move the focus into the trigger first and then close the pop-up layer
|
|
19429
19429
|
// to avoid the problem of opening the pop-up layer again when the focus returns to the trigger in the case of hover and focus
|
|
19430
|
-
this.
|
|
19431
|
-
|
|
19430
|
+
this.focusTrigger();
|
|
19432
19431
|
this.hide();
|
|
19433
19432
|
}
|
|
19434
19433
|
|
|
@@ -20147,6 +20146,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20147
20146
|
zIndex
|
|
20148
20147
|
}
|
|
20149
20148
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
20149
|
+
// listen keyboard event, don't move tabIndex -1
|
|
20150
|
+
tabIndex: -1,
|
|
20150
20151
|
className: `${BASE_CLASS_PREFIX}-portal-inner`,
|
|
20151
20152
|
style: portalInnerStyle,
|
|
20152
20153
|
ref: this.setContainerEl,
|
|
@@ -20500,6 +20501,14 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20500
20501
|
this.mounted = false;
|
|
20501
20502
|
this.foundation.destroy();
|
|
20502
20503
|
}
|
|
20504
|
+
/**
|
|
20505
|
+
* focus on tooltip trigger
|
|
20506
|
+
*/
|
|
20507
|
+
|
|
20508
|
+
|
|
20509
|
+
focusTrigger() {
|
|
20510
|
+
this.foundation.focusTrigger();
|
|
20511
|
+
}
|
|
20503
20512
|
/** for transition - end */
|
|
20504
20513
|
|
|
20505
20514
|
|
|
@@ -21332,8 +21341,8 @@ const local = {
|
|
|
21332
21341
|
code: 'zh-CN',
|
|
21333
21342
|
dateFnsLocale: zh_CN,
|
|
21334
21343
|
Pagination: {
|
|
21335
|
-
pageSize: '
|
|
21336
|
-
total: '
|
|
21344
|
+
pageSize: '每页条数:${pageSize}',
|
|
21345
|
+
total: '总页数:${total}',
|
|
21337
21346
|
jumpTo: '跳至',
|
|
21338
21347
|
page: '页'
|
|
21339
21348
|
},
|
|
@@ -21474,8 +21483,8 @@ const local = {
|
|
|
21474
21483
|
clear: '清空',
|
|
21475
21484
|
selectAll: '全选',
|
|
21476
21485
|
clearSelectAll: '取消全选',
|
|
21477
|
-
total: '
|
|
21478
|
-
selected: '
|
|
21486
|
+
total: '总个数:${total}',
|
|
21487
|
+
selected: '已选个数:${total}'
|
|
21479
21488
|
},
|
|
21480
21489
|
Form: {
|
|
21481
21490
|
optional: '(可选)'
|
|
@@ -23986,8 +23995,17 @@ const popover_positionSet = popover_constants_strings.POSITION_SET;
|
|
|
23986
23995
|
const popover_triggerSet = popover_constants_strings.TRIGGER_SET;
|
|
23987
23996
|
|
|
23988
23997
|
class popover_Popover extends external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.PureComponent {
|
|
23989
|
-
constructor() {
|
|
23990
|
-
super(
|
|
23998
|
+
constructor(props) {
|
|
23999
|
+
super(props);
|
|
24000
|
+
/**
|
|
24001
|
+
* focus on tooltip trigger
|
|
24002
|
+
*/
|
|
24003
|
+
|
|
24004
|
+
this.focusTrigger = () => {
|
|
24005
|
+
var _a;
|
|
24006
|
+
|
|
24007
|
+
(_a = this.tooltipRef.current) === null || _a === void 0 ? void 0 : _a.focusTrigger();
|
|
24008
|
+
};
|
|
23991
24009
|
|
|
23992
24010
|
this.renderPopCard = _ref => {
|
|
23993
24011
|
let {
|
|
@@ -24025,6 +24043,8 @@ class popover_Popover extends external_root_React_commonjs2_react_commonjs_react
|
|
|
24025
24043
|
};
|
|
24026
24044
|
return !isFunction_default()(content) ? content : content(contentProps);
|
|
24027
24045
|
};
|
|
24046
|
+
|
|
24047
|
+
this.tooltipRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
24028
24048
|
}
|
|
24029
24049
|
|
|
24030
24050
|
render() {
|
|
@@ -24058,7 +24078,8 @@ class popover_Popover extends external_root_React_commonjs2_react_commonjs_react
|
|
|
24058
24078
|
|
|
24059
24079
|
const role = trigger === 'click' || trigger === 'custom' ? 'dialog' : 'tooltip';
|
|
24060
24080
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, Object.assign({
|
|
24061
|
-
guardFocus: true
|
|
24081
|
+
guardFocus: true,
|
|
24082
|
+
ref: this.tooltipRef
|
|
24062
24083
|
}, attr, {
|
|
24063
24084
|
trigger: trigger,
|
|
24064
24085
|
position: position,
|
|
@@ -25132,13 +25153,8 @@ class FormatNumeral {
|
|
|
25132
25153
|
return `${this.truncatePrecision(value)} ${units[i]}`;
|
|
25133
25154
|
},
|
|
25134
25155
|
percentages: value => {
|
|
25135
|
-
|
|
25136
|
-
|
|
25137
|
-
if (Number(cArr[0]) === 0) {
|
|
25138
|
-
return `${this.truncatePrecision(value * 100)}%`;
|
|
25139
|
-
}
|
|
25140
|
-
|
|
25141
|
-
return `${this.truncatePrecision(value)}%`;
|
|
25156
|
+
// The rules here have been modified in version v2.30.0
|
|
25157
|
+
return `${this.truncatePrecision(value * 100)}%`;
|
|
25142
25158
|
},
|
|
25143
25159
|
exponential: value => {
|
|
25144
25160
|
const vExponential = value.toExponential(this.precision + 2);
|
|
@@ -45197,6 +45213,14 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
45197
45213
|
}, inputProps)));
|
|
45198
45214
|
}
|
|
45199
45215
|
|
|
45216
|
+
close() {
|
|
45217
|
+
this.foundation.close();
|
|
45218
|
+
}
|
|
45219
|
+
|
|
45220
|
+
open() {
|
|
45221
|
+
this.foundation.open();
|
|
45222
|
+
}
|
|
45223
|
+
|
|
45200
45224
|
render() {
|
|
45201
45225
|
const {
|
|
45202
45226
|
zIndex,
|
|
@@ -50563,10 +50587,13 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
50563
50587
|
|
|
50564
50588
|
const result = this.parseWithTimezone(_value, timeZone, prevTimeZone);
|
|
50565
50589
|
|
|
50566
|
-
this._adapter.updatePrevTimezone(prevTimeZone);
|
|
50590
|
+
this._adapter.updatePrevTimezone(prevTimeZone); // reset input value when value update
|
|
50591
|
+
|
|
50567
50592
|
|
|
50568
50593
|
this._adapter.updateInputValue(null);
|
|
50569
50594
|
|
|
50595
|
+
this._adapter.updateInsetInputValue(null);
|
|
50596
|
+
|
|
50570
50597
|
this._adapter.updateValue(result);
|
|
50571
50598
|
|
|
50572
50599
|
this.resetCachedSelectedValue(result);
|
|
@@ -53571,14 +53598,20 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
53571
53598
|
|
|
53572
53599
|
_initDatePickerFromValue(values) {
|
|
53573
53600
|
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
53574
|
-
|
|
53601
|
+
|
|
53602
|
+
const {
|
|
53603
|
+
monthLeft
|
|
53604
|
+
} = this._adapter.getStates();
|
|
53605
|
+
|
|
53575
53606
|
const newMonthLeft = Object.assign({}, monthLeft); // REMOVE:
|
|
53576
53607
|
|
|
53577
53608
|
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
53578
53609
|
|
|
53579
53610
|
const newSelected = new Set();
|
|
53580
53611
|
|
|
53581
|
-
|
|
53612
|
+
const isMultiple = this._isMultiple();
|
|
53613
|
+
|
|
53614
|
+
if (!isMultiple) {
|
|
53582
53615
|
values[0] && newSelected.add(format_format(values[0], datePicker_constants_strings.FORMAT_FULL_DATE));
|
|
53583
53616
|
} else {
|
|
53584
53617
|
values.forEach(date => {
|
|
@@ -53587,7 +53620,12 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
53587
53620
|
}
|
|
53588
53621
|
|
|
53589
53622
|
if (refreshPicker) {
|
|
53590
|
-
|
|
53623
|
+
if (isMultiple) {
|
|
53624
|
+
const leftPickerDateInSelected = values === null || values === void 0 ? void 0 : values.some(item => item && differenceInCalendarMonths(item, monthLeft.pickerDate) === 0);
|
|
53625
|
+
!leftPickerDateInSelected && this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
53626
|
+
} else {
|
|
53627
|
+
this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
53628
|
+
}
|
|
53591
53629
|
} else {
|
|
53592
53630
|
// FIXME:
|
|
53593
53631
|
this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
|
|
@@ -58185,36 +58223,12 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
58185
58223
|
density,
|
|
58186
58224
|
topSlot,
|
|
58187
58225
|
bottomSlot,
|
|
58188
|
-
insetInput,
|
|
58189
|
-
type,
|
|
58190
|
-
format,
|
|
58191
|
-
rangeSeparator,
|
|
58192
|
-
defaultPickerValue,
|
|
58193
58226
|
presetPosition
|
|
58194
58227
|
} = this.props;
|
|
58195
|
-
const {
|
|
58196
|
-
insetInputValue,
|
|
58197
|
-
value
|
|
58198
|
-
} = this.state;
|
|
58199
58228
|
const wrapCls = classnames_default()(datePicker_constants_cssClasses.PREFIX, {
|
|
58200
58229
|
[datePicker_constants_cssClasses.PANEL_YAM]: this.adapter.typeIsYearOrMonth(),
|
|
58201
58230
|
[`${datePicker_constants_cssClasses.PREFIX}-compact`]: density === 'compact'
|
|
58202
58231
|
}, dropdownClassName);
|
|
58203
|
-
const insetInputProps = {
|
|
58204
|
-
dateFnsLocale,
|
|
58205
|
-
format,
|
|
58206
|
-
insetInputValue,
|
|
58207
|
-
rangeSeparator,
|
|
58208
|
-
type,
|
|
58209
|
-
value: value,
|
|
58210
|
-
handleInsetDateFocus: this.handleInsetDateFocus,
|
|
58211
|
-
handleInsetTimeFocus: this.handleInsetTimeFocus,
|
|
58212
|
-
onInsetInputChange: this.handleInsetInputChange,
|
|
58213
|
-
rangeInputStartRef: this.rangeInputStartRef,
|
|
58214
|
-
rangeInputEndRef: this.rangeInputEndRef,
|
|
58215
|
-
density,
|
|
58216
|
-
defaultPickerValue
|
|
58217
|
-
};
|
|
58218
58232
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
58219
58233
|
ref: this.panelRef,
|
|
58220
58234
|
className: wrapCls,
|
|
@@ -74134,7 +74148,7 @@ const popconfirm_constants_numbers = {
|
|
|
74134
74148
|
};
|
|
74135
74149
|
|
|
74136
74150
|
// CONCATENATED MODULE: ../semi-foundation/popconfirm/popconfirmFoundation.ts
|
|
74137
|
-
|
|
74151
|
+
|
|
74138
74152
|
|
|
74139
74153
|
|
|
74140
74154
|
class popconfirmFoundation_PopConfirmFoundation extends foundation {
|
|
@@ -74187,9 +74201,28 @@ class popconfirmFoundation_PopConfirmFoundation extends foundation {
|
|
|
74187
74201
|
this._adapter.setVisible(visible);
|
|
74188
74202
|
}
|
|
74189
74203
|
|
|
74204
|
+
if (visible) {
|
|
74205
|
+
this.handleFocusOperateButton();
|
|
74206
|
+
} else {
|
|
74207
|
+
this._adapter.focusPrevFocusElement();
|
|
74208
|
+
}
|
|
74209
|
+
|
|
74190
74210
|
this._adapter.notifyVisibleChange(visible);
|
|
74191
74211
|
}
|
|
74192
74212
|
|
|
74213
|
+
handleFocusOperateButton() {
|
|
74214
|
+
const {
|
|
74215
|
+
cancelButtonProps,
|
|
74216
|
+
okButtonProps
|
|
74217
|
+
} = this._adapter.getProps();
|
|
74218
|
+
|
|
74219
|
+
if (get_default()(cancelButtonProps, 'autoFocus') && !get_default()(cancelButtonProps, 'disabled')) {
|
|
74220
|
+
this._adapter.focusCancelButton();
|
|
74221
|
+
} else if (get_default()(okButtonProps, 'autoFocus') && !get_default()(okButtonProps, 'disabled')) {
|
|
74222
|
+
this._adapter.focusOkButton();
|
|
74223
|
+
}
|
|
74224
|
+
}
|
|
74225
|
+
|
|
74193
74226
|
}
|
|
74194
74227
|
// EXTERNAL MODULE: ../semi-foundation/popconfirm/popconfirm.scss
|
|
74195
74228
|
var popconfirm = __webpack_require__("s0u6");
|
|
@@ -74198,6 +74231,8 @@ var popconfirm = __webpack_require__("s0u6");
|
|
|
74198
74231
|
|
|
74199
74232
|
|
|
74200
74233
|
|
|
74234
|
+
|
|
74235
|
+
|
|
74201
74236
|
var popconfirm_rest = undefined && undefined.__rest || function (s, e) {
|
|
74202
74237
|
var t = {};
|
|
74203
74238
|
|
|
@@ -74237,12 +74272,74 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
74237
74272
|
|
|
74238
74273
|
this.stopImmediatePropagation = e => e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
|
|
74239
74274
|
|
|
74275
|
+
this.renderConfirmPopCard = _ref => {
|
|
74276
|
+
let {
|
|
74277
|
+
initialFocusRef
|
|
74278
|
+
} = _ref;
|
|
74279
|
+
const {
|
|
74280
|
+
content,
|
|
74281
|
+
title,
|
|
74282
|
+
className,
|
|
74283
|
+
style,
|
|
74284
|
+
cancelType,
|
|
74285
|
+
icon,
|
|
74286
|
+
prefixCls
|
|
74287
|
+
} = this.props;
|
|
74288
|
+
const {
|
|
74289
|
+
direction
|
|
74290
|
+
} = this.context;
|
|
74291
|
+
const popCardCls = classnames_default()(prefixCls, className, {
|
|
74292
|
+
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
74293
|
+
});
|
|
74294
|
+
const showTitle = title !== null && typeof title !== 'undefined';
|
|
74295
|
+
const showContent = !(content === null || typeof content === 'undefined');
|
|
74296
|
+
return (
|
|
74297
|
+
/*#__PURE__*/
|
|
74298
|
+
|
|
74299
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
74300
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74301
|
+
className: popCardCls,
|
|
74302
|
+
onClick: this.stopImmediatePropagation,
|
|
74303
|
+
style: style
|
|
74304
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74305
|
+
className: `${prefixCls}-inner`
|
|
74306
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74307
|
+
className: `${prefixCls}-header`
|
|
74308
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
74309
|
+
className: `${prefixCls}-header-icon`,
|
|
74310
|
+
"x-semi-prop": "icon"
|
|
74311
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? icon : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74312
|
+
className: `${prefixCls}-header-body`
|
|
74313
|
+
}, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74314
|
+
className: `${prefixCls}-header-title`,
|
|
74315
|
+
"x-semi-prop": "title"
|
|
74316
|
+
}, title) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
74317
|
+
className: `${prefixCls}-btn-close`,
|
|
74318
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
74319
|
+
size: "small",
|
|
74320
|
+
theme: 'borderless',
|
|
74321
|
+
type: cancelType,
|
|
74322
|
+
onClick: this.handleCancel
|
|
74323
|
+
})), showContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74324
|
+
className: `${prefixCls}-body`,
|
|
74325
|
+
"x-semi-prop": "content"
|
|
74326
|
+
}, isFunction_default()(content) ? content({
|
|
74327
|
+
initialFocusRef
|
|
74328
|
+
}) : content) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74329
|
+
className: `${prefixCls}-footer`,
|
|
74330
|
+
ref: this.footerRef
|
|
74331
|
+
}, this.renderControls())))
|
|
74332
|
+
);
|
|
74333
|
+
};
|
|
74334
|
+
|
|
74240
74335
|
this.state = {
|
|
74241
74336
|
cancelLoading: false,
|
|
74242
74337
|
confirmLoading: false,
|
|
74243
74338
|
visible: props.defaultVisible || false
|
|
74244
74339
|
};
|
|
74245
74340
|
this.foundation = new popconfirmFoundation_PopConfirmFoundation(this.adapter);
|
|
74341
|
+
this.footerRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
74342
|
+
this.popoverRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
74246
74343
|
}
|
|
74247
74344
|
|
|
74248
74345
|
static getDerivedStateFromProps(props, state) {
|
|
@@ -74272,7 +74369,28 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
74272
74369
|
notifyConfirm: e => this.props.onConfirm(e),
|
|
74273
74370
|
notifyCancel: e => this.props.onCancel(e),
|
|
74274
74371
|
notifyVisibleChange: visible => this.props.onVisibleChange(visible),
|
|
74275
|
-
notifyClickOutSide: e => this.props.onClickOutSide(e)
|
|
74372
|
+
notifyClickOutSide: e => this.props.onClickOutSide(e),
|
|
74373
|
+
focusCancelButton: () => {
|
|
74374
|
+
var _a, _b;
|
|
74375
|
+
|
|
74376
|
+
const buttonNode = (_b = (_a = this.footerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector('[data-type=cancel]');
|
|
74377
|
+
buttonNode === null || buttonNode === void 0 ? void 0 : buttonNode.focus({
|
|
74378
|
+
preventScroll: true
|
|
74379
|
+
});
|
|
74380
|
+
},
|
|
74381
|
+
focusOkButton: () => {
|
|
74382
|
+
var _a, _b;
|
|
74383
|
+
|
|
74384
|
+
const buttonNode = (_b = (_a = this.footerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector('[data-type=ok]');
|
|
74385
|
+
buttonNode === null || buttonNode === void 0 ? void 0 : buttonNode.focus({
|
|
74386
|
+
preventScroll: true
|
|
74387
|
+
});
|
|
74388
|
+
},
|
|
74389
|
+
focusPrevFocusElement: () => {
|
|
74390
|
+
var _a;
|
|
74391
|
+
|
|
74392
|
+
(_a = this.popoverRef.current) === null || _a === void 0 ? void 0 : _a.focusTrigger();
|
|
74393
|
+
}
|
|
74276
74394
|
});
|
|
74277
74395
|
}
|
|
74278
74396
|
|
|
@@ -74292,68 +74410,17 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
74292
74410
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
74293
74411
|
componentName: "Popconfirm"
|
|
74294
74412
|
}, (locale, localeCode) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, Object.assign({
|
|
74413
|
+
"data-type": "cancel",
|
|
74295
74414
|
type: cancelType,
|
|
74296
74415
|
onClick: this.handleCancel,
|
|
74297
74416
|
loading: cancelLoading
|
|
74298
|
-
}, cancelButtonProps), cancelText || get_default()(locale, 'cancel')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, Object.assign({
|
|
74417
|
+
}, omit_default()(cancelButtonProps, 'autoFocus')), cancelText || get_default()(locale, 'cancel')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, Object.assign({
|
|
74418
|
+
"data-type": "ok",
|
|
74299
74419
|
type: okType,
|
|
74300
74420
|
theme: "solid",
|
|
74301
74421
|
onClick: this.handleConfirm,
|
|
74302
74422
|
loading: confirmLoading
|
|
74303
|
-
}, okButtonProps), okText || get_default()(locale, 'confirm'))));
|
|
74304
|
-
}
|
|
74305
|
-
|
|
74306
|
-
renderConfirmPopCard() {
|
|
74307
|
-
const {
|
|
74308
|
-
content,
|
|
74309
|
-
title,
|
|
74310
|
-
className,
|
|
74311
|
-
style,
|
|
74312
|
-
cancelType,
|
|
74313
|
-
icon,
|
|
74314
|
-
prefixCls
|
|
74315
|
-
} = this.props;
|
|
74316
|
-
const {
|
|
74317
|
-
direction
|
|
74318
|
-
} = this.context;
|
|
74319
|
-
const popCardCls = classnames_default()(prefixCls, className, {
|
|
74320
|
-
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
74321
|
-
});
|
|
74322
|
-
const showTitle = title !== null && typeof title !== 'undefined';
|
|
74323
|
-
const showContent = !(content === null || typeof content === 'undefined');
|
|
74324
|
-
return (
|
|
74325
|
-
/*#__PURE__*/
|
|
74326
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
74327
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74328
|
-
className: popCardCls,
|
|
74329
|
-
onClick: this.stopImmediatePropagation,
|
|
74330
|
-
style: style
|
|
74331
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74332
|
-
className: `${prefixCls}-inner`
|
|
74333
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74334
|
-
className: `${prefixCls}-header`
|
|
74335
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
74336
|
-
className: `${prefixCls}-header-icon`,
|
|
74337
|
-
"x-semi-prop": "icon"
|
|
74338
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? icon : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74339
|
-
className: `${prefixCls}-header-body`
|
|
74340
|
-
}, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74341
|
-
className: `${prefixCls}-header-title`,
|
|
74342
|
-
"x-semi-prop": "title"
|
|
74343
|
-
}, title) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
74344
|
-
className: `${prefixCls}-btn-close`,
|
|
74345
|
-
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
74346
|
-
size: "small",
|
|
74347
|
-
theme: 'borderless',
|
|
74348
|
-
type: cancelType,
|
|
74349
|
-
onClick: this.handleCancel
|
|
74350
|
-
})), showContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74351
|
-
className: `${prefixCls}-body`,
|
|
74352
|
-
"x-semi-prop": "content"
|
|
74353
|
-
}, content) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
74354
|
-
className: `${prefixCls}-footer`
|
|
74355
|
-
}, this.renderControls())))
|
|
74356
|
-
);
|
|
74423
|
+
}, omit_default()(okButtonProps, 'autoFocus')), okText || get_default()(locale, 'confirm'))));
|
|
74357
74424
|
}
|
|
74358
74425
|
|
|
74359
74426
|
render() {
|
|
@@ -74381,7 +74448,6 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
74381
74448
|
const {
|
|
74382
74449
|
visible
|
|
74383
74450
|
} = this.state;
|
|
74384
|
-
const popContent = this.renderConfirmPopCard();
|
|
74385
74451
|
const popProps = {
|
|
74386
74452
|
onVisibleChange: this.handleVisibleChange,
|
|
74387
74453
|
className: popconfirm_constants_cssClasses.POPOVER,
|
|
@@ -74392,8 +74458,10 @@ class popconfirm_Popconfirm extends baseComponent_BaseComponent {
|
|
|
74392
74458
|
popProps.trigger = 'custom';
|
|
74393
74459
|
}
|
|
74394
74460
|
|
|
74395
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popover_0, Object.assign({
|
|
74396
|
-
|
|
74461
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popover_0, Object.assign({
|
|
74462
|
+
ref: this.popoverRef
|
|
74463
|
+
}, attrs, {
|
|
74464
|
+
content: this.renderConfirmPopCard,
|
|
74397
74465
|
visible: visible,
|
|
74398
74466
|
position: position
|
|
74399
74467
|
}, popProps), children);
|
|
@@ -74404,7 +74472,7 @@ popconfirm_Popconfirm.contextType = configProvider_context;
|
|
|
74404
74472
|
popconfirm_Popconfirm.propTypes = {
|
|
74405
74473
|
motion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.func, prop_types_default.a.object]),
|
|
74406
74474
|
disabled: prop_types_default.a.bool,
|
|
74407
|
-
content: prop_types_default.a.
|
|
74475
|
+
content: prop_types_default.a.oneOfType([prop_types_default.a.node, prop_types_default.a.func]),
|
|
74408
74476
|
title: prop_types_default.a.any,
|
|
74409
74477
|
prefixCls: prop_types_default.a.string,
|
|
74410
74478
|
className: prop_types_default.a.string,
|