shineout 3.1.14 → 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.14'
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.14');
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
  },
@@ -23454,10 +23456,10 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
23454
23456
  background: src.tableCellBorderColor,
23455
23457
  borderLeft: "1px solid ".concat(src.tableCellBorderColor)
23456
23458
  },
23457
- '&[dir=ltr]::after': {
23459
+ '[dir=ltr]&::after': {
23458
23460
  right: 0
23459
23461
  },
23460
- '&[dir=rtl]::after': {
23462
+ '[dir=rtl]&::after': {
23461
23463
  left: 0
23462
23464
  }
23463
23465
  }
@@ -30184,11 +30186,12 @@ var CardHeader = function CardHeader(props) {
30184
30186
  })
30185
30187
  });
30186
30188
  };
30187
- 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);
30188
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);
30189
30193
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
30190
- className: classnames_default()(cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.header, cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.simpleHeader, props.className),
30191
- style: props.style,
30194
+ className: simpleHeaderClassName,
30192
30195
  children: props.children
30193
30196
  });
30194
30197
  }
@@ -35997,8 +36000,8 @@ var result_Result = function Result(props) {
35997
36000
  var handleResetMore = function handleResetMore() {
35998
36001
  if (!compressed) return;
35999
36002
  if (isCompressedBound()) return;
36000
- setMore(-1);
36001
36003
  setShouldResetMore(true);
36004
+ setMore(-1);
36002
36005
  };
36003
36006
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36004
36007
  if (!focus && mounted.current) {
@@ -36009,11 +36012,11 @@ var result_Result = function Result(props) {
36009
36012
  }
36010
36013
  mounted.current = true;
36011
36014
  }, [focus]);
36012
- (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 () {
36013
36016
  setTimeout(handleResetMore);
36014
36017
  }, [valueProp, data]);
