shineout 3.3.6-beta.4 → 3.3.6-beta.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 +74 -28
- 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.3.6-beta.
|
|
479
|
+
version: '3.3.6-beta.7'
|
|
480
480
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -11968,7 +11968,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
11968
11968
|
};
|
|
11969
11969
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
11970
11970
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
11971
|
-
/* harmony default export */ var version = ('3.3.6-beta.
|
|
11971
|
+
/* harmony default export */ var version = ('3.3.6-beta.7');
|
|
11972
11972
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
11973
11973
|
|
|
11974
11974
|
|
|
@@ -24444,6 +24444,14 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
|
|
|
24444
24444
|
background: "".concat(src.tableTbodyHoverBackgroundColor)
|
|
24445
24445
|
}
|
|
24446
24446
|
},
|
|
24447
|
+
rowHover: {
|
|
24448
|
+
'& td': {
|
|
24449
|
+
transition: 'background-color 0.2s'
|
|
24450
|
+
},
|
|
24451
|
+
'&&:hover td': {
|
|
24452
|
+
background: "".concat(src.tableTbodyHoverBackgroundColor)
|
|
24453
|
+
}
|
|
24454
|
+
},
|
|
24447
24455
|
floatLeft: {
|
|
24448
24456
|
'& $cellFixedLast$cellFixedLeft': {
|
|
24449
24457
|
'&::after': {
|
|
@@ -37453,8 +37461,8 @@ var Cascader = function Cascader(props0) {
|
|
|
37453
37461
|
return;
|
|
37454
37462
|
}
|
|
37455
37463
|
};
|
|
37456
|
-
var handleChange = function handleChange(item) {
|
|
37457
|
-
onChange === null || onChange === void 0 || onChange(item);
|
|
37464
|
+
var handleChange = function handleChange(item, selectId) {
|
|
37465
|
+
onChange === null || onChange === void 0 || onChange(item, selectId);
|
|
37458
37466
|
};
|
|
37459
37467
|
var handleClear = function handleClear(e) {
|
|
37460
37468
|
e.stopPropagation();
|
|
@@ -48068,6 +48076,8 @@ var usePaginationList = function usePaginationList(props) {
|
|
|
48068
48076
|
|
|
48069
48077
|
var Scroll = function Scroll(props) {
|
|
48070
48078
|
var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
48079
|
+
var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
48080
|
+
var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
|
|
48071
48081
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
48072
48082
|
timer: null,
|
|
48073
48083
|
isMouseDown: false,
|
|
@@ -48141,6 +48151,13 @@ var Scroll = function Scroll(props) {
|
|
|
48141
48151
|
fromDrag: context.isMouseDown
|
|
48142
48152
|
});
|
|
48143
48153
|
});
|
|
48154
|
+
var handleInnerScroll = usePersistFn(function (e) {
|
|
48155
|
+
var scrollTop = e.currentTarget.scrollTop;
|
|
48156
|
+
if (scrollRef.current) {
|
|
48157
|
+
e.currentTarget.scrollTop = 0;
|
|
48158
|
+
scrollRef.current.scrollTop += scrollTop;
|
|
48159
|
+
}
|
|
48160
|
+
});
|
|
48144
48161
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
48145
48162
|
className: props.className,
|
|
48146
48163
|
style: props.style,
|
|
@@ -48150,7 +48167,7 @@ var Scroll = function Scroll(props) {
|
|
|
48150
48167
|
})), {}, {
|
|
48151
48168
|
style: scrollerStyle,
|
|
48152
48169
|
onScroll: handleScroll,
|
|
48153
|
-
ref:
|
|
48170
|
+
ref: wrapperRef,
|
|
48154
48171
|
onMouseDown: function onMouseDown() {
|
|
48155
48172
|
context.isMouseDown = true;
|
|
48156
48173
|
},
|
|
@@ -48162,6 +48179,7 @@ var Scroll = function Scroll(props) {
|
|
|
48162
48179
|
})), {}, {
|
|
48163
48180
|
style: containerStyle,
|
|
48164
48181
|
ref: containerRef,
|
|
48182
|
+
onScroll: handleInnerScroll,
|
|
48165
48183
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
48166
48184
|
style: objectSpread2_default()({
|
|
48167
48185
|
flexGrow: 1
|
|
@@ -55831,6 +55849,7 @@ var useTableTree = function useTableTree(props) {
|
|
|
55831
55849
|
|
|
55832
55850
|
|
|
55833
55851
|
|
|
55852
|
+
var MAX_ROW_SPAN = 200;
|
|
55834
55853
|
var useTableVirtual = function useTableVirtual(props) {
|
|
55835
55854
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
55836
55855
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
@@ -55913,7 +55932,9 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
55913
55932
|
topTimer: null,
|
|
55914
55933
|
controlScrollRate: null,
|
|
55915
55934
|
heightCallback: null,
|
|
55916
|
-
preIndex: null
|
|
55935
|
+
preIndex: null,
|
|
55936
|
+
rowSpanRows: 0,
|
|
55937
|
+
autoAddRows: 0
|
|
55917
55938
|
}),
|
|
55918
55939
|
context = _useRef.current;
|
|
55919
55940
|
var getTranslate = usePersistFn(function (left, top) {
|
|
@@ -55964,17 +55985,20 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
55964
55985
|
var top = 0;
|
|
55965
55986
|
var maxIndex = Math.max(props.data.length - rowsInView, 0);
|
|
55966
55987
|
for (var i = 0; i <= maxIndex; i++) {
|
|
55988
|
+
context.rowSpanRows = 0;
|
|
55967
55989
|
sum += context.cachedHeight[i] || props.rowHeight;
|
|
55968
55990
|
var rowSpanHeight = 0;
|
|
55969
55991
|
if (rowSpanInfos) {
|
|
55992
|
+
var maxRowSpanLenth = Math.min(rowSpanInfos.length, props.rowsInView > MAX_ROW_SPAN ? props.rowsInView : props.rowsInView || MAX_ROW_SPAN);
|
|
55970
55993
|
var siblingsIndexs = [];
|
|
55971
|
-
for (var k = 0; k <
|
|
55994
|
+
for (var k = 0; k < maxRowSpanLenth; k++) {
|
|
55972
55995
|
if (rowSpanInfos[k] <= i && k > i) {
|
|
55973
55996
|
siblingsIndexs.push(k);
|
|
55974
55997
|
}
|
|
55975
55998
|
}
|
|
55976
55999
|
for (var j = 0; j < siblingsIndexs.length; j++) {
|
|
55977
56000
|
var index = siblingsIndexs[j];
|
|
56001
|
+
context.rowSpanRows += 1;
|
|
55978
56002
|
rowSpanHeight += context.cachedHeight[index] || props.rowHeight;
|
|
55979
56003
|
}
|
|
55980
56004
|
}
|
|
@@ -56065,6 +56089,24 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
56065
56089
|
props.scrollRef.current.scrollTop = beforeHeight;
|
|
56066
56090
|
}
|
|
56067
56091
|
});
|
|
56092
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
56093
|
+
var scrollRefHeight = props.scrollRef.current ? props.scrollRef.current.clientHeight : 0;
|
|
56094
|
+
var tableRefHeight = props.innerRef.current ? props.innerRef.current.clientHeight : 0;
|
|
56095
|
+
var remainHeight = scrollRefHeight - tableRefHeight;
|
|
56096
|
+
if (remainHeight > 0) {
|
|
56097
|
+
var addonHeight = 0;
|
|
56098
|
+
var addonCount = 0;
|
|
56099
|
+
for (var i = startIndex + rowsInView; i < props.data.length; i++) {
|
|
56100
|
+
var height = context.cachedHeight[i] || props.rowHeight;
|
|
56101
|
+
addonHeight += height;
|
|
56102
|
+
addonCount += 1;
|
|
56103
|
+
if (addonHeight >= remainHeight + context.cachedHeight[0]) break;
|
|
56104
|
+
}
|
|
56105
|
+
if (addonCount > 0) {
|
|
56106
|
+
context.autoAddRows = addonCount;
|
|
56107
|
+
}
|
|
56108
|
+
}
|
|
56109
|
+
}, []);
|
|
56068
56110
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
56069
56111
|
// 记录preIndex
|
|
56070
56112
|
context.preIndex = startIndex;
|
|
@@ -56099,7 +56141,8 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
56099
56141
|
cb();
|
|
56100
56142
|
}
|
|
56101
56143
|
}, [scrollHeight]);
|
|
56102
|
-
var
|
|
56144
|
+
var finalRowsInView = rowsInView + context.rowSpanRows + context.autoAddRows;
|
|
56145
|
+
var renderData = props.disabled ? props.data : toConsumableArray_default()(props.data).slice(startIndex, startIndex + finalRowsInView);
|
|
56103
56146
|
return {
|
|
56104
56147
|
scrollHeight: scrollHeight,
|
|
56105
56148
|
startIndex: startIndex,
|
|
@@ -57018,6 +57061,9 @@ var Tr = function Tr(props) {
|
|
|
57018
57061
|
var tds = [];
|
|
57019
57062
|
var skip = 0;
|
|
57020
57063
|
var lastRowIndex = data.length - 1;
|
|
57064
|
+
var hasSiblingRowSpan = data === null || data === void 0 ? void 0 : data.some(function (item) {
|
|
57065
|
+
return item === null;
|
|
57066
|
+
});
|
|
57021
57067
|
var _loop = function _loop(i) {
|
|
57022
57068
|
if (skip > 0) {
|
|
57023
57069
|
skip--;
|
|
@@ -57029,13 +57075,13 @@ var Tr = function Tr(props) {
|
|
|
57029
57075
|
var td = /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
|
|
57030
57076
|
colSpan: data[i].colSpan,
|
|
57031
57077
|
rowSpan: data[i].rowSpan,
|
|
57032
|
-
onMouseEnter: function
|
|
57078
|
+
onMouseEnter: props.hover && hasSiblingRowSpan ? function () {
|
|
57033
57079
|
props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
57034
|
-
},
|
|
57035
|
-
onMouseLeave: function
|
|
57080
|
+
} : undefined,
|
|
57081
|
+
onMouseLeave: props.hover && hasSiblingRowSpan ? function () {
|
|
57036
57082
|
props.handleCellHover(-1, 0);
|
|
57037
|
-
},
|
|
57038
|
-
className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
|
|
57083
|
+
} : undefined,
|
|
57084
|
+
className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), data[i].rowSpan > 1 && props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
|
|
57039
57085
|
style: getTdStyle(col, data[i].colSpan),
|
|
57040
57086
|
dir: config.direction,
|
|
57041
57087
|
onClick: props.onCellClick ? function () {
|
|
@@ -57101,7 +57147,7 @@ var Tr = function Tr(props) {
|
|
|
57101
57147
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
57102
57148
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", objectSpread2_default()(objectSpread2_default()({
|
|
57103
57149
|
ref: trRef,
|
|
57104
|
-
className: classnames_default()(props === null || props === void 0 || (_props$rowClassName = props.rowClassName) === null || _props$rowClassName === void 0 ? void 0 : _props$rowClassName.call(props, props.rawData, props.rowIndex), props.striped && props.rowIndex % 2 === 1 && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowStriped), props.isSelect && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowChecked))
|
|
57150
|
+
className: classnames_default()(props === null || props === void 0 || (_props$rowClassName = props.rowClassName) === null || _props$rowClassName === void 0 ? void 0 : _props$rowClassName.call(props, props.rawData, props.rowIndex), props.striped && props.rowIndex % 2 === 1 && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowStriped), props.isSelect && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowChecked), props.hover && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowHover))
|
|
57105
57151
|
}, props.rowEvents), {}, {
|
|
57106
57152
|
onClick: handleRowClick,
|
|
57107
57153
|
children: renderTds(props.columns, props.row)
|
|
@@ -57172,6 +57218,7 @@ var Tr = function Tr(props) {
|
|
|
57172
57218
|
striped: props.striped,
|
|
57173
57219
|
radio: props.radio,
|
|
57174
57220
|
isCellHover: isCellHover,
|
|
57221
|
+
hover: hover,
|
|
57175
57222
|
isSelect: props.datum.check(rowSelectMergeStartData[index]),
|
|
57176
57223
|
handleCellHover: handleCellHover
|
|
57177
57224
|
// to update
|
|
@@ -58489,11 +58536,10 @@ var Tabs = function Tabs(props) {
|
|
|
58489
58536
|
className: tabsStyle.panelWrapper,
|
|
58490
58537
|
style: panelStyle,
|
|
58491
58538
|
children: external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.toArray(children).map(function (child, index) {
|
|
58492
|
-
var
|
|
58493
|
-
if (tabs_isNamedComponent(
|
|
58494
|
-
return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(
|
|
58495
|
-
id:
|
|
58496
|
-
active: active
|
|
58539
|
+
var Child = child;
|
|
58540
|
+
if (tabs_isNamedComponent(Child.type) && Child.type.displayName === 'ShineoutTabsPanel') {
|
|
58541
|
+
return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(Child, {
|
|
58542
|
+
id: Child.props.id !== undefined ? Child.props.id : index
|
|
58497
58543
|
});
|
|
58498
58544
|
}
|
|
58499
58545
|
return null;
|
|
@@ -58504,20 +58550,20 @@ var Tabs = function Tabs(props) {
|
|
|
58504
58550
|
var tabs = [];
|
|
58505
58551
|
var border = getSplitColor();
|
|
58506
58552
|
external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.toArray(children).forEach(function (child, index) {
|
|
58507
|
-
var
|
|
58508
|
-
if (!
|
|
58509
|
-
var childBorder =
|
|
58510
|
-
var
|
|
58511
|
-
id =
|
|
58553
|
+
var Child = child;
|
|
58554
|
+
if (!Child || !Child.type) return;
|
|
58555
|
+
var childBorder = Child.props.splitColor || Child.props.border;
|
|
58556
|
+
var _Child$props$id = Child.props.id,
|
|
58557
|
+
id = _Child$props$id === void 0 ? index : _Child$props$id;
|
|
58512
58558
|
if (active === id && childBorder) {
|
|
58513
58559
|
border = childBorder;
|
|
58514
58560
|
}
|
|
58515
58561
|
tabs.push({
|
|
58516
|
-
id:
|
|
58517
|
-
tab:
|
|
58518
|
-
disabled:
|
|
58562
|
+
id: Child.props.id !== undefined ? Child.props.id : index,
|
|
58563
|
+
tab: Child.props.tab,
|
|
58564
|
+
disabled: Child.props.disabled,
|
|
58519
58565
|
jssStyle: jssStyle,
|
|
58520
|
-
color:
|
|
58566
|
+
color: Child.props.color || (active === id ? color : undefined)
|
|
58521
58567
|
});
|
|
58522
58568
|
});
|
|
58523
58569
|
var header = /*#__PURE__*/(0,jsx_runtime.jsx)(tabs_header, {
|
|
@@ -63886,7 +63932,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
63886
63932
|
|
|
63887
63933
|
|
|
63888
63934
|
/* harmony default export */ var src_0 = ({
|
|
63889
|
-
version: '3.3.6-beta.
|
|
63935
|
+
version: '3.3.6-beta.7'
|
|
63890
63936
|
});
|
|
63891
63937
|
}();
|
|
63892
63938
|
/******/ return __webpack_exports__;
|