shineout 3.9.8-beta.11 → 3.9.8-beta.13

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.13'
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.13');
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],
@@ -47359,7 +47360,36 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
47359
47360
  return item;
47360
47361
  });
47361
47362
  var isDis = isDisabledInputDate(inputValue);
47363
+
47364
+ // Check min/max constraints for inputValue
47365
+ var isOutOfRange = false;
47362
47366
  if (!isDis) {
47367
+ for (var i = 0; i < inputValue.length; i++) {
47368
+ var _date = inputValue[i];
47369
+ if (_date) {
47370
+ if (type === 'week') {
47371
+ if (props.min && util.compareWeek(_date, props.min, 0, options) < 0) {
47372
+ isOutOfRange = true;
47373
+ break;
47374
+ }
47375
+ if (props.max && util.compareWeek(_date, props.max, 0, options) > 0) {
47376
+ isOutOfRange = true;
47377
+ break;
47378
+ }
47379
+ } else {
47380
+ if (props.min && util.compareDay(_date, props.min, 0, options) < 0) {
47381
+ isOutOfRange = true;
47382
+ break;
47383
+ }
47384
+ if (props.max && util.compareDay(_date, props.max, 0, options) > 0) {
47385
+ isOutOfRange = true;
47386
+ break;
47387
+ }
47388
+ }
47389
+ }
47390
+ }
47391
+ }
47392
+ if (!isDis && !isOutOfRange) {
47363
47393
  formatValue = getFormatValueArr(inputValue);
47364
47394
  }
47365
47395
  }
@@ -49636,7 +49666,9 @@ var DatePicker = function DatePicker(props0) {
49636
49666
  disabled = props.disabled,
49637
49667
  size = props.size,
49638
49668
  _props$adjust = props.adjust,
49639
- adjust = _props$adjust === void 0 ? true : _props$adjust;
49669
+ adjust = _props$adjust === void 0 ? true : _props$adjust,
49670
+ startOfWeek = props.startOfWeek,
49671
+ weekShort = props.weekShort;
49640
49672
  var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(-1),
49641
49673
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
49642
49674
  activeIndex = _React$useState2[0],
@@ -49672,7 +49704,7 @@ var DatePicker = function DatePicker(props0) {
49672
49704
  var options = {
49673
49705
  timeZone: props.timeZone,
49674
49706
  // 需要确保 weekStartsOn 是 number,否则后续的星期顺序计算都会出错
49675
- weekStartsOn: Number(getLocale(locale, 'startOfWeek'))
49707
+ weekStartsOn: startOfWeek === null || startOfWeek === undefined ? Number(getLocale(locale, 'startOfWeek')) : startOfWeek
49676
49708
  };
49677
49709
  var inputAbleResult = useInputAble({
49678
49710
  value: props.value,
@@ -49696,7 +49728,9 @@ var DatePicker = function DatePicker(props0) {
49696
49728
  allowSingle: props.allowSingle,
49697
49729
  defaultCurrent: props.defaultPickerValue || props.defaultRangeMonth,
49698
49730
  formatResult: props.formatResult,
49699
- onPickerChange: props.onPickerChange
49731
+ onPickerChange: props.onPickerChange,
49732
+ min: props.min,
49733
+ max: props.max
49700
49734
  }),
49701
49735
  inputArr = _useDatePickerFormat.inputArr,
49702
49736
  resultArr = _useDatePickerFormat.resultArr,
@@ -49819,6 +49853,7 @@ var DatePicker = function DatePicker(props0) {
49819
49853
  disabledLeft: disabledStatus === 'left',
49820
49854
  disabledRight: disabledStatus === 'right',
49821
49855
  placeholder: props.placeholder,
49856
+ weekShort: weekShort,
49822
49857
  focused: focused,
49823
49858
  open: open,
49824
49859
  onFocus: handleFocus,
@@ -65043,21 +65078,21 @@ var useColumns = function useColumns(props) {
65043
65078
  var scrollLeft = scrollInfo.scrollLeft;
65044
65079
  var sum = 0;
65045
65080
  var currentIndex = 0;
65046
- for (var i = 0, len = middleColumns.length - 1; i < len; i++) {
65081
+ for (var i = 0, len = middleColumns.length; i < len; i++) {
65047
65082
  var curCol = middleColumns[i];
65048
65083
  sum += curCol.width || 100;
65049
65084
  if (scrollLeft < sum) {
65050
65085
  // 计算可视区域内需要渲染的列数
65051
- for (var j = i + 1; j <= len; j++) {
65086
+ for (var j = i + 1; j < len; j++) {
65052
65087
  var _props$scrollRef$curr;
65053
65088
  var nextCol = middleColumns[j];
65054
65089
  sum += nextCol.width || 100;
65055
65090
  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
65091
  // 在原有基础上,右侧增加缓冲列
65057
- var visibleCount = j - i;
65092
+ var visibleCount = j - i + 1;
65058
65093
  setRenderedCount(Math.min(visibleCount + overscan * 2, len));
65059
65094
  break;
65060
- } else if (j === len) {
65095
+ } else if (j === len - 1) {
65061
65096
  // 到达最后一列
65062
65097
  var _visibleCount = j - i + 1;
65063
65098
  setRenderedCount(Math.min(_visibleCount + overscan * 2, len));
@@ -65094,17 +65129,24 @@ var useColumns = function useColumns(props) {
65094
65129
  if (col.fixed) {
65095
65130
  return col;
65096
65131
  }
65097
- if (index < startIndex || index > startIndex + renderedCount) {
65132
+ // 计算当前列在 middleColumns 中的索引
65133
+ var middleIndex = index - leftFixedColumns.length;
65134
+
65135
+ // 如果不在可渲染范围内
65136
+ if (middleIndex < startIndex || middleIndex > startIndex + renderedCount) {
65098
65137
  var colSpan;
65099
65138
  var colSpanWidth;
65100
- if (index > startIndex + renderedCount && index === startIndex + renderedCount + 1) {
65139
+ // 如果是可见范围后的第一列,合并后面所有隐藏的列
65140
+ if (middleIndex > startIndex + renderedCount && middleIndex === startIndex + renderedCount + 1) {
65101
65141
  colSpan = function colSpan() {
65102
- return middleColumns.length - index;
65142
+ return middleColumns.length - middleIndex;
65103
65143
  };
65104
- colSpanWidth = middleColumns.slice(index).reduce(function (sum, c) {
65144
+ colSpanWidth = middleColumns.slice(middleIndex).reduce(function (sum, c) {
65105
65145
  return sum + (c.width || 0);
65106
65146
  }, 0);
65107
- } else if (index < startIndex && index === leftFixedColumns.length && startIndex > 0) {
65147
+ }
65148
+ // 如果是第一个中间列且前面有隐藏列,合并前面所有隐藏的列
65149
+ else if (middleIndex < startIndex && middleIndex === 0 && startIndex > 0) {
65108
65150
  colSpan = function colSpan() {
65109
65151
  return startIndex;
65110
65152
  };
@@ -75178,7 +75220,7 @@ var upload_interface = __webpack_require__(8821);
75178
75220
 
75179
75221
 
75180
75222
  /* harmony default export */ var src_0 = ({
75181
- version: '3.9.8-beta.11'
75223
+ version: '3.9.8-beta.13'
75182
75224
  });
75183
75225
  }();
75184
75226
  /******/ return __webpack_exports__;