shineout 3.4.0-beta.8 → 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.8');
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);
@@ -44591,7 +44662,8 @@ var Dropdown = function Dropdown(props) {
44591
44662
  className = props.className,
44592
44663
  size = props.size,
44593
44664
  animation = props.animation,
44594
- hideArrow = props.hideArrow;
44665
+ hideArrow = props.hideArrow,
44666
+ zIndex = props.zIndex;
44595
44667
  var dropdownClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$dropdown = jssStyle.dropdown) === null || _jssStyle$dropdown === void 0 ? void 0 : _jssStyle$dropdown.call(jssStyle);
44596
44668
  var config = useConfig();
44597
44669
  var isRtl = config.direction === 'rtl';
@@ -44740,6 +44812,7 @@ var Dropdown = function Dropdown(props) {
44740
44812
  focus: open,
44741
44813
  parentElRef: targetRef,
44742
44814
  absolute: absolute,
44815
+ zIndex: zIndex,
44743
44816
  fixedWidth: 'min',
44744
44817
  popupGap: 4,
44745
44818
  popupElRef: popupRef,
@@ -45050,6 +45123,7 @@ var useAutoSize = function useAutoSize(props) {
45050
45123
 
45051
45124
 
45052
45125
 
45126
+
45053
45127
  var textarea_excluded = ["info", "suffix", "renderFooter", "width", "style", "jssStyle", "onBlur", "status", "trim", "delay"];
45054
45128
 
45055
45129
 
@@ -45162,8 +45236,17 @@ var textarea_Textarea = function Textarea(props0) {
45162
45236
  var forwardProps = removeProps(resetProps, objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, inputAbleParams), autosizeParams), tipProps), formatParams), innerTitleProps));
45163
45237
  var getInfo = function getInfo() {
45164
45238
  var notNumber = typeof info !== 'number';
45165
- if (typeof info !== 'function' && notNumber) return null;
45166
- 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);
45167
45250
  var res = textInfo(inputAbleProps.value);
45168
45251
  // empty
45169
45252
  if (!res) return null;
@@ -45175,7 +45258,7 @@ var textarea_Textarea = function Textarea(props0) {
45175
45258
  minWidth: 'auto'
45176
45259
  },
45177
45260
  dir: config.direction,
45178
- 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)),
45179
45262
  children: text
45180
45263
  }, 'info');
45181
45264
  };
@@ -48738,8 +48821,7 @@ var Scroll = function Scroll(props) {
48738
48821
  var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
48739
48822
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
48740
48823
  timer: null,
48741
- isMouseDown: false,
48742
- lastPaddingTop: 0
48824
+ isMouseDown: false
48743
48825
  }),
48744
48826
  context = _useRef.current;
48745
48827
  var _props$scrollHeight = props.scrollHeight,
@@ -48768,13 +48850,11 @@ var Scroll = function Scroll(props) {
48768
48850
  overflow: 'hidden',
48769
48851
  position: 'sticky'
48770
48852
  }, isRtl ? 'right' : 'left', 0), "top", 0);
48771
- var pd = context.lastPaddingTop;
48772
- if (height > 0 && scrollHeight > 0) {
48773
- pd = Math.max(0, Math.floor(scrollHeight - height));
48774
- context.lastPaddingTop = pd;
48775
- }
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]);
48776
48856
  var placeStyle = {
48777
- paddingTop: pd,
48857
+ paddingTop: paddingTop,
48778
48858
  width: scrollWidth,
48779
48859
  overflow: props.isScrollY ? 'hidden' : 'auto hidden',
48780
48860
  height: props.isScrollY ? 0 : 1,
@@ -48907,7 +48987,7 @@ var VirtualList = function VirtualList(props) {
48907
48987
  var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
48908
48988
  _useState8 = slicedToArray_default()(_useState7, 2),
48909
48989
  startIndex = _useState8[0],
48910
- setCurrentIndex = _useState8[1];
48990
+ setStartIndex = _useState8[1];
48911
48991
  var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
48912
48992
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
48913
48993
  cachedHeight: [],
@@ -48986,7 +49066,7 @@ var VirtualList = function VirtualList(props) {
48986
49066
  }
48987
49067
  }
48988
49068
  if (nextCurrentIndex !== startIndex) {
48989
- setCurrentIndex(nextCurrentIndex);
49069
+ setStartIndex(nextCurrentIndex);
48990
49070
  }
48991
49071
  setTop(top);
48992
49072
  };
