shineout 3.0.8 → 3.0.10
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/cjs/index.js +1 -1
- package/dist/shineout.js +131 -58
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
package/cjs/index.js
CHANGED
|
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
476
476
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
477
477
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
478
478
|
var _default = exports.default = {
|
|
479
|
-
version: '3.0.
|
|
479
|
+
version: '3.0.10'
|
|
480
480
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12019,7 +12019,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12019
12019
|
};
|
|
12020
12020
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12021
12021
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12022
|
-
/* harmony default export */ var version = ('3.0.
|
|
12022
|
+
/* harmony default export */ var version = ('3.0.10');
|
|
12023
12023
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12024
12024
|
|
|
12025
12025
|
|
|
@@ -17029,6 +17029,7 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
17029
17029
|
resultText: {
|
|
17030
17030
|
lineHeight: src.lineHeightDynamic,
|
|
17031
17031
|
position: 'relative',
|
|
17032
|
+
zIndex: 0,
|
|
17032
17033
|
flex: '1',
|
|
17033
17034
|
minWidth: 0,
|
|
17034
17035
|
'&::before': {
|
|
@@ -17037,7 +17038,25 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
17037
17038
|
}
|
|
17038
17039
|
},
|
|
17039
17040
|
resultTextPadding: {
|
|
17041
|
+
position: 'relative',
|
|
17042
|
+
zIndex: 2,
|
|
17043
|
+
'& > input': {
|
|
17044
|
+
color: 'inherit',
|
|
17045
|
+
padding: '0',
|
|
17046
|
+
border: '0',
|
|
17047
|
+
outline: '0',
|
|
17048
|
+
fontSize: 'inherit',
|
|
17049
|
+
lineHeight: src.lineHeightDynamic,
|
|
17050
|
+
backgroundColor: 'transparent',
|
|
17051
|
+
width: '100%',
|
|
17052
|
+
'&::placeholder': {
|
|
17053
|
+
color: src.datePickerPlaceholderColor
|
|
17054
|
+
}
|
|
17055
|
+
}
|
|
17056
|
+
},
|
|
17057
|
+
resultTextBg: {
|
|
17040
17058
|
position: 'absolute',
|
|
17059
|
+
zIndex: 1,
|
|
17041
17060
|
padding: "0 ".concat(src.datePickerResultTextPaddingX),
|
|
17042
17061
|
left: "calc(-1 * ".concat(src.datePickerResultTextPaddingX, ")"),
|
|
17043
17062
|
right: "calc(-1 * ".concat(src.datePickerResultTextPaddingX, ")"),
|
|
@@ -17059,7 +17078,7 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
17059
17078
|
}
|
|
17060
17079
|
},
|
|
17061
17080
|
resultTextActive: {
|
|
17062
|
-
'& $
|
|
17081
|
+
'& $resultTextBg': {
|
|
17063
17082
|
backgroundColor: src.datePickerResultTextActiveBackgroundColor
|
|
17064
17083
|
}
|
|
17065
17084
|
},
|
|
@@ -33666,6 +33685,7 @@ var useFilter = function useFilter(props) {
|
|
|
33666
33685
|
|
|
33667
33686
|
|
|
33668
33687
|
|
|
33688
|
+
|
|
33669
33689
|
var MODE = {
|
|
33670
33690
|
/**
|
|
33671
33691
|
* 返回全选数据,包含父节点和子节点
|
|
@@ -33720,6 +33740,7 @@ var useTree = function useTree(props) {
|
|
|
33720
33740
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
33721
33741
|
pathMap: new Map(),
|
|
33722
33742
|
dataMap: new Map(),
|
|
33743
|
+
forceUpdateMap: new Map(),
|
|
33723
33744
|
valueMap: new Map(),
|
|
33724
33745
|
updateMap: new Map(),
|
|
33725
33746
|
unmatchedValueMap: new Map(),
|
|
@@ -33731,6 +33752,14 @@ var useTree = function useTree(props) {
|
|
|
33731
33752
|
}),
|
|
33732
33753
|
context = _useRef.current;
|
|
33733
33754
|
|
|
33755
|
+
// 注册刷新方法
|
|
33756
|
+
var bindUpdate = usePersistFn(function (id, update) {
|
|
33757
|
+
context.forceUpdateMap.set(id, update);
|
|
33758
|
+
});
|
|
33759
|
+
var unBindUpdate = usePersistFn(function (id) {
|
|
33760
|
+
context.forceUpdateMap.delete(id);
|
|
33761
|
+
});
|
|
33762
|
+
|
|
33734
33763
|
// 注册节点
|
|
33735
33764
|
var bindNode = function bindNode(id, update) {
|
|
33736
33765
|
context.updateMap.set(id, update);
|
|
@@ -33846,6 +33875,8 @@ var useTree = function useTree(props) {
|
|
|
33846
33875
|
};
|
|
33847
33876
|
var setValueMap = function setValueMap(id, checked) {
|
|
33848
33877
|
context.valueMap.set(id, checked);
|
|
33878
|
+
var update = context.forceUpdateMap.get(id);
|
|
33879
|
+
if (update) update();
|
|
33849
33880
|
};
|
|
33850
33881
|
var setUnmatedValue = function setUnmatedValue() {
|
|
33851
33882
|
context.unmatchedValueMap = new Map();
|
|
@@ -34052,6 +34083,8 @@ var useTree = function useTree(props) {
|
|
|
34052
34083
|
isDisabled: isDisabled,
|
|
34053
34084
|
bindNode: bindNode,
|
|
34054
34085
|
getDataById: getDataById,
|
|
34086
|
+
bindUpdate: bindUpdate,
|
|
34087
|
+
unBindUpdate: unBindUpdate,
|
|
34055
34088
|
pathMap: context.pathMap,
|
|
34056
34089
|
dataMap: context.dataMap,
|
|
34057
34090
|
valueMap: context.valueMap,
|
|
@@ -34540,9 +34573,9 @@ var Result = function Result(props) {
|
|
|
34540
34573
|
var renderItem = function renderItem(info) {
|
|
34541
34574
|
var dis = info.index === 1 ? disabledRight : disabledLeft;
|
|
34542
34575
|
var className = classnames_default()(styles === null || styles === void 0 ? void 0 : styles.resultText, info.target && (styles === null || styles === void 0 ? void 0 : styles.placeholder), dis && (styles === null || styles === void 0 ? void 0 : styles.resultTextDisabled), info.index === activeIndex && (styles === null || styles === void 0 ? void 0 : styles.resultTextActive));
|
|
34543
|
-
return /*#__PURE__*/(0,jsx_runtime.
|
|
34576
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
34544
34577
|
className: className,
|
|
34545
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("
|
|
34578
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
34546
34579
|
className: styles === null || styles === void 0 ? void 0 : styles.resultTextPadding,
|
|
34547
34580
|
children: info.inputable ? /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
|
|
34548
34581
|
onRef: function onRef(el) {
|
|
@@ -34577,7 +34610,9 @@ var Result = function Result(props) {
|
|
|
34577
34610
|
className: styles === null || styles === void 0 ? void 0 : styles.placeholder,
|
|
34578
34611
|
children: info.place
|
|
34579
34612
|
})
|
|
34580
|
-
})
|
|
34613
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
34614
|
+
className: styles === null || styles === void 0 ? void 0 : styles.resultTextBg
|
|
34615
|
+
})]
|
|
34581
34616
|
});
|
|
34582
34617
|
};
|
|
34583
34618
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
@@ -34626,10 +34661,7 @@ var ResultInput = function ResultInput(props) {
|
|
|
34626
34661
|
var bindInputRef = function bindInputRef(ref) {
|
|
34627
34662
|
inputRef.current = ref;
|
|
34628
34663
|
};
|
|
34629
|
-
var handleBlur = function handleBlur(
|
|
34630
|
-
if (e.target.value === inputText) {
|
|
34631
|
-
return;
|
|
34632
|
-
}
|
|
34664
|
+
var handleBlur = function handleBlur() {
|
|
34633
34665
|
if (trim) {
|
|
34634
34666
|
return onInputBlur === null || onInputBlur === void 0 ? void 0 : onInputBlur(inputText === null || inputText === void 0 ? void 0 : inputText.trim());
|
|
34635
34667
|
}
|
|
@@ -35160,14 +35192,18 @@ var result_Result = function Result(props) {
|
|
|
35160
35192
|
getDataByValues = props.getDataByValues,
|
|
35161
35193
|
checkUnMatched = props.checkUnMatched,
|
|
35162
35194
|
onRemove = props.onRemove,
|
|
35163
|
-
onResultItemClick = props.onResultItemClick
|
|
35195
|
+
onResultItemClick = props.onResultItemClick,
|
|
35196
|
+
data = props.data;
|
|
35164
35197
|
var value = [null, undefined, ''].includes(valueProp) ? [] : multiple ? valueProp : [valueProp];
|
|
35165
35198
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(-1),
|
|
35166
35199
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
35167
35200
|
more = _useState2[0],
|
|
35168
35201
|
setMore = _useState2[1];
|
|
35202
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
35203
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
35204
|
+
shouldResetMore = _useState4[0],
|
|
35205
|
+
setShouldResetMore = _useState4[1];
|
|
35169
35206
|
var resultRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
35170
|
-
var shouldResetMore = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
35171
35207
|
var prevMore = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(more);
|
|
35172
35208
|
var showInput = allowOnFilter;
|
|
35173
35209
|
var mounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
@@ -35239,6 +35275,7 @@ var result_Result = function Result(props) {
|
|
|
35239
35275
|
if (result_isUnMatchedData(item)) {
|
|
35240
35276
|
if (result_isFunc(keygen)) {
|
|
35241
35277
|
key = keygen(item.value, index);
|
|
35278
|
+
if (key === undefined) key = index;
|
|
35242
35279
|
} else {
|
|
35243
35280
|
key = item.value;
|
|
35244
35281
|
}
|
|
@@ -35382,7 +35419,9 @@ var result_Result = function Result(props) {
|
|
|
35382
35419
|
};
|
|
35383
35420
|
var handleResetMore = function handleResetMore() {
|
|
35384
35421
|
if (!compressed) return;
|
|
35385
|
-
|
|
35422
|
+
if (isCompressedBound()) return;
|
|
35423
|
+
setMore(-1);
|
|
35424
|
+
setShouldResetMore(true);
|
|
35386
35425
|
};
|
|
35387
35426
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35388
35427
|
if (!focus && mounted.current) {
|
|
@@ -35394,34 +35433,27 @@ var result_Result = function Result(props) {
|
|
|
35394
35433
|
mounted.current = true;
|
|
35395
35434
|
}, [focus]);
|
|
35396
35435
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35397
|
-
if (!resultRef.current) return;
|
|
35398
|
-
if (!compressed) return;
|
|
35399
|
-
if (isCompressedBound()) return;
|
|
35400
35436
|
handleResetMore();
|
|
35401
|
-
}, [valueProp]);
|
|
35437
|
+
}, [valueProp, data]);
|
|
35402
35438
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35403
|
-
if (
|
|
35404
|
-
if (!resultRef.current) return;
|
|
35405
|
-
if (more === -1) {
|
|
35439
|
+
if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || [].length)) {
|
|
35406
35440
|
var tagClassName = ".".concat(styles.tag.split(' ')[0]);
|
|
35407
|
-
if (shouldResetMore
|
|
35408
|
-
shouldResetMore.current = false;
|
|
35441
|
+
if (shouldResetMore && result_isArray(value) && (value || []).length) {
|
|
35409
35442
|
var newMore = getResetMore(showInput, resultRef.current, resultRef.current.querySelectorAll(tagClassName));
|
|
35410
|
-
|
|
35411
|
-
// 下次触发折叠逻辑的时候,将多余的 tag 隐藏,避免视图闪断
|
|
35412
|
-
if (newMore !== prevMore.current && prevMore.current === -1 && newMore > prevMore.current) {
|
|
35413
|
-
var tags = resultRef.current.querySelectorAll(tagClassName);
|
|
35414
|
-
tags.forEach(function (tag, index) {
|
|
35415
|
-
if (index >= newMore) tag.setAttribute('style', 'opacity: 0');
|
|
35416
|
-
});
|
|
35417
|
-
}
|
|
35418
35443
|
prevMore.current = newMore;
|
|
35419
35444
|
setMore(newMore);
|
|
35445
|
+
setShouldResetMore(false);
|
|
35446
|
+
} else {
|
|
35447
|
+
setShouldResetMore(false);
|
|
35420
35448
|
}
|
|
35449
|
+
} else {
|
|
35450
|
+
setShouldResetMore(false);
|
|
35421
35451
|
}
|
|
35422
|
-
}, [
|
|
35452
|
+
}, [shouldResetMore]);
|
|
35423
35453
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35424
35454
|
if (!resultRef.current) return;
|
|
35455
|
+
if (!compressed) return;
|
|
35456
|
+
if (isCompressedBound()) return;
|
|
35425
35457
|
var cancelObserver = addResizeObserver(resultRef.current, handleResetMore, {
|
|
35426
35458
|
direction: 'x'
|
|
35427
35459
|
});
|
|
@@ -36496,6 +36528,7 @@ var validate = function validate(value, formData, rules, p) {
|
|
|
36496
36528
|
|
|
36497
36529
|
|
|
36498
36530
|
|
|
36531
|
+
|
|
36499
36532
|
var getValue = function getValue(name, formValue) {
|
|
36500
36533
|
if (!name) return undefined;
|
|
36501
36534
|
if (isArray(name)) {
|
|
@@ -36550,6 +36583,9 @@ function useFormControl(props) {
|
|
|
36550
36583
|
_React$useState4 = slicedToArray_default()(_React$useState3, 2),
|
|
36551
36584
|
valueState = _React$useState4[0],
|
|
36552
36585
|
setValueState = _React$useState4[1];
|
|
36586
|
+
var latestInfo = use_latest_obj({
|
|
36587
|
+
valueState: valueState
|
|
36588
|
+
});
|
|
36553
36589
|
if (name && formFunc) {
|
|
36554
36590
|
inForm = true;
|
|
36555
36591
|
value = valueState;
|
|
@@ -36567,8 +36603,9 @@ function useFormControl(props) {
|
|
|
36567
36603
|
if (error !== errorState) {
|
|
36568
36604
|
setErrorState(error);
|
|
36569
36605
|
}
|
|
36570
|
-
if (!shallowEqual(value, valueState)) {
|
|
36606
|
+
if (!shallowEqual(value, latestInfo.valueState)) {
|
|
36571
36607
|
setValueState(value);
|
|
36608
|
+
latestInfo.valueState = value;
|
|
36572
36609
|
}
|
|
36573
36610
|
});
|
|
36574
36611
|
var validateFiled = use_persist_fn(function (name, v, formV) {
|
|
@@ -36657,9 +36694,11 @@ function useFormControl(props) {
|
|
|
36657
36694
|
if (isArray(name)) {
|
|
36658
36695
|
name.forEach(function (n) {
|
|
36659
36696
|
controlFunc.unbind(n, reserveAble);
|
|
36697
|
+
updateError(n, undefined);
|
|
36660
36698
|
});
|
|
36661
36699
|
} else {
|
|
36662
36700
|
controlFunc.unbind(name, reserveAble);
|
|
36701
|
+
updateError(name, undefined);
|
|
36663
36702
|
}
|
|
36664
36703
|
}
|
|
36665
36704
|
};
|
|
@@ -42495,6 +42534,7 @@ var useAutoSize = function useAutoSize(props) {
|
|
|
42495
42534
|
if (!shadowRef.current) return;
|
|
42496
42535
|
var v = value || '';
|
|
42497
42536
|
if (shadowRef.current.value !== v) shadowRef.current.value = v;
|
|
42537
|
+
if (shadowRef.current.scrollHeight === 0) return;
|
|
42498
42538
|
setHeight(shadowRef.current.scrollHeight);
|
|
42499
42539
|
};
|
|
42500
42540
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
|
|
@@ -46405,6 +46445,7 @@ var ListOption = function ListOption(props) {
|
|
|
46405
46445
|
onHover(index);
|
|
46406
46446
|
};
|
|
46407
46447
|
var handleClick = function handleClick() {
|
|
46448
|
+
if (datum.disabledCheck(data)) return;
|
|
46408
46449
|
if (isChecked && multiple) {
|
|
46409
46450
|
datum.remove(data);
|
|
46410
46451
|
} else {
|
|
@@ -46645,6 +46686,7 @@ var useTreeContext = function useTreeContext() {
|
|
|
46645
46686
|
|
|
46646
46687
|
|
|
46647
46688
|
|
|
46689
|
+
|
|
46648
46690
|
var TreeCheckbox = function TreeCheckbox(props) {
|
|
46649
46691
|
var jssStyle = props.jssStyle,
|
|
46650
46692
|
className = props.className,
|
|
@@ -46654,7 +46696,8 @@ var TreeCheckbox = function TreeCheckbox(props) {
|
|
|
46654
46696
|
var _useTreeContext = useTreeContext(),
|
|
46655
46697
|
getValue = _useTreeContext.getValue,
|
|
46656
46698
|
set = _useTreeContext.set,
|
|
46657
|
-
getChecked = _useTreeContext.getChecked
|
|
46699
|
+
getChecked = _useTreeContext.getChecked,
|
|
46700
|
+
unBindUpdate = _useTreeContext.unBindUpdate;
|
|
46658
46701
|
var handleChange = function handleChange(_, checked) {
|
|
46659
46702
|
set(id, checked ? 1 : 0);
|
|
46660
46703
|
if (onChange) {
|
|
@@ -46662,6 +46705,11 @@ var TreeCheckbox = function TreeCheckbox(props) {
|
|
|
46662
46705
|
}
|
|
46663
46706
|
};
|
|
46664
46707
|
var checked = getChecked(id);
|
|
46708
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
46709
|
+
return function () {
|
|
46710
|
+
unBindUpdate(id);
|
|
46711
|
+
};
|
|
46712
|
+
}, []);
|
|
46665
46713
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_checkbox_checkbox
|
|
46666
46714
|
//@ts-ignore
|
|
46667
46715
|
, {
|
|
@@ -46709,9 +46757,12 @@ var NodeContent = function NodeContent(props) {
|
|
|
46709
46757
|
onToggle = props.onToggle,
|
|
46710
46758
|
onDragOver = props.onDragOver,
|
|
46711
46759
|
onNodeClick = props.onNodeClick;
|
|
46760
|
+
var forceUpdate = useRender();
|
|
46712
46761
|
var _useTreeContext = useTreeContext(),
|
|
46713
|
-
isDisabled = _useTreeContext.isDisabled
|
|
46762
|
+
isDisabled = _useTreeContext.isDisabled,
|
|
46763
|
+
bindUpdate = _useTreeContext.bindUpdate;
|
|
46714
46764
|
var disabled = isDisabled(id);
|
|
46765
|
+
bindUpdate(id, forceUpdate);
|
|
46715
46766
|
var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
|
|
46716
46767
|
var rootClass = classnames_default()(contentStyle.contentWrapper, defineProperty_default()(defineProperty_default()({}, contentStyle.childnode, data[childrenKey] && data[childrenKey].length > 0), contentStyle.inlineContent, inlineNode));
|
|
46717
46768
|
var contentClass = classnames_default()(contentStyle.content, isString(contentClassProp) && contentClassProp, isFunc(contentClassProp) && contentClassProp(data));
|
|
@@ -48031,7 +48082,7 @@ function Select(props0) {
|
|
|
48031
48082
|
filterSameChange = props.filterSameChange,
|
|
48032
48083
|
noCache = props.noCache;
|
|
48033
48084
|
var hasFilter = isFunc(props.onAdvancedFilter || onFilterProp);
|
|
48034
|
-
var showInput = hasFilter || isFunc(onCreateProp);
|
|
48085
|
+
var showInput = hasFilter || isFunc(onCreateProp) || onCreateProp === true;
|
|
48035
48086
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
|
|
48036
48087
|
var rootStyle = Object.assign({
|
|
48037
48088
|
width: width
|
|
@@ -48044,8 +48095,6 @@ function Select(props0) {
|
|
|
48044
48095
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
48045
48096
|
focused = _useState4[0],
|
|
48046
48097
|
setFocused = _useState4[1];
|
|
48047
|
-
var isPreventBlur = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
48048
|
-
var blurEvent = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
48049
48098
|
var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
48050
48099
|
var optionListRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
48051
48100
|
var _useFilter = use_filter({
|
|
@@ -48074,14 +48123,6 @@ function Select(props0) {
|
|
|
48074
48123
|
rawData = _useFilter.rawData;
|
|
48075
48124
|
var onCollapse = usePersistFn(function (collapse) {
|
|
48076
48125
|
onCollapseProp === null || onCollapseProp === void 0 || onCollapseProp(collapse);
|
|
48077
|
-
if (isPreventBlur.current) {
|
|
48078
|
-
isPreventBlur.current = false;
|
|
48079
|
-
return;
|
|
48080
|
-
}
|
|
48081
|
-
if (blurEvent.current && !collapse) {
|
|
48082
|
-
blurEvent.current();
|
|
48083
|
-
blurEvent.current = null;
|
|
48084
|
-
}
|
|
48085
48126
|
onClearCreatedData();
|
|
48086
48127
|
});
|
|
48087
48128
|
var renderMoreIcon = function renderMoreIcon() {
|
|
@@ -48265,12 +48306,12 @@ function Select(props0) {
|
|
|
48265
48306
|
if (!onCreate) return;
|
|
48266
48307
|
if (multiple && !text) return;
|
|
48267
48308
|
// 防止点击 option 后触发 blur 事件,先把要做的事情存起来,后面再看要不要执行
|
|
48268
|
-
|
|
48269
|
-
if (createdData) {
|
|
48270
|
-
|
|
48309
|
+
if (createdData) {
|
|
48310
|
+
if (!datum.check(createdData)) {
|
|
48311
|
+
datum.add(createdData);
|
|
48271
48312
|
}
|
|
48272
48313
|
onClearCreatedData();
|
|
48273
|
-
}
|
|
48314
|
+
}
|
|
48274
48315
|
};
|
|
48275
48316
|
var handleFilter = function handleFilter(text, from) {
|
|
48276
48317
|
var hideCreate = onCreate && hideCreateOption;
|
|
@@ -48287,7 +48328,6 @@ function Select(props0) {
|
|
|
48287
48328
|
onFilter === null || onFilter === void 0 || onFilter(trim ? text.trim() : text, from);
|
|
48288
48329
|
};
|
|
48289
48330
|
var handleOptionClick = function handleOptionClick() {
|
|
48290
|
-
isPreventBlur.current = true;
|
|
48291
48331
|
if (multiple) return;
|
|
48292
48332
|
// 单选结束后需要清除创建项
|
|
48293
48333
|
onClearCreatedData();
|
|
@@ -53094,19 +53134,52 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53094
53134
|
var getColgroup = use_persist_fn(function (fromDrag) {
|
|
53095
53135
|
var _props$data, _target$current;
|
|
53096
53136
|
var target = props !== null && props !== void 0 && (_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length ? tbodyRef : theadRef;
|
|
53097
|
-
var
|
|
53098
|
-
if (!
|
|
53099
|
-
var
|
|
53137
|
+
var tr = (_target$current = target.current) === null || _target$current === void 0 ? void 0 : _target$current.querySelector('tr');
|
|
53138
|
+
if (!tr) return;
|
|
53139
|
+
var items = tr.children;
|
|
53100
53140
|
var newCols = [];
|
|
53101
53141
|
var sum = 0;
|
|
53102
|
-
|
|
53103
|
-
var
|
|
53104
|
-
width =
|
|
53142
|
+
var _loop = function _loop() {
|
|
53143
|
+
var _items$i$getBoundingC = items[i].getBoundingClientRect(),
|
|
53144
|
+
width = _items$i$getBoundingC.width;
|
|
53105
53145
|
sum += width;
|
|
53106
|
-
|
|
53146
|
+
var colspan = items[i].getAttribute('colspan');
|
|
53147
|
+
var dfWidth = props.columns.slice(i, i + (colspan ? parseInt(colspan, 10) : 1)).map(function (v) {
|
|
53148
|
+
return v.width;
|
|
53149
|
+
});
|
|
53150
|
+
var tempcols = [];
|
|
53151
|
+
var emptyNum = dfWidth.filter(function (v) {
|
|
53152
|
+
return v === undefined;
|
|
53153
|
+
}).length;
|
|
53154
|
+
if (dfWidth.length === 1) {
|
|
53155
|
+
// colspan = 1
|
|
53156
|
+
tempcols = [width];
|
|
53157
|
+
} else if (emptyNum === 0) {
|
|
53158
|
+
// 都有宽度按照比例分
|
|
53159
|
+
var all = dfWidth.reduce(function (a, b) {
|
|
53160
|
+
return a + b;
|
|
53161
|
+
}, 0);
|
|
53162
|
+
tempcols = dfWidth.map(function (v) {
|
|
53163
|
+
return v / all * width;
|
|
53164
|
+
});
|
|
53165
|
+
} else {
|
|
53166
|
+
// 多余的平分
|
|
53167
|
+
var _all = dfWidth.reduce(function (a, b) {
|
|
53168
|
+
return (a || 0) + (b || 0);
|
|
53169
|
+
}, 0);
|
|
53170
|
+
var rest = width - _all;
|
|
53171
|
+
var agv = rest > 0 ? rest / emptyNum : 0;
|
|
53172
|
+
tempcols = dfWidth.map(function (v) {
|
|
53173
|
+
return v ? v : agv;
|
|
53174
|
+
});
|
|
53175
|
+
}
|
|
53176
|
+
newCols = [].concat(toConsumableArray_default()(newCols), toConsumableArray_default()(tempcols));
|
|
53177
|
+
};
|
|
53178
|
+
for (var i = 0, count = items.length; i < count; i++) {
|
|
53179
|
+
_loop();
|
|
53107
53180
|
}
|
|
53108
53181
|
if (fromDrag && props.columnResizable) {
|
|
53109
|
-
var widthArr =
|
|
53182
|
+
var widthArr = toConsumableArray_default()(newCols);
|
|
53110
53183
|
if (typeof props.width === 'number') {
|
|
53111
53184
|
var maxWidth = Math.max(context.clientWidth, props.width + deltaXSum);
|
|
53112
53185
|
|
|
@@ -61261,7 +61334,7 @@ var upload_interface = __webpack_require__(4412);
|
|
|
61261
61334
|
|
|
61262
61335
|
|
|
61263
61336
|
/* harmony default export */ var src_0 = ({
|
|
61264
|
-
version: '3.0.
|
|
61337
|
+
version: '3.0.10'
|
|
61265
61338
|
});
|
|
61266
61339
|
}();
|
|
61267
61340
|
/******/ return __webpack_exports__;
|