shineout 3.9.8-beta.11 → 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.11'
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.11');
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,
@@ -65043,21 +65047,21 @@ var useColumns = function useColumns(props) {
65043
65047
  var scrollLeft = scrollInfo.scrollLeft;
65044
65048
  var sum = 0;
65045
65049
  var currentIndex = 0;
65046
- for (var i = 0, len = middleColumns.length - 1; i < len; i++) {
65050
+ for (var i = 0, len = middleColumns.length; i < len; i++) {
65047
65051
  var curCol = middleColumns[i];
65048
65052
  sum += curCol.width || 100;
65049
65053
  if (scrollLeft < sum) {
65050
65054
  // 计算可视区域内需要渲染的列数
65051
- for (var j = i + 1; j <= len; j++) {
65055
+ for (var j = i + 1; j < len; j++) {
65052
65056
  var _props$scrollRef$curr;
65053
65057
  var nextCol = middleColumns[j];
65054
65058
  sum += nextCol.width || 100;
65055
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)) {
65056
65060
  // 在原有基础上,右侧增加缓冲列
65057
- var visibleCount = j - i;
65061
+ var visibleCount = j - i + 1;
65058
65062
  setRenderedCount(Math.min(visibleCount + overscan * 2, len));
65059
65063
  break;
65060
- } else if (j === len) {
65064
+ } else if (j === len - 1) {
65061
65065
  // 到达最后一列
65062
65066
  var _visibleCount = j - i + 1;
65063
65067
  setRenderedCount(Math.min(_visibleCount + overscan * 2, len));
@@ -65094,17 +65098,24 @@ var useColumns = function useColumns(props) {
65094
65098
  if (col.fixed) {
65095
65099
  return col;
65096
65100
  }
65097
- if (index < startIndex || index > startIndex + renderedCount) {
65101
+ // 计算当前列在 middleColumns 中的索引
65102
+ var middleIndex = index - leftFixedColumns.length;
65103
+
65104
+ // 如果不在可渲染范围内
65105
+ if (middleIndex < startIndex || middleIndex > startIndex + renderedCount) {
65098
65106
  var colSpan;
65099
65107
  var colSpanWidth;
65100
- if (index > startIndex + renderedCount && index === startIndex + renderedCount + 1) {
65108
+ // 如果是可见范围后的第一列,合并后面所有隐藏的列
65109
+ if (middleIndex > startIndex + renderedCount && middleIndex === startIndex + renderedCount + 1) {
65101
65110
  colSpan = function colSpan() {
65102
- return middleColumns.length - index;
65111
+ return middleColumns.length - middleIndex;
65103
65112
  };
65104
- colSpanWidth = middleColumns.slice(index).reduce(function (sum, c) {
65113
+ colSpanWidth = middleColumns.slice(middleIndex).reduce(function (sum, c) {
65105
65114
  return sum + (c.width || 0);
65106
65115
  }, 0);
65107
- } else if (index < startIndex && index === leftFixedColumns.length && startIndex > 0) {
65116
+ }
65117
+ // 如果是第一个中间列且前面有隐藏列,合并前面所有隐藏的列
65118
+ else if (middleIndex < startIndex && middleIndex === 0 && startIndex > 0) {
65108
65119
  colSpan = function colSpan() {
65109
65120
  return startIndex;
65110
65121
  };
@@ -75178,7 +75189,7 @@ var upload_interface = __webpack_require__(8821);
75178
75189
 
75179
75190
 
75180
75191
  /* harmony default export */ var src_0 = ({
75181
- version: '3.9.8-beta.11'
75192
+ version: '3.9.8-beta.12'
75182
75193
  });
75183
75194
  }();
75184
75195
  /******/ return __webpack_exports__;