shineout 3.4.0-beta.9 → 3.4.0

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/dist/shineout.js CHANGED
@@ -11991,7 +11991,7 @@ var handleStyle = function handleStyle(style) {
11991
11991
  };
11992
11992
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11993
11993
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11994
- /* harmony default export */ var version = ('3.4.0-beta.9');
11994
+ /* harmony default export */ var version = ('3.4.0');
11995
11995
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11996
11996
 
11997
11997
 
@@ -18129,7 +18129,10 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()({
18129
18129
  },
18130
18130
  datetimeHide: {
18131
18131
  opacity: '0',
18132
- pointerEvents: 'none'
18132
+ pointerEvents: 'none',
18133
+ '& > span': {
18134
+ display: 'none'
18135
+ }
18133
18136
  },
18134
18137
  quickPicker: {
18135
18138
  padding: "".concat(src.datePickerQuickPanelPaddingY, " ").concat(src.datePickerQuickPanelPaddingX),
@@ -22044,7 +22047,11 @@ var rateStyle = {
22044
22047
  width: '100%',
22045
22048
  height: '100%',
22046
22049
  transition: 'none',
22047
- color: src.rateBackgroundColor
22050
+ color: src.rateBackgroundColor,
22051
+ '& > svg': {
22052
+ width: '1em',
22053
+ height: '1em'
22054
+ }
22048
22055
  },
22049
22056
  itemFront: {
22050
22057
  position: 'absolute',
@@ -22053,7 +22060,11 @@ var rateStyle = {
22053
22060
  right: 0,
22054
22061
  bottom: 0,
22055
22062
  opacity: 0,
22056
- color: src.rateFrontBackgroundColor
22063
+ color: src.rateFrontBackgroundColor,
22064
+ '& > svg': {
22065
+ width: '1em',
22066
+ height: '1em'
22067
+ }
22057
22068
  },
22058
22069
  itemHalf: {
22059
22070
  position: 'absolute',
@@ -24714,7 +24725,8 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
24714
24725
  }
24715
24726
  },
24716
24727
  bordered: {
24717
- border: "1px solid ".concat(src.tableCellBorderColor),
24728
+ borderLeft: "1px solid ".concat(src.tableCellBorderColor),
24729
+ borderRight: "1px solid ".concat(src.tableCellBorderColor),
24718
24730
  borderBottom: 'none',
24719
24731
  borderTop: 'none',
24720
24732
  '&::before': {
@@ -24737,6 +24749,9 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
24737
24749
  borderTop: "1px solid ".concat(src.tableCellBorderColor)
24738
24750
  }
24739
24751
  },
24752
+ headMirrorScroller: {
24753
+ overflow: 'scroll hidden'
24754
+ },
24740
24755
  headWrapper: {
24741
24756
  flex: '0 0 auto',
24742
24757
  overflow: 'hidden',
@@ -26210,6 +26225,12 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
26210
26225
  '&[dir=rtl]': {
26211
26226
  left: '0'
26212
26227
  },
26228
+ '&$bottomLeft': {
26229
+ right: 'auto'
26230
+ },
26231
+ '&$bottomRight': {
26232
+ left: 'auto'
26233
+ },
26213
26234
  top: '100%',
26214
26235
  transformOrigin: '100% 0',
26215
26236
  marginTop: '10px',
@@ -26238,8 +26259,22 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
26238
26259
  },
26239
26260
  '&[dir=rtl]::before': {
26240
26261
  left: '8px'
26262
+ },
26263
+ '&$bottomLeft::before': {
26264
+ left: '8px',
26265
+ right: 'auto'
26266
+ },
26267
+ '&$bottomRight::before': {
26268
+ right: '4px',
26269
+ left: 'auto'
26241
26270
  }
26242
26271
  },
26272
+ bottomLeft: {
26273
+ left: 0
26274
+ },
26275
+ bottomRight: {
26276
+ right: 0
26277
+ },
26243
26278
  infoError: {
26244
26279
  boxShadow: "0 0 0 1px ".concat(src.textareaInfoErrorBorderColor),
26245
26280
  color: src.textareaInfoErrorFontColor,
@@ -34166,15 +34201,31 @@ var Carousel = function Carousel(props) {
34166
34201
  };
34167
34202
  var renderArrow = function renderArrow() {
34168
34203
  if (!props.showArrow) return null;
34204
+ var handlePrev = function handlePrev() {
34205
+ if (config.direction === 'ltr') {
34206
+ func.backward();
34207
+ } else {
34208
+ func.forward();
34209
+ }
34210
+ func.stop();
34211
+ };
34212
+ var handleNext = function handleNext() {
34213
+ if (config.direction === 'ltr') {
34214
+ func.forward();
34215
+ } else {
34216
+ func.backward();
34217
+ }
34218
+ func.stop();
34219
+ };
34169
34220
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
34170
34221
  className: classnames_default()(props.showArrow === 'hover' && (carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowHover), carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowWrapper, props.arrowClassName),
34171
34222
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
34172
34223
  className: classnames_default()(carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowLeft, carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowItem),
34173
- onClick: config.direction === 'ltr' ? func.backward : func.forward,
34224
+ onClick: handlePrev,
34174
34225
  children: icons_config.carousel.Backward
34175
34226
  }, 'left'), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
34176
34227
  className: classnames_default()(carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowRight, carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowItem),
34177
- onClick: config.direction === 'ltr' ? func.forward : func.backward,
34228
+ onClick: handleNext,
34178
34229
  children: icons_config.carousel.Forward
34179
34230
  }, 'right')]
