shineout 3.1.13 → 3.1.15

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 CHANGED
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.1.13'
479
+ version: '3.1.15'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11949,7 +11949,7 @@ var handleStyle = function handleStyle(style) {
11949
11949
  };
11950
11950
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11951
11951
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11952
- /* harmony default export */ var version = ('3.1.13');
11952
+ /* harmony default export */ var version = ('3.1.15');
11953
11953
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11954
11954
 
11955
11955
 
@@ -15504,7 +15504,9 @@ var cardStyle = {
15504
15504
  headerContent: objectSpread2_default()(objectSpread2_default()({}, headerCommon), {}, {
15505
15505
  flex: 1
15506
15506
  }),
15507
- simpleHeader: objectSpread2_default()({}, headerCommon),
15507
+ simpleHeader: objectSpread2_default()(objectSpread2_default()({}, headerCommon), {}, {
15508
+ display: 'block'
15509
+ }),
15508
15510
  center: {
15509
15511
  textAlign: 'center'
15510
15512
  },
@@ -20411,7 +20413,13 @@ var popoverStyle = {
20411
20413
  height: '8.4px',
20412
20414
  boxSizing: 'content-box',
20413
20415
  background: 'inherit',
20414
- borderBottom: 'none'
20416
+ borderBottom: 'none',
20417
+ '&[dir=ltr]': {
20418
+ borderLeftColor: 'transparent'
20419
+ },
20420
+ '&[dir=rtl]': {
20421
+ borderRight: 'transparent'
20422
+ }
20415
20423
  },
20416
20424
  '&[data-soui-position^="bottom"]': {
20417
20425
  marginTop: arrowGap - 2,
@@ -23448,10 +23456,10 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
23448
23456
  background: src.tableCellBorderColor,
23449
23457
  borderLeft: "1px solid ".concat(src.tableCellBorderColor)
23450
23458
  },
23451
- '&[dir=ltr]::after': {
23459
+ '[dir=ltr]&::after': {
23452
23460
  right: 0
23453
23461
  },
23454
- '&[dir=rtl]::after': {
23462
+ '[dir=rtl]&::after': {
23455
23463
  left: 0
23456
23464
  }
23457
23465
  }
@@ -25112,7 +25120,8 @@ var tooltipStyle = objectSpread2_default()(objectSpread2_default()({}, tooltip_a
25112
25120
  '&[data-soui-type^="light"]': {
25113
25121
  backgroundColor: src.tooltipLightBackgroundColor,
25114
25122
  color: src.tooltipLightColor,
25115
- border: "1px solid ".concat(src.tooltipLightBorderColor)
25123
+ border: "1px solid ".concat(src.tooltipLightBorderColor),
25124
+ boxSizing: 'border-box'
25116
25125
  },
25117
25126
  '&[data-soui-type^="primary"]': {
25118
25127
  backgroundColor: src.tooltipPrimaryBackgroundColor,
@@ -25136,12 +25145,12 @@ var tooltipStyle = objectSpread2_default()(objectSpread2_default()({}, tooltip_a
25136
25145
  content: '" "',
25137
25146
  display: 'block',
25138
25147
  border: "inherit",
25139
- borderLeft: 'none',
25148
+ borderLeftColor: 'transparent',
25140
25149
  width: '8.4px',
25141
25150
  height: '8.4px',
25142
25151
  boxSizing: 'content-box',
25143
25152
  background: 'inherit',
25144
- borderBottom: 'none'
25153
+ borderBottomColor: 'transparent'
25145
25154
  },
25146
25155
  '&[data-soui-position^="bottom"]': {
25147
25156
  marginTop: tooltip_arrowGap - 2,
@@ -25624,16 +25633,35 @@ var treeStyle = {
25624
25633
  cursor: 'pointer',
25625
25634
  padding: "0 ".concat(src.treePaddingX),
25626
25635
  borderRadius: src.treeContentBorderRadius,
25636
+ position: 'relative',
25637
+ '&[data-expanded="true"]::before': {
25638
+ content: '""',
25639
+ position: 'absolute',
25640
+ top: 24,
25641
+ bottom: 0,
25642
+ left: -12,
25643
+ width: 1,
25644
+ background: '#ebebeb'
25645
+ },
25646
+ '&[dir=ltr][data-expanded="true"]::before': {
25647
+ left: -12
25648
+ },
25649
+ '&[dir=rtl][data-expanded="true"]::before': {
25650
+ right: -12
25651
+ },
25627
25652
  '&[data-active="true"]': {
25628
25653
  background: src.treeContentActiveBackgroundColor,
25629
25654
  '& $text': {
25630
25655
  color: src.treeContentActiveFontColor
25631
25656
  }
25632
25657
  },
25633
- '&[data-disabled="true"]': {
25634
- cursor: 'not-allowed'
25635
- },
25636
- '&:hover:not([data-active="true"]):not([data-disabled="true"])': {
25658
+ // '&[data-disabled="true"]': {
25659
+ // cursor: 'not-allowed',
25660
+ // },
25661
+ // '&:hover:not([data-active="true"]):not([data-disabled="true"])': {
25662
+ // background: Token.treeContentHoverBackgroundColor,
25663
+ // },
25664
+ '&:hover:not([data-active="true"])': {
25637
25665
  background: src.treeContentHoverBackgroundColor
25638
25666
  }
25639
25667
  },
@@ -25650,9 +25678,9 @@ var treeStyle = {
25650
25678
  paddingTop: src.treeTextPaddingY,
25651
25679
  paddingBottom: src.treeTextPaddingY
25652
25680
  },
25653
- textDisabled: {
25654
- color: src.treeItemDisabledFontColor
25655
- },
25681
+ // textDisabled: {
25682
+ // color: Token.treeItemDisabledFontColor,
25683
+ // },
25656
25684
  list: {},
25657
25685
  node: {
25658
25686
  position: 'relative',
@@ -30158,11 +30186,12 @@ var CardHeader = function CardHeader(props) {
30158
30186
  })
30159
30187
  });
30160
30188
  };
30161
- var headerContentClassName = classnames_default()(cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.headerContent, align === 'center' && (cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.center), align === 'right' && (cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.right));
30189
+ var alignClass = classnames_default()(align === 'center' && (cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.center), align === 'right' && (cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.right));
30190
+ var headerContentClassName = classnames_default()(cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.headerContent, alignClass);
30162
30191
  if (!props.extra && !collapsible) {
30192
+ var simpleHeaderClassName = classnames_default()(cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.header, cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.simpleHeader, alignClass, props.className);
30163
30193
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
30164
- className: classnames_default()(cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.header, cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.simpleHeader, props.className),
30165
- style: props.style,
30194
+ className: simpleHeaderClassName,
30166
30195
  children: props.children
30167
30196
  });
30168
30197
  }
@@ -31826,7 +31855,8 @@ var Popover = function Popover(props) {
31826
31855
  onMouseLeave: events.onMouseLeave,
31827
31856
  dir: config.direction,
31828
31857
  children: [showArrow && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
31829
- className: popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.arrow
31858
+ className: popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.arrow,
31859
+ dir: config.direction
31830
31860
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
31831
31861
  style: style,
31832
31862
  className: classnames_default()(popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.content, (typeof childrened === 'string' || props.useTextStyle) && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.text)),
@@ -35970,8 +36000,8 @@ var result_Result = function Result(props) {
35970
36000
  var handleResetMore = function handleResetMore() {
35971
36001
  if (!compressed) return;
35972
36002
  if (isCompressedBound()) return;
35973
- setMore(-1);
35974
36003
  setShouldResetMore(true);
36004
+ setMore(-1);
35975
36005
  };
35976
36006
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
35977
36007
  if (!focus && mounted.current) {
@@ -35982,11 +36012,11 @@ var result_Result = function Result(props) {
35982
36012
  }
35983
36013
  mounted.current = true;
35984
36014
  }, [focus]);
35985
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36015
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
35986
36016
  setTimeout(handleResetMore);
35987
36017
  }, [valueProp, data]);
35988
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
35989
- if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || [].length)) {
36018
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
36019
+ if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || []).length) {
35990
36020
  var tagClassName = ".".concat(styles.tag.split(' ')[0]);
35991
36021
  if (shouldResetMore && result_isArray(value) && (value || []).length) {
35992
36022
  var newMore = getResetMore(showInput, resultRef.current, resultRef.current.querySelectorAll(tagClassName));
@@ -46695,7 +46725,7 @@ var Scroll = function Scroll(props) {
46695
46725
  position: 'sticky'
46696
46726
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46697
46727
  var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46698
- marginTop: Math.max(0, Math.floor(scrollHeight - height))
46728
+ marginTop: height > 0 && scrollHeight > 0 ? Math.max(0, Math.floor(scrollHeight - height)) : 0
46699
46729
  }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46700
46730
  var handleScroll = usePersistFn(function (e) {
46701
46731
  var target = e.currentTarget;
@@ -47435,7 +47465,8 @@ var NodeContent = function NodeContent(props) {
47435
47465
  var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
47436
47466
  var rootClass = classnames_default()(contentStyle.contentWrapper, defineProperty_default()(defineProperty_default()({}, contentStyle.childnode, data[childrenKey] && data[childrenKey].length > 0), contentStyle.inlineContent, inlineNode));
47437
47467
  var contentClass = classnames_default()(contentStyle.content, isString(contentClassProp) && contentClassProp, isFunc(contentClassProp) && contentClassProp(data));
47438
- var textClass = classnames_default()(contentStyle.text, disabled ? contentStyle.textDisabled : '');
47468
+ // const textClass = classNames(contentStyle.text, disabled ? contentStyle.textDisabled : '');
47469
+ var textClass = classnames_default()(contentStyle.text);
47439
47470
  var hasExpandIcons = expandIcons !== undefined;
47440
47471
  var children = data[childrenKey];
47441
47472
  var hasChildren = children && children.length > 0;
@@ -47444,9 +47475,9 @@ var NodeContent = function NodeContent(props) {
47444
47475
  if (highlight) {
47445
47476
  dataProps['data-active'] = active;
47446
47477
  }
47447
- if (disabled) {
47448
- dataProps['data-disabled'] = disabled;
47449
- }
47478
+ // if (disabled) {
47479
+ // dataProps['data-disabled'] = disabled;
47480
+ // }
47450
47481
  return dataProps;
47451
47482
  };
47452
47483
  var handleIndicatorClick = function handleIndicatorClick() {
@@ -47463,7 +47494,7 @@ var NodeContent = function NodeContent(props) {
47463
47494
  }
47464
47495
  };
47465
47496
  var handleNodeClick = function handleNodeClick() {
47466
- if (disabled) return;
47497
+ // if (disabled) return;
47467
47498
  if (parentClickExpand && hasChildren) {
47468
47499
  handleIndicatorClick();
47469
47500
  } else {
@@ -47550,6 +47581,7 @@ var NodeContent = function NodeContent(props) {
47550
47581
  dir: config.direction,
47551
47582
  children: [renderIndicator(), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
47552
47583
  dir: config.direction,
47584
+ "data-expanded": expanded,
47553
47585
  ref: bindContent,
47554
47586
  className: contentClass
47555
47587
  }, contentDataProps()), contentEvent), {}, {
@@ -47849,6 +47881,10 @@ var Node = function Node(props) {
47849
47881
  onChange: onChange,
47850
47882
  onToggle: onToggle,
47851
47883
  onNodeClick: onNodeClick,
47884
+ onDragOver: onDragOver,
47885
+ onDragLeave: onDragLeave,
47886
+ onDragStart: onDragStart,
47887
+ onDragEnd: onDragEnd,
47852
47888
  bindNode: bindNode,
47853
47889
  childrenClassName: childrenClass(data),
47854
47890
  childrenKey: childrenKey,
@@ -48898,16 +48934,6 @@ function Select(props0) {
48898
48934
  }),
48899
48935
  groupData = _useGroup.data,
48900
48936
  groupKey = _useGroup.groupKey;
48901
-
48902
- // const triggerOpen = usePersistFn(() => {
48903
- // if (disabled === true) return;
48904
- // if (open) {
48905
- // closePop();
48906
- // } else {
48907
- // openPop();
48908
- // }
48909
- // });
48910
-
48911
48937
  var focusAndOpen = function focusAndOpen() {
48912
48938
  if (!focused) {
48913
48939
  var _inputRef$current2;
@@ -49314,7 +49340,7 @@ function Select(props0) {
49314
49340
  children: [tipNode, renderResult(), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
49315
49341
  adjust: true,
49316
49342
  focus: open,
49317
- fixedWidth: autoAdapt ? 'min' : true,
49343
+ fixedWidth: !props.columns && (autoAdapt ? 'min' : true),
49318
49344
  absolute: props.absolute,
49319
49345
  zIndex: props.zIndex,
49320
49346
  position: position,
@@ -53236,6 +53262,7 @@ StepsComp.Step = StepsStep;
53236
53262
  var sticky_cssSupport = cssSupport;
53237
53263
  var supportSticky = sticky_cssSupport('position', 'sticky');
53238
53264
  var defaultZIndex = 900;
53265
+ var events = ['scroll', 'pageshow', 'load', 'resize'];
53239
53266
 
53240
53267
  // const getFirstScrollParent = (el: HTMLElement) => {
53241
53268
  // let parent = el.parentNode as HTMLElement;
@@ -53254,7 +53281,6 @@ var defaultZIndex = 900;
53254
53281
  // };
53255
53282
 
53256
53283
  var Sticky = function Sticky(props) {
53257
- var _props$style;
53258
53284
  var children = props.children,
53259
53285
  top = props.top,
53260
53286
  bottom = props.bottom;
@@ -53264,7 +53290,8 @@ var Sticky = function Sticky(props) {
53264
53290
  div: null,
53265
53291
  observer: null,
53266
53292
  parentObserver: null,
53267
- isTop: false
53293
+ isTop: false,
53294
+ bodyObserver: null
53268
53295
  }),
53269
53296
  context = _useRef.current;
53270
53297
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({}),
@@ -53281,10 +53308,6 @@ var Sticky = function Sticky(props) {
53281
53308
  setParentVisible = _useState6[1];
53282
53309
  var forceRender = useRender();
53283
53310
  var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
53284
- var elementSize = useResize({
53285
- targetRef: elementRef,
53286
- timer: 0
53287
- });
53288
53311
  var getTarget = function getTarget() {
53289
53312
  var scrollContainer = props.scrollContainer;
53290
53313
  if (typeof scrollContainer === 'string') {
@@ -53294,11 +53317,10 @@ var Sticky = function Sticky(props) {
53294
53317
  if (scrollContainer && scrollContainer.nodeType === 1) {
53295
53318
  return scrollContainer;
53296
53319
  }
53297
- return document.body;
53320
+ return null;
53298
53321
  };
53299
53322
  var updateStyle = usePersistFn(function () {
53300
53323
  if (context.div && !context.isTop && show) {
53301
- var shouldFixed = context.target === document.body;
53302
53324
  var scrollRect = context.target.getBoundingClientRect();
53303
53325
  var targetRect = elementRef.current.getBoundingClientRect();
53304
53326
  var targetLeft = targetRect.left;
@@ -53307,7 +53329,7 @@ var Sticky = function Sticky(props) {
53307
53329
  if (typeof bottom === 'number') {
53308
53330
  var outRootRect = context.target.getBoundingClientRect();
53309
53331
  var _style = {
53310
- position: shouldFixed ? 'fixed' : 'absolute',
53332
+ position: 'absolute',
53311
53333
  width: "".concat(width, "px"),
53312
53334
  height: "".concat(height, "px"),
53313
53335
  top: "".concat(scrollRect.bottom - (props.bottom || 0) - outRootRect.top, "px"),
@@ -53318,19 +53340,13 @@ var Sticky = function Sticky(props) {
53318
53340
  }
53319
53341
  }
53320
53342
  });
53321
- var handlePosition = usePersistFn(function (entries) {
53343
+ var handleTargetPosition = usePersistFn(function (entries) {
53322
53344
  var entry = entries[0];
53323
53345
  var scrollRect = entry.rootBounds;
53324
53346
  var targetRect = entry.boundingClientRect;
53325
- var shouldFixed = context.target === document.body;
53326
53347
  if (!entry.isIntersecting) {
53327
53348
  var targetLeft = targetRect.left;
53328
- var outRootRect = shouldFixed ? {
53329
- top: 0,
53330
- bottom: 0,
53331
- left: 0,
53332
- right: 0
53333
- } : context.div.getBoundingClientRect();
53349
+ var outRootRect = context.div.getBoundingClientRect();
53334
53350
  var width = targetRect.width,
53335
53351
  height = targetRect.height;
53336
53352
  if (scrollRect && targetRect.bottom < scrollRect.bottom) {
@@ -53339,7 +53355,7 @@ var Sticky = function Sticky(props) {
53339
53355
  if (typeof top === 'number') {
53340
53356
  setShow(true);
53341
53357
  var _style2 = {
53342
- position: shouldFixed ? 'fixed' : 'absolute',
53358
+ position: 'absolute',
53343
53359
  width: "".concat(width, "px"),
53344
53360
  height: "".concat(height, "px"),
53345
53361
  top: "".concat(scrollRect.top - outRootRect.top, "px"),
@@ -53354,7 +53370,7 @@ var Sticky = function Sticky(props) {
53354
53370
  setShow(true);
53355
53371
  var _outRootRect = context.target.getBoundingClientRect();
53356
53372
  var _style3 = {
53357
- position: shouldFixed ? 'fixed' : 'absolute',
53373
+ position: 'absolute',
53358
53374
  width: "".concat(width, "px"),
53359
53375
  height: "".concat(height, "px"),
53360
53376
  top: "".concat(scrollRect.bottom - _outRootRect.top, "px"),
@@ -53377,7 +53393,58 @@ var Sticky = function Sticky(props) {
53377
53393
  setParentVisible(false);
53378
53394
  }
53379
53395
  });
53380
- var cleanEvents = function cleanEvents() {
53396
+ var handleFixedPosition = usePersistFn(function () {
53397
+ var element = elementRef.current;
53398
+ if (!element) return;
53399
+ var selfRect = element.getBoundingClientRect();
53400
+ if (selfRect === null) return;
53401
+ // If the element is hidden, the width and height will be 0
53402
+ if (selfRect && selfRect.width === 0 && selfRect.height === 0) return;
53403
+ // const { marginBottom, marginTop } = getComputedStyle(element);
53404
+ // selfRect.height += parseFloat(marginBottom) + parseFloat(marginTop);
53405
+ var scrollElement = document.body;
53406
+ var scrollRect = scrollElement.getBoundingClientRect();
53407
+ var top = props.top,
53408
+ bottom = props.bottom;
53409
+ if (top !== undefined && Math.ceil(selfRect.top) <= top) {
53410
+ setShow(true);
53411
+ setStyle({
53412
+ position: 'fixed',
53413
+ top: top,
53414
+ left: "".concat(selfRect.left, "px"),
53415
+ width: "".concat(selfRect.width, "px")
53416
+ });
53417
+ return;
53418
+ } else if (bottom !== undefined && Math.ceil(selfRect.bottom) + bottom > scrollRect.bottom) {
53419
+ setShow(true);
53420
+ setStyle({
53421
+ position: 'fixed',
53422
+ bottom: bottom,
53423
+ left: "".concat(selfRect.left, "px"),
53424
+ width: "".concat(selfRect.width, "px")
53425
+ });
53426
+ return;
53427
+ } else {
53428
+ setShow(false);
53429
+ }
53430
+ });
53431
+ var elementSize = useResize({
53432
+ targetRef: elementRef,
53433
+ timer: 0,
53434
+ cb: handleFixedPosition
53435
+ });
53436
+ var createBodyObserver = function createBodyObserver() {
53437
+ if (context.bodyObserver) {
53438
+ context.bodyObserver.disconnect();
53439
+ }
53440
+ context.bodyObserver = new IntersectionObserver(handleFixedPosition, {
53441
+ root: null,
53442
+ rootMargin: "-".concat(top || 0, "px 0px -").concat(bottom || 0, "px 0px"),
53443
+ threshold: 1.0
53444
+ });
53445
+ context.bodyObserver.observe(elementRef.current);
53446
+ };
53447
+ var cancelObserver = function cancelObserver() {
53381
53448
  if (context.observer) {
53382
53449
  context.observer.disconnect();
53383
53450
  context.observer = null;
@@ -53386,18 +53453,15 @@ var Sticky = function Sticky(props) {
53386
53453
  context.parentObserver.disconnect();
53387
53454
  context.parentObserver = null;
53388
53455
  }
53389
- window.removeEventListener('resize', updateStyle);
53390
53456
  };
53391
- var createObserver = function createObserver() {
53392
- var target = getTarget();
53393
- if (!context.div && target !== document.body) {
53457
+ var createObserver = function createObserver(target) {
53458
+ if (!context.div) {
53394
53459
  context.div = document.createElement('div');
53395
53460
  context.div.style.position = 'relative';
53396
53461
  }
53397
- if (target && target !== context.target) {
53462
+ if (target) {
53398
53463
  forceRender();
53399
- context.target = target;
53400
- cleanEvents();
53464
+ cancelObserver();
53401
53465
  if (context.div) {
53402
53466
  // append div
53403
53467
  if (target === document.body) {
@@ -53415,7 +53479,7 @@ var Sticky = function Sticky(props) {
53415
53479
  }
53416
53480
  }
53417
53481
  if (window.IntersectionObserver) {
53418
- var observer = new IntersectionObserver(handlePosition, {
53482
+ var observer = new IntersectionObserver(handleTargetPosition, {
53419
53483
  root: target,
53420
53484
  rootMargin: "-".concat(top || 0, "px 0px -").concat(bottom || 0, "px 0px"),
53421
53485
  threshold: 1.0
@@ -53438,17 +53502,34 @@ var Sticky = function Sticky(props) {
53438
53502
  }
53439
53503
  };
53440
53504
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
53441
- if (!css) {
53442
- createObserver();
53505
+ if (css) return;
53506
+ var target = getTarget();
53507
+ context.target = target;
53508
+ if (target) {
53509
+ createObserver(target);
53443
53510
  window.addEventListener('resize', updateStyle);
53511
+ return function () {
53512
+ cancelObserver();
53513
+ window.removeEventListener('resize', updateStyle);
53514
+ if (context.div) {
53515
+ context.div.remove();
53516
+ }
53517
+ };
53518
+ } else {
53519
+ // fixed 布局
53520
+ createBodyObserver();
53521
+ events.forEach(function (event) {
53522
+ window.addEventListener(event, handleFixedPosition);
53523
+ });
53524
+ return function () {
53525
+ if (context.bodyObserver) {
53526
+ context.bodyObserver.disconnect();
53527
+ }
53528
+ events.forEach(function (event) {
53529
+ window.removeEventListener(event, handleFixedPosition);
53530
+ });
53531
+ };
53444
53532
  }
53445
- return function () {
53446
- cleanEvents();
53447
- if (context.div) {
53448
- context.div.remove();
53449
- context.div = null;
53450
- }
53451
- };
53452
53533
  }, [css]);
53453
53534
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
53454
53535
  if (props.parent && context.parentObserver) {
@@ -53490,12 +53571,14 @@ var Sticky = function Sticky(props) {
53490
53571
  })
53491
53572
  }) : null;
53492
53573
  var isFixed = style.position === 'fixed';
53574
+ var hideStyle = {
53575
+ opacity: 0,
53576
+ pointerEvents: 'none'
53577
+ };
53493
53578
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
53494
53579
  children: [isFixed ? StickyEl : context.target && context.div && /*#__PURE__*/(0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.createPortal)(StickyEl, context.div), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
53495
53580
  className: props.className,
53496
- style: objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
53497
- opacity: show && parentVisible ? 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.opacity
53498
- }),
53581
+ style: objectSpread2_default()(objectSpread2_default()({}, props.style), show && parentVisible ? hideStyle : {}),
53499
53582
  ref: handleElementRef,
53500
53583
  children: children
53501
53584
  })]
@@ -62181,7 +62264,7 @@ var upload_interface = __webpack_require__(4412);
62181
62264
 
62182
62265
 
62183
62266
  /* harmony default export */ var src_0 = ({
62184
- version: '3.1.13'
62267
+ version: '3.1.15'
62185
62268
  });
62186
62269
  }();
62187
62270
  /******/ return __webpack_exports__;