shineout 3.1.4 → 3.1.6
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 +76 -82
- 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.6'
|
|
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.6');
|
|
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,
|
|
@@ -46668,7 +46660,6 @@ var Scroll = function Scroll(props) {
|
|
|
46668
46660
|
ref: containerRef,
|
|
46669
46661
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
46670
46662
|
style: {
|
|
46671
|
-
flexShrink: 0,
|
|
46672
46663
|
flexGrow: 1
|
|
46673
46664
|
},
|
|
46674
46665
|
children: props.children
|
|
@@ -53743,9 +53734,9 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53743
53734
|
var newColgroup = toConsumableArray_default()(colgroup);
|
|
53744
53735
|
newColgroup[index] = context.dragWidth;
|
|
53745
53736
|
if (isFunc(props.onColumnResize)) {
|
|
53746
|
-
var newColumns = props.columns.map(function (item) {
|
|
53737
|
+
var newColumns = props.columns.map(function (item, i) {
|
|
53747
53738
|
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
53748
|
-
width: newColgroup[
|
|
53739
|
+
width: newColgroup[i]
|
|
53749
53740
|
});
|
|
53750
53741
|
});
|
|
53751
53742
|
props.onColumnResize(newColumns);
|
|
@@ -53779,13 +53770,15 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53779
53770
|
if (!tr) return;
|
|
53780
53771
|
var items = tr.children;
|
|
53781
53772
|
var newCols = [];
|
|
53773
|
+
var index = 0;
|
|
53782
53774
|
var sum = 0;
|
|
53783
53775
|
var _loop = function _loop() {
|
|
53784
53776
|
var _items$i$getBoundingC = items[i].getBoundingClientRect(),
|
|
53785
53777
|
width = _items$i$getBoundingC.width;
|
|
53786
53778
|
sum += width;
|
|
53787
53779
|
var colspan = items[i].getAttribute('colspan');
|
|
53788
|
-
var
|
|
53780
|
+
var colspanNum = parseInt(colspan || '1', 10);
|
|
53781
|
+
var dfWidth = props.columns.slice(index, index + colspanNum).map(function (v) {
|
|
53789
53782
|
return v.width;
|
|
53790
53783
|
});
|
|
53791
53784
|
var tempcols = [];
|
|
@@ -53814,6 +53807,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53814
53807
|
return v ? v : agv;
|
|
53815
53808
|
});
|
|
53816
53809
|
}
|
|
53810
|
+
index += colspanNum;
|
|
53817
53811
|
newCols = [].concat(toConsumableArray_default()(newCols), toConsumableArray_default()(tempcols));
|
|
53818
53812
|
};
|
|
53819
53813
|
for (var i = 0, count = items.length; i < count; i++) {
|
|
@@ -53889,8 +53883,8 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
53889
53883
|
var hasNoWith = props.columns.find(function (v) {
|
|
53890
53884
|
return v.width === undefined;
|
|
53891
53885
|
});
|
|
53892
|
-
if (
|
|
53893
|
-
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();
|
|
53894
53888
|
}
|
|
53895
53889
|
}, [props.columns, props.data, props.dataChangeResize]);
|
|
53896
53890
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
@@ -62045,7 +62039,7 @@ var upload_interface = __webpack_require__(4412);
|
|
|
62045
62039
|
|
|
62046
62040
|
|
|
62047
62041
|
/* harmony default export */ var src_0 = ({
|
|
62048
|
-
version: '3.1.
|
|
62042
|
+
version: '3.1.6'
|
|
62049
62043
|
});
|
|
62050
62044
|
}();
|
|
62051
62045
|
/******/ return __webpack_exports__;
|