@douyinfe/semi-ui 2.51.4 → 2.52.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 +285 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +488 -214
- 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.d.ts +2 -1
- package/lib/cjs/_utils/index.js +0 -5
- package/lib/cjs/avatar/TopSlotSvg.d.ts +5 -0
- package/lib/cjs/avatar/TopSlotSvg.js +74 -0
- package/lib/cjs/avatar/index.d.ts +25 -0
- package/lib/cjs/avatar/index.js +126 -8
- package/lib/cjs/avatar/interface.d.ts +24 -1
- package/lib/cjs/cascader/index.d.ts +2 -3
- package/lib/cjs/cascader/index.js +19 -28
- package/lib/cjs/datePicker/datePicker.js +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +16 -20
- package/lib/cjs/dropdown/dropdownItem.js +2 -1
- package/lib/cjs/form/hoc/withField.d.ts +3 -3
- package/lib/cjs/input/index.d.ts +1 -0
- package/lib/cjs/input/index.js +12 -4
- package/lib/cjs/modal/Modal.d.ts +1 -0
- package/lib/cjs/modal/Modal.js +13 -5
- package/lib/cjs/modal/confirm.d.ts +5 -0
- package/lib/cjs/select/option.js +1 -2
- package/lib/cjs/slider/index.js +33 -1
- package/lib/cjs/table/ColumnFilter.d.ts +34 -18
- package/lib/cjs/table/ColumnFilter.js +134 -73
- package/lib/cjs/table/ResizableTable.js +1 -1
- package/lib/cjs/table/Table.d.ts +5 -5
- package/lib/cjs/table/Table.js +38 -13
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/table/interface.d.ts +30 -10
- package/lib/cjs/treeSelect/index.d.ts +2 -0
- package/lib/cjs/treeSelect/index.js +4 -0
- package/lib/es/_utils/index.d.ts +2 -1
- package/lib/es/_utils/index.js +0 -5
- package/lib/es/avatar/TopSlotSvg.d.ts +5 -0
- package/lib/es/avatar/TopSlotSvg.js +66 -0
- package/lib/es/avatar/index.d.ts +25 -0
- package/lib/es/avatar/index.js +126 -8
- package/lib/es/avatar/interface.d.ts +24 -1
- package/lib/es/cascader/index.d.ts +2 -3
- package/lib/es/cascader/index.js +19 -28
- package/lib/es/datePicker/datePicker.js +1 -1
- package/lib/es/datePicker/yearAndMonth.js +16 -20
- package/lib/es/dropdown/dropdownItem.js +2 -1
- package/lib/es/form/hoc/withField.d.ts +3 -3
- package/lib/es/input/index.d.ts +1 -0
- package/lib/es/input/index.js +12 -4
- package/lib/es/modal/Modal.d.ts +1 -0
- package/lib/es/modal/Modal.js +13 -5
- package/lib/es/modal/confirm.d.ts +5 -0
- package/lib/es/select/option.js +1 -2
- package/lib/es/slider/index.js +33 -1
- package/lib/es/table/ColumnFilter.d.ts +34 -18
- package/lib/es/table/ColumnFilter.js +135 -74
- package/lib/es/table/ResizableTable.js +1 -1
- package/lib/es/table/Table.d.ts +5 -5
- package/lib/es/table/Table.js +38 -13
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/table/interface.d.ts +30 -10
- package/lib/es/treeSelect/index.d.ts +2 -0
- package/lib/es/treeSelect/index.js +4 -0
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -18633,7 +18633,6 @@ class foundation_Tooltip extends foundation {
|
|
|
18633
18633
|
return null;
|
|
18634
18634
|
}
|
|
18635
18635
|
calcPosStyle(props) {
|
|
18636
|
-
var _a;
|
|
18637
18636
|
const {
|
|
18638
18637
|
spacing,
|
|
18639
18638
|
isOverFlow
|
|
@@ -18684,10 +18683,6 @@ class foundation_Tooltip extends foundation {
|
|
|
18684
18683
|
const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
|
|
18685
18684
|
const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
|
|
18686
18685
|
const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
|
|
18687
|
-
const scaled = Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1;
|
|
18688
|
-
if (scaled) {
|
|
18689
|
-
SPACING = SPACING * wrapperRect.width / this._adapter.getContainer().clientWidth;
|
|
18690
|
-
}
|
|
18691
18686
|
switch (position) {
|
|
18692
18687
|
case 'top':
|
|
18693
18688
|
// left = middleX;
|
|
@@ -18804,12 +18799,6 @@ class foundation_Tooltip extends foundation {
|
|
|
18804
18799
|
// Calculate container positioning relative to window
|
|
18805
18800
|
left = left - containerRect.left;
|
|
18806
18801
|
top = top - containerRect.top;
|
|
18807
|
-
if (scaled) {
|
|
18808
|
-
left /= wrapperRect.width / this._adapter.getContainer().clientWidth;
|
|
18809
|
-
}
|
|
18810
|
-
if (scaled) {
|
|
18811
|
-
top /= wrapperRect.height / this._adapter.getContainer().clientHeight;
|
|
18812
|
-
}
|
|
18813
18802
|
/**
|
|
18814
18803
|
* container为body时,如果position不为relative或absolute,这时trigger计算出的top/left会根据html定位(initial containing block)
|
|
18815
18804
|
* 此时如果body有margin,则计算出的位置相对于body会有问题 fix issue #1368
|
|
@@ -19607,11 +19596,6 @@ function stopPropagation(e, noImmediate) {
|
|
|
19607
19596
|
e.nativeEvent.stopImmediatePropagation();
|
|
19608
19597
|
}
|
|
19609
19598
|
}
|
|
19610
|
-
/**
|
|
19611
|
-
* use in Table, Form, Navigation
|
|
19612
|
-
*
|
|
19613
|
-
* skip clone function and react element
|
|
19614
|
-
*/
|
|
19615
19599
|
function cloneDeep(value, customizer) {
|
|
19616
19600
|
return cloneDeepWith_default()(value, v => {
|
|
19617
19601
|
if (typeof customizer === 'function') {
|
|
@@ -26506,9 +26490,10 @@ class Input extends BaseComponent {
|
|
|
26506
26490
|
getValueLength,
|
|
26507
26491
|
preventScroll,
|
|
26508
26492
|
borderless,
|
|
26509
|
-
showClearIgnoreDisabled
|
|
26493
|
+
showClearIgnoreDisabled,
|
|
26494
|
+
onlyBorder
|
|
26510
26495
|
} = _a,
|
|
26511
|
-
rest = input_rest(_a, ["addonAfter", "addonBefore", "autoFocus", "clearIcon", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll", "borderless", "showClearIgnoreDisabled"]);
|
|
26496
|
+
rest = input_rest(_a, ["addonAfter", "addonBefore", "autoFocus", "clearIcon", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll", "borderless", "showClearIgnoreDisabled", "onlyBorder"]);
|
|
26512
26497
|
const {
|
|
26513
26498
|
value,
|
|
26514
26499
|
isFocus,
|
|
@@ -26536,7 +26521,8 @@ class Input extends BaseComponent {
|
|
|
26536
26521
|
[`${wrapperPrefix}-modebtn`]: mode === 'password',
|
|
26537
26522
|
[`${wrapperPrefix}-hidden`]: type === 'hidden',
|
|
26538
26523
|
[`${wrapperPrefix}-${size}`]: size,
|
|
26539
|
-
[`${input_prefixCls}-borderless`]: borderless
|
|
26524
|
+
[`${input_prefixCls}-borderless`]: borderless,
|
|
26525
|
+
[`${input_prefixCls}-only_border`]: onlyBorder !== undefined && onlyBorder !== null
|
|
26540
26526
|
});
|
|
26541
26527
|
const inputCls = classnames_default()(input_prefixCls, {
|
|
26542
26528
|
[`${input_prefixCls}-${size}`]: size,
|
|
@@ -26570,12 +26556,18 @@ class Input extends BaseComponent {
|
|
|
26570
26556
|
if (validateStatus === 'error') {
|
|
26571
26557
|
inputProps['aria-invalid'] = 'true';
|
|
26572
26558
|
}
|
|
26559
|
+
let wrapperStyle = Object.assign({}, style);
|
|
26560
|
+
if (onlyBorder !== undefined) {
|
|
26561
|
+
wrapperStyle = Object.assign({
|
|
26562
|
+
borderWidth: onlyBorder
|
|
26563
|
+
}, style);
|
|
26564
|
+
}
|
|
26573
26565
|
return (
|
|
26574
26566
|
/*#__PURE__*/
|
|
26575
26567
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
26576
26568
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
26577
26569
|
className: wrapperCls,
|
|
26578
|
-
style:
|
|
26570
|
+
style: wrapperStyle,
|
|
26579
26571
|
onMouseEnter: e => this.handleMouseOver(e),
|
|
26580
26572
|
onMouseLeave: e => this.handleMouseLeave(e),
|
|
26581
26573
|
onClick: e => this.handleClick(e)
|
|
@@ -27356,6 +27348,73 @@ class AvatarFoundation extends foundation {
|
|
|
27356
27348
|
}
|
|
27357
27349
|
// EXTERNAL MODULE: ../semi-foundation/avatar/avatar.scss
|
|
27358
27350
|
var avatar = __webpack_require__("mW/5");
|
|
27351
|
+
;// CONCATENATED MODULE: ./avatar/TopSlotSvg.tsx
|
|
27352
|
+
|
|
27353
|
+
|
|
27354
|
+
const TopSlotSvg = _ref => {
|
|
27355
|
+
let {
|
|
27356
|
+
gradientStart,
|
|
27357
|
+
gradientEnd
|
|
27358
|
+
} = _ref;
|
|
27359
|
+
const id = getUuidShort();
|
|
27360
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
|
|
27361
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27362
|
+
width: "51",
|
|
27363
|
+
height: "52",
|
|
27364
|
+
viewBox: "0 0 51 52",
|
|
27365
|
+
fill: "none"
|
|
27366
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("g", {
|
|
27367
|
+
filter: "url(#filter0_d_6_2)"
|
|
27368
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
|
|
27369
|
+
d: "M40.4918 46.5592C44.6795 43.176 46.261 34.1333 47.5301 25.6141C49.5854 11.8168 39.6662 1 25.8097 1C11.2857 1 3 11.4279 3 25.3518C3 33.7866 6.29361 43.8947 10.4602 46.5592C12.5868 47.9192 12.5868 47.9051 25.8097 47.9192C38.3651 47.9282 38.5352 48.14 40.4918 46.5592Z",
|
|
27370
|
+
fill: `url(#${id})`
|
|
27371
|
+
})), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("defs", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("filter", {
|
|
27372
|
+
id: "filter0_d_6_2",
|
|
27373
|
+
x: "0.789215",
|
|
27374
|
+
y: "0.447304",
|
|
27375
|
+
width: "49.2216",
|
|
27376
|
+
height: "51.3549",
|
|
27377
|
+
filterUnits: "userSpaceOnUse",
|
|
27378
|
+
colorInterpolationFilters: "sRGB"
|
|
27379
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feFlood", {
|
|
27380
|
+
floodOpacity: "0",
|
|
27381
|
+
result: "BackgroundImageFix"
|
|
27382
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feColorMatrix", {
|
|
27383
|
+
in: "SourceAlpha",
|
|
27384
|
+
type: "matrix",
|
|
27385
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
27386
|
+
result: "hardAlpha"
|
|
27387
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feOffset", {
|
|
27388
|
+
dy: "1.65809"
|
|
27389
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feGaussianBlur", {
|
|
27390
|
+
stdDeviation: "1.10539"
|
|
27391
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feColorMatrix", {
|
|
27392
|
+
type: "matrix",
|
|
27393
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"
|
|
27394
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feBlend", {
|
|
27395
|
+
mode: "normal",
|
|
27396
|
+
in2: "BackgroundImageFix",
|
|
27397
|
+
result: "effect1_dropShadow_6_2"
|
|
27398
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("feBlend", {
|
|
27399
|
+
mode: "normal",
|
|
27400
|
+
in: "SourceGraphic",
|
|
27401
|
+
in2: "effect1_dropShadow_6_2",
|
|
27402
|
+
result: "shape"
|
|
27403
|
+
})), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("linearGradient", {
|
|
27404
|
+
id: id,
|
|
27405
|
+
x1: "17.671",
|
|
27406
|
+
y1: "31.7392",
|
|
27407
|
+
x2: "17.671",
|
|
27408
|
+
y2: "47.9333",
|
|
27409
|
+
gradientUnits: "userSpaceOnUse"
|
|
27410
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("stop", {
|
|
27411
|
+
stopColor: gradientStart
|
|
27412
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("stop", {
|
|
27413
|
+
offset: "1",
|
|
27414
|
+
stopColor: gradientEnd
|
|
27415
|
+
}))));
|
|
27416
|
+
};
|
|
27417
|
+
/* harmony default export */ const avatar_TopSlotSvg = (TopSlotSvg);
|
|
27359
27418
|
;// CONCATENATED MODULE: ./avatar/index.tsx
|
|
27360
27419
|
var avatar_rest = undefined && undefined.__rest || function (s, e) {
|
|
27361
27420
|
var t = {};
|
|
@@ -27374,6 +27433,7 @@ var avatar_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
27374
27433
|
|
|
27375
27434
|
|
|
27376
27435
|
|
|
27436
|
+
|
|
27377
27437
|
const avatar_sizeSet = avatar_constants_strings.SIZE;
|
|
27378
27438
|
const shapeSet = avatar_constants_strings.SHAPE;
|
|
27379
27439
|
const colorSet = avatar_constants_strings.COLOR;
|
|
@@ -27447,6 +27507,64 @@ class Avatar extends BaseComponent {
|
|
|
27447
27507
|
}
|
|
27448
27508
|
return content;
|
|
27449
27509
|
};
|
|
27510
|
+
this.renderBottomSlot = () => {
|
|
27511
|
+
var _a, _b;
|
|
27512
|
+
if (!this.props.bottomSlot) {
|
|
27513
|
+
return null;
|
|
27514
|
+
}
|
|
27515
|
+
if (this.props.bottomSlot.render) {
|
|
27516
|
+
return this.props.bottomSlot.render();
|
|
27517
|
+
}
|
|
27518
|
+
const renderContent = (_a = this.props.bottomSlot.render) !== null && _a !== void 0 ? _a : () => {
|
|
27519
|
+
var _a;
|
|
27520
|
+
const style = {};
|
|
27521
|
+
if (this.props.bottomSlot.bgColor) {
|
|
27522
|
+
style['backgroundColor'] = this.props.bottomSlot.bgColor;
|
|
27523
|
+
}
|
|
27524
|
+
if (this.props.bottomSlot.textColor) {
|
|
27525
|
+
style['color'] = this.props.bottomSlot.textColor;
|
|
27526
|
+
}
|
|
27527
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
27528
|
+
style: style,
|
|
27529
|
+
className: classnames_default()(`${avatar_prefixCls}-bottom_slot-shape_${this.props.bottomSlot.shape}`, `${avatar_prefixCls}-bottom_slot-shape_${this.props.bottomSlot.shape}-${this.props.size}`, (_a = this.props.bottomSlot.className) !== null && _a !== void 0 ? _a : "")
|
|
27530
|
+
}, this.props.bottomSlot.text);
|
|
27531
|
+
};
|
|
27532
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27533
|
+
className: classnames_default()([`${avatar_prefixCls}-bottom_slot`]),
|
|
27534
|
+
style: (_b = this.props.bottomSlot.style) !== null && _b !== void 0 ? _b : {}
|
|
27535
|
+
}, renderContent());
|
|
27536
|
+
};
|
|
27537
|
+
this.renderTopSlot = () => {
|
|
27538
|
+
var _a, _b, _c, _d;
|
|
27539
|
+
if (!this.props.topSlot) {
|
|
27540
|
+
return null;
|
|
27541
|
+
}
|
|
27542
|
+
if (this.props.topSlot.render) {
|
|
27543
|
+
return this.props.topSlot.render();
|
|
27544
|
+
}
|
|
27545
|
+
const textStyle = {};
|
|
27546
|
+
if (this.props.topSlot.textColor) {
|
|
27547
|
+
textStyle['color'] = this.props.topSlot.textColor;
|
|
27548
|
+
}
|
|
27549
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27550
|
+
style: (_a = this.props.topSlot.style) !== null && _a !== void 0 ? _a : {},
|
|
27551
|
+
className: classnames_default()([`${avatar_prefixCls}-top_slot-wrapper`, (_b = this.props.topSlot.className) !== null && _b !== void 0 ? _b : "", {
|
|
27552
|
+
[`${avatar_prefixCls}-animated`]: this.props.contentMotion
|
|
27553
|
+
}])
|
|
27554
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27555
|
+
className: classnames_default()([`${avatar_prefixCls}-top_slot-bg`, `${avatar_prefixCls}-top_slot-bg-${this.props.size}`])
|
|
27556
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27557
|
+
className: classnames_default()([`${avatar_prefixCls}-top_slot-bg-svg`, `${avatar_prefixCls}-top_slot-bg-svg-${this.props.size}`])
|
|
27558
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(avatar_TopSlotSvg, {
|
|
27559
|
+
gradientStart: (_c = this.props.topSlot.gradientStart) !== null && _c !== void 0 ? _c : "var(--semi-color-primary)",
|
|
27560
|
+
gradientEnd: (_d = this.props.topSlot.gradientEnd) !== null && _d !== void 0 ? _d : "var(--semi-color-primary)"
|
|
27561
|
+
}))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27562
|
+
className: classnames_default()([`${avatar_prefixCls}-top_slot`])
|
|
27563
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27564
|
+
style: textStyle,
|
|
27565
|
+
className: classnames_default()([`${avatar_prefixCls}-top_slot-content`, `${avatar_prefixCls}-top_slot-content-${this.props.size}`])
|
|
27566
|
+
}, this.props.topSlot.text)));
|
|
27567
|
+
};
|
|
27450
27568
|
this.state = {
|
|
27451
27569
|
isImgExist: true,
|
|
27452
27570
|
hoverContent: '',
|
|
@@ -27564,7 +27682,8 @@ class Avatar extends BaseComponent {
|
|
|
27564
27682
|
}
|
|
27565
27683
|
}
|
|
27566
27684
|
render() {
|
|
27567
|
-
|
|
27685
|
+
var _a, _b;
|
|
27686
|
+
const _c = this.props,
|
|
27568
27687
|
{
|
|
27569
27688
|
shape,
|
|
27570
27689
|
children,
|
|
@@ -27578,9 +27697,13 @@ class Avatar extends BaseComponent {
|
|
|
27578
27697
|
srcSet,
|
|
27579
27698
|
style,
|
|
27580
27699
|
alt,
|
|
27581
|
-
gap
|
|
27582
|
-
|
|
27583
|
-
|
|
27700
|
+
gap,
|
|
27701
|
+
bottomSlot,
|
|
27702
|
+
topSlot,
|
|
27703
|
+
border,
|
|
27704
|
+
contentMotion
|
|
27705
|
+
} = _c,
|
|
27706
|
+
others = avatar_rest(_c, ["shape", "children", "size", "color", "className", "hoverMask", "onClick", "imgAttr", "src", "srcSet", "style", "alt", "gap", "bottomSlot", "topSlot", "border", "contentMotion"]);
|
|
27584
27707
|
const {
|
|
27585
27708
|
isImgExist,
|
|
27586
27709
|
hoverContent,
|
|
@@ -27592,14 +27715,15 @@ class Avatar extends BaseComponent {
|
|
|
27592
27715
|
[`${avatar_prefixCls}-${size}`]: size,
|
|
27593
27716
|
[`${avatar_prefixCls}-${color}`]: color && !isImg,
|
|
27594
27717
|
[`${avatar_prefixCls}-img`]: isImg,
|
|
27595
|
-
[`${avatar_prefixCls}-focus`]: focusVisible
|
|
27718
|
+
[`${avatar_prefixCls}-focus`]: focusVisible,
|
|
27719
|
+
[`${avatar_prefixCls}-animated`]: contentMotion
|
|
27596
27720
|
}, className);
|
|
27597
27721
|
const hoverRender = hoverContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27598
27722
|
className: `${avatar_prefixCls}-hover`,
|
|
27599
27723
|
"x-semi-prop": "hoverContent"
|
|
27600
27724
|
}, hoverContent) : null;
|
|
27601
|
-
|
|
27602
|
-
style: style,
|
|
27725
|
+
let avatar = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", Object.assign({}, others, {
|
|
27726
|
+
style: border || bottomSlot || topSlot || border ? {} : style,
|
|
27603
27727
|
className: avatarCls,
|
|
27604
27728
|
onClick: onClick,
|
|
27605
27729
|
onMouseEnter: this.onEnter,
|
|
@@ -27607,6 +27731,36 @@ class Avatar extends BaseComponent {
|
|
|
27607
27731
|
role: 'listitem',
|
|
27608
27732
|
ref: this.avatarRef
|
|
27609
27733
|
}), this.getContent(), hoverRender);
|
|
27734
|
+
if (border) {
|
|
27735
|
+
const borderStyle = {};
|
|
27736
|
+
if (border === null || border === void 0 ? void 0 : border.color) {
|
|
27737
|
+
borderStyle['borderColor'] = border.color;
|
|
27738
|
+
}
|
|
27739
|
+
avatar = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
27740
|
+
style: Object.assign({
|
|
27741
|
+
position: "relative"
|
|
27742
|
+
}, style)
|
|
27743
|
+
}, avatar, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
27744
|
+
style: borderStyle,
|
|
27745
|
+
className: classnames_default()([`${avatar_prefixCls}-additionalBorder`, `${avatar_prefixCls}-additionalBorder-${size}`, {
|
|
27746
|
+
[`${avatar_prefixCls}-${shape}`]: shape
|
|
27747
|
+
}])
|
|
27748
|
+
}), ((_a = this.props.border) === null || _a === void 0 ? void 0 : _a.motion) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
27749
|
+
style: borderStyle,
|
|
27750
|
+
className: classnames_default()([`${avatar_prefixCls}-additionalBorder`, `${avatar_prefixCls}-additionalBorder-${size}`, {
|
|
27751
|
+
[`${avatar_prefixCls}-${shape}`]: shape,
|
|
27752
|
+
[`${avatar_prefixCls}-additionalBorder-animated`]: (_b = this.props.border) === null || _b === void 0 ? void 0 : _b.motion
|
|
27753
|
+
}])
|
|
27754
|
+
}));
|
|
27755
|
+
}
|
|
27756
|
+
if (bottomSlot || topSlot || border) {
|
|
27757
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
27758
|
+
className: classnames_default()([`${avatar_prefixCls}-wrapper`]),
|
|
27759
|
+
style: style
|
|
27760
|
+
}, avatar, topSlot && ["small", "default", "medium", "large", "extra-large"].includes(size) && shape === "circle" && this.renderTopSlot(), bottomSlot && ["small", "default", "medium", "large", "extra-large"].includes(size) && this.renderBottomSlot());
|
|
27761
|
+
} else {
|
|
27762
|
+
return avatar;
|
|
27763
|
+
}
|
|
27610
27764
|
}
|
|
27611
27765
|
}
|
|
27612
27766
|
Avatar.defaultProps = {
|
|
@@ -27634,7 +27788,30 @@ Avatar.propTypes = {
|
|
|
27634
27788
|
onError: (prop_types_default()).func,
|
|
27635
27789
|
onClick: (prop_types_default()).func,
|
|
27636
27790
|
onMouseEnter: (prop_types_default()).func,
|
|
27637
|
-
onMouseLeave: (prop_types_default()).func
|
|
27791
|
+
onMouseLeave: (prop_types_default()).func,
|
|
27792
|
+
bottomSlot: prop_types_default().shape({
|
|
27793
|
+
render: (prop_types_default()).func,
|
|
27794
|
+
shape: prop_types_default().oneOf(['circle', 'square']),
|
|
27795
|
+
text: (prop_types_default()).node,
|
|
27796
|
+
bgColor: (prop_types_default()).string,
|
|
27797
|
+
textColor: (prop_types_default()).string,
|
|
27798
|
+
className: (prop_types_default()).string,
|
|
27799
|
+
style: (prop_types_default()).object
|
|
27800
|
+
}),
|
|
27801
|
+
topSlot: prop_types_default().shape({
|
|
27802
|
+
render: (prop_types_default()).func,
|
|
27803
|
+
gradientStart: (prop_types_default()).string,
|
|
27804
|
+
gradientEnd: (prop_types_default()).string,
|
|
27805
|
+
text: (prop_types_default()).node,
|
|
27806
|
+
textColor: (prop_types_default()).string,
|
|
27807
|
+
className: (prop_types_default()).string,
|
|
27808
|
+
style: (prop_types_default()).object
|
|
27809
|
+
}),
|
|
27810
|
+
border: prop_types_default().oneOfType([prop_types_default().shape({
|
|
27811
|
+
color: (prop_types_default()).string,
|
|
27812
|
+
motion: (prop_types_default()).bool
|
|
27813
|
+
}), (prop_types_default()).bool]),
|
|
27814
|
+
contentMotion: (prop_types_default()).bool
|
|
27638
27815
|
};
|
|
27639
27816
|
Avatar.elementType = 'Avatar';
|
|
27640
27817
|
;// CONCATENATED MODULE: ./avatar/avatarGroup.tsx
|
|
@@ -37005,12 +37182,10 @@ function util_traverseDataNodes(treeNodes, callback) {
|
|
|
37005
37182
|
// Process node if is not root
|
|
37006
37183
|
if (node) {
|
|
37007
37184
|
const key = parent ? `${parent.key}${constants_VALUE_SPLIT}${node.value}` : node.value;
|
|
37008
|
-
const pos = parent ? util_getPosition(parent.pos, ind) : `${ind}`;
|
|
37009
37185
|
item = {
|
|
37010
37186
|
data: Object.assign({}, node),
|
|
37011
37187
|
ind,
|
|
37012
37188
|
key,
|
|
37013
|
-
pos,
|
|
37014
37189
|
level: parent ? parent.level + 1 : 0,
|
|
37015
37190
|
parentKey: parent ? parent.key : null,
|
|
37016
37191
|
path: parent ? [...parent.path, key] : [key],
|
|
@@ -37043,17 +37218,6 @@ function getKeyByValuePath(valuePath) {
|
|
|
37043
37218
|
function getValuePathByKey(key) {
|
|
37044
37219
|
return key.split(VALUE_SPLIT);
|
|
37045
37220
|
}
|
|
37046
|
-
function getKeyByPos(pos, treeData) {
|
|
37047
|
-
const posArr = pos.split('-').map(item => Number(item));
|
|
37048
|
-
let resultData = treeData;
|
|
37049
|
-
let valuePath = [];
|
|
37050
|
-
posArr.forEach((item, index) => {
|
|
37051
|
-
var _a;
|
|
37052
|
-
resultData = index === 0 ? resultData[item] : (_a = resultData === null || resultData === void 0 ? void 0 : resultData.children) === null || _a === void 0 ? void 0 : _a[item];
|
|
37053
|
-
valuePath.push(resultData === null || resultData === void 0 ? void 0 : resultData.value);
|
|
37054
|
-
});
|
|
37055
|
-
return getKeyByValuePath(valuePath);
|
|
37056
|
-
}
|
|
37057
37221
|
function util_convertDataToEntities(dataNodes) {
|
|
37058
37222
|
const keyEntities = {};
|
|
37059
37223
|
util_traverseDataNodes(dataNodes, data => {
|
|
@@ -37108,28 +37272,6 @@ class CascaderFoundation extends foundation {
|
|
|
37108
37272
|
isSearching: false
|
|
37109
37273
|
});
|
|
37110
37274
|
};
|
|
37111
|
-
this.handleTagRemoveByKey = key => {
|
|
37112
|
-
var _a, _b;
|
|
37113
|
-
const {
|
|
37114
|
-
keyEntities
|
|
37115
|
-
} = this.getStates();
|
|
37116
|
-
const {
|
|
37117
|
-
disabled
|
|
37118
|
-
} = this.getProps();
|
|
37119
|
-
if (disabled) {
|
|
37120
|
-
/* istanbul ignore next */
|
|
37121
|
-
return;
|
|
37122
|
-
}
|
|
37123
|
-
const removedItem = (_a = keyEntities[key]) !== null && _a !== void 0 ? _a : {};
|
|
37124
|
-
!((_b = removedItem === null || removedItem === void 0 ? void 0 : removedItem.data) === null || _b === void 0 ? void 0 : _b.disable) && this._handleMultipleSelect(removedItem);
|
|
37125
|
-
};
|
|
37126
|
-
this.handleTagRemoveInTrigger = pos => {
|
|
37127
|
-
const {
|
|
37128
|
-
treeData
|
|
37129
|
-
} = this.getStates();
|
|
37130
|
-
const key = getKeyByPos(pos, treeData);
|
|
37131
|
-
this.handleTagRemoveByKey(key);
|
|
37132
|
-
};
|
|
37133
37275
|
}
|
|
37134
37276
|
init() {
|
|
37135
37277
|
const isOpen = this.getProp('open') || this.getProp('defaultOpen');
|
|
@@ -37963,6 +38105,20 @@ class CascaderFoundation extends foundation {
|
|
|
37963
38105
|
activeNode: data
|
|
37964
38106
|
});
|
|
37965
38107
|
}
|
|
38108
|
+
handleTagRemove(e, tagValuePath) {
|
|
38109
|
+
const {
|
|
38110
|
+
keyEntities
|
|
38111
|
+
} = this.getStates();
|
|
38112
|
+
const {
|
|
38113
|
+
disabled
|
|
38114
|
+
} = this.getProps();
|
|
38115
|
+
if (disabled) {
|
|
38116
|
+
/* istanbul ignore next */
|
|
38117
|
+
return;
|
|
38118
|
+
}
|
|
38119
|
+
const removedItem = Object.values(keyEntities).filter(item => isEqual_default()(item.valuePath, tagValuePath))[0];
|
|
38120
|
+
!isEmpty_default()(removedItem) && !removedItem.data.disabled && this._handleMultipleSelect(removedItem);
|
|
38121
|
+
}
|
|
37966
38122
|
}
|
|
37967
38123
|
// EXTERNAL MODULE: ../semi-foundation/cascader/cascader.scss
|
|
37968
38124
|
var cascader = __webpack_require__("B2DP");
|
|
@@ -47621,13 +47777,14 @@ class Cascader extends BaseComponent {
|
|
|
47621
47777
|
this.handleInputChange = value => {
|
|
47622
47778
|
this.foundation.handleInputChange(value);
|
|
47623
47779
|
};
|
|
47624
|
-
this.
|
|
47625
|
-
this.foundation.
|
|
47780
|
+
this.handleTagRemove = (e, tagValuePath) => {
|
|
47781
|
+
this.foundation.handleTagRemove(e, tagValuePath);
|
|
47626
47782
|
};
|
|
47627
|
-
this.
|
|
47628
|
-
|
|
47629
|
-
|
|
47630
|
-
this.
|
|
47783
|
+
this.handleRemoveByKey = key => {
|
|
47784
|
+
const {
|
|
47785
|
+
keyEntities
|
|
47786
|
+
} = this.state;
|
|
47787
|
+
this.handleTagRemove(null, keyEntities[key].valuePath);
|
|
47631
47788
|
};
|
|
47632
47789
|
this.renderTagItem = (nodeKey, idx) => {
|
|
47633
47790
|
const {
|
|
@@ -47655,18 +47812,18 @@ class Cascader extends BaseComponent {
|
|
|
47655
47812
|
size: size === 'default' ? 'large' : size,
|
|
47656
47813
|
key: `tag-${nodeKey}-${idx}`,
|
|
47657
47814
|
color: "white",
|
|
47658
|
-
tagKey: nodeKey,
|
|
47659
47815
|
className: tagCls,
|
|
47660
47816
|
closable: true,
|
|
47661
|
-
onClose:
|
|
47817
|
+
onClose: (tagChildren, e) => {
|
|
47818
|
+
// When value has not changed, prevent clicking tag closeBtn to close tag
|
|
47819
|
+
e.preventDefault();
|
|
47820
|
+
this.handleTagRemove(e, keyEntities[nodeKey].valuePath);
|
|
47821
|
+
}
|
|
47662
47822
|
}, keyEntities[nodeKey].data[displayProp]);
|
|
47663
47823
|
}
|
|
47664
47824
|
}
|
|
47665
47825
|
return null;
|
|
47666
47826
|
};
|
|
47667
|
-
this.onRemoveInTagInput = v => {
|
|
47668
|
-
this.foundation.handleTagRemoveByKey(v);
|
|
47669
|
-
};
|
|
47670
47827
|
this.handleItemClick = (e, item) => {
|
|
47671
47828
|
this.foundation.handleItemClick(e, item);
|
|
47672
47829
|
};
|
|
@@ -47866,7 +48023,6 @@ class Cascader extends BaseComponent {
|
|
|
47866
48023
|
}, labelNode);
|
|
47867
48024
|
};
|
|
47868
48025
|
this.renderCustomTrigger = () => {
|
|
47869
|
-
var _a;
|
|
47870
48026
|
const {
|
|
47871
48027
|
disabled,
|
|
47872
48028
|
triggerRender,
|
|
@@ -47877,26 +48033,17 @@ class Cascader extends BaseComponent {
|
|
|
47877
48033
|
inputValue,
|
|
47878
48034
|
inputPlaceHolder,
|
|
47879
48035
|
resolvedCheckedKeys,
|
|
47880
|
-
checkedKeys
|
|
47881
|
-
keyEntities
|
|
48036
|
+
checkedKeys
|
|
47882
48037
|
} = this.state;
|
|
47883
48038
|
let realValue;
|
|
47884
48039
|
if (multiple) {
|
|
47885
48040
|
if (this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE) {
|
|
47886
|
-
realValue =
|
|
47887
|
-
checkedKeys.forEach(key => {
|
|
47888
|
-
var _a;
|
|
47889
|
-
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
47890
|
-
});
|
|
48041
|
+
realValue = checkedKeys;
|
|
47891
48042
|
} else {
|
|
47892
|
-
realValue =
|
|
47893
|
-
resolvedCheckedKeys.forEach(key => {
|
|
47894
|
-
var _a;
|
|
47895
|
-
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
47896
|
-
});
|
|
48043
|
+
realValue = resolvedCheckedKeys;
|
|
47897
48044
|
}
|
|
47898
48045
|
} else {
|
|
47899
|
-
realValue =
|
|
48046
|
+
realValue = [...selectedKeys][0];
|
|
47900
48047
|
}
|
|
47901
48048
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
|
|
47902
48049
|
value: realValue,
|
|
@@ -47909,7 +48056,7 @@ class Cascader extends BaseComponent {
|
|
|
47909
48056
|
componentName: 'Cascader',
|
|
47910
48057
|
componentProps: Object.assign({}, this.props),
|
|
47911
48058
|
onSearch: this.handleInputChange,
|
|
47912
|
-
onRemove: this.
|
|
48059
|
+
onRemove: this.handleRemoveByKey
|
|
47913
48060
|
});
|
|
47914
48061
|
};
|
|
47915
48062
|
this.handleMouseOver = () => {
|
|
@@ -48393,11 +48540,11 @@ class Cascader extends BaseComponent {
|
|
|
48393
48540
|
showRestTagsPopover: showRestTagsPopover,
|
|
48394
48541
|
restTagsPopoverProps: restTagsPopoverProps,
|
|
48395
48542
|
maxTagCount: maxTagCount,
|
|
48396
|
-
renderTagItem: this.renderTagItem,
|
|
48543
|
+
renderTagItem: (value, index) => this.renderTagItem(value, index),
|
|
48397
48544
|
inputValue: inputValue,
|
|
48398
48545
|
onInputChange: this.handleInputChange,
|
|
48399
48546
|
// TODO Modify logic, not modify type
|
|
48400
|
-
onRemove: this.
|
|
48547
|
+
onRemove: v => this.handleTagRemove(null, v),
|
|
48401
48548
|
placeholder: placeholder,
|
|
48402
48549
|
expandRestTagsOnClick: false
|
|
48403
48550
|
});
|
|
@@ -53228,7 +53375,6 @@ function isValidTimeZone(timeZone) {
|
|
|
53228
53375
|
|
|
53229
53376
|
|
|
53230
53377
|
|
|
53231
|
-
|
|
53232
53378
|
/**
|
|
53233
53379
|
* The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
|
|
53234
53380
|
* task 1. Accept the selected date change, update the date value, and update the input box value according to the date = > Notify the change
|
|
@@ -53332,8 +53478,6 @@ class DatePickerFoundation extends foundation {
|
|
|
53332
53478
|
parsedV = zonedTimeToUtc(parsedV, prevTimeZone);
|
|
53333
53479
|
}
|
|
53334
53480
|
result.push(isValidTimeZone(timeZone) ? utcToZonedTime(parsedV, timeZone) : parsedV);
|
|
53335
|
-
} else {
|
|
53336
|
-
warning(true, `[Semi DatePicker] value cannot be parsed, value: ${String(v)}`);
|
|
53337
53481
|
}
|
|
53338
53482
|
}
|
|
53339
53483
|
}
|
|
@@ -54093,17 +54237,19 @@ class DatePickerFoundation extends foundation {
|
|
|
54093
54237
|
timeZone
|
|
54094
54238
|
} = this.getProps();
|
|
54095
54239
|
const prevTimeZone = this.getState('prevTimezone');
|
|
54240
|
+
const start = typeof item.start === 'function' ? item.start() : item.start;
|
|
54241
|
+
const end = typeof item.end === 'function' ? item.end() : item.end;
|
|
54096
54242
|
let value;
|
|
54097
54243
|
switch (type) {
|
|
54098
54244
|
case 'month':
|
|
54099
54245
|
case 'dateTime':
|
|
54100
54246
|
case 'date':
|
|
54101
|
-
value = this.parseWithTimezone([
|
|
54247
|
+
value = this.parseWithTimezone([start], timeZone, prevTimeZone);
|
|
54102
54248
|
this.handleSelectedChange(value);
|
|
54103
54249
|
break;
|
|
54104
54250
|
case 'dateTimeRange':
|
|
54105
54251
|
case 'dateRange':
|
|
54106
|
-
value = this.parseWithTimezone([
|
|
54252
|
+
value = this.parseWithTimezone([start, end], timeZone, prevTimeZone);
|
|
54107
54253
|
this.handleSelectedChange(value, {
|
|
54108
54254
|
needCheckFocusRecord: false
|
|
54109
54255
|
});
|
|
@@ -58963,6 +59109,16 @@ class YearAndMonth extends BaseComponent {
|
|
|
58963
59109
|
currentYear,
|
|
58964
59110
|
currentMonth
|
|
58965
59111
|
} = props;
|
|
59112
|
+
const currentLeftYear = currentYear.left || now.getFullYear();
|
|
59113
|
+
const currentLeftMonth = currentMonth.left || now.getMonth() + 1;
|
|
59114
|
+
currentYear = {
|
|
59115
|
+
left: currentLeftYear,
|
|
59116
|
+
right: currentLeftYear
|
|
59117
|
+
};
|
|
59118
|
+
currentMonth = {
|
|
59119
|
+
left: currentLeftMonth,
|
|
59120
|
+
right: currentMonth.right || currentLeftMonth + 1
|
|
59121
|
+
};
|
|
58966
59122
|
this.state = {
|
|
58967
59123
|
years: _utils_getYears(props.startYear, props.endYear).map(year => ({
|
|
58968
59124
|
value: year,
|
|
@@ -58972,14 +59128,8 @@ class YearAndMonth extends BaseComponent {
|
|
|
58972
59128
|
value: idx + 1,
|
|
58973
59129
|
month: idx + 1
|
|
58974
59130
|
})),
|
|
58975
|
-
currentYear
|
|
58976
|
-
|
|
58977
|
-
right: currentYear.right || now.getFullYear()
|
|
58978
|
-
},
|
|
58979
|
-
currentMonth: {
|
|
58980
|
-
left: currentMonth.left || now.getMonth() + 1,
|
|
58981
|
-
right: currentMonth.right || now.getMonth() + 2
|
|
58982
|
-
}
|
|
59131
|
+
currentYear,
|
|
59132
|
+
currentMonth
|
|
58983
59133
|
};
|
|
58984
59134
|
this.yearRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
58985
59135
|
this.monthRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
@@ -59016,19 +59166,11 @@ class YearAndMonth extends BaseComponent {
|
|
|
59016
59166
|
}
|
|
59017
59167
|
static getDerivedStateFromProps(props, state) {
|
|
59018
59168
|
const willUpdateStates = {};
|
|
59019
|
-
if (!isEqual_default()(props.currentYear, state.currentYear)) {
|
|
59020
|
-
|
|
59021
|
-
willUpdateStates.currentYear = {
|
|
59022
|
-
left: props.currentYear.left || nowYear,
|
|
59023
|
-
right: props.currentYear.right || nowYear
|
|
59024
|
-
};
|
|
59169
|
+
if (!isEqual_default()(props.currentYear, state.currentYear) && props.currentYear.left !== 0) {
|
|
59170
|
+
willUpdateStates.currentYear = props.currentYear;
|
|
59025
59171
|
}
|
|
59026
|
-
if (!isEqual_default()(props.currentMonth, state.currentMonth)) {
|
|
59027
|
-
|
|
59028
|
-
willUpdateStates.currentMonth = {
|
|
59029
|
-
left: props.currentMonth.left || nowMonth + 1,
|
|
59030
|
-
right: props.currentMonth.right || nowMonth + 2
|
|
59031
|
-
};
|
|
59172
|
+
if (!isEqual_default()(props.currentMonth, state.currentMonth) && props.currentMonth.left !== 0) {
|
|
59173
|
+
willUpdateStates.currentMonth = props.currentMonth;
|
|
59032
59174
|
}
|
|
59033
59175
|
return willUpdateStates;
|
|
59034
59176
|
}
|
|
@@ -60447,7 +60589,7 @@ class DatePicker extends BaseComponent {
|
|
|
60447
60589
|
return /range/i.test(type) && !isFunction_default()(triggerRender);
|
|
60448
60590
|
}
|
|
60449
60591
|
componentDidUpdate(prevProps) {
|
|
60450
|
-
if (
|
|
60592
|
+
if (prevProps.value !== this.props.value) {
|
|
60451
60593
|
this.foundation.initFromProps(Object.assign({}, this.props));
|
|
60452
60594
|
} else if (this.props.timeZone !== prevProps.timeZone) {
|
|
60453
60595
|
this.foundation.initFromProps({
|
|
@@ -62194,7 +62336,6 @@ const destroyFns = [];
|
|
|
62194
62336
|
class Modal extends BaseComponent {
|
|
62195
62337
|
constructor(props) {
|
|
62196
62338
|
super(props);
|
|
62197
|
-
this.bodyOverflow = null;
|
|
62198
62339
|
this.handleCancel = e => {
|
|
62199
62340
|
this.foundation.handleCancel(e);
|
|
62200
62341
|
};
|
|
@@ -62214,7 +62355,8 @@ class Modal extends BaseComponent {
|
|
|
62214
62355
|
cancelText,
|
|
62215
62356
|
confirmLoading,
|
|
62216
62357
|
cancelLoading,
|
|
62217
|
-
hasCancel
|
|
62358
|
+
hasCancel,
|
|
62359
|
+
footerFill
|
|
62218
62360
|
} = this.props;
|
|
62219
62361
|
const getCancelButton = locale => {
|
|
62220
62362
|
if (!hasCancel) {
|
|
@@ -62225,6 +62367,7 @@ class Modal extends BaseComponent {
|
|
|
62225
62367
|
onClick: this.handleCancel,
|
|
62226
62368
|
loading: cancelLoading === undefined ? this.state.onCancelReturnPromiseStatus === "pending" : cancelLoading,
|
|
62227
62369
|
type: "tertiary",
|
|
62370
|
+
block: footerFill,
|
|
62228
62371
|
autoFocus: true
|
|
62229
62372
|
}, this.props.cancelButtonProps, {
|
|
62230
62373
|
"x-semi-children-alias": "cancelText"
|
|
@@ -62233,10 +62376,15 @@ class Modal extends BaseComponent {
|
|
|
62233
62376
|
};
|
|
62234
62377
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(LocaleConsumer, {
|
|
62235
62378
|
componentName: "Modal"
|
|
62236
|
-
}, (locale, localeCode) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div",
|
|
62379
|
+
}, (locale, localeCode) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
62380
|
+
className: classnames_default()({
|
|
62381
|
+
[`${modal_constants_cssClasses.DIALOG}-footerfill`]: footerFill
|
|
62382
|
+
})
|
|
62383
|
+
}, getCancelButton(locale), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(button_0, Object.assign({
|
|
62237
62384
|
"aria-label": "confirm",
|
|
62238
62385
|
type: okType,
|
|
62239
62386
|
theme: "solid",
|
|
62387
|
+
block: footerFill,
|
|
62240
62388
|
loading: confirmLoading === undefined ? this.state.onOKReturnPromiseStatus === "pending" : confirmLoading,
|
|
62241
62389
|
onClick: this.handleOk
|
|
62242
62390
|
}, this.props.okButtonProps, {
|
|
@@ -62334,6 +62482,7 @@ class Modal extends BaseComponent {
|
|
|
62334
62482
|
};
|
|
62335
62483
|
this.foundation = new ModalFoundation(this.adapter);
|
|
62336
62484
|
this.modalRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
62485
|
+
this.bodyOverflow = '';
|
|
62337
62486
|
this.scrollBarWidth = 0;
|
|
62338
62487
|
this.originBodyWidth = '100%';
|
|
62339
62488
|
}
|
|
@@ -62354,7 +62503,7 @@ class Modal extends BaseComponent {
|
|
|
62354
62503
|
const {
|
|
62355
62504
|
getPopupContainer
|
|
62356
62505
|
} = this.props;
|
|
62357
|
-
if (!getPopupContainer && this.bodyOverflow !==
|
|
62506
|
+
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
62358
62507
|
document.body.style.overflow = this.bodyOverflow;
|
|
62359
62508
|
document.body.style.width = this.originBodyWidth;
|
|
62360
62509
|
}
|
|
@@ -62469,7 +62618,8 @@ Modal.propTypes = {
|
|
|
62469
62618
|
keepDOM: (prop_types_default()).bool,
|
|
62470
62619
|
lazyRender: (prop_types_default()).bool,
|
|
62471
62620
|
direction: prop_types_default().oneOf(modal_constants_strings.directions),
|
|
62472
|
-
fullScreen: (prop_types_default()).bool
|
|
62621
|
+
fullScreen: (prop_types_default()).bool,
|
|
62622
|
+
footerFill: (prop_types_default()).bool
|
|
62473
62623
|
};
|
|
62474
62624
|
Modal.defaultProps = {
|
|
62475
62625
|
zIndex: 1000,
|
|
@@ -62754,7 +62904,8 @@ class DropdownItem extends BaseComponent {
|
|
|
62754
62904
|
const events = {};
|
|
62755
62905
|
if (!disabled) {
|
|
62756
62906
|
['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
|
|
62757
|
-
|
|
62907
|
+
const isInAnotherDropdown = this.context.level !== 1;
|
|
62908
|
+
if (isInAnotherDropdown && eventName === "onClick") {
|
|
62758
62909
|
events["onMouseDown"] = e => {
|
|
62759
62910
|
var _a, _b;
|
|
62760
62911
|
if (e.button === 0) {
|
|
@@ -70628,8 +70779,7 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
70628
70779
|
value,
|
|
70629
70780
|
label,
|
|
70630
70781
|
children
|
|
70631
|
-
}, rest), e)
|
|
70632
|
-
className
|
|
70782
|
+
}, rest), e)
|
|
70633
70783
|
}, rest));
|
|
70634
70784
|
}
|
|
70635
70785
|
const config = {
|
|
@@ -75513,7 +75663,8 @@ const slider_constants_cssClasses = {
|
|
|
75513
75663
|
TRACK: `${BASE_CLASS_PREFIX}-slider-track`,
|
|
75514
75664
|
DOTS: `${BASE_CLASS_PREFIX}-slider-dots`,
|
|
75515
75665
|
MARKS: `${BASE_CLASS_PREFIX}-slider-marks`,
|
|
75516
|
-
HANDLE: `${BASE_CLASS_PREFIX}-slider-handle
|
|
75666
|
+
HANDLE: `${BASE_CLASS_PREFIX}-slider-handle`,
|
|
75667
|
+
HANDLE_DOT: `${BASE_CLASS_PREFIX}-slider-handle-dot`
|
|
75517
75668
|
};
|
|
75518
75669
|
const slider_constants_strings = {
|
|
75519
75670
|
SIZE: ['small', 'large', 'default'],
|
|
@@ -76332,6 +76483,7 @@ class Slider extends BaseComponent {
|
|
|
76332
76483
|
constructor(props) {
|
|
76333
76484
|
super(props);
|
|
76334
76485
|
this.renderHandle = () => {
|
|
76486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
76335
76487
|
const {
|
|
76336
76488
|
vertical,
|
|
76337
76489
|
range,
|
|
@@ -76430,6 +76582,14 @@ class Slider extends BaseComponent {
|
|
|
76430
76582
|
"aria-valuenow": currentValue,
|
|
76431
76583
|
"aria-valuemax": max,
|
|
76432
76584
|
"aria-valuemin": min
|
|
76585
|
+
}), this.props.handleDot && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
76586
|
+
className: slider_constants_cssClasses.HANDLE_DOT,
|
|
76587
|
+
style: Object.assign(Object.assign({}, ((_a = this.props.handleDot) === null || _a === void 0 ? void 0 : _a.size) ? {
|
|
76588
|
+
width: this.props.handleDot.size,
|
|
76589
|
+
height: this.props.handleDot.size
|
|
76590
|
+
} : {}), ((_b = this.props.handleDot) === null || _b === void 0 ? void 0 : _b.color) ? {
|
|
76591
|
+
backgroundColor: this.props.handleDot.color
|
|
76592
|
+
} : {})
|
|
76433
76593
|
}))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Tooltip, {
|
|
76434
76594
|
content: tipChildren.min,
|
|
76435
76595
|
position: "top",
|
|
@@ -76481,6 +76641,14 @@ class Slider extends BaseComponent {
|
|
|
76481
76641
|
"aria-valuenow": currentValue[0],
|
|
76482
76642
|
"aria-valuemax": currentValue[1],
|
|
76483
76643
|
"aria-valuemin": min
|
|
76644
|
+
}), ((_c = this.props.handleDot) === null || _c === void 0 ? void 0 : _c[0]) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
76645
|
+
className: slider_constants_cssClasses.HANDLE_DOT,
|
|
76646
|
+
style: Object.assign(Object.assign({}, ((_d = this.props.handleDot[0]) === null || _d === void 0 ? void 0 : _d.size) ? {
|
|
76647
|
+
width: this.props.handleDot[0].size,
|
|
76648
|
+
height: this.props.handleDot[0].size
|
|
76649
|
+
} : {}), ((_e = this.props.handleDot[0]) === null || _e === void 0 ? void 0 : _e.color) ? {
|
|
76650
|
+
backgroundColor: this.props.handleDot[0].color
|
|
76651
|
+
} : {})
|
|
76484
76652
|
}))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Tooltip, {
|
|
76485
76653
|
content: tipChildren.max,
|
|
76486
76654
|
position: "top",
|
|
@@ -76532,6 +76700,14 @@ class Slider extends BaseComponent {
|
|
|
76532
76700
|
"aria-valuenow": currentValue[1],
|
|
76533
76701
|
"aria-valuemax": max,
|
|
76534
76702
|
"aria-valuemin": currentValue[0]
|
|
76703
|
+
}), ((_f = this.props.handleDot) === null || _f === void 0 ? void 0 : _f[1]) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
76704
|
+
className: slider_constants_cssClasses.HANDLE_DOT,
|
|
76705
|
+
style: Object.assign(Object.assign({}, ((_g = this.props.handleDot[1]) === null || _g === void 0 ? void 0 : _g.size) ? {
|
|
76706
|
+
width: this.props.handleDot[1].size,
|
|
76707
|
+
height: this.props.handleDot[1].size
|
|
76708
|
+
} : {}), ((_h = this.props.handleDot[1]) === null || _h === void 0 ? void 0 : _h.color) ? {
|
|
76709
|
+
backgroundColor: this.props.handleDot[1].color
|
|
76710
|
+
} : {})
|
|
76535
76711
|
}))));
|
|
76536
76712
|
return handleContents;
|
|
76537
76713
|
};
|
|
@@ -76948,7 +77124,14 @@ Slider.propTypes = {
|
|
|
76948
77124
|
showBoundary: (prop_types_default()).bool,
|
|
76949
77125
|
railStyle: (prop_types_default()).object,
|
|
76950
77126
|
verticalReverse: (prop_types_default()).bool,
|
|
76951
|
-
getAriaValueText: (prop_types_default()).func
|
|
77127
|
+
getAriaValueText: (prop_types_default()).func,
|
|
77128
|
+
handleDot: prop_types_default().oneOfType([prop_types_default().shape({
|
|
77129
|
+
size: (prop_types_default()).string,
|
|
77130
|
+
color: (prop_types_default()).string
|
|
77131
|
+
}), prop_types_default().arrayOf(prop_types_default().shape({
|
|
77132
|
+
size: (prop_types_default()).string,
|
|
77133
|
+
color: (prop_types_default()).string
|
|
77134
|
+
}))])
|
|
76952
77135
|
};
|
|
76953
77136
|
Slider.defaultProps = {
|
|
76954
77137
|
// allowClear: false,
|
|
@@ -79865,8 +80048,9 @@ const IconFilter_IconComponent = convertIcon(IconFilter_SvgComponent, 'filter');
|
|
|
79865
80048
|
|
|
79866
80049
|
|
|
79867
80050
|
|
|
79868
|
-
|
|
79869
|
-
|
|
80051
|
+
|
|
80052
|
+
|
|
80053
|
+
function renderDropdown(props) {
|
|
79870
80054
|
let nestedElem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
79871
80055
|
let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79872
80056
|
const {
|
|
@@ -79878,77 +80062,80 @@ function renderDropdown() {
|
|
|
79878
80062
|
onFilterDropdownVisibleChange = (noop_default()),
|
|
79879
80063
|
trigger = 'click',
|
|
79880
80064
|
position = 'bottom',
|
|
80065
|
+
renderFilterDropdown,
|
|
79881
80066
|
renderFilterDropdownItem
|
|
79882
|
-
} = props;
|
|
80067
|
+
} = props !== null && props !== void 0 ? props : {};
|
|
80068
|
+
const renderFilterDropdownProps = pick_default()(props, ['tempFilteredValue', 'setTempFilteredValue', 'confirm', 'clear', 'close', 'filters']);
|
|
80069
|
+
const render = typeof renderFilterDropdown === 'function' ? renderFilterDropdown(renderFilterDropdownProps) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(dropdown_0.Menu, null, Array.isArray(filters) && filters.map((filter, index) => {
|
|
80070
|
+
const changeFn = e => {
|
|
80071
|
+
const domEvent = e && e.nativeEvent;
|
|
80072
|
+
if (domEvent) {
|
|
80073
|
+
// Block this event to prevent the pop-up layer from closing
|
|
80074
|
+
domEvent.stopImmediatePropagation();
|
|
80075
|
+
// Prevent bubbling and default events to prevent label click events from triggering twice
|
|
80076
|
+
domEvent.stopPropagation();
|
|
80077
|
+
domEvent.preventDefault();
|
|
80078
|
+
}
|
|
80079
|
+
let values = [...filteredValue];
|
|
80080
|
+
const included = values.includes(filter.value);
|
|
80081
|
+
const idx = values.indexOf(filter.value);
|
|
80082
|
+
if (idx > -1) {
|
|
80083
|
+
values.splice(idx, 1);
|
|
80084
|
+
} else if (filterMultiple) {
|
|
80085
|
+
values.push(filter.value);
|
|
80086
|
+
} else {
|
|
80087
|
+
values = [filter.value];
|
|
80088
|
+
}
|
|
80089
|
+
return onSelect({
|
|
80090
|
+
value: filter.value,
|
|
80091
|
+
filteredValue: values,
|
|
80092
|
+
included: !included,
|
|
80093
|
+
domEvent
|
|
80094
|
+
});
|
|
80095
|
+
};
|
|
80096
|
+
const checked = filteredValue.includes(filter.value);
|
|
80097
|
+
const {
|
|
80098
|
+
text
|
|
80099
|
+
} = filter;
|
|
80100
|
+
const {
|
|
80101
|
+
value
|
|
80102
|
+
} = filter;
|
|
80103
|
+
const key = `${level}_${index}`;
|
|
80104
|
+
const dropdownItem = typeof renderFilterDropdownItem === 'function' ? renderFilterDropdownItem({
|
|
80105
|
+
onChange: changeFn,
|
|
80106
|
+
filterMultiple,
|
|
80107
|
+
value,
|
|
80108
|
+
text,
|
|
80109
|
+
checked,
|
|
80110
|
+
filteredValue,
|
|
80111
|
+
level
|
|
80112
|
+
}) : null;
|
|
80113
|
+
let item = dropdownItem && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(dropdownItem) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(dropdownItem, {
|
|
80114
|
+
key
|
|
80115
|
+
}) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(dropdown_0.Item, {
|
|
80116
|
+
key: key,
|
|
80117
|
+
onClick: changeFn
|
|
80118
|
+
}, filterMultiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(checkbox_checkbox_0, {
|
|
80119
|
+
checked: checked
|
|
80120
|
+
}, text) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(radio_radio_0, {
|
|
80121
|
+
checked: checked
|
|
80122
|
+
}, text));
|
|
80123
|
+
if (Array.isArray(filter.children) && filter.children.length) {
|
|
80124
|
+
const childrenDropdownProps = Object.assign(Object.assign({}, props), {
|
|
80125
|
+
filters: filter.children,
|
|
80126
|
+
trigger: 'hover',
|
|
80127
|
+
position: 'right'
|
|
80128
|
+
});
|
|
80129
|
+
delete childrenDropdownProps.filterDropdownVisible;
|
|
80130
|
+
item = renderDropdown(childrenDropdownProps, item, level + 1);
|
|
80131
|
+
}
|
|
80132
|
+
return item;
|
|
80133
|
+
}));
|
|
79883
80134
|
const dropdownProps = Object.assign(Object.assign({}, props), {
|
|
79884
80135
|
onVisibleChange: visible => onFilterDropdownVisibleChange(visible),
|
|
79885
80136
|
trigger,
|
|
79886
80137
|
position,
|
|
79887
|
-
render
|
|
79888
|
-
const changeFn = e => {
|
|
79889
|
-
const domEvent = e && e.nativeEvent;
|
|
79890
|
-
if (domEvent) {
|
|
79891
|
-
// Block this event to prevent the pop-up layer from closing
|
|
79892
|
-
domEvent.stopImmediatePropagation();
|
|
79893
|
-
// Prevent bubbling and default events to prevent label click events from triggering twice
|
|
79894
|
-
domEvent.stopPropagation();
|
|
79895
|
-
domEvent.preventDefault();
|
|
79896
|
-
}
|
|
79897
|
-
let values = [...filteredValue];
|
|
79898
|
-
const included = values.includes(filter.value);
|
|
79899
|
-
const idx = values.indexOf(filter.value);
|
|
79900
|
-
if (idx > -1) {
|
|
79901
|
-
values.splice(idx, 1);
|
|
79902
|
-
} else if (filterMultiple) {
|
|
79903
|
-
values.push(filter.value);
|
|
79904
|
-
} else {
|
|
79905
|
-
values = [filter.value];
|
|
79906
|
-
}
|
|
79907
|
-
return onSelect({
|
|
79908
|
-
value: filter.value,
|
|
79909
|
-
filteredValue: values,
|
|
79910
|
-
included: !included,
|
|
79911
|
-
domEvent
|
|
79912
|
-
});
|
|
79913
|
-
};
|
|
79914
|
-
const checked = filteredValue.includes(filter.value);
|
|
79915
|
-
const {
|
|
79916
|
-
text
|
|
79917
|
-
} = filter;
|
|
79918
|
-
const {
|
|
79919
|
-
value
|
|
79920
|
-
} = filter;
|
|
79921
|
-
const key = `${level}_${index}`;
|
|
79922
|
-
const dropdownItem = typeof renderFilterDropdownItem === 'function' ? renderFilterDropdownItem({
|
|
79923
|
-
onChange: changeFn,
|
|
79924
|
-
filterMultiple,
|
|
79925
|
-
value,
|
|
79926
|
-
text,
|
|
79927
|
-
checked,
|
|
79928
|
-
filteredValue,
|
|
79929
|
-
level
|
|
79930
|
-
}) : null;
|
|
79931
|
-
let item = dropdownItem && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(dropdownItem) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(dropdownItem, {
|
|
79932
|
-
key
|
|
79933
|
-
}) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(dropdown_0.Item, {
|
|
79934
|
-
key: key,
|
|
79935
|
-
onClick: changeFn
|
|
79936
|
-
}, filterMultiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(checkbox_checkbox_0, {
|
|
79937
|
-
checked: checked
|
|
79938
|
-
}, text) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(radio_radio_0, {
|
|
79939
|
-
checked: checked
|
|
79940
|
-
}, text));
|
|
79941
|
-
if (Array.isArray(filter.children) && filter.children.length) {
|
|
79942
|
-
const childrenDropdownProps = Object.assign(Object.assign({}, props), {
|
|
79943
|
-
filters: filter.children,
|
|
79944
|
-
trigger: 'hover',
|
|
79945
|
-
position: 'right'
|
|
79946
|
-
});
|
|
79947
|
-
delete childrenDropdownProps.filterDropdownVisible;
|
|
79948
|
-
item = renderDropdown(childrenDropdownProps, item, level + 1);
|
|
79949
|
-
}
|
|
79950
|
-
return item;
|
|
79951
|
-
}))
|
|
80138
|
+
render
|
|
79952
80139
|
});
|
|
79953
80140
|
if (filterDropdownVisible != null) {
|
|
79954
80141
|
dropdownProps.visible = filterDropdownVisible;
|
|
@@ -79964,12 +80151,68 @@ function ColumnFilter() {
|
|
|
79964
80151
|
prefixCls = table_constants_cssClasses.PREFIX,
|
|
79965
80152
|
filteredValue,
|
|
79966
80153
|
filterIcon = 'filter',
|
|
80154
|
+
filterDropdownProps,
|
|
80155
|
+
onSelect,
|
|
80156
|
+
filterDropdownVisible,
|
|
79967
80157
|
renderFilterDropdown,
|
|
79968
|
-
|
|
80158
|
+
onFilterDropdownVisibleChange
|
|
79969
80159
|
} = props;
|
|
79970
80160
|
let {
|
|
79971
80161
|
filterDropdown = null
|
|
79972
80162
|
} = props;
|
|
80163
|
+
// custom filter related status
|
|
80164
|
+
const isFilterDropdownVisibleControlled = typeof filterDropdownVisible !== 'undefined';
|
|
80165
|
+
const isCustomFilterDropdown = typeof renderFilterDropdown === 'function';
|
|
80166
|
+
const isCustomDropdownVisible = !isFilterDropdownVisibleControlled && isCustomFilterDropdown;
|
|
80167
|
+
const [tempFilteredValue, setTempFilteredValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(filteredValue);
|
|
80168
|
+
const dropdownVisibleInitValue = isCustomDropdownVisible ? false : filterDropdownVisible;
|
|
80169
|
+
const [dropdownVisible, setDropdownVisible] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(dropdownVisibleInitValue);
|
|
80170
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
80171
|
+
if (typeof filterDropdownVisible !== 'undefined') {
|
|
80172
|
+
setDropdownVisible(filterDropdownVisible);
|
|
80173
|
+
}
|
|
80174
|
+
}, [filterDropdownVisible]);
|
|
80175
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
80176
|
+
setTempFilteredValue(filteredValue);
|
|
80177
|
+
}, [filteredValue]);
|
|
80178
|
+
const confirm = function () {
|
|
80179
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
80180
|
+
const newFilteredValue = (props === null || props === void 0 ? void 0 : props.filteredValue) || tempFilteredValue;
|
|
80181
|
+
if (!isEqual_default()(newFilteredValue, filteredValue)) {
|
|
80182
|
+
onSelect({
|
|
80183
|
+
filteredValue: newFilteredValue
|
|
80184
|
+
});
|
|
80185
|
+
}
|
|
80186
|
+
if (props.closeDropdown) {
|
|
80187
|
+
setDropdownVisible(false);
|
|
80188
|
+
}
|
|
80189
|
+
};
|
|
80190
|
+
const clear = function () {
|
|
80191
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
80192
|
+
setTempFilteredValue([]);
|
|
80193
|
+
onSelect({
|
|
80194
|
+
filteredValue: []
|
|
80195
|
+
});
|
|
80196
|
+
if (props.closeDropdown) {
|
|
80197
|
+
setDropdownVisible(false);
|
|
80198
|
+
}
|
|
80199
|
+
};
|
|
80200
|
+
const close = () => {
|
|
80201
|
+
setDropdownVisible(false);
|
|
80202
|
+
};
|
|
80203
|
+
const handleFilterDropdownVisibleChange = visible => {
|
|
80204
|
+
if (isCustomDropdownVisible) {
|
|
80205
|
+
setDropdownVisible(visible);
|
|
80206
|
+
}
|
|
80207
|
+
onFilterDropdownVisibleChange(visible);
|
|
80208
|
+
};
|
|
80209
|
+
const renderFilterDropdownProps = {
|
|
80210
|
+
tempFilteredValue,
|
|
80211
|
+
setTempFilteredValue,
|
|
80212
|
+
confirm,
|
|
80213
|
+
clear,
|
|
80214
|
+
close
|
|
80215
|
+
};
|
|
79973
80216
|
const finalCls = classnames_default()(`${prefixCls}-column-filter`, {
|
|
79974
80217
|
on: Array.isArray(filteredValue) && filteredValue.length
|
|
79975
80218
|
});
|
|
@@ -79989,10 +80232,11 @@ function ColumnFilter() {
|
|
|
79989
80232
|
size: "default"
|
|
79990
80233
|
}));
|
|
79991
80234
|
}
|
|
79992
|
-
const renderProps = Object.assign(Object.assign({}, props), filterDropdownProps)
|
|
79993
|
-
|
|
79994
|
-
|
|
79995
|
-
})
|
|
80235
|
+
const renderProps = Object.assign(Object.assign(Object.assign(Object.assign({}, props), filterDropdownProps), renderFilterDropdownProps), {
|
|
80236
|
+
filterDropdownVisible: isFilterDropdownVisibleControlled ? filterDropdownVisible : dropdownVisible,
|
|
80237
|
+
onFilterDropdownVisibleChange: handleFilterDropdownVisibleChange
|
|
80238
|
+
});
|
|
80239
|
+
filterDropdown = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(filterDropdown) ? filterDropdown : renderDropdown(renderProps, iconElem);
|
|
79996
80240
|
return filterDropdown;
|
|
79997
80241
|
}
|
|
79998
80242
|
;// CONCATENATED MODULE: ../semi-icons/lib/es/icons/IconCaretup.js
|
|
@@ -83229,6 +83473,7 @@ class Table extends BaseComponent {
|
|
|
83229
83473
|
this.renderSelection = function () {
|
|
83230
83474
|
let record = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
83231
83475
|
let inHeader = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
83476
|
+
let index = arguments.length > 2 ? arguments[2] : undefined;
|
|
83232
83477
|
const {
|
|
83233
83478
|
rowSelection,
|
|
83234
83479
|
allDisabledRowKeysSet
|
|
@@ -83238,43 +83483,67 @@ class Table extends BaseComponent {
|
|
|
83238
83483
|
selectedRowKeys = [],
|
|
83239
83484
|
selectedRowKeysSet = new Set(),
|
|
83240
83485
|
getCheckboxProps,
|
|
83241
|
-
disabled
|
|
83486
|
+
disabled,
|
|
83487
|
+
renderCell
|
|
83242
83488
|
} = rowSelection;
|
|
83489
|
+
const allRowKeys = _this2.cachedFilteredSortedRowKeys;
|
|
83490
|
+
const allRowKeysSet = _this2.cachedFilteredSortedRowKeysSet;
|
|
83491
|
+
const allIsSelected = _this2.foundation.allIsSelected(selectedRowKeysSet, allDisabledRowKeysSet, allRowKeys);
|
|
83492
|
+
const hasRowSelected = _this2.foundation.hasRowSelected(selectedRowKeys, allRowKeysSet);
|
|
83493
|
+
const indeterminate = hasRowSelected && !allIsSelected;
|
|
83243
83494
|
if (inHeader) {
|
|
83244
83495
|
const columnKey = get_default()(rowSelection, 'key', table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION);
|
|
83245
|
-
const
|
|
83246
|
-
const allRowKeysSet = _this2.cachedFilteredSortedRowKeysSet;
|
|
83247
|
-
const allIsSelected = _this2.foundation.allIsSelected(selectedRowKeysSet, allDisabledRowKeysSet, allRowKeys);
|
|
83248
|
-
const hasRowSelected = _this2.foundation.hasRowSelected(selectedRowKeys, allRowKeysSet);
|
|
83249
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(TableSelectionCell, {
|
|
83496
|
+
const originNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(TableSelectionCell, {
|
|
83250
83497
|
"aria-label": `${allIsSelected ? 'Deselect' : 'Select'} all rows`,
|
|
83251
83498
|
disabled: disabled,
|
|
83252
83499
|
key: columnKey,
|
|
83253
83500
|
selected: allIsSelected,
|
|
83254
|
-
indeterminate:
|
|
83501
|
+
indeterminate: indeterminate,
|
|
83255
83502
|
onChange: (selected, e) => {
|
|
83256
83503
|
_this2.toggleSelectAllRow(selected, e);
|
|
83257
83504
|
}
|
|
83258
83505
|
});
|
|
83506
|
+
const selectAll = (selected, e) => _this2.toggleSelectAllRow(selected, e);
|
|
83507
|
+
return isFunction_default()(renderCell) ? renderCell({
|
|
83508
|
+
selected: allIsSelected,
|
|
83509
|
+
record,
|
|
83510
|
+
originNode,
|
|
83511
|
+
inHeader,
|
|
83512
|
+
disabled,
|
|
83513
|
+
indeterminate,
|
|
83514
|
+
selectAll
|
|
83515
|
+
}) : originNode;
|
|
83259
83516
|
} else {
|
|
83260
83517
|
const key = _this2.foundation.getRecordKey(record);
|
|
83261
83518
|
const selected = selectedRowKeysSet.has(key);
|
|
83262
83519
|
const checkboxPropsFn = () => typeof getCheckboxProps === 'function' ? getCheckboxProps(record) : {};
|
|
83263
|
-
|
|
83520
|
+
const originNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(TableSelectionCell, {
|
|
83264
83521
|
"aria-label": `${selected ? 'Deselect' : 'Select'} this row`,
|
|
83265
83522
|
getCheckboxProps: checkboxPropsFn,
|
|
83266
83523
|
selected: selected,
|
|
83267
83524
|
onChange: (status, e) => _this2.toggleSelectRow(status, key, e)
|
|
83268
83525
|
});
|
|
83526
|
+
const selectRow = (selected, e) => _this2.toggleSelectRow(selected, key, e);
|
|
83527
|
+
return isFunction_default()(renderCell) ? renderCell({
|
|
83528
|
+
selected,
|
|
83529
|
+
record,
|
|
83530
|
+
index,
|
|
83531
|
+
originNode,
|
|
83532
|
+
inHeader: false,
|
|
83533
|
+
disabled,
|
|
83534
|
+
indeterminate,
|
|
83535
|
+
selectRow
|
|
83536
|
+
}) : originNode;
|
|
83269
83537
|
}
|
|
83270
83538
|
}
|
|
83271
83539
|
return null;
|
|
83272
83540
|
};
|
|
83273
83541
|
this.renderRowSelectionCallback = function (text) {
|
|
83274
83542
|
let record = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
83275
|
-
|
|
83543
|
+
let index = arguments.length > 2 ? arguments[2] : undefined;
|
|
83544
|
+
return _this2.renderSelection(record, false, index);
|
|
83276
83545
|
};
|
|
83277
|
-
this.renderTitleSelectionCallback = () => this.renderSelection(
|
|
83546
|
+
this.renderTitleSelectionCallback = () => this.renderSelection(undefined, true);
|
|
83278
83547
|
this.normalizeSelectionColumn = function () {
|
|
83279
83548
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
83280
83549
|
const {
|
|
@@ -83369,7 +83638,7 @@ class Table extends BaseComponent {
|
|
|
83369
83638
|
const {
|
|
83370
83639
|
prefixCls
|
|
83371
83640
|
} = _this2.props;
|
|
83372
|
-
if (column && (column.sorter || column.filters || column.useFullRender)) {
|
|
83641
|
+
if (column && (column.sorter || column.filters || column.onFilter || column.useFullRender)) {
|
|
83373
83642
|
let hasSorterOrFilter = false;
|
|
83374
83643
|
const {
|
|
83375
83644
|
dataIndex,
|
|
@@ -83411,10 +83680,10 @@ class Table extends BaseComponent {
|
|
|
83411
83680
|
const stateFilteredValue = get_default()(curQuery, 'filteredValue');
|
|
83412
83681
|
const defaultFilteredValue = get_default()(curQuery, 'defaultFilteredValue');
|
|
83413
83682
|
const filteredValue = stateFilteredValue ? stateFilteredValue : defaultFilteredValue;
|
|
83414
|
-
if (Array.isArray(column.filters) && column.filters.length || /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(column.filterDropdown)) {
|
|
83683
|
+
if (Array.isArray(column.filters) && column.filters.length || /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(column.filterDropdown) || typeof column.renderFilterDropdown === 'function') {
|
|
83415
83684
|
const filter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ColumnFilter, Object.assign({
|
|
83416
83685
|
key: table_constants_strings.DEFAULT_KEY_COLUMN_FILTER
|
|
83417
|
-
}, curQuery, {
|
|
83686
|
+
}, omit_default()(curQuery, 'children'), {
|
|
83418
83687
|
filteredValue: filteredValue,
|
|
83419
83688
|
onFilterDropdownVisibleChange: visible => _this2.foundation.toggleShowFilter(dataIndex, visible),
|
|
83420
83689
|
onSelect: data => _this2.foundation.handleFilterSelect(dataIndex, data)
|
|
@@ -84301,7 +84570,7 @@ const ResizableTable = function () {
|
|
|
84301
84570
|
width: table_constants_numbers.DEFAULT_WIDTH_COLUMN_EXPAND
|
|
84302
84571
|
});
|
|
84303
84572
|
}
|
|
84304
|
-
if (props.rowSelection && !
|
|
84573
|
+
if (props.rowSelection && !find_default()(rawColumns, item => item.key === table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
84305
84574
|
newColumns.unshift({
|
|
84306
84575
|
width: get_default()(props, 'rowSelection.width', table_constants_numbers.DEFAULT_WIDTH_COLUMN_SELECTION),
|
|
84307
84576
|
key: table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION
|
|
@@ -90132,6 +90401,7 @@ class TreeSelectFoundation extends foundation {
|
|
|
90132
90401
|
}
|
|
90133
90402
|
}
|
|
90134
90403
|
}
|
|
90404
|
+
this._adapter.notifyClear(e);
|
|
90135
90405
|
}
|
|
90136
90406
|
/**
|
|
90137
90407
|
* A11y: simulate clear button click
|
|
@@ -91698,6 +91968,9 @@ class TreeSelect extends BaseComponent {
|
|
|
91698
91968
|
onLoad
|
|
91699
91969
|
} = this.props;
|
|
91700
91970
|
isFunction_default()(onLoad) && onLoad(newLoadedKeys, data);
|
|
91971
|
+
},
|
|
91972
|
+
notifyClear: e => {
|
|
91973
|
+
this.props.onClear && this.props.onClear(e);
|
|
91701
91974
|
}
|
|
91702
91975
|
};
|
|
91703
91976
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.adapter), filterAdapter), treeSelectAdapter), treeAdapter), {
|
|
@@ -91869,6 +92142,7 @@ TreeSelect.propTypes = {
|
|
|
91869
92142
|
virtualize: (prop_types_default()).object,
|
|
91870
92143
|
treeNodeFilterProp: (prop_types_default()).string,
|
|
91871
92144
|
onChange: (prop_types_default()).func,
|
|
92145
|
+
onClear: (prop_types_default()).func,
|
|
91872
92146
|
onSearch: (prop_types_default()).func,
|
|
91873
92147
|
onSelect: (prop_types_default()).func,
|
|
91874
92148
|
onExpand: (prop_types_default()).func,
|