shineout 3.9.8-beta.10 → 3.9.8-beta.12

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.8-beta.10'
525
+ version: '3.9.8-beta.12'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12402,7 +12402,7 @@ var handleStyle = function handleStyle(style) {
12402
12402
  };
12403
12403
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12405
- /* harmony default export */ var version = ('3.9.8-beta.10');
12405
+ /* harmony default export */ var version = ('3.9.8-beta.12');
12406
12406
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12407
12407
 
12408
12408
 
@@ -42449,6 +42449,7 @@ var Result = function Result(props) {
42449
42449
  disabledRight = props.disabledRight,
42450
42450
  _props$activeIndex = props.activeIndex,
42451
42451
  activeIndex = _props$activeIndex === void 0 ? -1 : _props$activeIndex,
42452
+ weekShort = props.weekShort,
42452
42453
  onClickProps = props.onClick;
42453
42454
  var _useConfig = useConfig(),
42454
42455
  locale = _useConfig.locale;
@@ -42510,7 +42511,7 @@ var Result = function Result(props) {
42510
42511
  var className = classnames_default()(styles === null || styles === void 0 ? void 0 : styles.resultText, info.target && (styles === null || styles === void 0 ? void 0 : styles.placeholder), dis && (styles === null || styles === void 0 ? void 0 : styles.resultTextDisabled), info.index === activeIndex && (styles === null || styles === void 0 ? void 0 : styles.resultTextActive));
42511
42512
  var formFieldId = (fieldId === null || fieldId === void 0 ? void 0 : fieldId.split(separator)) || [];
42512
42513
  var inputValue = info.target || info.value || '';
42513
- var displayValue = props.type === 'week' && inputValue ? "".concat(inputValue).concat(getLocale(locale, 'weekShort')) : inputValue;
42514
+ var displayValue = props.type === 'week' && inputValue && weekShort !== null ? "".concat(inputValue).concat(weekShort === undefined ? getLocale(locale, 'weekShort') : weekShort) : inputValue;
42514
42515
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
42515
42516
  className: className,
42516
42517
  id: formFieldId[info.index],
@@ -49636,7 +49637,9 @@ var DatePicker = function DatePicker(props0) {
49636
49637
  disabled = props.disabled,
49637
49638
  size = props.size,
49638
49639
  _props$adjust = props.adjust,
49639
- adjust = _props$adjust === void 0 ? true : _props$adjust;
49640
+ adjust = _props$adjust === void 0 ? true : _props$adjust,
49641
+ startOfWeek = props.startOfWeek,
49642
+ weekShort = props.weekShort;
49640
49643
  var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(-1),
49641
49644
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
49642
49645
  activeIndex = _React$useState2[0],
@@ -49672,7 +49675,7 @@ var DatePicker = function DatePicker(props0) {
49672
49675
  var options = {
49673
49676
  timeZone: props.timeZone,
49674
49677
  // 需要确保 weekStartsOn 是 number,否则后续的星期顺序计算都会出错
49675
- weekStartsOn: Number(getLocale(locale, 'startOfWeek'))
49678
+ weekStartsOn: startOfWeek === null || startOfWeek === undefined ? Number(getLocale(locale, 'startOfWeek')) : startOfWeek
49676
49679
  };
49677
49680
  var inputAbleResult = useInputAble({
49678
49681
  value: props.value,
@@ -49819,6 +49822,7 @@ var DatePicker = function DatePicker(props0) {
49819
49822
  disabledLeft: disabledStatus === 'left',
49820
49823
  disabledRight: disabledStatus === 'right',
49821
49824
  placeholder: props.placeholder,
49825
+ weekShort: weekShort,
49822
49826
  focused: focused,
49823
49827
  open: open,
49824
49828
  onFocus: handleFocus,
@@ -50470,6 +50474,7 @@ function _ReactUnmount() {
50470
50474
 
50471
50475
 
50472
50476
 
50477
+
50473
50478
  var hasMask = false;
50474
50479
  var modal_content_config = {
50475
50480
  instanceIds: [],
@@ -50528,6 +50533,8 @@ var Modal = function Modal(props) {
50528
50533
  var _props$jssStyle, _props$jssStyle$modal;
50529
50534
  var modalClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$modal = _props$jssStyle.modal) === null || _props$jssStyle$modal === void 0 ? void 0 : _props$jssStyle$modal.call(_props$jssStyle);
50530
50535
  var panelRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
50536
+ var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
50537
+ var popupCtx = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(popup_context);
50531
50538
  var isPositionX = ['left', 'right'].includes(props.position || '');
50532
50539
  var isPositionY = ['top', 'bottom'].includes(props.position || '');
50533
50540
  var defaultWidth = isPositionX ? 'auto' : 500;
@@ -50741,6 +50748,22 @@ var Modal = function Modal(props) {
50741
50748
  }
50742
50749
  }, [props.setInnerClose]);
50743
50750
 
50751
+ // 将 Modal 的 ref 注册到父 Popover 的 chain 中,防止点击 Modal 时关闭 Popover
50752
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
50753
+ // Modal 显示或关闭动画播放期间,都需要在 chain 中
50754
+ if (wrapperRef.current) {
50755
+ if (visible) {
50756
+ popupCtx.bindChild(wrapperRef);
50757
+ } else {
50758
+ popupCtx.removeChild(wrapperRef);
50759
+ }
50760
+ }
50761
+ return function () {
50762
+ // 确保清理时移除
50763
+ popupCtx.removeChild(wrapperRef);
50764
+ };
50765
+ }, [visible]);
50766
+
50744
50767
  // render
50745
50768
  var renderIcon = function renderIcon(isEmptyTitle) {
50746
50769
  var iconRoot = classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerIcon, isEmptyTitle && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.emptyIcon));
@@ -50869,6 +50892,7 @@ var Modal = function Modal(props) {
50869
50892
  context.content = content;
50870
50893
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormFooterProvider, {
50871
50894
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
50895
+ ref: wrapperRef,
50872
50896
  onClick: function onClick(e) {
50873
50897
  e.stopPropagation();
50874
50898
  },
@@ -65023,21 +65047,21 @@ var useColumns = function useColumns(props) {
65023
65047
  var scrollLeft = scrollInfo.scrollLeft;
65024
65048
  var sum = 0;
65025
65049
  var currentIndex = 0;
65026
- for (var i = 0, len = middleColumns.length - 1; i < len; i++) {
65050
+ for (var i = 0, len = middleColumns.length; i < len; i++) {
65027
65051
  var curCol = middleColumns[i];
65028
65052
  sum += curCol.width || 100;
65029
65053
  if (scrollLeft < sum) {
65030
65054
  // 计算可视区域内需要渲染的列数
65031
- for (var j = i + 1; j <= len; j++) {
65055
+ for (var j = i + 1; j < len; j++) {
65032
65056
  var _props$scrollRef$curr;
65033
65057
  var nextCol = middleColumns[j];
65034
65058
  sum += nextCol.width || 100;
65035
65059
  if (props.scrollRef.current && sum - scrollLeft >= ((_props$scrollRef$curr = props.scrollRef.current) === null || _props$scrollRef$curr === void 0 ? void 0 : _props$scrollRef$curr.clientWidth)) {
65036
65060
  // 在原有基础上,右侧增加缓冲列
65037
- var visibleCount = j - i;
65061
+ var visibleCount = j - i + 1;
65038
65062
  setRenderedCount(Math.min(visibleCount + overscan * 2, len));
65039
65063
  break;
65040
- } else if (j === len) {
65064
+ } else if (j === len - 1) {
65041
65065
  // 到达最后一列
65042
65066
  var _visibleCount = j - i + 1;
65043
65067
  setRenderedCount(Math.min(_visibleCount + overscan * 2, len));
@@ -65074,17 +65098,24 @@ var useColumns = function useColumns(props) {
65074
65098
  if (col.fixed) {
65075
65099
  return col;
65076
65100
  }
65077
- if (index < startIndex || index > startIndex + renderedCount) {
65101
+ // 计算当前列在 middleColumns 中的索引
65102
+ var middleIndex = index - leftFixedColumns.length;
65103
+
65104
+ // 如果不在可渲染范围内
65105
+ if (middleIndex < startIndex || middleIndex > startIndex + renderedCount) {
65078
65106
  var colSpan;
65079
65107
  var colSpanWidth;
65080
- if (index > startIndex + renderedCount && index === startIndex + renderedCount + 1) {
65108
+ // 如果是可见范围后的第一列,合并后面所有隐藏的列
65109
+ if (middleIndex > startIndex + renderedCount && middleIndex === startIndex + renderedCount + 1) {
65081
65110
  colSpan = function colSpan() {
65082
- return middleColumns.length - index;
65111
+ return middleColumns.length - middleIndex;
65083
65112
  };
65084
- colSpanWidth = middleColumns.slice(index).reduce(function (sum, c) {
65113
+ colSpanWidth = middleColumns.slice(middleIndex).reduce(function (sum, c) {
65085
65114
  return sum + (c.width || 0);
65086
65115
  }, 0);
65087
- } else if (index < startIndex && index === leftFixedColumns.length && startIndex > 0) {
65116
+ }
65117
+ // 如果是第一个中间列且前面有隐藏列,合并前面所有隐藏的列
65118
+ else if (middleIndex < startIndex && middleIndex === 0 && startIndex > 0) {
65088
65119
  colSpan = function colSpan() {
65089
65120
  return startIndex;
65090
65121
  };
@@ -75158,7 +75189,7 @@ var upload_interface = __webpack_require__(8821);
75158
75189
 
75159
75190
 
75160
75191
  /* harmony default export */ var src_0 = ({
75161
- version: '3.9.8-beta.10'
75192
+ version: '3.9.8-beta.12'
75162
75193
  });
75163
75194
  }();
75164
75195
  /******/ return __webpack_exports__;