@@ -49002,8 +49082,7 @@ var VirtualList = function VirtualList(props) {
49002
49082
  };
49003
49083
  var handleScroll = function handleScroll(info) {
49004
49084
  var _props$onScroll;
49005
- var scrollLeft = info.scrollLeft,
49006
- height = info.height,
49085
+ var height = info.height,
49007
49086
  y = info.y,
49008
49087
  fromDrag = info.fromDrag;
49009
49088
  var scrollTop = info.scrollTop;
@@ -49028,7 +49107,7 @@ var VirtualList = function VirtualList(props) {
49028
49107
  var renderList = function renderList() {
49029
49108
  var items = data.slice(startIndex, startIndex + rowsInView);
49030
49109
  var Tag = tag;
49031
- var shouldScroll = data.length * lineHeight > height;
49110
+ var shouldScroll = getContentHeight(data.length - 1) > height;
49032
49111
  var nextStyle = objectSpread2_default()({}, style);
49033
49112
  if (shouldScroll) nextStyle.height = height;
49034
49113
  var scrollHeight = getContentHeight(data.length - 1);
@@ -49063,11 +49142,19 @@ var VirtualList = function VirtualList(props) {
49063
49142
  });
49064
49143
  };
49065
49144
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49066
- 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
+ };
49067
49155
  }, [data.length]);
49068
49156
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49069
49157
  if (offsetY) {
49070
- // if (wrapperRef.current && props.innerRef.current) {
49071
49158
  if (wrapperRef.current) {
49072
49159
  setOffsetY(0);
49073
49160
  setTop(function (s) {
@@ -49078,11 +49165,8 @@ var VirtualList = function VirtualList(props) {
49078
49165
  }
49079
49166
  }, [offsetY, startIndex]);
49080
49167
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49081
- // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
49082
- return function () {
49083
- context.preIndex = null;
49084
- };
49085
- }, [props.data]);
49168
+ setHeight(getContentHeight(props.data.length - 1));
49169
+ }, [data.length]);
49086
49170
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49087
49171
  if (context.heightCallback) {
49088
49172
  var cb = context.heightCallback;
@@ -49090,10 +49174,6 @@ var VirtualList = function VirtualList(props) {
49090
49174
  cb();
49091
49175
  }
49092
49176
  }, [scrollHeight]);
49093
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49094
- // 记录preIndex
49095
- context.preIndex = startIndex;
49096
- }, [startIndex]);
49097
49177
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
49098
49178
  if (virtualRef !== null && virtualRef !== void 0 && virtualRef.current) {
49099
49179
  virtualRef.current.scrollByStep = handleScrollByStep;
@@ -49428,7 +49508,6 @@ var list_List = function List(props) {
49428
49508
  _props$itemsInView = props.itemsInView,
49429
49509
  itemsInView = _props$itemsInView === void 0 ? 10 : _props$itemsInView,
49430
49510
  lineHeightProp = props.lineHeight,
49431
- loading = props.loading,
49432
49511
  threshold = props.threshold,
49433
49512
  controlType = props.controlType,
49434
49513
  hideCreateOption = props.hideCreateOption,
@@ -50350,7 +50429,8 @@ var Root = function Root(props) {
50350
50429
 
50351
50430
 
50352
50431
 
50353
- 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"];
50354
50434
 
50355
50435
 
50356
50436
 
@@ -50389,10 +50469,11 @@ var Tree = function Tree(props) {
50389
50469
  dragSibling = props.dragSibling,
50390
50470
  unmatch = props.unmatch,
50391
50471
  dragHoverExpand = props.dragHoverExpand,
50392
- active = props.active,
50472
+ propActive = props.active,
50473
+ propSetActive = props.setActive,
50393
50474
  disabled = props.disabled,
50394
50475
  inlineNode = props.inlineNode,
50395
- highlight = props.highlight,
50476
+ propHighlight = props.highlight,
50396
50477
  className = props.className,
50397
50478
  onClick = props.onClick,
50398
50479
  loader = props.loader,
@@ -50406,6 +50487,17 @@ var Tree = function Tree(props) {
50406
50487
  onDragStart = props.onDragStart,
50407
50488
  propsDatum = props.datum,
50408
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]);
50409
50501
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
50410
50502
  mounted: false
50411
50503
  }),
@@ -50444,14 +50536,14 @@ var Tree = function Tree(props) {
50444
50536
  });
