shineout 3.1.5 → 3.1.7
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 +84 -87
- 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.1.
|
|
479
|
+
version: '3.1.7'
|
|
480
480
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -11949,7 +11949,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
11949
11949
|
};
|
|
11950
11950
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
11951
11951
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
11952
|
-
/* harmony default export */ var version = ('3.1.
|
|
11952
|
+
/* harmony default export */ var version = ('3.1.7');
|
|
11953
11953
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
11954
11954
|
|
|
11955
11955
|
|
|
@@ -18120,6 +18120,9 @@ var formItemStyle = {
|
|
|
18120
18120
|
},
|
|
18121
18121
|
wrapperTip: {},
|
|
18122
18122
|
label: {
|
|
18123
|
+
'$wrapperInline &': {
|
|
18124
|
+
width: 'auto'
|
|
18125
|
+
},
|
|
18123
18126
|
wordWrap: 'break-word',
|
|
18124
18127
|
width: src.formItemLabelWidth,
|
|
18125
18128
|
padding: "".concat(src.formItemLabelPaddingY, " 0"),
|
|
@@ -34039,26 +34042,22 @@ var useFilter = function useFilter(props) {
|
|
|
34039
34042
|
onAdvancedFilter = props.onAdvancedFilter,
|
|
34040
34043
|
_props$filterDelay = props.filterDelay,
|
|
34041
34044
|
filterDelay = _props$filterDelay === void 0 ? 400 : _props$filterDelay;
|
|
34042
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
34045
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
34043
34046
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
34044
|
-
|
|
34045
|
-
|
|
34046
|
-
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
34047
|
+
filterText = _useState2[0],
|
|
34048
|
+
setFilterText = _useState2[1];
|
|
34049
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(undefined),
|
|
34047
34050
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
34048
|
-
|
|
34049
|
-
|
|
34050
|
-
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
34051
|
+
filterFunc = _useState4[0],
|
|
34052
|
+
setFilterFunc = _useState4[1];
|
|
34053
|
+
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
|
|
34051
34054
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
34052
|
-
|
|
34053
|
-
|
|
34054
|
-
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
34055
|
+
inputText = _useState6[0],
|
|
34056
|
+
setInputText = _useState6[1];
|
|
34057
|
+
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
|
|
34055
34058
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
34056
|
-
|
|
34057
|
-
|
|
34058
|
-
var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
|
|
34059
|
-
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
34060
|
-
createdData = _useState10[0],
|
|
34061
|
-
setCreatedData = _useState10[1];
|
|
34059
|
+
createdData = _useState8[0],
|
|
34060
|
+
setCreatedData = _useState8[1];
|
|
34062
34061
|
var firstMatchNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
|
|
34063
34062
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
34064
34063
|
filterTimer: null
|
|
@@ -34067,36 +34066,6 @@ var useFilter = function useFilter(props) {
|
|
|
34067
34066
|
var filterFn = onFilterWidthCreate || function (item, createdData, key) {
|
|
34068
34067
|
return getKey(keygen, item) === key;
|
|
34069
34068
|
};
|
|
34070
|
-
var getData = function getData() {
|
|
34071
|
-
var newData = filterData || [];
|
|
34072
|
-
if (createdData && !hideCreateOption) {
|
|
34073
|
-
var newKey = getKey(keygen, createdData);
|
|
34074
|
-
var sameItem = newData.find(function (item) {
|
|
34075
|
-
return filterFn(item, createdData, newKey);
|
|
34076
|
-
});
|
|
34077
|
-
if (!sameItem) return [createdData].concat(toConsumableArray_default()(newData));
|
|
34078
|
-
}
|
|
34079
|
-
return newData;
|
|
34080
|
-
};
|
|
34081
|
-
var getFirstMatchNode = function getFirstMatchNode(node) {
|
|
34082
|
-
if (firstMatchNode.current) return;
|
|
34083
|
-
firstMatchNode.current = node;
|
|
34084
|
-
};
|
|
34085
|
-
var getTreeData = function getTreeData() {
|
|
34086
|
-
var filterExpandedKeys = expandedProp || [];
|
|
34087
|
-
var newData = treeData;
|
|
34088
|
-
if (filterText) {
|
|
34089
|
-
newData = getFilterTree(treeData, onFilter === null || onFilter === void 0 ? void 0 : onFilter(filterText), filterExpandedKeys, function (node) {
|
|
34090
|
-
return getKey(keygen, node);
|
|
34091
|
-
}, childrenKey, !!showHitDescendants, firstMatch ? getFirstMatchNode : undefined, {
|
|
34092
|
-
advanced: !!onAdvancedFilter
|
|
34093
|
-
});
|
|
34094
|
-
}
|
|
34095
|
-
return {
|
|
34096
|
-
newData: newData,
|
|
34097
|
-
filterExpandedKeys: filterExpandedKeys
|
|
34098
|
-
};
|
|
34099
|
-
};
|
|
34100
34069
|
var handleClearCreatedData = function handleClearCreatedData() {
|
|
34101
34070
|
setCreatedData(undefined);
|
|
34102
34071
|
};
|
|
@@ -34108,17 +34077,11 @@ var useFilter = function useFilter(props) {
|
|
|
34108
34077
|
};
|
|
34109
34078
|
var handleFilter = function handleFilter(text) {
|
|
34110
34079
|
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'edit';
|
|
34080
|
+
if (context.filterTimer) clearTimeout(context.filterTimer);
|
|
34111
34081
|
setInputText(text);
|
|
34112
34082
|
setFilterText(text);
|
|
34113
34083
|
firstMatchNode.current = null;
|
|
34114
|
-
if (context.filterTimer) clearTimeout(context.filterTimer);
|
|
34115
34084
|
if (!text) {
|
|
34116
|
-
if (data) {
|
|
34117
|
-
setFilterData(data);
|
|
34118
|
-
}
|
|
34119
|
-
if (treeData) {
|
|
34120
|
-
setFilterData(treeData);
|
|
34121
|
-
}
|
|
34122
34085
|
setFilterFunc(undefined);
|
|
34123
34086
|
handleClearCreatedData();
|
|
34124
34087
|
// 没有 text 时触发一次 onFilter 以便外部重置数据
|
|
@@ -34136,32 +34099,61 @@ var useFilter = function useFilter(props) {
|
|
|
34136
34099
|
setFilterFunc(function () {
|
|
34137
34100
|
return next;
|
|
34138
34101
|
});
|
|
34139
|
-
var nextData = data === null || data === void 0 ? void 0 : data.filter(function (item) {
|
|
34140
|
-
if (!groupKey) return next(item);
|
|
34141
|
-
// 剔除分组项
|
|
34142
|
-
if (item[groupKey]) return item;
|
|
34143
|
-
return next(item);
|
|
34144
|
-
});
|
|
34145
|
-
setFilterData(nextData);
|
|
34146
34102
|
}, filterDelay);
|
|
34147
34103
|
};
|
|
34148
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
34149
|
-
if (data) setFilterData(data);
|
|
34150
|
-
}, [data]);
|
|
34151
34104
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
34152
34105
|
if (context.filterTimer) clearTimeout(context.filterTimer);
|
|
34153
34106
|
}, []);
|
|
34154
|
-
var
|
|
34155
|
-
|
|
34156
|
-
|
|
34157
|
-
|
|
34158
|
-
|
|
34159
|
-
|
|
34160
|
-
|
|
34161
|
-
|
|
34162
|
-
|
|
34163
|
-
|
|
34164
|
-
|
|
34107
|
+
var _useMemo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
34108
|
+
if (treeData) {
|
|
34109
|
+
var getTreeData = function getTreeData() {
|
|
34110
|
+
var getFirstMatchNode = function getFirstMatchNode(node) {
|
|
34111
|
+
if (firstMatchNode.current) return;
|
|
34112
|
+
firstMatchNode.current = node;
|
|
34113
|
+
};
|
|
34114
|
+
var filterExpandedKeys = expandedProp || [];
|
|
34115
|
+
var newData = treeData;
|
|
34116
|
+
if (filterFunc) {
|
|
34117
|
+
newData = getFilterTree(treeData, filterFunc, filterExpandedKeys, function (node) {
|
|
34118
|
+
return getKey(keygen, node);
|
|
34119
|
+
}, childrenKey, !!showHitDescendants, firstMatch ? getFirstMatchNode : undefined, {
|
|
34120
|
+
advanced: !!onAdvancedFilter
|
|
34121
|
+
});
|
|
34122
|
+
}
|
|
34123
|
+
return {
|
|
34124
|
+
newData: newData,
|
|
34125
|
+
filterExpandedKeys: filterExpandedKeys
|
|
34126
|
+
};
|
|
34127
|
+
};
|
|
34128
|
+
var _getTreeData = getTreeData(),
|
|
34129
|
+
newData = _getTreeData.newData,
|
|
34130
|
+
filterExpandedKeys = _getTreeData.filterExpandedKeys;
|
|
34131
|
+
return [newData, filterExpandedKeys];
|
|
34132
|
+
} else if (data) {
|
|
34133
|
+
var getData = function getData() {
|
|
34134
|
+
var newData = (filterFunc ? data === null || data === void 0 ? void 0 : data.filter(function (item) {
|
|
34135
|
+
if (!groupKey) return filterFunc(item);
|
|
34136
|
+
// 剔除分组项
|
|
34137
|
+
if (item[groupKey]) return item;
|
|
34138
|
+
return filterFunc(item);
|
|
34139
|
+
}) : data) || [];
|
|
34140
|
+
if (createdData && !hideCreateOption) {
|
|
34141
|
+
var newKey = getKey(keygen, createdData);
|
|
34142
|
+
var sameItem = newData.find(function (item) {
|
|
34143
|
+
return filterFn(item, createdData, newKey);
|
|
34144
|
+
});
|
|
34145
|
+
if (!sameItem) return [createdData].concat(toConsumableArray_default()(newData));
|
|
34146
|
+
}
|
|
34147
|
+
return newData;
|
|
34148
|
+
};
|
|
34149
|
+
return [getData(), undefined];
|
|
34150
|
+
} else {
|
|
34151
|
+
return [undefined, undefined];
|
|
34152
|
+
}
|
|
34153
|
+
}, [data, treeData, filterFunc, createdData, expandedProp]),
|
|
34154
|
+
_useMemo2 = slicedToArray_default()(_useMemo, 2),
|
|
34155
|
+
nextData = _useMemo2[0],
|
|
34156
|
+
nextExpanded = _useMemo2[1];
|
|
34165
34157
|
return {
|
|
34166
34158
|
inputText: inputText,
|
|
34167
34159
|
filterText: filterText,
|
|
@@ -44114,7 +44106,7 @@ var useForm = function useForm(props) {
|
|
|
44114
44106
|
external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
|
|
44115
44107
|
context.removeLock = false;
|
|
44116
44108
|
if (props.value === context.lastValue) return;
|
|
44117
|
-
context.value = props.value || emptyObj;
|
|
44109
|
+
context.value = deepClone(props.value) || emptyObj;
|
|
44118
44110
|
if (initValidate && !context.resetTime) {
|
|
44119
44111
|
var keys = Object.keys(context.validateMap).filter(function (key) {
|
|
44120
44112
|
var oldValue = deepGet(context.lastValue || emptyObj, key);
|
|
@@ -53632,7 +53624,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53632
53624
|
clientWidth: 0
|
|
53633
53625
|
}),
|
|
53634
53626
|
context = _useRef.current;
|
|
53635
|
-
var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(
|
|
53627
|
+
var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(undefined),
|
|
53636
53628
|
_React$useState2 = slicedToArray_default()(_React$useState, 2),
|
|
53637
53629
|
isScrollX = _React$useState2[0],
|
|
53638
53630
|
setIsScrollX = _React$useState2[1];
|
|
@@ -53640,7 +53632,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53640
53632
|
_React$useState4 = slicedToArray_default()(_React$useState3, 2),
|
|
53641
53633
|
deltaXSum = _React$useState4[0],
|
|
53642
53634
|
setDeltaXSum = _React$useState4[1];
|
|
53643
|
-
var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(
|
|
53635
|
+
var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(undefined),
|
|
53644
53636
|
_React$useState6 = slicedToArray_default()(_React$useState5, 2),
|
|
53645
53637
|
isScrollY = _React$useState6[0],
|
|
53646
53638
|
setIsScrollY = _React$useState6[1];
|
|
@@ -53742,9 +53734,9 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53742
53734
|
var newColgroup = toConsumableArray_default()(colgroup);
|
|
53743
53735
|
newColgroup[index] = context.dragWidth;
|
|
53744
53736
|
if (isFunc(props.onColumnResize)) {
|
|
53745
|
-
var newColumns = props.columns.map(function (item) {
|
|
53737
|
+
var newColumns = props.columns.map(function (item, i) {
|
|
53746
53738
|
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
53747
|
-
width: newColgroup[
|
|
53739
|
+
width: newColgroup[i]
|
|
53748
53740
|
});
|
|
53749
53741
|
});
|
|
53750
53742
|
props.onColumnResize(newColumns);
|
|
@@ -53778,13 +53770,15 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53778
53770
|
if (!tr) return;
|
|
53779
53771
|
var items = tr.children;
|
|
53780
53772
|
var newCols = [];
|
|
53773
|
+
var index = 0;
|
|
53781
53774
|
var sum = 0;
|
|
53782
53775
|
var _loop = function _loop() {
|
|
53783
53776
|
var _items$i$getBoundingC = items[i].getBoundingClientRect(),
|
|
53784
53777
|
width = _items$i$getBoundingC.width;
|
|
53785
53778
|
sum += width;
|
|
53786
53779
|
var colspan = items[i].getAttribute('colspan');
|
|
53787
|
-
var
|
|
53780
|
+
var colspanNum = parseInt(colspan || '1', 10);
|
|
53781
|
+
var dfWidth = props.columns.slice(index, index + colspanNum).map(function (v) {
|
|
53788
53782
|
return v.width;
|
|
53789
53783
|
});
|
|
53790
53784
|
var tempcols = [];
|
|
@@ -53813,6 +53807,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53813
53807
|
return v ? v : agv;
|
|
53814
53808
|
});
|
|
53815
53809
|
}
|
|
53810
|
+
index += colspanNum;
|
|
53816
53811
|
newCols = [].concat(toConsumableArray_default()(newCols), toConsumableArray_default()(tempcols));
|
|
53817
53812
|
};
|
|
53818
53813
|
for (var i = 0, count = items.length; i < count; i++) {
|
|
@@ -53888,8 +53883,8 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53888
53883
|
var hasNoWith = props.columns.find(function (v) {
|
|
53889
53884
|
return v.width === undefined;
|
|
53890
53885
|
});
|
|
53891
|
-
if (
|
|
53892
|
-
if (preData.length === 0 || props.dataChangeResize) resetColGroup();
|
|
53886
|
+
if (preData && props.data && props.data.length !== preData.length) {
|
|
53887
|
+
if (preData.length === 0 || props.dataChangeResize || hasNoWith) resetColGroup();
|
|
53893
53888
|
}
|
|
53894
53889
|
}, [props.columns, props.data, props.dataChangeResize]);
|
|
53895
53890
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
@@ -53897,7 +53892,8 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53897
53892
|
syncScrollWidth();
|
|
53898
53893
|
if (scrollRef.current) {
|
|
53899
53894
|
cancelFunc = addResizeObserver(scrollRef.current, handleResize, {
|
|
53900
|
-
direction: true
|
|
53895
|
+
direction: true,
|
|
53896
|
+
timer: 10
|
|
53901
53897
|
});
|
|
53902
53898
|
}
|
|
53903
53899
|
return function () {
|
|
@@ -53917,8 +53913,8 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53917
53913
|
}
|
|
53918
53914
|
}, [colgroup]);
|
|
53919
53915
|
return {
|
|
53920
|
-
isScrollX: isScrollX,
|
|
53921
|
-
isScrollY: isScrollY,
|
|
53916
|
+
isScrollX: !!isScrollX,
|
|
53917
|
+
isScrollY: !!isScrollY,
|
|
53922
53918
|
floatLeft: floatLeft,
|
|
53923
53919
|
floatRight: floatRight,
|
|
53924
53920
|
scrollBarWidth: scrollBarWidth,
|
|
@@ -58401,6 +58397,7 @@ var TreeSelect = function TreeSelect(props0) {
|
|
|
58401
58397
|
jssStyle: jssStyle,
|
|
58402
58398
|
renderItem: renderItem
|
|
58403
58399
|
}, treeProps), {}, {
|
|
58400
|
+
childrenKey: props.childrenKey,
|
|
58404
58401
|
line: line,
|
|
58405
58402
|
mode: mode,
|
|
58406
58403
|
data: tiledData,
|
|
@@ -62044,7 +62041,7 @@ var upload_interface = __webpack_require__(4412);
|
|
|
62044
62041
|
|
|
62045
62042
|
|
|
62046
62043
|
/* harmony default export */ var src_0 = ({
|
|
62047
|
-
version: '3.1.
|
|
62044
|
+
version: '3.1.7'
|
|
62048
62045
|
});
|
|
62049
62046
|
}();
|
|
62050
62047
|
/******/ return __webpack_exports__;
|