34180
34231
  });
@@ -40902,6 +40953,13 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
40902
40953
  var getCurrentArr = function getCurrentArr() {
40903
40954
  var arr = convertValueToDateArr(value, format, options);
40904
40955
  var currentArr = convertValueToDateArr(props.defaultCurrent, 'YYYY-MM-DD', options);
40956
+ var validArr = arr.filter(function (item) {
40957
+ return item;
40958
+ });
40959
+ var validCurrentArr = currentArr.filter(function (item) {
40960
+ return item;
40961
+ });
40962
+ if (!validArr.length && currentArr.length) return validCurrentArr;
40905
40963
  if (!arr[0]) arr[0] = arr[1] || currentArr[0] || new Date();
40906
40964
  if (range && !arr[1]) arr[1] = arr[0] || currentArr[1] || new Date();
40907
40965
  return arr;
@@ -41876,7 +41934,8 @@ var Day = function Day(props) {
41876
41934
  className: styles === null || styles === void 0 ? void 0 : styles.pickerFooter,
41877
41935
  dir: direction,
41878
41936
  style: {
41879
- borderTop: props.needConfirm && props.range ? 'none' : ''
41937
+ borderTop: props.needConfirm && props.range ? 'none' : undefined,
41938
+ marginTop: props.needConfirm && props.range ? -16 : undefined
41880
41939
  },
41881
41940
  children: [props.type === 'datetime' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
41882
41941
  className: classnames_default()(styles === null || styles === void 0 ? void 0 : styles.pickerFooterTime, styles === null || styles === void 0 ? void 0 : styles.datetime, !timeStr && (styles === null || styles === void 0 ? void 0 : styles.datetimeHide)),
@@ -44122,6 +44181,11 @@ var Modal = function Modal(props) {
44122
44181
  }
44123
44182
  };
44124
44183
  }, []);
44184
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
44185
+ if (props.setInnerClose) {
44186
+ props.setInnerClose(handleClose);
44187
+ }
44188
+ }, [props.setInnerClose]);
44125
44189
 
44126
44190
  // render
