shineout 3.9.14-beta.8 → 3.9.14

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
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.14-beta.8'
525
+ version: '3.9.14'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12326,7 +12326,7 @@ var handleStyle = function handleStyle(style) {
12326
12326
  };
12327
12327
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12328
12328
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12329
- /* harmony default export */ var version = ('3.9.14-beta.8');
12329
+ /* harmony default export */ var version = ('3.9.14');
12330
12330
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12331
12331
 
12332
12332
 
@@ -20767,6 +20767,7 @@ var groupSpace = function groupSpace(gap) {
20767
20767
  padding: "0 ".concat(gap),
20768
20768
  display: 'flex',
20769
20769
  alignItems: 'center',
20770
+ flexShrink: 0,
20770
20771
  borderLeft: "1px solid ".concat(src.inputBorderColor),
20771
20772
  borderRight: "1px solid ".concat(src.inputBorderColor),
20772
20773
  background: src.inputGroupFontBackgroundColor,
@@ -42037,6 +42038,9 @@ var VirtualList = function VirtualList(props) {
42037
42038
  // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
42038
42039
  setTop(0);
42039
42040
  setStartIndex(0);
42041
+ if (wrapperRef.current) {
42042
+ wrapperRef.current.scrollTop = 0;
42043
+ }
42040
42044
  context.prevWrapperRefHeight = currentWrapperRefHeight;
42041
42045
  return function () {
42042
42046
  context.preIndex = null;
@@ -56323,6 +56327,7 @@ var useNumberFormat = function useNumberFormat(props) {
56323
56327
  min = props.min,
56324
56328
  max = props.max,
56325
56329
  allowNull = props.allowNull,
56330
+ clearToUndefined = props.clearToUndefined,
56326
56331
  _props$step = props.step,
56327
56332
  step = _props$step === void 0 ? 1 : _props$step,
56328
56333
  cancelBlurChange = props.cancelBlurChange,
@@ -56343,10 +56348,9 @@ var useNumberFormat = function useNumberFormat(props) {
56343
56348
  setInternalInputValue = _React$useState2[1];
56344
56349
  var focusedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(false);
56345
56350
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56346
- // 聚焦编辑期间不同步外部值,避免 form 回填 defaultValue 覆盖用户输入
56347
- // 但当外部值被清空时( clearable 触发),即使聚焦也需要同步
56348
- if (props.value !== inernalInputValue && (!focusedRef.current || props.value == null || props.value === '')) {
56349
- setInternalInputValue(getStringValue(props.value));
56351
+ var stringValue = getStringValue(props.value);
56352
+ if (stringValue !== inernalInputValue && (!focusedRef.current || props.value == null)) {
56353
+ setInternalInputValue(stringValue);
56350
56354
  }
56351
56355
  }, [props.value]);
56352
56356
  var getNumberValue = function getNumberValue(value) {
@@ -56472,6 +56476,10 @@ var useNumberFormat = function useNumberFormat(props) {
56472
56476
  var num = changeValue(-step);
56473
56477
  if (num !== undefined) setInternalInputValue(getStringValue(num));
56474
56478
  });
56479
+ var handleClear = use_persist_fn(function () {
56480
+ setInternalInputValue('');
56481
+ onChange === null || onChange === void 0 || onChange(clearToUndefined ? undefined : allowNull ? null : '');
56482
+ });
56475
56483
  return objectSpread2_default()(objectSpread2_default()({}, use_input_format({
56476
56484
  value: inernalInputValue,
56477
56485
  type: 'number',
@@ -56485,7 +56493,8 @@ var useNumberFormat = function useNumberFormat(props) {
56485
56493
  cancelBlurChange: true
56486
56494
  })), {}, {
56487
56495
  onPlus: handlePlus,
56488
- onMinus: handleMinus
56496
+ onMinus: handleMinus,
56497
+ onClear: handleClear
56489
56498
  });
56490
56499
  };
56491
56500
  /* harmony default export */ var use_input_number = (useNumberFormat);
@@ -56533,7 +56542,8 @@ var InputNumber = function InputNumber(props) {
56533
56542
  value: commonProps.value,
56534
56543
  onChange: commonProps.onChange,
56535
56544
  disabled: !!commonProps.disabled,
56536
- defaultValue: props.defaultValue
56545
+ defaultValue: props.defaultValue,
56546
+ clearToUndefined: props.clearToUndefined
56537
56547
  }, numberFormatParams)),
56538
56548
  onMinus = _useInputNumber.onMinus,
56539
56549
  onPlus = _useInputNumber.onPlus,
@@ -59308,9 +59318,7 @@ function Select(props0) {
59308
59318
  onClearCreatedData = _useFilter.onClearCreatedData,
59309
59319
  rawData = _useFilter.rawData,
59310
59320
  FilterProvider = _useFilter.FilterProvider;
59311
- var prevFilterTextRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(filterText);
59312
- var filterTextChanged = prevFilterTextRef.current !== filterText;
59313
- prevFilterTextRef.current = filterText;
59321
+ var prevListDataLengthRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
59314
59322
  var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
59315
59323
  _useState8 = slicedToArray_default()(_useState7, 2),
59316
59324
  absoluteListUpdateKey = _useState8[0],
@@ -59723,8 +59731,13 @@ function Select(props0) {
59723
59731
  });
59724
59732
  };
59725
59733
  var renderList = function renderList() {
59734
+ var _listData$length;
59735
+ var listData = groupBy ? groupData : filterData;
59736
+ var listDataLength = (_listData$length = listData === null || listData === void 0 ? void 0 : listData.length) !== null && _listData$length !== void 0 ? _listData$length : 0;
59737
+ var dataGrew = listDataLength > prevListDataLengthRef.current;
59738
+ prevListDataLengthRef.current = listDataLength;
59726
59739
  var listProps = {
59727
- data: groupBy ? groupData : filterData,
59740
+ data: listData,
59728
59741
  datum: datum,
59729
59742
  value: value,
59730
59743
  size: size,
@@ -59745,7 +59758,7 @@ function Select(props0) {
59745
59758
  renderItem: renderItem,
59746
59759
  controlType: controlType,
59747
59760
  onLoadMore: onLoadMore,
59748
- keepScrollTop: filterTextChanged ? false : true,
59761
+ keepScrollTop: dataGrew,
59749
59762
  isAnimationFinish: isAnimationFinish,
59750
59763
  threshold: threshold,
59751
59764
  onControlTypeChange: setControlType,
@@ -75757,7 +75770,7 @@ var upload_interface = __webpack_require__(8821);
75757
75770
 
75758
75771
 
75759
75772
  /* harmony default export */ var src_0 = ({
75760
- version: '3.9.14-beta.8'
75773
+ version: '3.9.14'
75761
75774
  });
75762
75775
  }();
75763
75776
  /******/ return __webpack_exports__;