shineout 3.4.5-beta.5 → 3.4.5-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.5-beta.5'
495
+ version: '3.4.5-beta.7'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11984,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
11984
11984
  };
11985
11985
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11986
11986
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11987
- /* harmony default export */ var version = ('3.4.5-beta.5');
11987
+ /* harmony default export */ var version = ('3.4.5-beta.7');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -22280,7 +22280,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
22280
22280
  minWidth: 12,
22281
22281
  maxWidth: '100%',
22282
22282
  // flex: 1,
22283
- width: 12,
22283
+ // width: 12,
22284
22284
  overflow: 'hidden',
22285
22285
  whiteSpace: 'nowrap',
22286
22286
  textOverflow: 'ellipsis',
@@ -30707,6 +30707,7 @@ var Spin = function Spin(props) {
30707
30707
  render = props.render,
30708
30708
  sizeProps = props.size,
30709
30709
  className = props.className,
30710
+ uniqueClassName = props.uniqueClassName,
30710
30711
  jssStyle = props.jssStyle;
30711
30712
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$spin = jssStyle.spin) === null || _jssStyle$spin === void 0 ? void 0 : _jssStyle$spin.call(jssStyle);
30712
30713
  var config = useConfig();
@@ -30721,7 +30722,7 @@ var Spin = function Spin(props) {
30721
30722
  width: size,
30722
30723
  height: size
30723
30724
  }, props.style);
30724
- var classname = classnames_default()(className, styles === null || styles === void 0 ? void 0 : styles.spin);
30725
+ var classname = classnames_default()(className, styles === null || styles === void 0 ? void 0 : styles.spin, uniqueClassName);
30725
30726
  if (count < 1 || !render) {
30726
30727
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
30727
30728
  style: style,
@@ -30819,7 +30820,7 @@ var spins_Default = function Default(props) {
30819
30820
  var sizeSet = Math.ceil(value / 12.5) + unit;
30820
30821
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin4 = jssStyle.spin) === null || _jssStyle$spin4 === void 0 ? void 0 : _jssStyle$spin4.call(jssStyle)) || {};
30821
30822
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30822
- className: spinStyles.default,
30823
+ uniqueClassName: spinStyles.default,
30823
30824
  count: 12,
30824
30825
  itemStyle: {
30825
30826
  width: sizeSet,
@@ -30834,7 +30835,7 @@ var ChasingDots = function ChasingDots(props) {
30834
30835
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin5 = jssStyle.spin) === null || _jssStyle$spin5 === void 0 ? void 0 : _jssStyle$spin5.call(jssStyle)) || {};
30835
30836
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30836
30837
  count: 2,
30837
- className: spinStyles.chasingDots,
30838
+ uniqueClassName: spinStyles.chasingDots,
30838
30839
  render: renderSvgItem
30839
30840
  }));
30840
30841
  };
@@ -30844,7 +30845,7 @@ var CubeGrid = function CubeGrid(props) {
30844
30845
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin6 = jssStyle.spin) === null || _jssStyle$spin6 === void 0 ? void 0 : _jssStyle$spin6.call(jssStyle)) || {};
30845
30846
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30846
30847
  count: 9,
30847
- className: spinStyles.cubeGrid,
30848
+ uniqueClassName: spinStyles.cubeGrid,
30848
30849
  render: renderSimpleItem
30849
30850
  }));
30850
30851
  };
@@ -30854,7 +30855,7 @@ var DoubleBounce = function DoubleBounce(props) {
30854
30855
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin7 = jssStyle.spin) === null || _jssStyle$spin7 === void 0 ? void 0 : _jssStyle$spin7.call(jssStyle)) || {};
30855
30856
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30856
30857
  count: 2,
30857
- className: spinStyles.doubleBounce,
30858
+ uniqueClassName: spinStyles.doubleBounce,
30858
30859
  render: renderSimpleItem
30859
30860
  }));
30860
30861
  };
@@ -30870,7 +30871,7 @@ var FadingCircle = function FadingCircle(props) {
30870
30871
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin8 = jssStyle.spin) === null || _jssStyle$spin8 === void 0 ? void 0 : _jssStyle$spin8.call(jssStyle)) || {};
30871
30872
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30872
30873
  count: 12,
30873
- className: spinStyles.fadingCircle,
30874
+ uniqueClassName: spinStyles.fadingCircle,
30874
30875
  itemSize: itemSize,
30875
30876
  itemClass: classnames_default()(spinStyles.fade),
30876
30877
  render: renderSvgItem
@@ -30888,7 +30889,7 @@ var ScaleCircle = function ScaleCircle(props) {
30888
30889
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin9 = jssStyle.spin) === null || _jssStyle$spin9 === void 0 ? void 0 : _jssStyle$spin9.call(jssStyle)) || {};
30889
30890
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30890
30891
  count: 12,
