uiw 4.16.0 → 4.17.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/uiw.css +13 -1
- package/dist/uiw.js +244 -50
- package/dist/uiw.min.css +1 -1
- package/dist/uiw.min.js +1 -1
- package/package.json +60 -60
package/dist/uiw.css
CHANGED
|
@@ -1896,6 +1896,12 @@ sup.w-badge-count {
|
|
|
1896
1896
|
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
|
1897
1897
|
}
|
|
1898
1898
|
|
|
1899
|
+
.w-cascader-close {
|
|
1900
|
+
font-size: 15px;
|
|
1901
|
+
margin-right: 1px;
|
|
1902
|
+
color: #393e48;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1899
1905
|
.w-radio {
|
|
1900
1906
|
vertical-align: middle;
|
|
1901
1907
|
display: inline-block;
|
|
@@ -2252,7 +2258,6 @@ sup.w-badge-count {
|
|
|
2252
2258
|
}
|
|
2253
2259
|
.w-descriptions-item-label {
|
|
2254
2260
|
font-size: 14px;
|
|
2255
|
-
white-space: nowrap;
|
|
2256
2261
|
font-weight: normal;
|
|
2257
2262
|
}
|
|
2258
2263
|
.w-descriptions-item-label::after {
|
|
@@ -3920,6 +3925,13 @@ a.w-list-item:hover:not(.w-disabled) {
|
|
|
3920
3925
|
cursor: not-allowed;
|
|
3921
3926
|
resize: none;
|
|
3922
3927
|
}
|
|
3928
|
+
.w-search-select-multiple-colse {
|
|
3929
|
+
left: 7px;
|
|
3930
|
+
font-size: 15px;
|
|
3931
|
+
}
|
|
3932
|
+
.w-search-select-singe-colse {
|
|
3933
|
+
font-size: 15px;
|
|
3934
|
+
}
|
|
3923
3935
|
|
|
3924
3936
|
.w-split {
|
|
3925
3937
|
height: 100%;
|
package/dist/uiw.js
CHANGED
|
@@ -4382,9 +4382,9 @@ var SubMenu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_am
|
|
|
4382
4382
|
className: [prefixCls ? prefixCls + "-overlay" : null].filter(Boolean).join(' ').trim()
|
|
4383
4383
|
};
|
|
4384
4384
|
var popupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
|
|
4385
|
-
var [isOpen, setIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
4385
|
+
var [isOpen, setIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(!!overlayProps.isOpen);
|
|
4386
4386
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
|
|
4387
|
-
setIsOpen(false);
|
|
4387
|
+
if (collapse) setIsOpen(false);
|
|
4388
4388
|
}, [collapse]);
|
|
4389
4389
|
|
|
4390
4390
|
function onClick(e) {
|
|
@@ -4534,6 +4534,9 @@ Menu.Divider = MenuDivider;
|
|
|
4534
4534
|
|
|
4535
4535
|
/* harmony default export */ const react_menu_esm = (esm_Menu);
|
|
4536
4536
|
|
|
4537
|
+
;// CONCATENATED MODULE: ../react-cascader/esm/style/index.css
|
|
4538
|
+
// extracted by mini-css-extract-plugin
|
|
4539
|
+
/* harmony default export */ const react_cascader_esm_style = ({});
|
|
4537
4540
|
;// CONCATENATED MODULE: ../react-cascader/esm/index.js
|
|
4538
4541
|
|
|
4539
4542
|
|
|
@@ -4543,10 +4546,16 @@ Menu.Divider = MenuDivider;
|
|
|
4543
4546
|
|
|
4544
4547
|
|
|
4545
4548
|
|
|
4549
|
+
|
|
4546
4550
|
function Cascader(props) {
|
|
4547
4551
|
var {
|
|
4552
|
+
value,
|
|
4553
|
+
onChange,
|
|
4554
|
+
onSearch,
|
|
4555
|
+
disabled,
|
|
4556
|
+
allowClear,
|
|
4548
4557
|
placeholder,
|
|
4549
|
-
prefixCls = 'w-
|
|
4558
|
+
prefixCls = 'w-cascader',
|
|
4550
4559
|
className,
|
|
4551
4560
|
style = {
|
|
4552
4561
|
width: 200
|
|
@@ -4557,23 +4566,109 @@ function Cascader(props) {
|
|
|
4557
4566
|
var cls = [prefixCls, className].filter(Boolean).join(' ').trim();
|
|
4558
4567
|
var [innerIsOpen, setInnerIsOpen] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
4559
4568
|
var [selectedValue, setSelectedValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
|
|
4569
|
+
var [selectIconType, setSelectIconType] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
|
|
4570
|
+
var [searchText, setSearchText] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
|
|
4571
|
+
var [searchOn, setSearchOn] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
4572
|
+
var [inputValue, setInputValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('');
|
|
4573
|
+
var [searchOption, setSearchOption] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)();
|
|
4574
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
4575
|
+
if (onSearch) {
|
|
4576
|
+
var tempOptions = [];
|
|
4577
|
+
iteratorOption(option, opt => {
|
|
4578
|
+
var label = opt.map(m => m.label).join(' / ');
|
|
4579
|
+
tempOptions.push({
|
|
4580
|
+
label,
|
|
4581
|
+
options: opt
|
|
4582
|
+
});
|
|
4583
|
+
});
|
|
4584
|
+
setSearchOption(tempOptions);
|
|
4585
|
+
}
|
|
4586
|
+
}, [onSearch]);
|
|
4587
|
+
|
|
4588
|
+
var iteratorOption = function iteratorOption(options, cb, opts) {
|
|
4589
|
+
if (opts === void 0) {
|
|
4590
|
+
opts = [];
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4593
|
+
options.map(opt => {
|
|
4594
|
+
var optsTemp = [...opts, opt];
|
|
4595
|
+
|
|
4596
|
+
if (opt.children) {
|
|
4597
|
+
iteratorOption(opt.children, cb, optsTemp);
|
|
4598
|
+
} else {
|
|
4599
|
+
cb == null ? void 0 : cb(optsTemp);
|
|
4600
|
+
}
|
|
4601
|
+
});
|
|
4602
|
+
};
|
|
4603
|
+
|
|
4604
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
4605
|
+
if (value) {
|
|
4606
|
+
var valueTemp = [];
|
|
4607
|
+
var optChildren = option;
|
|
4608
|
+
value == null ? void 0 : value.map(item => {
|
|
4609
|
+
var findOpt = optChildren.find(opt => opt.value === item);
|
|
4610
|
+
optChildren = (findOpt == null ? void 0 : findOpt.children) || [];
|
|
4611
|
+
valueTemp.push(_extends({
|
|
4612
|
+
label: item,
|
|
4613
|
+
value: item
|
|
4614
|
+
}, findOpt));
|
|
4615
|
+
});
|
|
4616
|
+
setSelectedValue(valueTemp);
|
|
4617
|
+
}
|
|
4618
|
+
}, [value]);
|
|
4560
4619
|
|
|
4561
4620
|
function onVisibleChange(isOpen) {
|
|
4562
4621
|
setInnerIsOpen(isOpen);
|
|
4563
4622
|
}
|
|
4564
4623
|
|
|
4624
|
+
function renderSelectIcon(type) {
|
|
4625
|
+
var selectIconType;
|
|
4626
|
+
|
|
4627
|
+
if (type === 'enter' && allowClear && selectedValue.length > 0) {
|
|
4628
|
+
selectIconType = 'close';
|
|
4629
|
+
} else {
|
|
4630
|
+
selectIconType = '';
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
setSelectIconType(selectIconType);
|
|
4634
|
+
}
|
|
4635
|
+
|
|
4636
|
+
var searchItemClick = options => {
|
|
4637
|
+
setSearchText('');
|
|
4638
|
+
setInnerIsOpen(false);
|
|
4639
|
+
handelChange(false, options);
|
|
4640
|
+
};
|
|
4641
|
+
|
|
4565
4642
|
var handleItemClick = (optionsItem, level) => {
|
|
4566
4643
|
selectedValue.splice(level, selectedValue.length - level, optionsItem);
|
|
4567
|
-
|
|
4568
|
-
handelChange();
|
|
4644
|
+
handelChange(true, selectedValue);
|
|
4569
4645
|
};
|
|
4570
4646
|
|
|
4571
|
-
var handelChange = () => {
|
|
4647
|
+
var handelChange = (isSeleted, selectedValue) => {
|
|
4648
|
+
setSelectedValue([...selectedValue]);
|
|
4572
4649
|
var value = selectedValue.map(item => item.value);
|
|
4573
|
-
|
|
4650
|
+
onChange == null ? void 0 : onChange(isSeleted, value, selectedValue);
|
|
4574
4651
|
};
|
|
4575
4652
|
|
|
4576
|
-
var
|
|
4653
|
+
var onClear = e => {
|
|
4654
|
+
e.stopPropagation();
|
|
4655
|
+
handelChange(false, []);
|
|
4656
|
+
};
|
|
4657
|
+
|
|
4658
|
+
var handelSearch = searchText => {
|
|
4659
|
+
setSearchText(searchText);
|
|
4660
|
+
};
|
|
4661
|
+
|
|
4662
|
+
var inputChange = e => {
|
|
4663
|
+
if (!innerIsOpen) {
|
|
4664
|
+
setInnerIsOpen(!innerIsOpen);
|
|
4665
|
+
}
|
|
4666
|
+
|
|
4667
|
+
var value = e.target.value;
|
|
4668
|
+
onSearch && handelSearch(value);
|
|
4669
|
+
};
|
|
4670
|
+
|
|
4671
|
+
var widths = (style == null ? void 0 : style.width) * 0.7 || undefined;
|
|
4577
4672
|
|
|
4578
4673
|
var OptionIter = function OptionIter(option, level) {
|
|
4579
4674
|
if (level === void 0) {
|
|
@@ -4595,25 +4690,26 @@ function Cascader(props) {
|
|
|
4595
4690
|
fontSize: 12
|
|
4596
4691
|
},
|
|
4597
4692
|
children: '没有数据'
|
|
4598
|
-
}) : option.map((
|
|
4693
|
+
}) : option.map((opt, index) => {
|
|
4599
4694
|
var _selectedValue$level;
|
|
4600
4695
|
|
|
4601
|
-
var active = ((_selectedValue$level = selectedValue[level]) == null ? void 0 : _selectedValue$level.value) ===
|
|
4696
|
+
var active = ((_selectedValue$level = selectedValue[level]) == null ? void 0 : _selectedValue$level.value) === opt.value;
|
|
4602
4697
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, {
|
|
4603
4698
|
active: active,
|
|
4604
|
-
text:
|
|
4605
|
-
addonAfter:
|
|
4699
|
+
text: opt.label,
|
|
4700
|
+
addonAfter: opt.children ? /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
4606
4701
|
type: "right"
|
|
4607
4702
|
}) : undefined,
|
|
4608
|
-
onClick: () => handleItemClick(
|
|
4703
|
+
onClick: () => handleItemClick(opt, level)
|
|
4609
4704
|
}, index);
|
|
4610
4705
|
})
|
|
4611
4706
|
}, level);
|
|
4612
4707
|
};
|
|
4613
4708
|
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4709
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
4710
|
+
var inputValue = selectedValue.map(opt => opt.label).join(' / ');
|
|
4711
|
+
setInputValue(inputValue);
|
|
4712
|
+
}, [selectedValue]);
|
|
4617
4713
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Dropdown, _extends({
|
|
4618
4714
|
className: cls,
|
|
4619
4715
|
trigger: "click",
|
|
@@ -4622,11 +4718,12 @@ function Cascader(props) {
|
|
|
4622
4718
|
}, style),
|
|
4623
4719
|
overlayStyl: {
|
|
4624
4720
|
width: 100
|
|
4625
|
-
}
|
|
4721
|
+
},
|
|
4722
|
+
disabled: disabled
|
|
4626
4723
|
}, others, {
|
|
4627
4724
|
onVisibleChange: onVisibleChange,
|
|
4628
4725
|
isOpen: innerIsOpen,
|
|
4629
|
-
menu: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
4726
|
+
menu: !searchText ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
4630
4727
|
style: {
|
|
4631
4728
|
display: 'flex'
|
|
4632
4729
|
},
|
|
@@ -4636,14 +4733,53 @@ function Cascader(props) {
|
|
|
4636
4733
|
var options = index ? (_selectedValue = selectedValue[index - 1]) == null ? void 0 : _selectedValue.children : option;
|
|
4637
4734
|
return OptionIter(options, index);
|
|
4638
4735
|
}).filter(m => !!m)
|
|
4639
|
-
}),
|
|
4640
|
-
|
|
4641
|
-
value: inputValue,
|
|
4642
|
-
onChange: () => {},
|
|
4643
|
-
placeholder: placeholder,
|
|
4736
|
+
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm, {
|
|
4737
|
+
bordered: true,
|
|
4644
4738
|
style: {
|
|
4739
|
+
minHeight: 25,
|
|
4740
|
+
minWidth: style == null ? void 0 : style.width,
|
|
4741
|
+
overflowY: 'scroll',
|
|
4645
4742
|
width: style == null ? void 0 : style.width
|
|
4646
|
-
}
|
|
4743
|
+
},
|
|
4744
|
+
children: !searchOption || searchOption.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
4745
|
+
style: {
|
|
4746
|
+
color: '#c7c7c7',
|
|
4747
|
+
fontSize: 12
|
|
4748
|
+
},
|
|
4749
|
+
children: '没有数据'
|
|
4750
|
+
}) : searchOption.filter(opt => opt.label.includes(searchText.trim())).map((opt, index) => {
|
|
4751
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_menu_esm.Item, {
|
|
4752
|
+
text: opt.label,
|
|
4753
|
+
onClick: () => searchItemClick(opt.options) //
|
|
4754
|
+
|
|
4755
|
+
}, index);
|
|
4756
|
+
})
|
|
4757
|
+
}),
|
|
4758
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
4759
|
+
onMouseLeave: () => renderSelectIcon('leave'),
|
|
4760
|
+
onMouseOver: () => renderSelectIcon('enter'),
|
|
4761
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_input_esm, {
|
|
4762
|
+
value: searchOn ? searchText : inputValue,
|
|
4763
|
+
onChange: inputChange,
|
|
4764
|
+
disabled: disabled,
|
|
4765
|
+
placeholder: searchOn ? inputValue : placeholder,
|
|
4766
|
+
style: {
|
|
4767
|
+
width: style == null ? void 0 : style.width
|
|
4768
|
+
},
|
|
4769
|
+
onFocus: () => onSearch && setSearchOn(true),
|
|
4770
|
+
onBlur: () => onSearch && setSearchOn(false),
|
|
4771
|
+
readOnly: !onSearch,
|
|
4772
|
+
addonAfter: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
4773
|
+
style: {
|
|
4774
|
+
width: 'auto'
|
|
4775
|
+
},
|
|
4776
|
+
children: !disabled && selectIconType === 'close' && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
4777
|
+
type: selectIconType,
|
|
4778
|
+
onClick: onClear,
|
|
4779
|
+
className: prefixCls + "-close"
|
|
4780
|
+
})
|
|
4781
|
+
})
|
|
4782
|
+
})
|
|
4647
4783
|
})
|
|
4648
4784
|
}));
|
|
4649
4785
|
}
|
|
@@ -8094,7 +8230,7 @@ var react_tag_esm_excluded = ["prefixCls", "className", "style", "title", "child
|
|
|
8094
8230
|
;// CONCATENATED MODULE: ../react-search-select/esm/index.js
|
|
8095
8231
|
|
|
8096
8232
|
|
|
8097
|
-
var react_search_select_esm_excluded = ["allowClear", "disabled", "
|
|
8233
|
+
var react_search_select_esm_excluded = ["allowClear", "disabled", "valueAmount", "size", "option", "maxTagCount", "loading", "labelInValue", "prefixCls", "className", "mode", "style", "isOpen", "value", "defaultValue", "showSearch", "tagProps", "placeholder", "onSearch", "onChange", "onSelect"];
|
|
8098
8234
|
|
|
8099
8235
|
|
|
8100
8236
|
|
|
@@ -8113,9 +8249,10 @@ function SearchSelect(props) {
|
|
|
8113
8249
|
var {
|
|
8114
8250
|
allowClear = false,
|
|
8115
8251
|
disabled = false,
|
|
8252
|
+
valueAmount,
|
|
8116
8253
|
size = 'default',
|
|
8117
|
-
maxTagCount,
|
|
8118
8254
|
option = [],
|
|
8255
|
+
maxTagCount,
|
|
8119
8256
|
loading = false,
|
|
8120
8257
|
labelInValue = false,
|
|
8121
8258
|
prefixCls = 'w-search-select',
|
|
@@ -8193,7 +8330,7 @@ function SearchSelect(props) {
|
|
|
8193
8330
|
}
|
|
8194
8331
|
|
|
8195
8332
|
if (!isMultiple && opts.length > 0) setSelectedLabel(opts[0].label || '');
|
|
8196
|
-
setSelectedValue(opts);
|
|
8333
|
+
setSelectedValue(opts.slice(0, valueAmount));
|
|
8197
8334
|
}
|
|
8198
8335
|
|
|
8199
8336
|
function removeSelectItem(index) {
|
|
@@ -8217,7 +8354,7 @@ function SearchSelect(props) {
|
|
|
8217
8354
|
}
|
|
8218
8355
|
|
|
8219
8356
|
function handleItemsClick(index, item) {
|
|
8220
|
-
var values = index !== -1 ? removeSelectItem(index) : [...selectedValue, item];
|
|
8357
|
+
var values = index !== -1 ? removeSelectItem(index) : [...selectedValue.slice(0, valueAmount ? valueAmount - 1 : undefined), item];
|
|
8221
8358
|
var resultValue = values.map(item => item.value);
|
|
8222
8359
|
handleChange(resultValue, values);
|
|
8223
8360
|
}
|
|
@@ -8386,6 +8523,7 @@ function SearchSelect(props) {
|
|
|
8386
8523
|
placeholder: selectedValue.length ? '' : placeholder
|
|
8387
8524
|
})]
|
|
8388
8525
|
}), !disabled && (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
8526
|
+
className: prefixCls + "-multiple-colse",
|
|
8389
8527
|
type: selectIconType,
|
|
8390
8528
|
spin: loading && selectIconType === 'loading',
|
|
8391
8529
|
onClick: resetSelectedValue
|
|
@@ -8400,6 +8538,8 @@ function SearchSelect(props) {
|
|
|
8400
8538
|
placeholder: placeholder,
|
|
8401
8539
|
addonAfter: !disabled && (selectIconType === 'close' || selectIconType === 'loading' && loading) && /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
8402
8540
|
type: selectIconType,
|
|
8541
|
+
className: prefixCls + "-singe-colse",
|
|
8542
|
+
color: "#393e48",
|
|
8403
8543
|
spin: loading && selectIconType === 'loading',
|
|
8404
8544
|
onClick: resetSelectedValue
|
|
8405
8545
|
})
|
|
@@ -9337,7 +9477,7 @@ class ThComponent extends external_root_React_commonjs2_react_commonjs_react_amd
|
|
|
9337
9477
|
var rect = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(this);
|
|
9338
9478
|
this.props.updateLocation({
|
|
9339
9479
|
width: rect.getBoundingClientRect().width
|
|
9340
|
-
}, this.props.colNum);
|
|
9480
|
+
}, "" + this.props.rowNum + this.props.colNum, this.props.item.key, this.props.item.colSpan);
|
|
9341
9481
|
}
|
|
9342
9482
|
|
|
9343
9483
|
render() {
|
|
@@ -9367,7 +9507,7 @@ class ThComponent extends external_root_React_commonjs2_react_commonjs_react_amd
|
|
|
9367
9507
|
}
|
|
9368
9508
|
|
|
9369
9509
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({}, thProps, {
|
|
9370
|
-
style: _extends({}, thProps.style, locationFixed(fixed, locationWidth, colNum)),
|
|
9510
|
+
style: _extends({}, thProps.style, locationFixed(fixed, locationWidth, "" + rowNum + colNum)),
|
|
9371
9511
|
className: prefixCls + "-tr-children-" + ((item == null ? void 0 : item.align) || 'left') + " " + (item.className || '') + " " + cls,
|
|
9372
9512
|
onClick: evn => onCellHead == null ? void 0 : onCellHead(item, colNum, rowNum, evn),
|
|
9373
9513
|
children: titleNode
|
|
@@ -9491,7 +9631,8 @@ function TableTr(props) {
|
|
|
9491
9631
|
hierarchy,
|
|
9492
9632
|
indentSize,
|
|
9493
9633
|
childrenColumnName,
|
|
9494
|
-
locationWidth
|
|
9634
|
+
locationWidth,
|
|
9635
|
+
header
|
|
9495
9636
|
} = props;
|
|
9496
9637
|
var [isOpacity, setIsOpacity] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
9497
9638
|
var [childrenIndex, setChildrenIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0);
|
|
@@ -9519,6 +9660,15 @@ function TableTr(props) {
|
|
|
9519
9660
|
};
|
|
9520
9661
|
}, [expandIndex]);
|
|
9521
9662
|
|
|
9663
|
+
var getIndex = key => {
|
|
9664
|
+
var j = 0;
|
|
9665
|
+
var i = header.findIndex(it => {
|
|
9666
|
+
j = it.findIndex(item => item.key === key);
|
|
9667
|
+
return j > -1;
|
|
9668
|
+
});
|
|
9669
|
+
return "" + i + j;
|
|
9670
|
+
};
|
|
9671
|
+
|
|
9522
9672
|
if (!Array.isArray(data) || !data.length) {
|
|
9523
9673
|
return null;
|
|
9524
9674
|
}
|
|
@@ -9573,7 +9723,7 @@ function TableTr(props) {
|
|
|
9573
9723
|
}
|
|
9574
9724
|
|
|
9575
9725
|
return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)("td", _extends({}, objs, {
|
|
9576
|
-
style: _extends({}, locationFixed(keyName.fixed, locationWidth,
|
|
9726
|
+
style: keyName.fixed ? _extends({}, locationFixed(keyName.fixed, locationWidth, "" + getIndex(keyName.key || 'undefined'))) : {},
|
|
9577
9727
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
9578
9728
|
className: ellipsis && ellipsis[keyName.key] ? prefixCls + "-ellipsis" : undefined,
|
|
9579
9729
|
children: objs.children
|
|
@@ -9637,34 +9787,71 @@ function Table(props) {
|
|
|
9637
9787
|
var [locationWidth, setLocationWidth] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({});
|
|
9638
9788
|
var finalLocationWidth = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
|
|
9639
9789
|
|
|
9640
|
-
var updateLocation = (params, index)
|
|
9790
|
+
var updateLocation = function updateLocation(params, index, key, colSpan) {
|
|
9791
|
+
if (colSpan === void 0) {
|
|
9792
|
+
colSpan = 0;
|
|
9793
|
+
}
|
|
9794
|
+
|
|
9641
9795
|
finalLocationWidth.current = _extends({}, finalLocationWidth.current, {
|
|
9642
|
-
[index]: _extends({}, finalLocationWidth.current[index], params
|
|
9796
|
+
[index]: _extends({}, finalLocationWidth.current[index], params, {
|
|
9797
|
+
key: key,
|
|
9798
|
+
colSpan
|
|
9799
|
+
})
|
|
9643
9800
|
});
|
|
9644
9801
|
|
|
9645
|
-
if (index ===
|
|
9802
|
+
if (index === "" + (header.length - 1) + (header[header.length - 1].length - 1)) {
|
|
9646
9803
|
setLocationWidth(computed());
|
|
9647
9804
|
}
|
|
9648
9805
|
};
|
|
9649
9806
|
|
|
9650
|
-
var
|
|
9651
|
-
var
|
|
9652
|
-
|
|
9807
|
+
var deepClumnsLocation = (params, fistIndex, leftOrRight, isReverse) => {
|
|
9808
|
+
var initialValue = 0,
|
|
9809
|
+
lastIndex = isReverse ? 0 : params.length - 1,
|
|
9810
|
+
deepParams = [];
|
|
9811
|
+
params.forEach(() => {
|
|
9812
|
+
var abs = Math.abs(lastIndex);
|
|
9813
|
+
var i = "" + fistIndex + abs;
|
|
9653
9814
|
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9815
|
+
if (isReverse) {
|
|
9816
|
+
lastIndex += 1;
|
|
9817
|
+
} else {
|
|
9818
|
+
lastIndex -= 1;
|
|
9658
9819
|
}
|
|
9659
|
-
}
|
|
9660
9820
|
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9821
|
+
if (typeof params[abs] === 'number') {
|
|
9822
|
+
initialValue = params[abs] + initialValue;
|
|
9823
|
+
deepParams.push(params[abs]);
|
|
9824
|
+
return;
|
|
9825
|
+
}
|
|
9826
|
+
|
|
9827
|
+
if (finalLocationWidth.current[i]) {
|
|
9828
|
+
finalLocationWidth.current[i][leftOrRight] = initialValue;
|
|
9829
|
+
initialValue = finalLocationWidth.current[i].width + initialValue;
|
|
9665
9830
|
}
|
|
9666
|
-
}
|
|
9667
9831
|
|
|
9832
|
+
if (Array.isArray(params[abs].children)) {
|
|
9833
|
+
deepParams.push(...params[abs].children);
|
|
9834
|
+
return;
|
|
9835
|
+
}
|
|
9836
|
+
|
|
9837
|
+
if (finalLocationWidth.current[i]) {
|
|
9838
|
+
deepParams.push(finalLocationWidth.current[i].width);
|
|
9839
|
+
} else {
|
|
9840
|
+
var parent = header.find(it => it.find(it => it.key === params[abs].key)) || [];
|
|
9841
|
+
var sub = parent.findIndex(it => it.key === params[abs].key);
|
|
9842
|
+
|
|
9843
|
+
if (finalLocationWidth.current["" + i[0] + sub]) {
|
|
9844
|
+
// 合并单元格
|
|
9845
|
+
deepParams.push(finalLocationWidth.current["" + i[0] + sub].width);
|
|
9846
|
+
}
|
|
9847
|
+
}
|
|
9848
|
+
});
|
|
9849
|
+
if (deepParams.filter(it => typeof it !== 'number').length) deepClumnsLocation(deepParams, fistIndex + 1, leftOrRight, isReverse);
|
|
9850
|
+
};
|
|
9851
|
+
|
|
9852
|
+
var computed = () => {
|
|
9853
|
+
deepClumnsLocation(columns, 0, 'left', true);
|
|
9854
|
+
deepClumnsLocation(columns, 0, 'right', false);
|
|
9668
9855
|
return finalLocationWidth.current;
|
|
9669
9856
|
};
|
|
9670
9857
|
|
|
@@ -9838,6 +10025,7 @@ function Table(props) {
|
|
|
9838
10025
|
rowKey: rowKey,
|
|
9839
10026
|
locationWidth: locationWidth,
|
|
9840
10027
|
data: data,
|
|
10028
|
+
header: header,
|
|
9841
10029
|
keys: self.keys,
|
|
9842
10030
|
render: render,
|
|
9843
10031
|
ellipsis: ellipsis,
|
|
@@ -9905,6 +10093,7 @@ var react_tabs_esm_excluded = ["prefixCls", "className", "children", "type", "ac
|
|
|
9905
10093
|
|
|
9906
10094
|
|
|
9907
10095
|
Tabs.Pane = Pane;
|
|
10096
|
+
var labelWidth = 0;
|
|
9908
10097
|
function Tabs(props) {
|
|
9909
10098
|
var _flowNav$nav;
|
|
9910
10099
|
|
|
@@ -9950,12 +10139,16 @@ function Tabs(props) {
|
|
|
9950
10139
|
flowNavSet(_extends({}, flowNav));
|
|
9951
10140
|
}
|
|
9952
10141
|
}, []);
|
|
9953
|
-
var divNavRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, key) => {
|
|
10142
|
+
var divNavRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((node, key, itemKey) => {
|
|
9954
10143
|
if (node !== null) {
|
|
9955
10144
|
node.addEventListener('click', e => {
|
|
9956
10145
|
activeItem.current = node;
|
|
9957
10146
|
});
|
|
9958
10147
|
divNavWidthChange(node.getBoundingClientRect().width, key);
|
|
10148
|
+
|
|
10149
|
+
if (itemKey === props.activeKey && type === 'line' && labelWidth === 0) {
|
|
10150
|
+
activeItem.current = node;
|
|
10151
|
+
}
|
|
9959
10152
|
}
|
|
9960
10153
|
}, []);
|
|
9961
10154
|
|
|
@@ -9994,6 +10187,7 @@ function Tabs(props) {
|
|
|
9994
10187
|
|
|
9995
10188
|
function calcSlideStyle() {
|
|
9996
10189
|
if (activeItem.current && type === 'line') {
|
|
10190
|
+
labelWidth = activeItem.current.clientWidth;
|
|
9997
10191
|
setSlideStyle({
|
|
9998
10192
|
width: activeItem.current.clientWidth,
|
|
9999
10193
|
left: activeItem.current.offsetLeft
|
|
@@ -10071,7 +10265,7 @@ function Tabs(props) {
|
|
|
10071
10265
|
}
|
|
10072
10266
|
|
|
10073
10267
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
|
|
10074
|
-
ref: _ref => divNavRef(_ref, key)
|
|
10268
|
+
ref: _ref => divNavRef(_ref, key, item.key)
|
|
10075
10269
|
}, divProps), key);
|
|
10076
10270
|
});
|
|
10077
10271
|
}
|