shineout 3.7.7-beta.6 → 3.7.7-beta.8

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.7.7-beta.6'
525
+ version: '3.7.7-beta.8'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.7-beta.6');
12237
+ /* harmony default export */ var version = ('3.7.7-beta.8');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -35572,6 +35572,26 @@ var getCompleteFieldKeys = function getCompleteFieldKeys(fields, allFields) {
35572
35572
  // 返回之前去重
35573
35573
  return Array.from(new Set(completeFields));
35574
35574
  };
35575
+
35576
+ /**
35577
+ * 将对象中的所有值设置为空, 如果值是数组,重置为空数组,如果是对象,重置为空对象,如果是基础类型,重置为undefined
35578
+ * @param obj 对象
35579
+ * @returns 空对象
35580
+ */
35581
+ var clearValue = function clearValue(obj) {
35582
+ if (isArray(obj)) {
35583
+ return obj.map(function (item) {
35584
+ return clearValue(item);
35585
+ });
35586
+ }
35587
+ if (is_isObject(obj)) {
35588
+ return Object.keys(obj).reduce(function (acc, key) {
35589
+ acc[key] = clearValue(obj[key]);
35590
+ return acc;
35591
+ }, {});
35592
+ }
35593
+ return undefined;
35594
+ };
35575
35595
  ;// CONCATENATED MODULE: ../hooks/src/components/use-check/use-check.ts
35576
35596
 
35577
35597
 
@@ -41366,7 +41386,7 @@ function getResetMore(onFilter, container, doms) {
41366
41386
  var paddingLeft = parsePxToNumber(style.paddingLeft);
41367
41387
  var paddingRight = parsePxToNumber(style.paddingRight);
41368
41388
  var minFilterWidth = onFilter ? 16 : 0;
41369
- var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth - 1;
41389
+ var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth;
41370
41390
  var hideEl = items.pop();
41371
41391
  var hideElStyle = getComputedStyle(hideEl);
41372
41392
  var hideMargin = parsePxToNumber(hideElStyle.marginLeft) + parsePxToNumber(hideElStyle.marginRight);
@@ -51710,8 +51730,13 @@ var FormFieldSet = function FormFieldSet(props) {
51710
51730
  },
51711
51731
  onInsert: function onInsert(val) {
51712
51732
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
51733
+ var insertValue = val;
51734
+ var valueTemplate = oldValue[i];
51735
+ if (insertValue === undefined) {
51736
+ insertValue = clearValue(deepClone(valueTemplate));
51737
+ }
51713
51738
  var newValue = form_fieldset_produce(oldValue, function (draft) {
51714
- draft.splice(i, 0, val);
51739
+ draft.splice(i, 0, insertValue);
51715
51740
  });
51716
51741
  _onChange(newValue);
51717
51742
  // context.ids.splice(i, 0, util.generateUUID());
@@ -51719,8 +51744,13 @@ var FormFieldSet = function FormFieldSet(props) {
51719
51744
  },
51720
51745
  onAppend: function onAppend(val) {
51721
51746
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
51747
+ var insertValue = val;
51748
+ var valueTemplate = oldValue[i];
51749
+ if (insertValue === undefined) {
51750
+ insertValue = clearValue(deepClone(valueTemplate));
51751
+ }
51722
51752
  var newValue = form_fieldset_produce(oldValue, function (draft) {
51723
- draft.splice(i + 1, 0, val);
51753
+ draft.splice(i + 1, 0, insertValue);
51724
51754
  });
51725
51755
  _onChange(newValue);
51726
51756
  // context.ids.splice(i + 1, 0, util.generateUUID());
@@ -62770,7 +62800,7 @@ var useTableVirtual = function useTableVirtual(props) {
62770
62800
  for (var i = 0; i <= index; i++) {
62771
62801
  sum += context.cachedHeight[i] || props.rowHeight;
62772
62802
  }
62773
- return sum + props.theadAndTfootHeight;
62803
+ return sum + props.theadHeight + props.tfootHeight;
62774
62804
  };
62775
62805
  var setRowHeight = usePersistFn(function (index, height) {
62776
62806
  if (props.disabled) return;
@@ -62913,7 +62943,7 @@ var useTableVirtual = function useTableVirtual(props) {
62913
62943
  callback();
62914
62944
  }
62915
62945
  };
62916
- props.scrollRef.current.scrollTop = beforeHeight;
62946
+ props.scrollRef.current.scrollTop = beforeHeight - props.theadHeight;
62917
62947
  }
62918
62948
  });
62919
62949
  var scrollColumnByLeft = usePersistFn(function (targetLeft) {
@@ -62990,7 +63020,7 @@ var useTableVirtual = function useTableVirtual(props) {
62990
63020
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
62991
63021
  if (props.disabled) return;
62992
63022
  setHeight(getContentHeight(props.data.length - 1));
62993
- }, [props.data.length, props.theadAndTfootHeight]);
63023
+ }, [props.data.length, props.theadHeight, props.tfootHeight]);
62994
63024
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
62995
63025
  if (props.disabled) return;
62996
63026
  if (context.heightCallback) {
@@ -64776,7 +64806,8 @@ var emptyRef = {
64776
64806
  };
64777
64807
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
64778
64808
  emptyHeight: 0,
64779
- theadAndTfootHeight: 0,
64809
+ theadHeight: 0,
64810
+ tfootHeight: 0,
64780
64811
  scrollingTimer: null
64781
64812
  }),
64782
64813
  context = _useRef.current;
@@ -64914,9 +64945,10 @@ var emptyRef = {
64914
64945
  var theadHeight = (theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0;
64915
64946
  var tfootHeight = ((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0;
64916
64947
  if (props.sticky) {
64917
- context.theadAndTfootHeight = tfootHeight;
64948
+ context.tfootHeight = tfootHeight;
64918
64949
  } else {
64919
- context.theadAndTfootHeight = theadHeight + tfootHeight;
64950
+ context.theadHeight = theadHeight;
64951
+ context.tfootHeight = tfootHeight;
64920
64952
  }
64921
64953
  });
64922
64954
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
@@ -64952,7 +64984,8 @@ var emptyRef = {
64952
64984
  innerRef: tbodyRef,
64953
64985
  scrollLeft: props.scrollLeft,
64954
64986
  isRtl: isRtl,
64955
- theadAndTfootHeight: context.theadAndTfootHeight
64987
+ theadHeight: context.theadHeight,
64988
+ tfootHeight: context.tfootHeight
64956
64989
  });
64957
64990
  var syncHeaderScroll = usePersistFn(function (left) {
64958
64991
  var _tableRef$current;
@@ -71801,7 +71834,7 @@ var upload_interface = __webpack_require__(8821);
71801
71834
 
71802
71835
 
71803
71836
  /* harmony default export */ var src_0 = ({
71804
- version: '3.7.7-beta.6'
71837
+ version: '3.7.7-beta.8'
71805
71838
  });
71806
71839
  }();
71807
71840
  /******/ return __webpack_exports__;