30891
- className: spinStyles.fadingCircle,
30892
+ uniqueClassName: spinStyles.fadingCircle,
30892
30893
  itemSize: itemSize,
30893
30894
  itemClass: classnames_default()(spinStyles.scaleCircle),
30894
30895
  render: renderSvgItem
@@ -30900,7 +30901,7 @@ var FourDots = function FourDots(props) {
30900
30901
  var spinStyles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$spin10 = jssStyle.spin) === null || _jssStyle$spin10 === void 0 ? void 0 : _jssStyle$spin10.call(jssStyle)) || {};
30901
30902
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30902
30903
  count: 4,
30903
- className: spinStyles.fourDots,
30904
+ uniqueClassName: spinStyles.fourDots,
30904
30905
  render: renderSvgItem
30905
30906
  }));
30906
30907
  };
@@ -30915,7 +30916,7 @@ var Plane = function Plane(props) {
30915
30916
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30916
30917
  count: 0,
30917
30918
  style: style,
30918
- className: spinStyles.plane
30919
+ uniqueClassName: spinStyles.plane
30919
30920
  }));
30920
30921
  };
30921
30922
  var Pulse = function Pulse(props) {
@@ -30929,7 +30930,7 @@ var Pulse = function Pulse(props) {
30929
30930
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30930
30931
  count: 0,
30931
30932
  style: style,
30932
- className: spinStyles.pulse
30933
+ uniqueClassName: spinStyles.pulse
30933
30934
  }));
30934
30935
  };
30935
30936
  var Ring = function Ring(props) {
@@ -30954,7 +30955,7 @@ var Ring = function Ring(props) {
30954
30955
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
30955
30956
  count: 0,
30956
30957
  style: style,
30957
- className: spinStyles.ring
30958
+ uniqueClassName: spinStyles.ring
30958
30959
  }));
30959
30960
  };
30960
30961
  var ThreeBounce = function ThreeBounce(props) {
@@ -30973,7 +30974,7 @@ var ThreeBounce = function ThreeBounce(props) {
30973
30974
  width: value * 2 + unit,
30974
30975
  height: 'auto'
30975
30976
  },
30976
- className: spinStyles.threeBounce,
30977
+ uniqueClassName: spinStyles.threeBounce,
30977
30978
  render: renderSvgItem
30978
30979
  }));
30979
30980
  };
@@ -31000,7 +31001,7 @@ var Wave = function Wave(props) {
31000
31001
  marginRight: margin
31001
31002
  },
31002
31003
  count: 5,
31003
- className: spinStyles.wave,
31004
+ uniqueClassName: spinStyles.wave,
31004
31005
  render: renderSimpleItem
31005
31006
  }));
31006
31007
  };
@@ -31023,7 +31024,7 @@ var ChasingRing = function ChasingRing(props) {
31023
31024
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
31024
31025
  count: 4,
31025
31026
  itemStyle: style,
31026
- className: spinStyles.chasingRing,
31027
+ uniqueClassName: spinStyles.chasingRing,
31027
31028
  render: renderSimpleItem
31028
31029
  }));
31029
31030
  };
@@ -31107,7 +31108,8 @@ var spin_Spin = function Spin() {
31107
31108
  var Comp = spins[n];
31108
31109
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Comp, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
31109
31110
  color: color,
31110
- style: style
31111
+ style: style,
31112
+ className: !tip ? className : undefined
31111
31113
  }));
31112
31114
  }
31113
31115
  return null;
@@ -32114,72 +32116,6 @@ var card_group_jssStyle = {
32114
32116
  jssStyle: card_group_jssStyle
32115
32117
  }, props));
32116
32118
  });