44127
44191
  var renderIcon = function renderIcon(isEmptyTitle) {
@@ -44322,12 +44386,16 @@ var BtnCancel = function BtnCancel(option) {
44322
44386
  var method = function method(type, jssStyle) {
44323
44387
  return function (options) {
44324
44388
  var id = getUidStr();
44389
+ var innerClose;
44325
44390
  var root = getRoot({
44326
44391
  container: options.container
44327
44392
  });
44328
44393
  if (!root) return;
44329
44394
  var destroyModal = function destroyModal() {
44330
- destroy(root);
44395
+ innerClose();
44396
+ setTimeout(function () {
44397
+ destroy(root);
44398
+ }, 300);
44331
44399
  };
44332
44400
  modals.add(root);
44333
44401
  var btnOptions = {
@@ -44356,6 +44424,9 @@ var method = function method(type, jssStyle) {
44356
44424
  shouldDestroy: function shouldDestroy(can) {
44357
44425
  if (can) destroyModal();
44358
44426
  },
44427
+ setInnerClose: function setInnerClose(close) {
44428
+ innerClose = close;
44429
+ },
44359
44430
  children: options.content || options.children
44360
44431
  }));
44361
44432
  ReactRender(Content, root);
@@ -45052,6 +45123,7 @@ var useAutoSize = function useAutoSize(props) {
45052
45123
 
45053
45124
 
45054
45125
 
45126
+
45055
45127
  var textarea_excluded = ["info", "suffix", "renderFooter", "width", "style", "jssStyle", "onBlur", "status", "trim", "delay"];
45056
45128
 
45057
45129
 
@@ -45164,8 +45236,17 @@ var textarea_Textarea = function Textarea(props0) {
45164
45236
  var forwardProps = removeProps(resetProps, objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, inputAbleParams), autosizeParams), tipProps), formatParams), innerTitleProps));
45165
45237
  var getInfo = function getInfo() {
45166
45238
  var notNumber = typeof info !== 'number';
45167
- if (typeof info !== 'function' && notNumber) return null;
45168
- var textInfo = notNumber ? info : textarea_defaultInfo.bind(null, info);
45239
+ if (typeof info !== 'function' && typeof_default()(info) !== 'object' && notNumber) return null;
45240
+ var infoContent;
45241
+ var infoPosition;
45242
+ if (typeof_default()(info) === 'object') {
45243
+ infoContent = info.content;
45244
+ infoPosition = info.position;
45245
+ } else {
45246
+ infoContent = info;
45247
+ }
45248
+ var notContentNumber = typeof infoContent !== 'number';
45249
+ var textInfo = notContentNumber ? infoContent : textarea_defaultInfo.bind(null, infoContent);
45169
45250
  var res = textInfo(inputAbleProps.value);
45170
45251
  // empty
45171
45252
  if (!res) return null;
@@ -45177,7 +45258,7 @@ var textarea_Textarea = function Textarea(props0) {
45177
45258
  minWidth: 'auto'
45178
45259
  },
45179
45260
  dir: config.direction,
45180
- className: classnames_default()(textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.info, !!isError && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.infoError)),
45261
+ className: classnames_default()(textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.info, !!isError && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.infoError), infoPosition === 'bottom-left' && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.bottomLeft), infoPosition === 'bottom-right' && (textareaClasses === null || textareaClasses === void 0 ? void 0 : textareaClasses.bottomRight)),
45181
45262
  children: text
45182
45263
  }, 'info');
45183
45264
  };
@@ -48740,8 +48821,7 @@ var Scroll = function Scroll(props) {
48740
48821
  var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
48741
48822
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
48742
48823
  timer: null,
48743
- isMouseDown: false,
48744
- lastPaddingTop: 0
48824
+ isMouseDown: false
48745
48825
  }),
48746
48826
  context = _useRef.current;
48747
48827
  var _props$scrollHeight = props.scrollHeight,
@@ -48770,13 +48850,11 @@ var Scroll = function Scroll(props) {
48770
48850
  overflow: 'hidden',
48771
48851
  position: 'sticky'
48772
48852
  }, isRtl ? 'right' : 'left', 0), "top", 0);
