shineout 3.2.3 → 3.2.5-beta.1

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.2.3'
479
+ version: '3.2.5-beta.1'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11960,7 +11960,7 @@ var handleStyle = function handleStyle(style) {
11960
11960
  };
11961
11961
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11962
11962
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11963
- /* harmony default export */ var version = ('3.2.3');
11963
+ /* harmony default export */ var version = ('3.2.5-beta.1');
11964
11964
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11965
11965
 
11966
11966
 
@@ -21779,6 +21779,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
21779
21779
  display: 'block',
21780
21780
  overflow: 'hidden',
21781
21781
  textOverflow: 'ellipsis',
21782
+ flex: 1,
21782
21783
  whiteSpace: 'nowrap',
21783
21784
  marginTop: src.selectPlaceholderMarginY,
21784
21785
  marginBottom: src.selectPlaceholderMarginY
@@ -26554,6 +26555,7 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
26554
26555
  display: 'block',
26555
26556
  overflow: 'hidden',
26556
26557
  textOverflow: 'ellipsis',
26558
+ flex: 1,
26557
26559
  whiteSpace: 'nowrap',
26558
26560
  marginTop: src.treeSelectPlaceholderMarginY,
26559
26561
  marginBottom: src.treeSelectPlaceholderMarginY
@@ -44500,6 +44502,15 @@ function spliceValue(obj, name, index) {
44500
44502
  delete obj[n];
44501
44503
  });
44502
44504
  }
44505
+ ;// CONCATENATED MODULE: ../hooks/src/common/use-default-value/use-previous.ts
44506
+
44507
+ function use_previous_usePrevious(value) {
44508
+ var ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
44509
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
44510
+ ref.current = value;
44511
+ });
44512
+ return ref.current;
44513
+ }
44503
44514
  ;// CONCATENATED MODULE: ../hooks/src/components/use-form/use-form.ts
44504
44515
 
44505
44516
 
@@ -44511,6 +44522,7 @@ function spliceValue(obj, name, index) {
44511
44522
 
44512
44523
 
44513
44524
 
44525
+
44514
44526
  var globalKey = '__global__&&@@';
44515
44527
 
44516
44528
 
@@ -44538,6 +44550,7 @@ var useForm = function useForm(props) {
44538
44550
  removeUndefined: removeUndefined,
44539
44551
  forceSet: true
44540
44552
  };
44553
+ var preValue = use_previous_usePrevious(props.value);
44541
44554
  var formRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
44542
44555
  var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
44543
44556
  defaultValues: {},
@@ -44908,8 +44921,8 @@ var useForm = function useForm(props) {
44908
44921
  var updateValue = function updateValue() {
44909
44922
  if (props.value !== context.lastValue && props.value !== context.value) {
44910
44923
  context.value = deepClone(props.value) || emptyObj;
44911
- context.lastValue = props.value;
44912
44924
  }
44925
+ context.lastValue = props.value;
44913
44926
  };
44914
44927
  updateValue();
44915
44928
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -44932,14 +44945,13 @@ var useForm = function useForm(props) {
44932
44945
  if (props.value === context.value) return;
44933
44946
  if (initValidate && !context.resetTime) {
44934
44947
  var keys = Object.keys(context.validateMap).filter(function (key) {
44935
- var oldValue = deepGet(context.lastValue || emptyObj, key);
44948
+ var oldValue = deepGet(preValue || emptyObj, key);
44936
44949
  var newValue = deepGet(context.value || emptyObj, key);
44937
44950
  return !shallowEqual(oldValue, newValue);
44938
44951
  });
44939
44952
  validateFields(keys).catch(function () {});
44940
44953
  }
44941
44954
  update();
44942
- context.lastValue = props.value;
44943
44955
  context.resetTime = 0;
44944
44956
  }, [props.value]);
44945
44957
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -55167,7 +55179,6 @@ var useTableTree = function useTableTree(props) {
55167
55179
 
55168
55180
 
55169
55181
 
55170
-
55171
55182
  var useTableVirtual = function useTableVirtual(props) {
55172
55183
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55173
55184
  _useState2 = slicedToArray_default()(_useState, 2),
@@ -55185,7 +55196,6 @@ var useTableVirtual = function useTableVirtual(props) {
55185
55196
  _useState8 = slicedToArray_default()(_useState7, 2),
55186
55197
  startIndex = _useState8[0],
55187
55198
  setStartIndex = _useState8[1];
55188
- var preIndex = usePrevious(startIndex);
55189
55199
  var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55190
55200
  _useState10 = slicedToArray_default()(_useState9, 2),
55191
55201
  offsetY = _useState10[0],
@@ -55198,7 +55208,8 @@ var useTableVirtual = function useTableVirtual(props) {
55198
55208
  rateTimer: null,
55199
55209
  topTimer: null,
55200
55210
  controlScrollRate: null,
55201
- heightCallback: null
55211
+ heightCallback: null,
55212
+ preIndex: null
55202
55213
  }),
55203
55214
  context = _useRef.current;
55204
55215
  var getTranslate = usePersistFn(function (left, top) {
@@ -55231,6 +55242,8 @@ var useTableVirtual = function useTableVirtual(props) {
55231
55242
  if (context.shouldUpdateHeight) {
55232
55243
  setHeight(getContentHeight(props.data.length - 1));
55233
55244
  }
55245
+ var preIndex = context.preIndex;
55246
+ // 解决: 从下往上滚 由于高度变化会导致滚动条跳动
55234
55247
  if (preIndex && preIndex > startIndex && startIndex === index) {
55235
55248
  // 发生在顶部
55236
55249
  if (context.heightCallback) return;
@@ -55335,6 +55348,16 @@ var useTableVirtual = function useTableVirtual(props) {
55335
55348
  props.scrollRef.current.scrollTop = beforeHeight;
55336
55349
  }
55337
55350
  });
55351
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55352
+ // 记录preIndex
55353
+ context.preIndex = startIndex;
55354
+ }, [startIndex]);
55355
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55356
+ // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
55357
+ return function () {
55358
+ context.preIndex = null;
55359
+ };
55360
+ }, [props.data]);
55338
55361
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55339
55362
  if (props.disabled) return;
55340
55363
  if (offsetY) {
@@ -63077,7 +63100,7 @@ var upload_interface = __webpack_require__(4412);
63077
63100
 
63078
63101
 
63079
63102
  /* harmony default export */ var src_0 = ({
63080
- version: '3.2.3'
63103
+ version: '3.2.5-beta.1'
63081
63104
  });
63082
63105
  }();
63083
63106
  /******/ return __webpack_exports__;