32117
- ;// CONCATENATED MODULE: ../hooks/src/common/use-in-view/use-in-view.ts
32118
-
32119
-
32120
- var useInView = function useInView() {
32121
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32122
- var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
32123
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
32124
- _useState2 = slicedToArray_default()(_useState, 2),
32125
- isInView = _useState2[0],
32126
- setIsInView = _useState2[1];
32127
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
32128
- _useState4 = slicedToArray_default()(_useState3, 2),
32129
- wasInView = _useState4[0],
32130
- setWasInView = _useState4[1];
32131
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
32132
- var element = elementRef.current;
32133
- if (!element) return;
32134
- if (typeof window === 'undefined' || !window.IntersectionObserver) {
32135
- setIsInView(true);
32136
- setWasInView(true);
32137
- return;
32138
- }
32139
- var observer = new IntersectionObserver(function (_ref) {
32140
- var _ref2 = slicedToArray_default()(_ref, 1),
32141
- entry = _ref2[0];
32142
- var inView = entry.isIntersecting;
32143
- setIsInView(inView);
32144
- if (inView) {
32145
- setWasInView(true);
32146
- // 如果设置了 once 选项,且元素已经出现过,则取消观察
32147
- if (options.once) {
32148
- observer.disconnect();
32149
- }
32150
- }
32151
- }, {
32152
- root: options.root || null,
32153
- rootMargin: options.rootMargin || '0px',
32154
- threshold: options.threshold || 0
32155
- });
32156
- observer.observe(element);
32157
- return function () {
32158
- observer.disconnect();
32159
- };
32160
- }, [options.root, options.rootMargin, options.threshold, options.once]);
32161
- return {
32162
- ref: elementRef,
32163
- isInView: isInView,
32164
- wasInView: wasInView
32165
- };
32166
- };
32167
- /* harmony default export */ var use_in_view = (useInView);
32168
-
32169
- // 使用示例
32170
- // const Example = () => {
32171
- // const { ref, isInView } = useInView({
32172
- // threshold: 0.5,
32173
- // rootMargin: '50px',
32174
- // once: true
32175
- // });
32176
-
32177
- // return (
32178
- // <div ref={ref}>
32179
- // {isInView ? '元素在视窗中' : '元素不在视窗中'}
32180
- // </div>
32181
- // );
32182
- // };
32183
32119
  ;// CONCATENATED MODULE: ../hooks/src/utils/uid.ts
32184
32120
  function generateUUID() {
32185
32121
  var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
@@ -32266,12 +32202,15 @@ function getObserver(obj, id) {
32266
32202
  container = _obj$container === void 0 ? null : _obj$container,
32267
32203
  offset = obj.offset,
32268
32204
  render = obj.render,
32205
+ offscreen = obj.offscreen,
32269
32206
  noRemove = obj.noRemove;
32270
32207
  var observer = new IntersectionObserver(function (entries) {
32271
32208
  entries.forEach(function (en) {
32272
32209
  if (en.isIntersecting || en.intersectionRatio > 0) {
32273
32210
  render();
32274
32211
  if (!noRemove) removeStack(id);
32212
+ } else {
32213
+ offscreen && offscreen();
32275
32214
  }
32276
32215
  });
32277
32216
  }, {
@@ -32335,7 +32274,7 @@ var Lazyload = function Lazyload(props) {
32335
32274
  lazyload_removeStack(lazyId);
32336
32275
  };
32337
32276
  }, []);
32338
- if (ready && props.isInView) return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
32277
+ if (ready) return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
32339
32278
  children: props.children
32340
32279
  });
32341
32280
  return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
@@ -34156,25 +34095,11 @@ var CheckboxWithContext = function CheckboxWithContext(props) {
34156
34095
 
34157
34096
 
34158
34097
 
34159
-
34160
-
34161
34098
  var Item = function Item(props) {
34162
34099
  var _props$jssStyle, _props$jssStyle$cardG;
34163
34100
  var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(CardGroupContext),
34164
34101
  container = _useContext.container;
34165
34102
  var classes = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$cardG = _props$jssStyle.cardGroup) === null || _props$jssStyle$cardG === void 0 ? void 0 : _props$jssStyle$cardG.call(_props$jssStyle);
34166
- var _useInView = use_in_view({
34167
- root: container,
34168
- rootMargin: "".concat(props.lazyLoadOffset || (container === null || container === void 0 ? void 0 : container.clientHeight) || 100, "px")
34169
- }),
34170
- itemRef = _useInView.ref,
34171
- itemIsInView = _useInView.isInView,
34172
- wasInView = _useInView.wasInView;
34173
- var isInView = props.placeholder ? itemIsInView : true;
34174
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
34175
- _useState2 = slicedToArray_default()(_useState, 2),
34176
- itemHeight = _useState2[0],
34177
- setItemHeight = _useState2[1];
34178
34103
  var handleChange = usePersistFn(function (_, checked) {
34179
34104
  if (props.onChange) props.onChange(checked, props.value);
34180
34105
  });
@@ -34184,7 +34109,6 @@ var Item = function Item(props) {
34184
34109
  return /*#__PURE__*/(0,jsx_runtime.jsx)(lazyload, {
34185
34110
  container: container,
34186
34111
  placeholder: props.placeholder,
34187
- isInView: isInView,
34188
34112
  children: content
34189
34113
  });
34190
34114
  };
@@ -34199,26 +34123,9 @@ var Item = function Item(props) {
34199
34123
  className: classes === null || classes === void 0 ? void 0 : classes.checkbox
34200
34124
  })]
34201
34125
  });