48773
- var pd = context.lastPaddingTop;
48774
- if (height > 0 && scrollHeight > 0) {
48775
- pd = Math.max(0, Math.floor(scrollHeight - height));
48776
- context.lastPaddingTop = pd;
48777
- }
48853
+ var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
48854
+ return Math.max(0, Math.floor(scrollHeight - height));
48855
+ }, [scrollHeight, height]);
48778
48856
  var placeStyle = {
48779
- paddingTop: pd,
48857
+ paddingTop: paddingTop,
48780
48858
  width: scrollWidth,
48781
48859
  overflow: props.isScrollY ? 'hidden' : 'auto hidden',
48782
48860
  height: props.isScrollY ? 0 : 1,
@@ -48909,7 +48987,7 @@ var VirtualList = function VirtualList(props) {
48909
48987
  var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
48910
48988
  _useState8 = slicedToArray_default()(_useState7, 2),
48911
48989
  startIndex = _useState8[0],
48912
- setCurrentIndex = _useState8[1];
48990
+ setStartIndex = _useState8[1];
48913
48991
  var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
48914
48992
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
48915
48993
  cachedHeight: [],
@@ -48988,7 +49066,7 @@ var VirtualList = function VirtualList(props) {
48988
49066
  }
48989
49067
  }
48990
49068
  if (nextCurrentIndex !== startIndex) {
48991
- setCurrentIndex(nextCurrentIndex);
49069
+ setStartIndex(nextCurrentIndex);
48992
49070
  }
48993
49071
  setTop(top);
48994
49072
  };
@@ -49004,8 +49082,7 @@ var VirtualList = function VirtualList(props) {
49004
49082
  };
49005
49083
  var handleScroll = function handleScroll(info) {
49006
49084
  var _props$onScroll;
49007
- var scrollLeft = info.scrollLeft,
49008
- height = info.height,
49085
+ var height = info.height,
49009
49086
  y = info.y,
49010
49087
  fromDrag = info.fromDrag;
49011
49088
  var scrollTop = info.scrollTop;
@@ -49030,7 +49107,7 @@ var VirtualList = function VirtualList(props) {
49030
49107
  var renderList = function renderList() {
49031
49108
  var items = data.slice(startIndex, startIndex + rowsInView);
49032
49109
  var Tag = tag;
49033
- var shouldScroll = data.length * lineHeight > height;
49110
+ var shouldScroll = getContentHeight(data.length - 1) > height;
49034
49111
  var nextStyle = objectSpread2_default()({}, style);
49035
49112
  if (shouldScroll) nextStyle.height = height;
49036
49113
  var scrollHeight = getContentHeight(data.length - 1);
@@ -49065,11 +49142,19 @@ var VirtualList = function VirtualList(props) {
49065
49142
  });
49066
49143
  };
49067
49144
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49068
- setHeight(getContentHeight(props.data.length - 1));
49145
+ // 记录preIndex
49146
+ context.preIndex = startIndex;
49147
+ }, [startIndex]);
49148
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
49149
+ // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
49150
+ setTop(0);
49151
+ setStartIndex(0);
49152
+ return function () {
49153
+ context.preIndex = null;
49154
+ };
49069
49155
  }, [data.length]);
49070
49156
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49071
49157
  if (offsetY) {
49072
- // if (wrapperRef.current && props.innerRef.current) {
49073
49158
  if (wrapperRef.current) {
49074
49159
  setOffsetY(0);
49075
49160
  setTop(function (s) {
@@ -49080,11 +49165,8 @@ var VirtualList = function VirtualList(props) {
49080
49165
  }
49081
49166
  }, [offsetY, startIndex]);
49082
49167
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49083
- // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
49084
- return function () {
49085
- context.preIndex = null;
49086
- };
49087
- }, [props.data]);
49168
+ setHeight(getContentHeight(props.data.length - 1));
49169
+ }, [data.length]);
49088
49170
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49089
49171
  if (context.heightCallback) {
49090
49172
  var cb = context.heightCallback;
@@ -49092,10 +49174,6 @@ var VirtualList = function VirtualList(props) {
49092
49174
  cb();
49093
49175
  }
49094
49176
  }, [scrollHeight]);
