shineout 3.0.8 → 3.0.9
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 +32 -25
- 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.9'
|
|
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.9');
|
|
12023
12023
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12024
12024
|
|
|
12025
12025
|
|
|
@@ -35160,14 +35160,18 @@ var result_Result = function Result(props) {
|
|
|
35160
35160
|
getDataByValues = props.getDataByValues,
|
|
35161
35161
|
checkUnMatched = props.checkUnMatched,
|
|
35162
35162
|
onRemove = props.onRemove,
|
|
35163
|
-
onResultItemClick = props.onResultItemClick
|
|
35163
|
+
onResultItemClick = props.onResultItemClick,
|
|
35164
|
+
data = props.data;
|
|
35164
35165
|
var value = [null, undefined, ''].includes(valueProp) ? [] : multiple ? valueProp : [valueProp];
|
|
35165
35166
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(-1),
|
|
35166
35167
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
35167
35168
|
more = _useState2[0],
|
|
35168
35169
|
setMore = _useState2[1];
|
|
35170
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
35171
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
35172
|
+
shouldResetMore = _useState4[0],
|
|
35173
|
+
setShouldResetMore = _useState4[1];
|
|
35169
35174
|
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
35175
|
var prevMore = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(more);
|
|
35172
35176
|
var showInput = allowOnFilter;
|
|
35173
35177
|
var mounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
@@ -35239,6 +35243,7 @@ var result_Result = function Result(props) {
|
|
|
35239
35243
|
if (result_isUnMatchedData(item)) {
|
|
35240
35244
|
if (result_isFunc(keygen)) {
|
|
35241
35245
|
key = keygen(item.value, index);
|
|
35246
|
+
if (key === undefined) key = index;
|
|
35242
35247
|
} else {
|
|
35243
35248
|
key = item.value;
|
|
35244
35249
|
}
|
|
@@ -35382,7 +35387,9 @@ var result_Result = function Result(props) {
|
|
|
35382
35387
|
};
|
|
35383
35388
|
var handleResetMore = function handleResetMore() {
|
|
35384
35389
|
if (!compressed) return;
|
|
35385
|
-
|
|
35390
|
+
if (isCompressedBound()) return;
|
|
35391
|
+
setMore(-1);
|
|
35392
|
+
setShouldResetMore(true);
|
|
35386
35393
|
};
|
|
35387
35394
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35388
35395
|
if (!focus && mounted.current) {
|
|
@@ -35394,34 +35401,27 @@ var result_Result = function Result(props) {
|
|
|
35394
35401
|
mounted.current = true;
|
|
35395
35402
|
}, [focus]);
|
|
35396
35403
|
(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
35404
|
handleResetMore();
|
|
35401
|
-
}, [valueProp]);
|
|
35405
|
+
}, [valueProp, data]);
|
|
35402
35406
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35403
|
-
if (
|
|
35404
|
-
if (!resultRef.current) return;
|
|
35405
|
-
if (more === -1) {
|
|
35407
|
+
if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || [].length)) {
|
|
35406
35408
|
var tagClassName = ".".concat(styles.tag.split(' ')[0]);
|
|
35407
|
-
if (shouldResetMore
|
|
35408
|
-
shouldResetMore.current = false;
|
|
35409
|
+
if (shouldResetMore && result_isArray(value) && (value || []).length) {
|
|
35409
35410
|
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
35411
|
prevMore.current = newMore;
|
|
35419
35412
|
setMore(newMore);
|
|
35413
|
+
setShouldResetMore(false);
|
|
35414
|
+
} else {
|
|
35415
|
+
setShouldResetMore(false);
|
|
35420
35416
|
}
|
|
35417
|
+
} else {
|
|
35418
|
+
setShouldResetMore(false);
|
|
35421
35419
|
}
|
|
35422
|
-
}, [
|
|
35420
|
+
}, [shouldResetMore]);
|
|
35423
35421
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
35424
35422
|
if (!resultRef.current) return;
|
|
35423
|
+
if (!compressed) return;
|
|
35424
|
+
if (isCompressedBound()) return;
|
|
35425
35425
|
var cancelObserver = addResizeObserver(resultRef.current, handleResetMore, {
|
|
35426
35426
|
direction: 'x'
|
|
35427
35427
|
});
|
|
@@ -36496,6 +36496,7 @@ var validate = function validate(value, formData, rules, p) {
|
|
|
36496
36496
|
|
|
36497
36497
|
|
|
36498
36498
|
|
|
36499
|
+
|
|
36499
36500
|
var getValue = function getValue(name, formValue) {
|
|
36500
36501
|
if (!name) return undefined;
|
|
36501
36502
|
if (isArray(name)) {
|
|
@@ -36550,6 +36551,9 @@ function useFormControl(props) {
|
|
|
36550
36551
|
_React$useState4 = slicedToArray_default()(_React$useState3, 2),
|
|
36551
36552
|
valueState = _React$useState4[0],
|
|
36552
36553
|
setValueState = _React$useState4[1];
|
|
36554
|
+
var latestInfo = use_latest_obj({
|
|
36555
|
+
valueState: valueState
|
|
36556
|
+
});
|
|
36553
36557
|
if (name && formFunc) {
|
|
36554
36558
|
inForm = true;
|
|
36555
36559
|
value = valueState;
|
|
@@ -36567,8 +36571,9 @@ function useFormControl(props) {
|
|
|
36567
36571
|
if (error !== errorState) {
|
|
36568
36572
|
setErrorState(error);
|
|
36569
36573
|
}
|
|
36570
|
-
if (!shallowEqual(value, valueState)) {
|
|
36574
|
+
if (!shallowEqual(value, latestInfo.valueState)) {
|
|
36571
36575
|
setValueState(value);
|
|
36576
|
+
latestInfo.valueState = value;
|
|
36572
36577
|
}
|
|
36573
36578
|
});
|
|
36574
36579
|
var validateFiled = use_persist_fn(function (name, v, formV) {
|
|
@@ -36657,9 +36662,11 @@ function useFormControl(props) {
|
|
|
36657
36662
|
if (isArray(name)) {
|
|
36658
36663
|
name.forEach(function (n) {
|
|
36659
36664
|
controlFunc.unbind(n, reserveAble);
|
|
36665
|
+
updateError(n, undefined);
|
|
36660
36666
|
});
|
|
36661
36667
|
} else {
|
|
36662
36668
|
controlFunc.unbind(name, reserveAble);
|
|
36669
|
+
updateError(name, undefined);
|
|
36663
36670
|
}
|
|
36664
36671
|
}
|
|
36665
36672
|
};
|
|
@@ -48031,7 +48038,7 @@ function Select(props0) {
|
|
|
48031
48038
|
filterSameChange = props.filterSameChange,
|
|
48032
48039
|
noCache = props.noCache;
|
|
48033
48040
|
var hasFilter = isFunc(props.onAdvancedFilter || onFilterProp);
|
|
48034
|
-
var showInput = hasFilter || isFunc(onCreateProp);
|
|
48041
|
+
var showInput = hasFilter || isFunc(onCreateProp) || onCreateProp === true;
|
|
48035
48042
|
var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
|
|
48036
48043
|
var rootStyle = Object.assign({
|
|
48037
48044
|
width: width
|
|
@@ -61261,7 +61268,7 @@ var upload_interface = __webpack_require__(4412);
|
|
|
61261
61268
|
|
|
61262
61269
|
|
|
61263
61270
|
/* harmony default export */ var src_0 = ({
|
|
61264
|
-
version: '3.0.
|
|
61271
|
+
version: '3.0.9'
|
|
61265
61272
|
});
|
|
61266
61273
|
}();
|
|
61267
61274
|
/******/ return __webpack_exports__;
|