34202
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
34203
- if (isInView) {
34204
- var _itemRef$current;
34205
- setItemHeight(((_itemRef$current = itemRef.current) === null || _itemRef$current === void 0 ? void 0 : _itemRef$current.offsetHeight) || 0);
34206
- }
34207
- }, [isInView]);
34208
- var hiddenStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34209
- return !isInView && wasInView && itemHeight ? {
34210
- height: itemHeight,
34211
- overflow: 'hidden',
34212
- visibility: isInView ? 'visible' : 'hidden'
34213
- } : undefined;
34214
- }, [isInView, itemHeight]);
34215
- var itemStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34216
- return hiddenStyle ? objectSpread2_default()(objectSpread2_default()({}, props.style), hiddenStyle) : props.style;
34217
- }, [hiddenStyle, props.style]);
34218
34126
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
34219
- ref: itemRef,
34220
34127
  className: cls,
34221
- style: itemStyle,
34128
+ style: props.style,
34222
34129
  children: renderChildren(content)
34223
34130
  });
34224
34131
  };
@@ -36548,12 +36455,13 @@ var CascaderNode = function CascaderNode(props) {
36548
36455
  var checked = datum.getChecked(id);
36549
36456
  handleChange(null, !checked);
36550
36457
  };
36458
+ var isHoverAble = expandTrigger === 'hover' || expandTrigger === 'hover-only';
36551
36459
  var getEvents = function getEvents() {
36552
36460
  var events = {};
36553
36461
  if (expandTrigger !== 'hover-only' || !hasChildren) {
36554
36462
  if (!isDisabled || props.mode === 4) events.onClick = handleClick;
36555
36463
  }
36556
- if (expandTrigger === 'hover' || expandTrigger === 'hover-only') {
36464
+ if (isHoverAble) {
36557
36465
  events.onMouseEnter = handlePathChange;
36558
36466
  if (multiple) events.onClick = handleSelect;
36559
36467
  }
@@ -36599,7 +36507,7 @@ var CascaderNode = function CascaderNode(props) {
36599
36507
  className: styles.optionCheckbox,
36600
36508
  checked: datum.getChecked(id),
36601
36509
  disabled: isDisabled,
36602
- onChange: handleChange
36510
+ onChange: isHoverAble && multiple ? undefined : handleChange
36603
36511
  }), renderContent(), renderIcon()]
36604
36512
  })
36605
36513
  }));
@@ -47568,10 +47476,17 @@ var useImage = function useImage() {
47568
47476
  offset: typeof lazy === 'number' ? lazy : 0,
47569
47477
  element: elementRef.current,
47570
47478
  render: markToRender,
47479
+ offscreen: function offscreen() {
47480
+ setStatus(PLACEHOLDER);
47481
+ },
47482
+ noRemove: props.inViewOnly,
47571
47483
  container: typeof container === 'string' ? document.querySelector(container) : container
47572
47484
  });
47573
47485
  }
47574
47486
  }
47487
+ return function () {
47488
+ if (lazyId) removeStack(lazyId);
47489
+ };
47575
47490
  }, [src]);
47576
47491
  return {
47577
47492
  src: src,
@@ -54779,15 +54694,15 @@ var radio_group_Group = function Group(props0) {
54779
54694
  }
54780
54695
  return content;
54781
54696
  }, []);
54782
- var providerValue = {
54697
+ var providerValue = objectSpread2_default()(objectSpread2_default()({
54783
54698
  checked: isChecked,
54784
54699
  onChange: handleItemChange,
54785
- disabled: disabled,
54786
54700
  renderRadio: renderRadio
54787
- };
54788
- if (size !== undefined) {
54789
- providerValue.size = size;
54790
- }
54701
+ }, size !== undefined && {
54702
+ size: size
54703
+ }), disabled !== undefined && {
54704
+ disabled: disabled
54705
+ });
54791
54706
  var groupClass = classnames_default()(className, radioClasses === null || radioClasses === void 0 ? void 0 : radioClasses.group, !!block && (radioClasses === null || radioClasses === void 0 ? void 0 : radioClasses.groupBlock), !!button && (radioClasses === null || radioClasses === void 0 ? void 0 : radioClasses.groupButton));
54792
54707
  var Radios = props.data === undefined ? /*#__PURE__*/(0,jsx_runtime.jsx)(radio_group_context.Provider, {
54793
54708
  value: providerValue,
@@ -65411,7 +65326,7 @@ var upload_interface = __webpack_require__(8821);
65411
65326
 
65412
65327
 
65413
65328
  /* harmony default export */ var src_0 = ({
65414
- version: '3.4.5-beta.5'
65329
+ version: '3.4.5-beta.7'
65415
65330
  });
65416
65331
  }();
65417
65332
  /******/ return __webpack_exports__;