shineout 3.5.1 → 3.5.2-beta.10

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
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
500
500
  // 此文件由脚本自动生成,请勿直接修改。
501
501
  // This file was generated automatically by a script. Please do not modify it directly.
502
502
  var _default = exports.default = {
503
- version: '3.5.1'
503
+ version: '3.5.2-beta.10'
504
504
  };
package/dist/shineout.js CHANGED
@@ -12002,7 +12002,7 @@ var handleStyle = function handleStyle(style) {
12002
12002
  };
12003
12003
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12004
12004
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12005
- /* harmony default export */ var version = ('3.5.1');
12005
+ /* harmony default export */ var version = ('3.5.2-beta.10');
12006
12006
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12007
12007
 
12008
12008
 
@@ -12599,11 +12599,11 @@ var badgeTokens = {
12599
12599
  badgeBadgeFontColor: 'Neutral-text-1',
12600
12600
  badgeBadgeBackgroundColor: 'Danger-6',
12601
12601
  badgeBadgeBorderRadius: 'Radius-full',
12602
- badgeCountPaddingX: 'spacing-6',
12602
+ badgeCountPaddingX: 'Spacing-6',
12603
12603
  badgeCountHeight: 'Size-10',
12604
12604
  badgeSmallCountHeight: 'Size-8',
12605
12605
  badgeDotWidth: 'Size-3',
12606
- badgeTextMarginLeft: 'spacing-8',
12606
+ badgeTextMarginLeft: 'Spacing-8',
12607
12607
  badgeTextFontColor: 'Neutral-text-5',
12608
12608
  badgeDefaultBackgroundColor: 'Neutral-fill-5',
12609
12609
  badgeWarningBackgroundColor: 'Warning-6',
@@ -22139,26 +22139,21 @@ var useRadioStyle = styled(src_radio_radio, 'radio');
22139
22139
  /* harmony default export */ var shineout_style_src_radio = ((/* unused pure expression or super */ null && (useRadioStyle)));
22140
22140
  ;// CONCATENATED MODULE: ../shineout-style/src/rate/rate.ts
22141
22141
 
22142
- // const animation = {
22143
- // '@keyframes scale': {
22144
- // '0%': {
22145
- // transform: 'scale(1)',
22146
- // },
22147
- // '80%': {
22148
- // transform: 'scale(1.4)',
22149
- // opacity: 0.8,
22150
- // },
22151
- // '81%': {
22152
- // transform: 'scale(1.2)',
22153
- // },
22154
- // '100%': {
22155
- // transform: 'scale3d(1.2)',
22156
- // },
22157
- // },
22158
- // }
22159
22142
 
22160
- var rateStyle = {
22161
- // ...animation,
22143
+ var rate_animation = {
22144
+ '@keyframes scale': {
22145
+ '0%': {
22146
+ transform: 'scale(1)'
22147
+ },
22148
+ '50%': {
22149
+ transform: 'scale(1.2)'
22150
+ },
22151
+ '100%': {
22152
+ transform: 'scale(1)'
22153
+ }
22154
+ }
22155
+ };
22156
+ var rateStyle = objectSpread2_default()(objectSpread2_default()({}, rate_animation), {}, {
22162
22157
  wrapper: {
22163
22158
  display: 'inline-block',
22164
22159
  '[data-soui-role="form-control"] > &': {
@@ -22251,9 +22246,9 @@ var rateStyle = {
22251
22246
  },
22252
22247
  itemDisabled: {},
22253
22248
  itemAnimation: {
22254
- // animation: '$scale 0.2s ease-out',
22249
+ animation: '$scale 0.4s cubic-bezier(0.34, 0.69, 0.1, 1)'
22255
22250
  }
22256
- };
22251
+ });
22257
22252
  /* harmony default export */ var rate_rate = (rateStyle);
22258
22253
  ;// CONCATENATED MODULE: ../shineout-style/src/rate/index.ts
22259
22254
 
@@ -29031,6 +29026,25 @@ function getClosestScrollContainer(element) {
29031
29026
  // 如果没有找到可滚动的祖先,返回 body 或 documentElement
29032
29027
  return document.scrollingElement || document.documentElement;
29033
29028
  }
29029
+ function getClosestFixedContainer(element) {
29030
+ if (!element) {
29031
+ return null;
29032
+ }
29033
+ var isFixable = function isFixable(el) {
29034
+ var style = window.getComputedStyle(el);
29035
+ return style.position === 'fixed';
29036
+ };
29037
+
29038
+ // 遍历父元素
29039
+ var parent = element.parentElement;
29040
+ while (parent) {
29041
+ if (isFixable(parent)) {
29042
+ return parent;
29043
+ }
29044
+ parent = parent.parentElement;
29045
+ }
29046
+ return null;
29047
+ }
29034
29048
  function cssSupport(attr, value) {
29035
29049
  if (is_isBrowser()) {
29036
29050
  var element = document.createElement('div');
@@ -32930,6 +32944,7 @@ function getUidStr() {
32930
32944
  }
32931
32945
  ;// CONCATENATED MODULE: ../hooks/src/utils/lazyload.ts
32932
32946
 
32947
+
32933
32948
  var lazyload_throttle = 80;
32934
32949
  var components = {};
32935
32950
  var timeout = null;
@@ -32989,10 +33004,12 @@ function removeStack(id, removeListener) {
32989
33004
  function getObserver(obj, id) {
32990
33005
  var _obj$container = obj.container,
32991
33006
  container = _obj$container === void 0 ? null : _obj$container,
33007
+ element = obj.element,
32992
33008
  offset = obj.offset,
32993
33009
  render = obj.render,
32994
33010
  offscreen = obj.offscreen,
32995
33011
  noRemove = obj.noRemove;
33012
+ var fixedContainer = getClosestFixedContainer(element);
32996
33013
  var observer = new IntersectionObserver(function (entries) {
32997
33014
  entries.forEach(function (en) {
32998
33015
  if (en.isIntersecting || en.intersectionRatio > 0) {
@@ -33003,7 +33020,7 @@ function getObserver(obj, id) {
33003
33020
  }
33004
33021
  });
33005
33022
  }, {
33006
- root: container,
33023
+ root: fixedContainer || container,
33007
33024
  rootMargin: "".concat(offset, "px")
33008
33025
  });
33009
33026
  obj.observer = observer;
@@ -33251,6 +33268,7 @@ function useInputAble(props) {
33251
33268
  var _props$value;
33252
33269
  var valuePo = props.value,
33253
33270
  onChange = props.onChange,
33271
+ onSameChange = props.onSameChange,
33254
33272
  control = props.control,
33255
33273
  beforeChange = props.beforeChange,
33256
33274
  delay = props.delay;
@@ -33298,7 +33316,10 @@ function useInputAble(props) {
33298
33316
  }
33299
33317
  var vv = v;
33300
33318
  if (other.length === 0 || props.filterSameChange) {
33301
- if (shallowEqual(v, value)) return;
33319
+ if (shallowEqual(v, value)) {
33320
+ if (onSameChange) onSameChange(v);
33321
+ return;
33322
+ }
33302
33323
  }
33303
33324
  if (isFunc(beforeChange)) {
33304
33325
  var temp = beforeChange(v);
@@ -40146,6 +40167,9 @@ function useFormControl(props) {
40146
40167
  }
40147
40168
  });
40148
40169
  setValueState(nextValue);
40170
+ formFunc === null || formFunc === void 0 || formFunc.setValue(defineProperty_default()({}, name, nextValue), {
40171
+ validate: false
40172
+ });
40149
40173
  } else {
40150
40174
  var _value2 = getValue(name, formValue);
40151
40175
  var _error2 = getError(name, errors, severErrors);
@@ -40155,6 +40179,9 @@ function useFormControl(props) {
40155
40179
  if (!shallowEqual(_value2, latestInfo.valueState)) {
40156
40180
  if (_value2 === undefined && defaultValue !== undefined) {
40157
40181
  setValueState(defaultValue);
40182
+ formFunc === null || formFunc === void 0 || formFunc.setValue(defineProperty_default()({}, name, defaultValue), {
40183
+ validate: false
40184
+ });
40158
40185
  } else {
40159
40186
  setValueState(_value2);
40160
40187
  }
@@ -40545,7 +40572,7 @@ var useListSelectMultiple = function useListSelectMultiple(props) {
40545
40572
  }
40546
40573
  });
40547
40574
  var removeAll = use_persist_fn(function () {
40548
- props.onChange([], undefined, false);
40575
+ props.onChange(props.separator ? '' : [], undefined, false);
40549
40576
  });
40550
40577
 
40551
40578
  // 删除数据
@@ -47547,11 +47574,13 @@ var useForm = function useForm(props) {
47547
47574
  context.removeArr.delete(n);
47548
47575
  if (df !== undefined && deepGet(context.value, n) === undefined) {
47549
47576
  if (!context.mounted) context.defaultValues[n] = df;
47550
- onChange(function (v) {
47551
- deepSet(v, n, df, deepSetOptions);
47577
+ setTimeout(function () {
47578
+ onChange(function (v) {
47579
+ deepSet(v, n, df, deepSetOptions);
47580
+ });
47581
+ update(n);
47552
47582
  });
47553
47583
  }
47554
- update(n);
47555
47584
  },
47556
47585
  unbind: function unbind(n, reserveAble, validateFiled, update) {
47557
47586
  var validateFieldSet = context.validateMap[n];
@@ -50530,6 +50559,7 @@ var useSelect = function useSelect(props) {
50530
50559
  prediction = props.prediction,
50531
50560
  valueProp = props.value,
50532
50561
  onChangeProp = props.onChange,
50562
+ onSameChange = props.onSameChange,
50533
50563
  filterSameChange = props.filterSameChange,
50534
50564
  noCache = props.noCache;
50535
50565
  var _useInputAble = useInputAble({
@@ -50538,6 +50568,7 @@ var useSelect = function useSelect(props) {
50538
50568
  defaultValue: defaultValue,
50539
50569
  beforeChange: beforeChange,
50540
50570
  onChange: onChangeProp,
50571
+ onSameChange: onSameChange,
50541
50572
  filterSameChange: filterSameChange
50542
50573
  }),
50543
50574
  value = _useInputAble.value,
@@ -51419,6 +51450,7 @@ var Node = function Node(props) {
51419
51450
  isControlled: isControlled,
51420
51451
  contentClass: contentClass,
51421
51452
  parentClickExpand: parentClickExpand,
51453
+ doubleClickExpand: doubleClickExpand,
51422
51454
  expanded: expanded,
51423
51455
  line: line,
51424
51456
  data: children,
@@ -52424,6 +52456,10 @@ function Select(props0) {
52424
52456
  onCreate = _useFilter.onCreate,
52425
52457
  onClearCreatedData = _useFilter.onClearCreatedData,
52426
52458
  rawData = _useFilter.rawData;
52459
+ var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
52460
+ _useState8 = slicedToArray_default()(_useState7, 2),
52461
+ absoluteListUpdateKey = _useState8[0],
52462
+ setAbsoluteListUpdateKey = _useState8[1];
52427
52463
  var onCollapse = usePersistFn(function (collapse) {
52428
52464
  onCollapseProp === null || onCollapseProp === void 0 || onCollapseProp(collapse);
52429
52465
  onClearCreatedData();
@@ -52462,6 +52498,11 @@ function Select(props0) {
52462
52498
  getTargetProps = _usePopup.getTargetProps,
52463
52499
  PopupProvider = _usePopup.Provider,
52464
52500
  popupProviderValue = _usePopup.providerValue;
52501
+ var preventDefault = function preventDefault(e) {
52502
+ if (focused && e.target !== inputRef.current) {
52503
+ e.preventDefault();
52504
+ }
52505
+ };
52465
52506
  var handleSelectChange = usePersistFn(function (value, dataItem, checked) {
52466
52507
  if (createdData || props.emptyAfterSelect) {
52467
52508
  onFilter === null || onFilter === void 0 || onFilter('');
@@ -52475,7 +52516,15 @@ function Select(props0) {
52475
52516
  inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.select();
52476
52517
  }
52477
52518
  onChange === null || onChange === void 0 || onChange(value, dataItem, checked);
52519
+ if (props.absolute === undefined) return;
52520
+ setAbsoluteListUpdateKey(value);
52478
52521
  });
52522
+ var handleSameChange = function handleSameChange() {
52523
+ var shouldFocus = showInput && props.reFocus;
52524
+ if (!multiple && !shouldFocus) {
52525
+ closePop();
52526
+ }
52527
+ };
52479
52528
  var _useSelect = use_select({
52480
52529
  value: valueProp,
52481
52530
  data: data,
@@ -52491,6 +52540,7 @@ function Select(props0) {
52491
52540
  prediction: prediction,
52492
52541
  beforeChange: beforeChange,
52493
52542
  onChange: handleSelectChange,
52543
+ onSameChange: handleSameChange,
52494
52544
  filterSameChange: filterSameChange,
52495
52545
  noCache: noCache
52496
52546
  }),
@@ -52835,10 +52885,7 @@ function Select(props0) {
52835
52885
  }
52836
52886
  return /*#__PURE__*/(0,jsx_runtime.jsx)(select_list, objectSpread2_default()({}, listProps));
52837
52887
  };
52838
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
52839
- _useState8 = slicedToArray_default()(_useState7, 2),
52840
- absoluteListUpdateKey = _useState8[0],
52841
- setAbsoluteListUpdateKey = _useState8[1];
52888
+
52842
52889
  // 当树形数据展开时,需要更新 AbsoluteList 的位置
52843
52890
  var onExpandWrap = usePersistFn(function (value) {
52844
52891
  onExpand === null || onExpand === void 0 || onExpand(value);
@@ -52933,6 +52980,7 @@ function Select(props0) {
52933
52980
  onFocus: handleFocus,
52934
52981
  onMouseEnter: onMouseEnter,
52935
52982
  onMouseLeave: onMouseLeave,
52983
+ onMouseDown: preventDefault,
52936
52984
  children: [tipNode, renderResult(), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
52937
52985
  adjust: adjust,
52938
52986
  focus: open,
@@ -55819,10 +55867,6 @@ var Rate = function Rate(props0) {
55819
55867
  var backItem = Array.isArray(back) ? back[index] : back;
55820
55868
  var isHalfChecked = props.allowHalf && showValue % 1 > 0 && index === currentIndex;
55821
55869
  var isChecked = !isHalfChecked && index <= currentIndex;
55822
- var itemStyle = {
55823
- fontSize: size,
55824
- width: size
55825
- };
55826
55870
  var handleChange = function handleChange(val) {
55827
55871
  if (clearable && value === val) {
55828
55872
  onChange(0);
@@ -55832,12 +55876,17 @@ var Rate = function Rate(props0) {
55832
55876
  onChange(val);
55833
55877
  }
55834
55878
  };
55879
+ var showAnimation = animationIndex && index < currentIndex;
55835
55880
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
55836
- className: classnames_default()(rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.item, isHalfChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemCheckedHalf), isChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemChecked), props.disabled && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemDisabled), animationIndex === index && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemAnimation)),
55881
+ className: classnames_default()(rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.item, isHalfChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemCheckedHalf), isChecked && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemChecked), props.disabled && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemDisabled), showAnimation && (rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemAnimation)),
55882
+ style: {
55883
+ fontSize: size,
55884
+ width: size,
55885
+ animationDelay: showAnimation ? "".concat(50 * index, "ms") : undefined
55886
+ },
55837
55887
  onAnimationEnd: function onAnimationEnd() {
55838
55888
  setAnimationIndex(null);
55839
55889
  },
55840
- style: itemStyle,
55841
55890
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
55842
55891
  className: rateClasses === null || rateClasses === void 0 ? void 0 : rateClasses.itemBg,
55843
55892
  children: backItem
@@ -66418,7 +66467,7 @@ var upload_interface = __webpack_require__(8821);
66418
66467
 
66419
66468
 
66420
66469
  /* harmony default export */ var src_0 = ({
66421
- version: '3.5.1'
66470
+ version: '3.5.2-beta.10'
66422
66471
  });
66423
66472
  }();
66424
66473
  /******/ return __webpack_exports__;