49095
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49096
- // 记录preIndex
49097
- context.preIndex = startIndex;
49098
- }, [startIndex]);
49099
49177
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49100
49178
  if (virtualRef !== null && virtualRef !== void 0 && virtualRef.current) {
49101
49179
  virtualRef.current.scrollByStep = handleScrollByStep;
@@ -49430,7 +49508,6 @@ var list_List = function List(props) {
49430
49508
  _props$itemsInView = props.itemsInView,
49431
49509
  itemsInView = _props$itemsInView === void 0 ? 10 : _props$itemsInView,
49432
49510
  lineHeightProp = props.lineHeight,
49433
- loading = props.loading,
49434
49511
  threshold = props.threshold,
49435
49512
  controlType = props.controlType,
49436
49513
  hideCreateOption = props.hideCreateOption,
@@ -50352,7 +50429,8 @@ var Root = function Root(props) {
50352
50429
 
50353
50430
 
50354
50431
 
50355
- var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "dragHoverExpand", "active", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum"];
50432
+
50433
+ var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "dragHoverExpand", "active", "setActive", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum"];
50356
50434
 
50357
50435
 
50358
50436
 
@@ -50391,10 +50469,11 @@ var Tree = function Tree(props) {
50391
50469
  dragSibling = props.dragSibling,
50392
50470
  unmatch = props.unmatch,
50393
50471
  dragHoverExpand = props.dragHoverExpand,
50394
- active = props.active,
50472
+ propActive = props.active,
50473
+ propSetActive = props.setActive,
50395
50474
  disabled = props.disabled,
50396
50475
  inlineNode = props.inlineNode,
50397
- highlight = props.highlight,
50476
+ propHighlight = props.highlight,
50398
50477
  className = props.className,
50399
50478
  onClick = props.onClick,
50400
50479
  loader = props.loader,
@@ -50408,6 +50487,17 @@ var Tree = function Tree(props) {
50408
50487
  onDragStart = props.onDragStart,
50409
50488
  propsDatum = props.datum,
50410
50489
  rest = objectWithoutProperties_default()(props, tree_excluded);
50490
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(propActive),
50491
+ _useState2 = slicedToArray_default()(_useState, 2),
50492
+ active = _useState2[0],
50493
+ setActive = _useState2[1];
50494
+ var isActiveControlled = ('active' in props);
50495
+ var highlight = propHighlight !== null && propHighlight !== void 0 ? propHighlight : isActiveControlled;
50496
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50497
+ if (isActiveControlled && propActive !== active) {
50498
+ setActive(propActive);
50499
+ }
50500
+ }, [active, propActive]);
50411
50501
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
50412
50502
  mounted: false
50413
50503
  }),
@@ -50446,14 +50536,14 @@ var Tree = function Tree(props) {
50446
50536
  });
50447
50537
  };
50448
50538
  var handleUpdateActive = function handleUpdateActive(active) {
50539
+ setActive(active);
50540
+ propSetActive === null || propSetActive === void 0 || propSetActive(active);
50449
50541
  datum.updateMap.forEach(function (update, id) {
50450
50542
  update('active', id === active);
50451
50543
  });
50452
50544
  };
50453
50545
  var handleNodeClick = function handleNodeClick(node, id) {
50454
- if (active === undefined) {
50455
- handleUpdateActive(id);
50456
- }
50546
+ handleUpdateActive(id);
50457
50547
  if (onClick) {
50458
50548
  onClick(node, id, datum.getPath(id));
50459
50549
  }
@@ -56080,6 +56170,49 @@ var BaseSwitch = function BaseSwitch(props) {
56080
56170
  var SwitchComp = src_switch_switch_0;
56081
56171
  SwitchComp.displayName = 'ShineoutSwitch';
56082
56172
  /* harmony default export */ var src_switch_0 = (SwitchComp);
56173
+ ;// CONCATENATED MODULE: ../hooks/src/common/use-scrollbar-width/index.ts
56174
+
56175
+
56176
+ var scrollbarWidthCache;
56177
+ function getScrollbarWidth() {
56178
+ // 检查是否在服务器端运行
56179
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
56180
+ return 0;
56181
+ }
56182
+
56183
+ // 如果我们的缓存变量已经存在,则直接返回该值
56184
+ if (scrollbarWidthCache !== undefined) {
56185
+ return scrollbarWidthCache;
56186
+ }
56187
+
56188
+ // 客户端环境,计算滚动条宽度
56189
+ var outer = document.createElement("div");
56190
+ outer.style.visibility = "hidden";
56191
+ outer.style.overflow = "scroll";
56192
+ document.body.appendChild(outer);
56193
+ var inner = document.createElement("div");
56194
+ outer.appendChild(inner);
56195
+ var scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
56196
+ if (outer.parentNode) outer.parentNode.removeChild(outer);
56197
+
56198
+ // 缓存并返回计算结果
56199
+ scrollbarWidthCache = scrollbarWidth;
56200
+ return scrollbarWidth;
56201
+ }
56202
+ function useScrollbarWidth() {
56203
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
56204
+ _useState2 = slicedToArray_default()(_useState, 2),
56205
+ scrollbarWidth = _useState2[0],
56206
+ setScrollbarWidth = _useState2[1];
56207
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56208
+ // 只有在客户端时才计算滚动条宽度
56209
+ if (typeof window !== 'undefined') {
56210
+ setScrollbarWidth(getScrollbarWidth());
56211
+ }
56212
+ }, []);
56213
+ return scrollbarWidth;
56214
+ }
56215
+ /* harmony default export */ var use_scrollbar_width = ((/* unused pure expression or super */ null && (useScrollbarWidth)));
56083
56216
  ;// CONCATENATED MODULE: ../hooks/src/components/use-table/use-table-columns.tsx