50445
50537
  };
50446
50538
  var handleUpdateActive = function handleUpdateActive(active) {
50539
+ setActive(active);
50540
+ propSetActive === null || propSetActive === void 0 || propSetActive(active);
50447
50541
  datum.updateMap.forEach(function (update, id) {
50448
50542
  update('active', id === active);
50449
50543
  });
50450
50544
  };
50451
50545
  var handleNodeClick = function handleNodeClick(node, id) {
50452
- if (active === undefined) {
50453
- handleUpdateActive(id);
50454
- }
50546
+ handleUpdateActive(id);
50455
50547
  if (onClick) {
50456
50548
  onClick(node, id, datum.getPath(id));
50457
50549
  }
@@ -56078,6 +56170,49 @@ var BaseSwitch = function BaseSwitch(props) {
56078
56170
  var SwitchComp = src_switch_switch_0;
56079
56171
  SwitchComp.displayName = 'ShineoutSwitch';
56080
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)));
56081
56216
  ;// CONCATENATED MODULE: ../hooks/src/components/use-table/use-table-columns.tsx
56082
56217
 
56083
56218
 
@@ -56238,6 +56373,7 @@ var useTableLayout = function useTableLayout(props) {
56238
56373
  return;
56239
56374
  }
56240
56375
  context.clientWidth = scrollEl.clientWidth;
56376
+ if (scrollEl.clientHeight === 0) return;
56241
56377
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
56242
56378
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
56243
56379
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
@@ -57012,6 +57148,8 @@ var useTableVirtual = function useTableVirtual(props) {
57012
57148
  }, [startIndex]);
57013
57149
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
57014
57150
  // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
57151
+ setTop(0);
57152
+ setStartIndex(0);
57015
57153
  return function () {
57016
57154
  context.preIndex = null;
57017
57155
  };
@@ -58297,7 +58435,9 @@ var emptyRef = {
58297
58435
  var theadRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58298
58436
  var tfootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58299
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);
58300
58439
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58440
+ var browserScrollbarWidth = useScrollbarWidth();
58301
58441
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
58302
58442
  emptyHeight: 0
58303
58443
  }),
@@ -58452,6 +58592,9 @@ var emptyRef = {
58452
58592
  var target = e.currentTarget;
58453
58593
  if (!target) return;
58454
58594
  layoutFunc.checkFloat();
58595
+ if (mirrorScrollRef.current) {
58596
+ mirrorScrollRef.current.scrollLeft = target.scrollLeft;
58597
+ }
58455
58598
  if (props.onScroll && typeof props.onScroll === 'function') {
58456
58599
  var maxWidth = target.scrollWidth - target.clientWidth;
58457
58600
  var maxHeight = target.scrollHeight - target.clientHeight;
@@ -58463,6 +58606,9 @@ var emptyRef = {
58463
58606
  var handleVirtualScroll = usePersistFn(function (info) {
58464
58607
  virtualInfo.handleScroll(info);
58465
58608
  layoutFunc.checkFloat();
58609
+ if (mirrorScrollRef.current) {
58610
+ mirrorScrollRef.current.scrollLeft = info.scrollLeft;
58611
+ }
58466
58612
  if (props.onScroll && typeof props.onScroll === 'function') {
58467
58613
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
58468
58614
  }
@@ -58481,7 +58627,7 @@ var emptyRef = {
58481
58627
  });
58482
58628
  };
58483
58629
  var renderTable = function renderTable() {
58484
- var _props$summary, _sticky$top, _props$data3, _props$style, _props$data4;
58630
+ var _props$summary, _sticky$top, _props$style;
58485
58631
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
58486
58632
  colgroup: colgroup,
58487
58633
  columns: columns,
@@ -58542,7 +58688,7 @@ var emptyRef = {
58542
58688
  colgroup: colgroup
58543
58689
  };
58544
58690
  var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
58545
- 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;
58546
58692
  var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
58547
58693
  top: 0
58548
58694
  };
@@ -58553,76 +58699,117 @@ var emptyRef = {
58553
58699
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
58554
58700
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
58555
58701
  };
58556
- 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;
58557
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));
58558
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));
58559
- if (isRenderBaseTable) {
58560
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58561
- ref: scrollRef,
58562
- className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
58563
- onScroll: handleBodyScroll,
58564
- 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,
58565
58723
  style: {
58566
- width: width
58724
+ height: browserScrollbarWidth,
58725
+ width: mirrorScrollRefWidth
58567
58726
  },
58568
- ref: tbodyRef,
58569
- 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
+ })
58570
58740
  })
