uiw 4.14.1 → 4.14.2
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 +8 -3
- package/dist/uiw.js +67 -48
- package/dist/uiw.min.css +1 -1
- package/dist/uiw.min.js +1 -1
- package/package.json +58 -58
package/dist/uiw.css
CHANGED
|
@@ -4627,9 +4627,14 @@ a.w-list-item:hover:not(.w-disabled) {
|
|
|
4627
4627
|
text-overflow: ellipsis;
|
|
4628
4628
|
word-break: keep-all;
|
|
4629
4629
|
}
|
|
4630
|
-
.w-table-
|
|
4631
|
-
|
|
4632
|
-
|
|
4630
|
+
.w-table-tr-children-center {
|
|
4631
|
+
text-align: center;
|
|
4632
|
+
}
|
|
4633
|
+
.w-table-tr-children-left {
|
|
4634
|
+
text-align: left;
|
|
4635
|
+
}
|
|
4636
|
+
.w-table-tr-children-right {
|
|
4637
|
+
text-align: right;
|
|
4633
4638
|
}
|
|
4634
4639
|
.w-table-bordered > table tr > th,
|
|
4635
4640
|
.w-table-bordered > table tr > td,
|
package/dist/uiw.js
CHANGED
|
@@ -8894,9 +8894,9 @@ function TheadComponent(props) {
|
|
|
8894
8894
|
thProps.className = (thProps.className || '') + " " + prefixCls + "-ellipsis";
|
|
8895
8895
|
}
|
|
8896
8896
|
|
|
8897
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({
|
|
8898
|
-
|
|
8899
|
-
|
|
8897
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)("th", _extends({}, thProps, {
|
|
8898
|
+
className: prefixCls + "-tr-children-" + ((item == null ? void 0 : item.align) || 'left') + " " + (className || ''),
|
|
8899
|
+
onClick: evn => onCellHead(item, colNum, rowNum, evn),
|
|
8900
8900
|
children: titleNode
|
|
8901
8901
|
}), colNum);
|
|
8902
8902
|
})
|
|
@@ -9059,7 +9059,7 @@ function getAllColumnsKeys(data, keys) {
|
|
|
9059
9059
|
if (data[i].children) {
|
|
9060
9060
|
keys = keys.concat(getAllColumnsKeys(data[i].children || []));
|
|
9061
9061
|
} else if (data[i].key) {
|
|
9062
|
-
keys.push(data[i]
|
|
9062
|
+
keys.push(data[i]);
|
|
9063
9063
|
}
|
|
9064
9064
|
}
|
|
9065
9065
|
|
|
@@ -9120,7 +9120,11 @@ function TableTr(props) {
|
|
|
9120
9120
|
indentSize,
|
|
9121
9121
|
childrenColumnName
|
|
9122
9122
|
} = props;
|
|
9123
|
+
var [isOpacity, setIsOpacity] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
9123
9124
|
var [expandIndex, setExpandIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]);
|
|
9125
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
9126
|
+
setIsOpacity(!!(data != null && data.find(it => it[childrenColumnName])));
|
|
9127
|
+
}, [data]);
|
|
9124
9128
|
var IconDom = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
|
|
9125
9129
|
return (key, isOpacity) => {
|
|
9126
9130
|
var flag = expandIndex.includes(key);
|
|
@@ -9129,7 +9133,9 @@ function TableTr(props) {
|
|
|
9129
9133
|
style: {
|
|
9130
9134
|
marginRight: 10,
|
|
9131
9135
|
opacity: isOpacity ? 1 : 0,
|
|
9132
|
-
marginLeft: hierarchy * indentSize
|
|
9136
|
+
marginLeft: hierarchy * indentSize,
|
|
9137
|
+
float: 'left',
|
|
9138
|
+
marginTop: 3.24
|
|
9133
9139
|
},
|
|
9134
9140
|
onClick: () => {
|
|
9135
9141
|
setExpandIndex(flag ? expandIndex.filter(it => it !== key) : [...expandIndex, key]);
|
|
@@ -9149,11 +9155,11 @@ function TableTr(props) {
|
|
|
9149
9155
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
|
|
9150
9156
|
children: keys.map((keyName, colNum) => {
|
|
9151
9157
|
var objs = {
|
|
9152
|
-
children: trData[keyName]
|
|
9158
|
+
children: trData[keyName.key]
|
|
9153
9159
|
};
|
|
9154
9160
|
|
|
9155
|
-
if (render[keyName]) {
|
|
9156
|
-
var child = render[keyName](trData[keyName], keyName, trData, rowNum, colNum);
|
|
9161
|
+
if (render[keyName.key]) {
|
|
9162
|
+
var child = render[keyName.key](trData[keyName.key], keyName.key, trData, rowNum, colNum);
|
|
9157
9163
|
|
|
9158
9164
|
if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(child)) {
|
|
9159
9165
|
objs.children = child;
|
|
@@ -9171,25 +9177,30 @@ function TableTr(props) {
|
|
|
9171
9177
|
}
|
|
9172
9178
|
}
|
|
9173
9179
|
|
|
9174
|
-
if (ellipsis && ellipsis[keyName]) {
|
|
9180
|
+
if (ellipsis && ellipsis[keyName.key]) {
|
|
9175
9181
|
objs.className = prefixCls + "-ellipsis";
|
|
9176
9182
|
}
|
|
9177
9183
|
|
|
9178
9184
|
var isHasChildren = Array.isArray(trData[childrenColumnName]);
|
|
9179
9185
|
|
|
9180
|
-
if (colNum === 0 && (hierarchy || isHasChildren)) {
|
|
9181
|
-
objs.className = objs.className + " " + prefixCls + "-has-children";
|
|
9186
|
+
if (colNum === 0 && (isOpacity || hierarchy || isHasChildren)) {
|
|
9182
9187
|
objs.children = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
9183
|
-
children: [IconDom(key, isHasChildren),
|
|
9188
|
+
children: [IconDom(key, isHasChildren), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
9189
|
+
style: {
|
|
9190
|
+
paddingLeft: hierarchy * indentSize
|
|
9191
|
+
}
|
|
9192
|
+
}), objs.children]
|
|
9184
9193
|
});
|
|
9185
9194
|
}
|
|
9186
9195
|
|
|
9187
9196
|
return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement)("td", _extends({}, objs, {
|
|
9188
|
-
key: colNum
|
|
9197
|
+
key: colNum // style={keyName?.style}
|
|
9198
|
+
,
|
|
9199
|
+
className: objs.className + " " + prefixCls + "-tr-children-" + ((keyName == null ? void 0 : keyName.align) || 'left') + " " + (keyName.className || ''),
|
|
9189
9200
|
onClick: evn => onCell(trData, {
|
|
9190
9201
|
rowNum,
|
|
9191
9202
|
colNum,
|
|
9192
|
-
keyName
|
|
9203
|
+
keyName: keyName.key
|
|
9193
9204
|
}, evn)
|
|
9194
9205
|
}));
|
|
9195
9206
|
})
|
|
@@ -9294,7 +9305,10 @@ function Table(props) {
|
|
|
9294
9305
|
var selfColumns = [];
|
|
9295
9306
|
|
|
9296
9307
|
if (expandable != null && expandable.expandedRowRender) {
|
|
9297
|
-
keys = [
|
|
9308
|
+
keys = [{
|
|
9309
|
+
key: 'uiw-expanded',
|
|
9310
|
+
align: 'center'
|
|
9311
|
+
}, ...keys];
|
|
9298
9312
|
selfColumns = [{
|
|
9299
9313
|
title: '',
|
|
9300
9314
|
key: 'uiw-expanded',
|
|
@@ -9778,6 +9792,9 @@ function TreeNode(props) {
|
|
|
9778
9792
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
9779
9793
|
className: prefixCls + "-label",
|
|
9780
9794
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
9795
|
+
style: {
|
|
9796
|
+
display: noChild ? 'none' : 'auto'
|
|
9797
|
+
},
|
|
9781
9798
|
className: prefixCls + "-switcher",
|
|
9782
9799
|
onClick: evn => onItemClick(item, evn),
|
|
9783
9800
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Icon, {
|
|
@@ -9858,7 +9875,10 @@ var getChildKeys = function getChildKeys(childs, result, depth) {
|
|
|
9858
9875
|
}
|
|
9859
9876
|
|
|
9860
9877
|
childs.forEach(item => {
|
|
9861
|
-
|
|
9878
|
+
if (!item.hideNode) {
|
|
9879
|
+
result.push(item.key);
|
|
9880
|
+
}
|
|
9881
|
+
|
|
9862
9882
|
if (typeof depth === 'number' && !(depth - 1)) return;
|
|
9863
9883
|
|
|
9864
9884
|
if (item.children && item.children.length > 0) {
|
|
@@ -10513,7 +10533,7 @@ function Transfer(props) {
|
|
|
10513
10533
|
var {
|
|
10514
10534
|
placeholder,
|
|
10515
10535
|
options,
|
|
10516
|
-
value,
|
|
10536
|
+
value = [],
|
|
10517
10537
|
showSearch = false,
|
|
10518
10538
|
selectedAll = false,
|
|
10519
10539
|
bodyStyle,
|
|
@@ -10536,11 +10556,11 @@ function Transfer(props) {
|
|
|
10536
10556
|
right: CheckedStatus.UnChecked
|
|
10537
10557
|
});
|
|
10538
10558
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10559
|
+
if (value) {
|
|
10560
|
+
rightOpionSet(value || []);
|
|
10561
|
+
value == null ? void 0 : value.forEach(selectd => selectOption.set(selectd.key, selectd.label));
|
|
10562
|
+
hiddenNode(child => !!(value != null && value.find(selectd => child.key === selectd.key)));
|
|
10563
|
+
}
|
|
10544
10564
|
}, [JSON.stringify(value)]);
|
|
10545
10565
|
|
|
10546
10566
|
var hiddenNode = callBackfn => {
|
|
@@ -10581,7 +10601,7 @@ function Transfer(props) {
|
|
|
10581
10601
|
|
|
10582
10602
|
var iteratorParent = child => {
|
|
10583
10603
|
if (child.parent) {
|
|
10584
|
-
var selectCount = child.parent.children.filter(child => !selectOption.get(child.key)).length;
|
|
10604
|
+
var selectCount = child.parent.children.filter(child => !selectOption.get(child.key) && !child.hideNode).length;
|
|
10585
10605
|
addOrDel(child.parent.key, child.parent.label, selectCount === 0);
|
|
10586
10606
|
iteratorParent(child.parent);
|
|
10587
10607
|
}
|
|
@@ -10611,22 +10631,22 @@ function Transfer(props) {
|
|
|
10611
10631
|
};
|
|
10612
10632
|
|
|
10613
10633
|
var transferClick = transferType => {
|
|
10614
|
-
var selectOptionTemp = selectOption;
|
|
10615
|
-
|
|
10616
10634
|
if (transferType === 'left') {
|
|
10617
10635
|
leftSelectOption.forEach((value, key) => {
|
|
10618
|
-
|
|
10636
|
+
selectOption.set(key, value);
|
|
10619
10637
|
});
|
|
10638
|
+
leftSelectOptionSet(new Map());
|
|
10639
|
+
leftSelectedKeySet([]);
|
|
10620
10640
|
} else {
|
|
10621
10641
|
rightSelectedKeys.forEach(key => {
|
|
10622
10642
|
selectOption.delete(key);
|
|
10623
10643
|
});
|
|
10644
|
+
rightSelectedKeySet([]);
|
|
10624
10645
|
}
|
|
10625
10646
|
|
|
10626
|
-
selectOptionSet(
|
|
10627
|
-
|
|
10647
|
+
selectOptionSet(selectOption);
|
|
10628
10648
|
var option = [];
|
|
10629
|
-
|
|
10649
|
+
selectOption.forEach((label, key) => option.push({
|
|
10630
10650
|
key,
|
|
10631
10651
|
label
|
|
10632
10652
|
}));
|
|
@@ -10671,22 +10691,23 @@ function Transfer(props) {
|
|
|
10671
10691
|
|
|
10672
10692
|
if ((_child$children3 = child.children) != null && _child$children3.length) {
|
|
10673
10693
|
selectedOptionsRecursion(child.children);
|
|
10674
|
-
}
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10694
|
+
}
|
|
10695
|
+
|
|
10696
|
+
if (!child.hideNode) {
|
|
10697
|
+
leftSelectOption.set(child.key, child.label);
|
|
10698
|
+
keys.push(child.key);
|
|
10679
10699
|
}
|
|
10680
10700
|
});
|
|
10681
10701
|
};
|
|
10682
10702
|
|
|
10683
10703
|
selectedOptionsRecursion(selectedOptions);
|
|
10704
|
+
leftSelectOptionSet(leftSelectOption);
|
|
10684
10705
|
leftSelectedKeySet(keys);
|
|
10685
10706
|
} else {
|
|
10686
10707
|
leftSelectedKeySet([]);
|
|
10708
|
+
leftSelectOptionSet(new Map());
|
|
10687
10709
|
}
|
|
10688
10710
|
|
|
10689
|
-
selectOptionSet(selectOption);
|
|
10690
10711
|
selectAllCheckedSet(selectAllChecked);
|
|
10691
10712
|
};
|
|
10692
10713
|
|
|
@@ -10695,16 +10716,12 @@ function Transfer(props) {
|
|
|
10695
10716
|
selectAllChecked.right = isChecked ? 1 : 0;
|
|
10696
10717
|
|
|
10697
10718
|
if (isChecked) {
|
|
10698
|
-
var keys = rightOpions.map(child =>
|
|
10699
|
-
selectOption.delete(child.key);
|
|
10700
|
-
return child.key;
|
|
10701
|
-
});
|
|
10719
|
+
var keys = rightOpions.map(child => child.key);
|
|
10702
10720
|
rightSelectedKeySet(keys);
|
|
10703
10721
|
} else {
|
|
10704
10722
|
rightSelectedKeySet([]);
|
|
10705
10723
|
}
|
|
10706
10724
|
|
|
10707
|
-
selectOptionSet(selectOption);
|
|
10708
10725
|
selectAllCheckedSet(selectAllChecked);
|
|
10709
10726
|
};
|
|
10710
10727
|
|
|
@@ -10726,16 +10743,16 @@ function Transfer(props) {
|
|
|
10726
10743
|
}, style),
|
|
10727
10744
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
|
|
10728
10745
|
bodyStyle: {
|
|
10729
|
-
padding:
|
|
10746
|
+
padding: '5px 9px'
|
|
10730
10747
|
},
|
|
10731
10748
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
10732
10749
|
children: [selectedAll && /*#__PURE__*/(0,jsx_runtime.jsx)(react_checkbox_esm, {
|
|
10733
10750
|
indeterminate: leftSelectedKeys.length < selectedOptionsShowCount.current && !!leftSelectedKeys.length,
|
|
10734
10751
|
checked: leftSelectedKeys.length >= selectedOptionsShowCount.current && !!leftSelectedKeys.length,
|
|
10735
10752
|
onChange: selectAllLeftChange
|
|
10736
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("
|
|
10753
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
10737
10754
|
style: {
|
|
10738
|
-
marginLeft:
|
|
10755
|
+
marginLeft: 3
|
|
10739
10756
|
},
|
|
10740
10757
|
children: [leftSelectedKeys.length, "/", selectedOptionsShowCount.current]
|
|
10741
10758
|
})]
|
|
@@ -10760,17 +10777,19 @@ function Transfer(props) {
|
|
|
10760
10777
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
|
|
10761
10778
|
click: () => transferClick('left'),
|
|
10762
10779
|
style: {
|
|
10763
|
-
transform: 'rotate(-90deg)'
|
|
10780
|
+
transform: 'rotate(-90deg)',
|
|
10781
|
+
background: leftSelectedKeys.length > 0 ? '#393E48' : 'none'
|
|
10764
10782
|
}
|
|
10765
10783
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Arrow, {
|
|
10766
10784
|
click: () => transferClick('right'),
|
|
10767
10785
|
style: {
|
|
10768
|
-
transform: 'rotate(90deg)'
|
|
10786
|
+
transform: 'rotate(90deg)',
|
|
10787
|
+
background: rightSelectedKeys.length > 0 ? '#393E48' : 'none'
|
|
10769
10788
|
}
|
|
10770
10789
|
})]
|
|
10771
10790
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(react_card_esm, {
|
|
10772
10791
|
bodyStyle: {
|
|
10773
|
-
padding:
|
|
10792
|
+
padding: '5px 9px'
|
|
10774
10793
|
},
|
|
10775
10794
|
className: prefixCls + "-card",
|
|
10776
10795
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
@@ -10778,9 +10797,9 @@ function Transfer(props) {
|
|
|
10778
10797
|
indeterminate: rightSelectedKeys.length < rightOpions.length && !!rightSelectedKeys.length,
|
|
10779
10798
|
checked: rightSelectedKeys.length === rightOpions.length && !!rightSelectedKeys.length,
|
|
10780
10799
|
onChange: selectAllRightChange
|
|
10781
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("
|
|
10800
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
10782
10801
|
style: {
|
|
10783
|
-
marginLeft:
|
|
10802
|
+
marginLeft: 3
|
|
10784
10803
|
},
|
|
10785
10804
|
children: [rightSelectedKeys.length, "/", rightOpions.length]
|
|
10786
10805
|
})]
|