56084
56217
 
56085
56218
 
@@ -56240,6 +56373,7 @@ var useTableLayout = function useTableLayout(props) {
56240
56373
  return;
56241
56374
  }
56242
56375
  context.clientWidth = scrollEl.clientWidth;
56376
+ if (scrollEl.clientHeight === 0) return;
56243
56377
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
56244
56378
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
56245
56379
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
@@ -57014,6 +57148,8 @@ var useTableVirtual = function useTableVirtual(props) {
57014
57148
  }, [startIndex]);
57015
57149
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
57016
57150
  // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
57151
+ setTop(0);
57152
+ setStartIndex(0);
57017
57153
  return function () {
57018
57154
  context.preIndex = null;
57019
57155
  };
@@ -58299,7 +58435,9 @@ var emptyRef = {
58299
58435
  var theadRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58300
58436
  var tfootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58301
58437
  var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58438
+ var mirrorScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58302
58439
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58440
+ var browserScrollbarWidth = useScrollbarWidth();
58303
58441
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
58304
58442
  emptyHeight: 0
58305
58443
  }),
@@ -58454,6 +58592,9 @@ var emptyRef = {
58454
58592
  var target = e.currentTarget;
58455
58593
  if (!target) return;
58456
58594
  layoutFunc.checkFloat();
58595
+ if (mirrorScrollRef.current) {
58596
+ mirrorScrollRef.current.scrollLeft = target.scrollLeft;
58597
+ }
58457
58598
  if (props.onScroll && typeof props.onScroll === 'function') {
58458
58599
  var maxWidth = target.scrollWidth - target.clientWidth;
58459
58600
  var maxHeight = target.scrollHeight - target.clientHeight;
@@ -58465,6 +58606,9 @@ var emptyRef = {
58465
58606
  var handleVirtualScroll = usePersistFn(function (info) {
58466
58607
  virtualInfo.handleScroll(info);
58467
58608
  layoutFunc.checkFloat();
58609
+ if (mirrorScrollRef.current) {
58610
+ mirrorScrollRef.current.scrollLeft = info.scrollLeft;
58611
+ }
58468
58612
  if (props.onScroll && typeof props.onScroll === 'function') {
58469
58613
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
58470
58614
  }
@@ -58483,7 +58627,7 @@ var emptyRef = {
58483
58627
  });
58484
58628
  };
58485
58629
  var renderTable = function renderTable() {
58486
- var _props$summary, _sticky$top, _props$data3, _props$style, _props$data4;
58630
+ var _props$summary, _sticky$top, _props$style;
58487
58631
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
58488
58632
  colgroup: colgroup,
58489
58633
  columns: columns,
@@ -58544,7 +58688,7 @@ var emptyRef = {
58544
58688
  colgroup: colgroup
58545
58689
  };
58546
58690
  var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
58547
- var Wrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
58691
+ var StickyWrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
58548
58692
  var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
58549
58693
  top: 0
58550
58694
  };
@@ -58555,76 +58699,117 @@ var emptyRef = {
58555
58699
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
58556
58700
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
58557
58701
  };
58558
- var isRenderBaseTable = !virtual && !isScrollY && !props.sticky && ((_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : _props$data3.length) && !((_props$style = props.style) !== null && _props$style !== void 0 && _props$style.height) && !props.height;
58702
+ var isRenderVirtualTable = virtual || props.sticky || ((_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.height) || props.height;
58559
58703
  var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
58560
58704
  var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
58561
- if (isRenderBaseTable) {
58562
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58563
- ref: scrollRef,
58564
- className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
58565
- onScroll: handleBodyScroll,
58566
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58705
+ var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
58706
+ var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
58707
+ if (!props.showTopScrollbar) return null;
58708
+ var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.clientWidth) || 0;
58709
+ var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.scrollWidth) || 0;
58710
+ var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
58711
+ var showScroll = scrollRefScrollWidth > scrollRefWidth;
58712
+ // 开启了双滚,但是没有滚动条,不显示
58713
+ if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
58714
+ var scrollerStickyProps = objectSpread2_default()(objectSpread2_default()({}, stickyProps), {}, {
58715
+ top: ((sticky === null || sticky === void 0 ? void 0 : sticky.top) || browserScrollbarWidth) - browserScrollbarWidth
58716
+ });
58717
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? scrollerStickyProps : {}), {}, {
58718
+ style: {
58719
+ zIndex: defaultZIndex + 1
58720
+ },
58721
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58722
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headMirrorScroller,
58567
58723
  style: {
58568
- width: width
58724
+ height: browserScrollbarWidth,
58725
+ width: mirrorScrollRefWidth
58569
58726
  },
58570
- ref: tbodyRef,
58571
- children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
58727
+ onScroll: function onScroll(e) {
58728
+ var target = e.currentTarget;
58729
+ if (scrollRef !== null && scrollRef !== void 0 && scrollRef.current && scrollRef.current.scrollLeft !== target.scrollLeft) {
58730
+ scrollRef.current.scrollLeft = target.scrollLeft;
58731
+ }
58732
+ },
58733
+ ref: mirrorScrollRef,
58734
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58735
+ style: {
58736
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth,
58737
+ height: 1
58738
+ }
58739
+ })
58572
58740
  })