58571
- });
58572
- }
58573
- return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58574
- children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
58575
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58576
- 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,
58577
58770
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58578
58771
  style: {
58579
58772
  width: width,
58580
- transform: "translate3d(".concat(0 - virtualInfo.innerLeft, "px, 0, 0)")
58773
+ transform: virtualInfo.getTranslate()
58581
58774
  },
58582
- ref: theadRef,
58583
- 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,
58584
58780
  fixLeftNum: virtualInfo.innerLeft,
58585
58781
  fixRightNum: fixRightNum
58586
58782
  }))]
58587
58783
  })
58588
- })
58589
- })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
58590
- style: scrollWrapperStyle,
58591
- scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : table_emptyStyle,
58592
- wrapperRef: scrollRef,
58593
- scrollWidth: width || 1,
58594
- scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
58595
- onScroll: handleVirtualScroll,
58596
- defaultHeight: context.emptyHeight,
58597
- isScrollY: isScrollY,
58598
- 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", {
58599
58806
  style: {
58600
- width: width,
58601
- transform: virtualInfo.getTranslate()
58807
+ width: width
58602
58808
  },
58603
58809
  ref: tbodyRef,
58604
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
58605
- currentIndex: virtualInfo.startIndex,
58606
- data: virtualInfo.data,
58607
- setRowHeight: virtualInfo.setRowHeight,
58608
- fixLeftNum: virtualInfo.innerLeft,
58609
- fixRightNum: fixRightNum
58610
- }))]
58611
- })
58612
- }), renderEmpty(), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58613
- className: footWrapperClass,
58614
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
58615
- style: {
58616
- width: width,
58617
- transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
58618
- },
58619
- ref: tfootRef,
58620
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()(objectSpread2_default()({}, footCommonProps), {}, {
58621
- fixLeftNum: virtualInfo.innerLeft,
58622
- fixRightNum: fixRightNum
58623
- }))]
58624
- })
58625
- }) : 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
+ })]
58626
58813
  });
58627
58814
  };
58628
58815
  var renderLoading = function renderLoading() {
@@ -58955,13 +59142,17 @@ var useTransform = function useTransform(props) {
58955
59142
  setAtStart(true);
58956
59143
  }
58957
59144
  var removeWheelListener;
59145
+ var removeScrollerListener;
58958
59146
  if (autoScroll) {
58959
59147
  var removeMouse = shouldScroll ? banOverScrollx(container) : null;
58960
59148
  removeWheelListener = addResizeObserver(container, handleResize);
59149
+ // 同时需要监听tabs-header-scroll的resize事件,防止tabs-header-scroll的宽度变化后不出现左右箭头的问题
59150
+ removeScrollerListener = addResizeObserver(target, handleResize);
58961
59151
  return function () {
58962
- var _removeWheelListener;
59152
+ var _removeWheelListener, _removeScrollerListen;
58963
59153
  removeMouse === null || removeMouse === void 0 || removeMouse();
58964
59154
  (_removeWheelListener = removeWheelListener) === null || _removeWheelListener === void 0 || _removeWheelListener();
59155
+ (_removeScrollerListen = removeScrollerListener) === null || _removeScrollerListen === void 0 || _removeScrollerListen();
58965
59156
  };
58966
59157
  }
58967
59158
  }, [containerRef.current, targetRef.current, shouldScroll]);
@@ -60808,6 +60999,7 @@ var TreeSelect = function TreeSelect(props0) {
60808
60999
  childrenKey: childrenKey,
60809
61000
  expanded: expandedProp,
60810
61001
  showHitDescendants: showHitDescendants,
61002
+ filterDelay: props.filterDelay,
60811
61003
  onAdvancedFilter: 'onAdvancedFilter' in props,
60812
61004
  onFilter: onAdvancedFilter || onFilterProp
60813
61005
  }),
@@ -64862,7 +65054,7 @@ var upload_interface = __webpack_require__(8821);
64862
65054
 
64863
65055
 
64864
65056
  /* harmony default export */ var src_0 = ({
64865
- version: '3.4.0-beta.8'
65057
+ version: '3.4.0'
64866
65058
  });
64867
65059
  }();
64868
65060
  /******/ return __webpack_exports__;