36015
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36016
- 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) {
36017
36020
  var tagClassName = ".".concat(styles.tag.split(' ')[0]);
36018
36021
  if (shouldResetMore && result_isArray(value) && (value || []).length) {
36019
36022
  var newMore = getResetMore(showInput, resultRef.current, resultRef.current.querySelectorAll(tagClassName));
@@ -46722,7 +46725,7 @@ var Scroll = function Scroll(props) {
46722
46725
  position: 'sticky'
46723
46726
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46724
46727
  var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46725
- marginTop: Math.max(0, Math.floor(scrollHeight - height))
46728
+ marginTop: height > 0 && scrollHeight > 0 ? Math.max(0, Math.floor(scrollHeight - height)) : 0
46726
46729
  }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46727
46730
  var handleScroll = usePersistFn(function (e) {
46728
46731
  var target = e.currentTarget;
@@ -48931,16 +48934,6 @@ function Select(props0) {
48931
48934
  }),
48932
48935
  groupData = _useGroup.data,
48933
48936
  groupKey = _useGroup.groupKey;
48934
-
48935
- // const triggerOpen = usePersistFn(() => {
48936
- // if (disabled === true) return;
48937
- // if (open) {
48938
- // closePop();
48939
- // } else {
48940
- // openPop();
48941
- // }
48942
- // });
48943
-
48944
48937
  var focusAndOpen = function focusAndOpen() {
48945
48938
  if (!focused) {
48946
48939
  var _inputRef$current2;
@@ -49347,7 +49340,7 @@ function Select(props0) {
49347
49340
  children: [tipNode, renderResult(), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
49348
49341
  adjust: true,
49349
49342
  focus: open,
49350
- fixedWidth: autoAdapt ? 'min' : true,
49343
+ fixedWidth: !props.columns && (autoAdapt ? 'min' : true),
49351
49344
  absolute: props.absolute,
49352
49345
  zIndex: props.zIndex,
49353
49346
  position: position,
@@ -53269,6 +53262,7 @@ StepsComp.Step = StepsStep;
53269
53262
  var sticky_cssSupport = cssSupport;
53270
53263
  var supportSticky = sticky_cssSupport('position', 'sticky');
53271
53264
  var defaultZIndex = 900;
53265
+ var events = ['scroll', 'pageshow', 'load', 'resize'];
53272
53266
 
53273
53267
  // const getFirstScrollParent = (el: HTMLElement) => {
53274
53268
  // let parent = el.parentNode as HTMLElement;
@@ -53287,7 +53281,6 @@ var defaultZIndex = 900;
53287
53281
  // };
53288
53282
 
53289
53283
  var Sticky = function Sticky(props) {
53290
- var _props$style;
53291
53284
  var children = props.children,
53292
53285
  top = props.top,
53293
53286
  bottom = props.bottom;
@@ -53297,7 +53290,8 @@ var Sticky = function Sticky(props) {
53297
53290
  div: null,
53298
53291
  observer: null,
53299
53292
  parentObserver: null,
53300
- isTop: false
53293
+ isTop: false,
53294
+ bodyObserver: null
53301
53295
  }),
53302
53296
  context = _useRef.current;
53303
53297
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({}),
@@ -53314,10 +53308,6 @@ var Sticky = function Sticky(props) {
53314
53308
  setParentVisible = _useState6[1];
53315
53309
  var forceRender = useRender();
53316
53310
  var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
53317
- var elementSize = useResize({
53318
- targetRef: elementRef,
53319
- timer: 0
53320
- });
53321
53311
  var getTarget = function getTarget() {
53322
53312
  var scrollContainer = props.scrollContainer;
53323
53313
  if (typeof scrollContainer === 'string') {
@@ -53327,11 +53317,10 @@ var Sticky = function Sticky(props) {
53327
53317
  if (scrollContainer && scrollContainer.nodeType === 1) {
53328
53318
  return scrollContainer;
53329
53319
  }
53330
- return document.body;
53320
+ return null;
53331
53321
  };
53332
53322
  var updateStyle = usePersistFn(function () {
53333
53323
  if (context.div && !context.isTop && show) {
53334
- var shouldFixed = context.target === document.body;
53335
53324
  var scrollRect = context.target.getBoundingClientRect();
53336
53325
  var targetRect = elementRef.current.getBoundingClientRect();
53337
53326
  var targetLeft = targetRect.left;
@@ -53340,7 +53329,7 @@ var Sticky = function Sticky(props) {
53340
53329
  if (typeof bottom === 'number') {
53341
53330
  var outRootRect = context.target.getBoundingClientRect();
53342
53331
  var _style = {
53343
- position: shouldFixed ? 'fixed' : 'absolute',
53332
+ position: 'absolute',
53344
53333
  width: "".concat(width, "px"),
53345
53334
  height: "".concat(height, "px"),
53346
53335
  top: "".concat(scrollRect.bottom - (props.bottom || 0) - outRootRect.top, "px"),
@@ -53351,19 +53340,13 @@ var Sticky = function Sticky(props) {
53351
53340
  }
53352
53341
  }
53353
53342
  });
53354
- var handlePosition = usePersistFn(function (entries) {
53343
+ var handleTargetPosition = usePersistFn(function (entries) {
53355
53344
  var entry = entries[0];
53356
53345
  var scrollRect = entry.rootBounds;
53357
53346
  var targetRect = entry.boundingClientRect;
53358
- var shouldFixed = context.target === document.body;
53359
53347
  if (!entry.isIntersecting) {
53360
53348
  var targetLeft = targetRect.left;
53361
- var outRootRect = shouldFixed ? {
53362
- top: 0,
53363
- bottom: 0,
53364
- left: 0,
53365
- right: 0
53366
- } : context.div.getBoundingClientRect();
53349
+ var outRootRect = context.div.getBoundingClientRect();
53367
53350
  var width = targetRect.width,
53368
53351
  height = targetRect.height;
53369
53352
  if (scrollRect && targetRect.bottom < scrollRect.bottom) {
@@ -53372,7 +53355,7 @@ var Sticky = function Sticky(props) {
53372
53355
  if (typeof top === 'number') {
53373
53356
  setShow(true);
53374
53357
  var _style2 = {
53375
- position: shouldFixed ? 'fixed' : 'absolute',
53358
+ position: 'absolute',
53376
53359
  width: "".concat(width, "px"),
53377
53360
  height: "".concat(height, "px"),
53378
53361
  top: "".concat(scrollRect.top - outRootRect.top, "px"),
@@ -53387,7 +53370,7 @@ var Sticky = function Sticky(props) {
53387
53370
  setShow(true);
53388
53371
  var _outRootRect = context.target.getBoundingClientRect();
53389
53372
  var _style3 = {
53390
- position: shouldFixed ? 'fixed' : 'absolute',
53373
+ position: 'absolute',
53391
53374
  width: "".concat(width, "px"),
53392
53375
  height: "".concat(height, "px"),
53393
53376
  top: "".concat(scrollRect.bottom - _outRootRect.top, "px"),
@@ -53410,7 +53393,58 @@ var Sticky = function Sticky(props) {
53410
53393
  setParentVisible(false);
53411
53394
  }
53412
53395
  });
53413
- 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() {
53414
53448
  if (context.observer) {
53415
53449
  context.observer.disconnect();
53416
53450
  context.observer = null;
@@ -53419,18 +53453,15 @@ var Sticky = function Sticky(props) {
53419
53453
  context.parentObserver.disconnect();
53420
53454
  context.parentObserver = null;
53421
53455
  }
53422
- window.removeEventListener('resize', updateStyle);
53423
53456
  };
53424
- var createObserver = function createObserver() {
53425
- var target = getTarget();
53426
- if (!context.div && target !== document.body) {
53457
+ var createObserver = function createObserver(target) {
53458
+ if (!context.div) {
53427
53459
  context.div = document.createElement('div');
53428
53460
  context.div.style.position = 'relative';
53429
53461
  }
53430
- if (target && target !== context.target) {
53462
+ if (target) {
53431
53463
  forceRender();
53432
- context.target = target;
53433
- cleanEvents();
53464
+ cancelObserver();
53434
53465
  if (context.div) {
53435
53466
  // append div
53436
53467
  if (target === document.body) {
@@ -53448,7 +53479,7 @@ var Sticky = function Sticky(props) {
53448
53479
  }
53449
53480
  }
53450
53481
  if (window.IntersectionObserver) {
53451
- var observer = new IntersectionObserver(handlePosition, {
53482
+ var observer = new IntersectionObserver(handleTargetPosition, {
53452
53483
  root: target,
53453
53484
  rootMargin: "-".concat(top || 0, "px 0px -").concat(bottom || 0, "px 0px"),
53454
53485
  threshold: 1.0
@@ -53471,17 +53502,34 @@ var Sticky = function Sticky(props) {
53471
53502
  }
53472
53503
  };
53473
53504
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
53474
- if (!css) {
53475
- createObserver();
53505
+ if (css) return;
53506
+ var target = getTarget();
53507
+ context.target = target;
53508
+ if (target) {
53509
+ createObserver(target);
53476
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
+ };
53477
53532
  }
53478
- return function () {
53479
- cleanEvents();
53480
- if (context.div) {
53481
- context.div.remove();
53482
- context.div = null;
53483
- }
53484
- };
53485
53533
  }, [css]);
53486
53534
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
53487
53535
  if (props.parent && context.parentObserver) {
@@ -53523,12 +53571,14 @@ var Sticky = function Sticky(props) {
53523
53571
  })
53524
53572
  }) : null;
53525
53573
  var isFixed = style.position === 'fixed';
53574
+ var hideStyle = {
53575
+ opacity: 0,
53576
+ pointerEvents: 'none'
53577
+ };
53526
53578
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
53527
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", {
53528
53580
  className: props.className,
53529
- style: objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
53530
- opacity: show && parentVisible ? 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.opacity
53531
- }),
53581
+ style: objectSpread2_default()(objectSpread2_default()({}, props.style), show && parentVisible ? hideStyle : {}),
53532
53582
  ref: handleElementRef,
53533
53583
  children: children
53534
53584
  })]
@@ -62214,7 +62264,7 @@ var upload_interface = __webpack_require__(4412);
62214
62264
 
62215
62265
 
62216
62266
  /* harmony default export */ var src_0 = ({
62217
- version: '3.1.14'
62267
+ version: '3.1.15'
62218
62268
  });
62219
62269
  }();
62220
62270
  /******/ return __webpack_exports__;