58573
- });
58574
- }
58575
- return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58576
- children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
58577
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58578
- className: headWrapperClass,
58741
+ }));
58742
+ };
58743
+ if (isRenderVirtualTable) {
58744
+ var _props$data3;
58745
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58746
+ children: [renderHeadMirrorScroller(), !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
58747
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58748
+ className: headWrapperClass,
58749
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58750
+ style: {
58751
+ width: width,
58752
+ transform: "translate3d(".concat(0 - virtualInfo.innerLeft, "px, 0, 0)")
58753
+ },
58754
+ ref: theadRef,
58755
+ children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()(objectSpread2_default()({}, headCommonProps), {}, {
58756
+ fixLeftNum: virtualInfo.innerLeft,
58757
+ fixRightNum: fixRightNum
58758
+ }))]
58759
+ })
58760
+ })
58761
+ })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
58762
+ style: scrollWrapperStyle,
58763
+ scrollerStyle: (_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length ? virtualScrollerStyle : table_emptyStyle,
58764
+ wrapperRef: scrollRef,
58765
+ scrollWidth: width || 1,
58766
+ scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
58767
+ onScroll: handleVirtualScroll,
58768
+ defaultHeight: context.emptyHeight,
58769
+ isScrollY: isScrollY,
58579
58770
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58580
58771
  style: {
58581
58772
  width: width,
58582
- transform: "translate3d(".concat(0 - virtualInfo.innerLeft, "px, 0, 0)")
58773
+ transform: virtualInfo.getTranslate()
58583
58774
  },
58584
- ref: theadRef,
58585
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()(objectSpread2_default()({}, headCommonProps), {}, {
58775
+ ref: tbodyRef,
58776
+ children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
58777
+ currentIndex: virtualInfo.startIndex,
58778
+ data: virtualInfo.data,
58779
+ setRowHeight: virtualInfo.setRowHeight,
58586
58780
  fixLeftNum: virtualInfo.innerLeft,
58587
58781
  fixRightNum: fixRightNum
58588
58782
  }))]
58589
58783
  })
