shineout 3.0.8 → 3.0.10-fix.1
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 +144 -72
- 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-fix.1'
|
|
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-fix.1');
|
|
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
|
},
|
|
@@ -30292,19 +30311,18 @@ function useInputAble(props) {
|
|
|
30292
30311
|
var render = useRender(syncValue);
|
|
30293
30312
|
var shouldUseState = delay || !control;
|
|
30294
30313
|
var value = shouldUseState ? stateValue : valuePo;
|
|
30295
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.
|
|
30296
|
-
if (
|
|
30314
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
30315
|
+
if (delay && control && props.value !== stateValue) {
|
|
30316
|
+
changeStateValue(props.value);
|
|
30317
|
+
} else if (context.timer) {
|
|
30297
30318
|
clearTimeout(context.timer);
|
|
30298
30319
|
context.timer = null;
|
|
30299
30320
|
}
|
|
30300
|
-
|
|
30301
|
-
changeStateValue(props.value);
|
|
30302
|
-
}
|
|
30303
|
-
}, [props.value, delay]);
|
|
30321
|
+
}, [props.value, delay, control]);
|
|
30304
30322
|
var forceDelayChange = use_persist_fn(function () {
|
|
30305
|
-
if (context.
|
|
30323
|
+
if (context.delayChange) context.delayChange();
|
|
30324
|
+
if (context.timer) {
|
|
30306
30325
|
clearTimeout(context.timer);
|
|
30307
|
-
context.delayChange();
|
|
30308
30326
|
context.timer = null;
|
|
30309
30327
|
context.delayChange = null;
|
|
30310
30328
|
}
|
|
@@ -30325,15 +30343,15 @@ function useInputAble(props) {
|
|
|
30325
30343
|
changeStateValue(vv);
|
|
30326
30344
|
}
|
|
30327
30345
|
if (!isFunc(onChange)) return;
|
|
30328
|
-
context.delayChange = function () {
|
|
30329
|
-
context.timer = null;
|
|
30330
|
-
context.delayChange = null;
|
|
30331
|
-
onChange.apply(void 0, [vv].concat(other));
|
|
30332
|
-
render();
|
|
30333
|
-
};
|
|
30334
30346
|
if (!delay) {
|
|
30335
30347
|
onChange.apply(void 0, [vv].concat(other));
|
|
30336
30348
|
} else {
|
|
30349
|
+
context.delayChange = function () {
|
|
30350
|
+
context.timer = null;
|
|
30351
|
+
context.delayChange = null;
|
|
30352
|
+
onChange.apply(void 0, [vv].concat(other));
|
|
30353
|
+
render();
|
|
30354
|
+
};
|
|
30337
30355
|
if (context.timer) clearTimeout(context.timer);
|
|
30338
30356
|
context.timer = setTimeout(context.delayChange, delay);
|
|
30339
30357
|
}
|
|
@@ -33666,6 +33684,7 @@ var useFilter = function useFilter(props) {
|
|
|
33666
33684
|
|
|
33667
33685
|
|
|
33668
33686
|
|
|
33687
|
+
|
|
33669
33688
|
var MODE = {
|
|
33670
33689
|
/**
|
|
33671
33690
|
* 返回全选数据,包含父节点和子节点
|
|
@@ -33720,6 +33739,7 @@ var useTree = function useTree(props) {
|
|
|
33720
33739
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
33721
33740
|
pathMap: new Map(),
|
|
33722
33741
|
dataMap: new Map(),
|
|
33742
|
+
forceUpdateMap: new Map(),
|
|
33723
33743
|
valueMap: new Map(),
|
|
33724
33744
|
updateMap: new Map(),
|
|
33725
33745
|
unmatchedValueMap: new Map(),
|
|
@@ -33731,6 +33751,14 @@ var useTree = function useTree(props) {
|
|
|
33731
33751
|
}),
|
|
33732
33752
|
context = _useRef.current;
|
|
33733
33753
|
|
|
33754
|
+
// 注册刷新方法
|
|
33755
|
+
var bindUpdate = usePersistFn(function (id, update) {
|
|
33756
|
+
context.forceUpdateMap.set(id, update);
|
|
33757
|
+
});
|
|
33758
|
+
var unBindUpdate = usePersistFn(function (id) {
|
|
33759
|
+
context.forceUpdateMap.delete(id);
|
|
33760
|
+
});
|
|
33761
|
+
|
|
33734
33762
|
// 注册节点
|
|
33735
33763
|
var bindNode = function bindNode(id, update) {
|
|
33736
33764
|
context.updateMap.set(id, update);
|
|
@@ -33846,6 +33874,8 @@ var useTree = function useTree(props) {
|
|
|
33846
33874
|
};
|
|
33847
33875
|
var setValueMap = function setValueMap(id, checked) {
|
|
33848
33876
|
context.valueMap.set(id, checked);
|
|
33877
|
+
var update = context.forceUpdateMap.get(id);
|
|
33878
|
+
if (update) update();
|
|
33849
33879
|
};
|
|
33850
33880
|
var setUnmatedValue = function setUnmatedValue() {
|
|
33851
33881
|
context.unmatchedValueMap = new Map();
|
|
@@ -34052,6 +34082,8 @@ var useTree = function useTree(props) {
|
|
|
34052
34082
|
isDisabled: isDisabled,
|
|
34053
34083
|
bindNode: bindNode,
|
|
34054
34084
|
getDataById: getDataById,
|
|
34085
|
+
bindUpdate: bindUpdate,
|
|
34086
|
+
unBindUpdate: unBindUpdate,
|
|
34055
34087
|
pathMap: context.pathMap,
|
|
34056
34088
|
dataMap: context.dataMap,
|
|
34057
34089
|
valueMap: context.valueMap,
|
|
@@ -34540,9 +34572,9 @@ var Result = function Result(props) {
|
|
|
34540
34572
|
var renderItem = function renderItem(info) {
|
|
34541
34573
|
var dis = info.index === 1 ? disabledRight : disabledLeft;
|
|
34542
34574
|
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.
|
|
34575
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
34544
34576
|
className: className,
|
|
34545
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("
|
|
34577
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
34546
34578
|
className: styles === null || styles === void 0 ? void 0 : styles.resultTextPadding,
|
|
34547
34579
|
children: info.inputable ? /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
|
|
34548
34580
|
onRef: function onRef(el) {
|
|
@@ -34577,7 +34609,9 @@ var Result = function Result(props) {
|
|
|
34577
34609
|
className: styles === null || styles === void 0 ? void 0 : styles.placeholder,
|
|
34578
34610
|
children: info.place
|
|
34579
34611
|
})
|
|
34580
|
-
})
|
|
34612
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
34613
|
+
className: styles === null || styles === void 0 ? void 0 : styles.resultTextBg
|
|
34614
|
+
})]
|
|
34581
34615
|
});
|
|
34582
34616
|
};
|
|
34583
34617
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
@@ -34626,10 +34660,7 @@ var ResultInput = function ResultInput(props) {
|
|
|
34626
34660
|
var bindInputRef = function bindInputRef(ref) {
|
|
34627
34661
|
inputRef.current = ref;
|
|
34628
34662
|
};
|
|
34629
|
-
var handleBlur = function handleBlur(
|
|
34630
|
-
if (e.target.value === inputText) {
|
|
34631
|
-
return;
|
|
34632
|
-
}
|
|
34663
|
+
var handleBlur = function handleBlur() {
|
|
34633
34664
|
if (trim) {
|
|
34634
34665
|
return onInputBlur === null || onInputBlur === void 0 ? void 0 : onInputBlur(inputText === null || inputText === void 0 ? void 0 : inputText.trim());
|
|
34635
34666
|
}
|
|
@@ -35160,14 +35191,18 @@ var result_Result = function Result(props) {
|
|
|
35160
35191
|
getDataByValues = props.getDataByValues,
|
|
35161
35192
|
checkUnMatched = props.checkUnMatched,
|
|
35162
35193
|
onRemove = props.onRemove,
|
|
35163
|
-
onResultItemClick = props.onResultItemClick
|
|
35194
|
+
onResultItemClick = props.onResultItemClick,
|
|
35195
|
+
data = props.data;
|
|
35164
35196
|
var value = [null, undefined, ''].includes(valueProp) ? [] : multiple ? valueProp : [valueProp];
|
|
35165
35197
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(-1),
|
|
35166
35198
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
35167
35199
|
more = _useState2[0],
|
|
35168
35200
|
setMore = _useState2[1];
|
|
35201
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
35202
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
35203
|
+
shouldResetMore = _useState4[0],
|
|
35204
|
+
setShouldResetMore = _useState4[1];
|
|
35169
35205
|
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
35206
|
var prevMore = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(more);
|
|
35172
35207
|
var showInput = allowOnFilter;
|
|
35173
35208
|
var mounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
@@ -35239,6 +35274,7 @@ var result_Result = function Result(props) {
|
|
|
35239
35274
|
if (result_isUnMatchedData(item)) {
|
|
35240
35275
|
if (result_isFunc(keygen)) {
|
|
35241
35276
|
key = keygen(item.value, index);
|
|
35277
|
+
if (key === undefined) key = index;
|
|
35242
35278
|
} else {
|
|
35243
35279
|
key = item.value;
|
|
35244
35280
|
}
|
|
@@ -35382,7 +35418,9 @@ var result_Result = function Result(props) {
|
|
|
35382
35418
|
};
|
|
35383
35419
|
var handleResetMore = function handleResetMore() {
|
|
35384
35420
|
if (!compressed) return;
|
|
35385
|
-
|
|
35421
|
+
if (isCompressedBound()) return;
|
|
35422
|
+
setMore(-1);
|
|
35423
|
+
setShouldResetMore(true);
|
|
35386
35424
|
};
|
|
35387
35425
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35388
35426
|
if (!focus && mounted.current) {
|
|
@@ -35394,34 +35432,27 @@ var result_Result = function Result(props) {
|
|
|
35394
35432
|
mounted.current = true;
|
|
35395
35433
|
}, [focus]);
|
|
35396
35434
|
(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
35435
|
handleResetMore();
|
|
35401
|
-
}, [valueProp]);
|
|
35436
|
+
}, [valueProp, data]);
|
|
35402
35437
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35403
|
-
if (
|
|
35404
|
-
if (!resultRef.current) return;
|
|
35405
|
-
if (more === -1) {
|
|
35438
|
+
if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || [].length)) {
|
|
35406
35439
|
var tagClassName = ".".concat(styles.tag.split(' ')[0]);
|
|
35407
|
-
if (shouldResetMore
|
|
35408
|
-
shouldResetMore.current = false;
|
|
35440
|
+
if (shouldResetMore && result_isArray(value) && (value || []).length) {
|
|
35409
35441
|
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
35442
|
prevMore.current = newMore;
|
|
35419
35443
|
setMore(newMore);
|
|
35444
|
+
setShouldResetMore(false);
|
|
35445
|
+
} else {
|
|
35446
|
+
setShouldResetMore(false);
|
|
35420
35447
|
}
|
|
35448
|
+
} else {
|
|
35449
|
+
setShouldResetMore(false);
|
|
35421
35450
|
}
|
|
35422
|
-
}, [
|
|
35451
|
+
}, [shouldResetMore]);
|
|
35423
35452
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35424
35453
|
if (!resultRef.current) return;
|
|
35454
|
+
if (!compressed) return;
|
|
35455
|
+
if (isCompressedBound()) return;
|
|
35425
35456
|
var cancelObserver = addResizeObserver(resultRef.current, handleResetMore, {
|
|
35426
35457
|
direction: 'x'
|
|
35427
35458
|
});
|
|
@@ -36496,6 +36527,7 @@ var validate = function validate(value, formData, rules, p) {
|
|
|
36496
36527
|
|
|
36497
36528
|
|
|
36498
36529
|
|
|
36530
|
+
|
|
36499
36531
|
var getValue = function getValue(name, formValue) {
|
|
36500
36532
|
if (!name) return undefined;
|
|
36501
36533
|
if (isArray(name)) {
|
|
@@ -36550,6 +36582,9 @@ function useFormControl(props) {
|
|
|
36550
36582
|
_React$useState4 = slicedToArray_default()(_React$useState3, 2),
|
|
36551
36583
|
valueState = _React$useState4[0],
|
|
36552
36584
|
setValueState = _React$useState4[1];
|
|
36585
|
+
var latestInfo = use_latest_obj({
|
|
36586
|
+
valueState: valueState
|
|
36587
|
+
});
|
|
36553
36588
|
if (name && formFunc) {
|
|
36554
36589
|
inForm = true;
|
|
36555
36590
|
value = valueState;
|
|
@@ -36567,8 +36602,9 @@ function useFormControl(props) {
|
|
|
36567
36602
|
if (error !== errorState) {
|
|
36568
36603
|
setErrorState(error);
|
|
36569
36604
|
}
|
|
36570
|
-
if (!shallowEqual(value, valueState)) {
|
|
36605
|
+
if (!shallowEqual(value, latestInfo.valueState)) {
|
|
36571
36606
|
setValueState(value);
|
|
36607
|
+
latestInfo.valueState = value;
|
|
36572
36608
|
}
|
|
36573
36609
|
});
|
|
36574
36610
|
var validateFiled = use_persist_fn(function (name, v, formV) {
|
|
@@ -36657,9 +36693,11 @@ function useFormControl(props) {
|
|
|
36657
36693
|
if (isArray(name)) {
|
|
36658
36694
|
name.forEach(function (n) {
|
|
36659
36695
|
controlFunc.unbind(n, reserveAble);
|
|
36696
|
+
updateError(n, undefined);
|
|
36660
36697
|
});
|
|
36661
36698
|
} else {
|
|
36662
36699
|
controlFunc.unbind(name, reserveAble);
|
|
36700
|
+
updateError(name, undefined);
|
|
36663
36701
|
}
|
|
36664
36702
|
}
|
|
36665
36703
|
};
|
|
@@ -42495,6 +42533,7 @@ var useAutoSize = function useAutoSize(props) {
|
|
|
42495
42533
|
if (!shadowRef.current) return;
|
|
42496
42534
|
var v = value || '';
|
|
42497
42535
|
if (shadowRef.current.value !== v) shadowRef.current.value = v;
|
|
42536
|
+
if (shadowRef.current.scrollHeight === 0) return;
|
|
42498
42537
|
setHeight(shadowRef.current.scrollHeight);
|
|
42499
42538
|
};
|
|
42500
42539
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
|
|
@@ -46405,6 +46444,7 @@ var ListOption = function ListOption(props) {
|
|
|
46405
46444
|
onHover(index);
|
|
46406
46445
|
};
|
|
46407
46446
|
var handleClick = function handleClick() {
|
|
46447
|
+
if (datum.disabledCheck(data)) return;
|
|
46408
46448
|
if (isChecked && multiple) {
|
|
46409
46449
|
datum.remove(data);
|
|
46410
46450
|
} else {
|
|
@@ -46645,6 +46685,7 @@ var useTreeContext = function useTreeContext() {
|
|
|
46645
46685
|
|
|
46646
46686
|
|
|
46647
46687
|
|
|
46688
|
+
|
|
46648
46689
|
var TreeCheckbox = function TreeCheckbox(props) {
|
|
46649
46690
|
var jssStyle = props.jssStyle,
|
|
46650
46691
|
className = props.className,
|
|
@@ -46654,7 +46695,8 @@ var TreeCheckbox = function TreeCheckbox(props) {
|
|
|
46654
46695
|
var _useTreeContext = useTreeContext(),
|
|
46655
46696
|
getValue = _useTreeContext.getValue,
|
|
46656
46697
|
set = _useTreeContext.set,
|
|
46657
|
-
getChecked = _useTreeContext.getChecked
|
|
46698
|
+
getChecked = _useTreeContext.getChecked,
|
|
46699
|
+
unBindUpdate = _useTreeContext.unBindUpdate;
|
|
46658
46700
|
var handleChange = function handleChange(_, checked) {
|
|
46659
46701
|
set(id, checked ? 1 : 0);
|
|
46660
46702
|
if (onChange) {
|
|
@@ -46662,6 +46704,11 @@ var TreeCheckbox = function TreeCheckbox(props) {
|
|
|
46662
46704
|
}
|
|
46663
46705
|
};
|
|
46664
46706
|
var checked = getChecked(id);
|
|
46707
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
46708
|
+
return function () {
|
|
46709
|
+
unBindUpdate(id);
|
|
46710
|
+
};
|
|
46711
|
+
}, []);
|
|
46665
46712
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_checkbox_checkbox
|
|
46666
46713
|
//@ts-ignore
|
|
46667
46714
|
, {
|
|
@@ -46709,9 +46756,12 @@ var NodeContent = function NodeContent(props) {
|
|
|
46709
46756
|
onToggle = props.onToggle,
|
|
46710
46757
|
onDragOver = props.onDragOver,
|
|
46711
46758
|
onNodeClick = props.onNodeClick;
|
|
46759
|
+
var forceUpdate = useRender();
|
|
46712
46760
|
var _useTreeContext = useTreeContext(),
|
|
46713
|
-
isDisabled = _useTreeContext.isDisabled
|
|
46761
|
+
isDisabled = _useTreeContext.isDisabled,
|
|
46762
|
+
bindUpdate = _useTreeContext.bindUpdate;
|
|
46714
46763
|
var disabled = isDisabled(id);
|
|
46764
|
+
bindUpdate(id, forceUpdate);
|
|
46715
46765
|
var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
|
|
46716
46766
|
var rootClass = classnames_default()(contentStyle.contentWrapper, defineProperty_default()(defineProperty_default()({}, contentStyle.childnode, data[childrenKey] && data[childrenKey].length > 0), contentStyle.inlineContent, inlineNode));
|
|
46717
46767
|
var contentClass = classnames_default()(contentStyle.content, isString(contentClassProp) && contentClassProp, isFunc(contentClassProp) && contentClassProp(data));
|
|
@@ -48031,7 +48081,7 @@ function Select(props0) {
|
|
|
48031
48081
|
filterSameChange = props.filterSameChange,
|
|
48032
48082
|
noCache = props.noCache;
|
|
48033
48083
|
var hasFilter = isFunc(props.onAdvancedFilter || onFilterProp);
|
|
48034
|
-
var showInput = hasFilter || isFunc(onCreateProp);
|
|
48084
|
+
var showInput = hasFilter || isFunc(onCreateProp) || onCreateProp === true;
|
|
48035
48085
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
|
|
48036
48086
|
var rootStyle = Object.assign({
|
|
48037
48087
|
width: width
|
|
@@ -48044,8 +48094,6 @@ function Select(props0) {
|
|
|
48044
48094
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
48045
48095
|
focused = _useState4[0],
|
|
48046
48096
|
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
48097
|
var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
48050
48098
|
var optionListRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
48051
48099
|
var _useFilter = use_filter({
|
|
@@ -48074,14 +48122,6 @@ function Select(props0) {
|
|
|
48074
48122
|
rawData = _useFilter.rawData;
|
|
48075
48123
|
var onCollapse = usePersistFn(function (collapse) {
|
|
48076
48124
|
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
48125
|
onClearCreatedData();
|
|
48086
48126
|
});
|
|
48087
48127
|
var renderMoreIcon = function renderMoreIcon() {
|
|
@@ -48265,12 +48305,12 @@ function Select(props0) {
|
|
|
48265
48305
|
if (!onCreate) return;
|
|
48266
48306
|
if (multiple && !text) return;
|
|
48267
48307
|
// 防止点击 option 后触发 blur 事件,先把要做的事情存起来,后面再看要不要执行
|
|
48268
|
-
|
|
48269
|
-
if (createdData) {
|
|
48270
|
-
|
|
48308
|
+
if (createdData) {
|
|
48309
|
+
if (!datum.check(createdData)) {
|
|
48310
|
+
datum.add(createdData);
|
|
48271
48311
|
}
|
|
48272
48312
|
onClearCreatedData();
|
|
48273
|
-
}
|
|
48313
|
+
}
|
|
48274
48314
|
};
|
|
48275
48315
|
var handleFilter = function handleFilter(text, from) {
|
|
48276
48316
|
var hideCreate = onCreate && hideCreateOption;
|
|
@@ -48287,7 +48327,6 @@ function Select(props0) {
|
|
|
48287
48327
|
onFilter === null || onFilter === void 0 || onFilter(trim ? text.trim() : text, from);
|
|
48288
48328
|
};
|
|
48289
48329
|
var handleOptionClick = function handleOptionClick() {
|
|
48290
|
-
isPreventBlur.current = true;
|
|
48291
48330
|
if (multiple) return;
|
|
48292
48331
|
// 单选结束后需要清除创建项
|
|
48293
48332
|
onClearCreatedData();
|
|
@@ -53094,19 +53133,52 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53094
53133
|
var getColgroup = use_persist_fn(function (fromDrag) {
|
|
53095
53134
|
var _props$data, _target$current;
|
|
53096
53135
|
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
|
|
53136
|
+
var tr = (_target$current = target.current) === null || _target$current === void 0 ? void 0 : _target$current.querySelector('tr');
|
|
53137
|
+
if (!tr) return;
|
|
53138
|
+
var items = tr.children;
|
|
53100
53139
|
var newCols = [];
|
|
53101
53140
|
var sum = 0;
|
|
53102
|
-
|
|
53103
|
-
var
|
|
53104
|
-
width =
|
|
53141
|
+
var _loop = function _loop() {
|
|
53142
|
+
var _items$i$getBoundingC = items[i].getBoundingClientRect(),
|
|
53143
|
+
width = _items$i$getBoundingC.width;
|
|
53105
53144
|
sum += width;
|
|
53106
|
-
|
|
53145
|
+
var colspan = items[i].getAttribute('colspan');
|
|
53146
|
+
var dfWidth = props.columns.slice(i, i + (colspan ? parseInt(colspan, 10) : 1)).map(function (v) {
|
|
53147
|
+
return v.width;
|
|
53148
|
+
});
|
|
53149
|
+
var tempcols = [];
|
|
53150
|
+
var emptyNum = dfWidth.filter(function (v) {
|
|
53151
|
+
return v === undefined;
|
|
53152
|
+
}).length;
|
|
53153
|
+
if (dfWidth.length === 1) {
|
|
53154
|
+
// colspan = 1
|
|
53155
|
+
tempcols = [width];
|
|
53156
|
+
} else if (emptyNum === 0) {
|
|
53157
|
+
// 都有宽度按照比例分
|
|
53158
|
+
var all = dfWidth.reduce(function (a, b) {
|
|
53159
|
+
return a + b;
|
|
53160
|
+
}, 0);
|
|
53161
|
+
tempcols = dfWidth.map(function (v) {
|
|
53162
|
+
return v / all * width;
|
|
53163
|
+
});
|
|
53164
|
+
} else {
|
|
53165
|
+
// 多余的平分
|
|
53166
|
+
var _all = dfWidth.reduce(function (a, b) {
|
|
53167
|
+
return (a || 0) + (b || 0);
|
|
53168
|
+
}, 0);
|
|
53169
|
+
var rest = width - _all;
|
|
53170
|
+
var agv = rest > 0 ? rest / emptyNum : 0;
|
|
53171
|
+
tempcols = dfWidth.map(function (v) {
|
|
53172
|
+
return v ? v : agv;
|
|
53173
|
+
});
|
|
53174
|
+
}
|
|
53175
|
+
newCols = [].concat(toConsumableArray_default()(newCols), toConsumableArray_default()(tempcols));
|
|
53176
|
+
};
|
|
53177
|
+
for (var i = 0, count = items.length; i < count; i++) {
|
|
53178
|
+
_loop();
|
|
53107
53179
|
}
|
|
53108
53180
|
if (fromDrag && props.columnResizable) {
|
|
53109
|
-
var widthArr =
|
|
53181
|
+
var widthArr = toConsumableArray_default()(newCols);
|
|
53110
53182
|
if (typeof props.width === 'number') {
|
|
53111
53183
|
var maxWidth = Math.max(context.clientWidth, props.width + deltaXSum);
|
|
53112
53184
|
|
|
@@ -61261,7 +61333,7 @@ var upload_interface = __webpack_require__(4412);
|
|
|
61261
61333
|
|
|
61262
61334
|
|
|
61263
61335
|
/* harmony default export */ var src_0 = ({
|
|
61264
|
-
version: '3.0.
|
|
61336
|
+
version: '3.0.10-fix.1'
|
|
61265
61337
|
});
|
|
61266
61338
|
}();
|
|
61267
61339
|
/******/ return __webpack_exports__;
|