58590
- })
58591
- })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
58592
- style: scrollWrapperStyle,
58593
- scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : table_emptyStyle,
58594
- wrapperRef: scrollRef,
58595
- scrollWidth: width || 1,
58596
- scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
58597
- onScroll: handleVirtualScroll,
58598
- defaultHeight: context.emptyHeight,
58599
- isScrollY: isScrollY,
58600
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58784
+ }), renderEmpty(), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58785
+ className: footWrapperClass,
58786
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58787
+ style: {
58788
+ width: width,
58789
+ transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
58790
+ },
58791
+ ref: tfootRef,
58792
+ children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()(objectSpread2_default()({}, footCommonProps), {}, {
58793
+ fixLeftNum: virtualInfo.innerLeft,
58794
+ fixRightNum: fixRightNum
58795
+ }))]
58796
+ })
58797
+ }) : null]
58798
+ });
58799
+ }
58800
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58801
+ children: [renderHeadMirrorScroller(), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
58802
+ ref: scrollRef,
58803
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
58804
+ onScroll: handleBodyScroll,
58805
+ children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58601
58806
  style: {
58602
- width: width,
58603
- transform: virtualInfo.getTranslate()
58807
+ width: width
58604
58808
  },
58605
58809
  ref: tbodyRef,
58606
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
58607
- currentIndex: virtualInfo.startIndex,
58608
- data: virtualInfo.data,
58609
- setRowHeight: virtualInfo.setRowHeight,
58610
- fixLeftNum: virtualInfo.innerLeft,
58611
- fixRightNum: fixRightNum
58612
- }))]
58613
- })
58614
- }), renderEmpty(), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58615
- className: footWrapperClass,
58616
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58617
- style: {
58618
- width: width,
58619
- transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
58620
- },
58621
- ref: tfootRef,
58622
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()(objectSpread2_default()({}, footCommonProps), {}, {
58623
- fixLeftNum: virtualInfo.innerLeft,
58624
- fixRightNum: fixRightNum
58625
- }))]
58626
- })
58627
- }) : null]
58810
+ children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
58811
+ }), renderEmpty()]
58812
+ })]
58628
58813
  });
58629
58814
  };
58630
58815
  var renderLoading = function renderLoading() {
@@ -58957,13 +59142,17 @@ var useTransform = function useTransform(props) {
58957
59142
  setAtStart(true);
58958
59143
  }
58959
59144
  var removeWheelListener;
59145
+ var removeScrollerListener;
58960
59146
  if (autoScroll) {
58961
59147
  var removeMouse = shouldScroll ? banOverScrollx(container) : null;
58962
59148
  removeWheelListener = addResizeObserver(container, handleResize);
59149
+ // 同时需要监听tabs-header-scroll的resize事件,防止tabs-header-scroll的宽度变化后不出现左右箭头的问题
59150
+ removeScrollerListener = addResizeObserver(target, handleResize);
58963
59151
  return function () {
58964
- var _removeWheelListener;
59152
+ var _removeWheelListener, _removeScrollerListen;
58965
59153
  removeMouse === null || removeMouse === void 0 || removeMouse();
58966
59154
  (_removeWheelListener = removeWheelListener) === null || _removeWheelListener === void 0 || _removeWheelListener();
59155
+ (_removeScrollerListen = removeScrollerListener) === null || _removeScrollerListen === void 0 || _removeScrollerListen();
58967
59156
  };
58968
59157
  }
58969
59158
  }, [containerRef.current, targetRef.current, shouldScroll]);
@@ -60810,6 +60999,7 @@ var TreeSelect = function TreeSelect(props0) {
60810
60999
  childrenKey: childrenKey,
60811
61000
  expanded: expandedProp,
60812
61001
  showHitDescendants: showHitDescendants,
61002
+ filterDelay: props.filterDelay,
60813
61003
  onAdvancedFilter: 'onAdvancedFilter' in props,
60814
61004
  onFilter: onAdvancedFilter || onFilterProp
60815
61005
  }),
@@ -64864,7 +65054,7 @@ var upload_interface = __webpack_require__(8821);
64864
65054
 
64865
65055
 
64866
65056
  /* harmony default export */ var src_0 = ({
64867
- version: '3.4.0-beta.9'
65057
+ version: '3.4.0'
64868
65058
  });
64869
65059
  }();
64870
65060
  /******/ return __webpack_exports__;