shineout 3.9.3-beta.13 → 3.9.3-beta.15

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.3-beta.13'
525
+ version: '3.9.3-beta.15'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12401,7 +12401,7 @@ var handleStyle = function handleStyle(style) {
12401
12401
  };
12402
12402
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12403
12403
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12404
- /* harmony default export */ var version = ('3.9.3-beta.13');
12404
+ /* harmony default export */ var version = ('3.9.3-beta.15');
12405
12405
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12406
12406
 
12407
12407
 
@@ -47453,15 +47453,24 @@ var useDate = function useDate(props) {
47453
47453
  var getTimeStr = function getTimeStr() {
47454
47454
  var format = props.format,
47455
47455
  type = props.type;
47456
- if (!props.value) return '';
47457
47456
  if (type !== 'datetime' || !format) return '';
47458
- if (/^[X|x]$/.test(format)) {
47457
+ if (/^[X|x]$/.test(util.compatibleFmt(format))) {
47459
47458
  format = 'HH:mm:ss';
47460
47459
  } else {
47461
47460
  var match = format.match(/[H|h].*/);
47462
47461
  // eslint-disable-next-line
47463
47462
  if (match) format = match[0];
47464
47463
  }
47464
+
47465
+ // 当不存在 props.value 时,根据 format 格式返回默认时间字符串
47466
+ if (!props.value) {
47467
+ return format.replace(/[Hh]+/g, '00') // HH/hh -> 00
47468
+ .replace(/m+/g, '00') // mm -> 00
47469
+ .replace(/s+/g, '00') // ss -> 00
47470
+ .replace(/S+/g, '0') // SSS -> 0
47471
+ .replace(/A/g, 'AM') // A -> AM
47472
+ .replace(/a/g, 'am'); // a -> am
47473
+ }
47465
47474
  return util.format(props.value, format, options);
47466
47475
  };
47467
47476
  var isInRange = function isInRange(date) {
@@ -64671,14 +64680,14 @@ var useColumns = function useColumns(props) {
64671
64680
  });
64672
64681
  }, []);
64673
64682
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
64674
- var _props$scrollRef$curr2;
64675
64683
  if (!props.virtualColumn) return;
64676
- if (((_props$scrollRef$curr2 = props.scrollRef.current) === null || _props$scrollRef$curr2 === void 0 ? void 0 : _props$scrollRef$curr2.scrollLeft) === 0) {
64684
+ if (props.scrollRef.current) {
64685
+ var _props$scrollRef$curr2;
64677
64686
  handleScroll({
64678
- scrollLeft: 0
64687
+ scrollLeft: (_props$scrollRef$curr2 = props.scrollRef.current) === null || _props$scrollRef$curr2 === void 0 ? void 0 : _props$scrollRef$curr2.scrollLeft
64679
64688
  });
64680
64689
  }
64681
- }, [(_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length]);
64690
+ }, [(_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length, columns]);
64682
64691
  var processedColumns = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
64683
64692
  if (!props.virtualColumn) return columns;
64684
64693
  return columns.map(function (col, index) {
@@ -64687,14 +64696,21 @@ var useColumns = function useColumns(props) {
64687
64696
  }
64688
64697
  if (index < startIndex || index > startIndex + renderedCount) {
64689
64698
  var colSpan;
64699
+ var colSpanWidth;
64690
64700
  if (index > startIndex + renderedCount && index === startIndex + renderedCount + 1) {
64691
64701
  colSpan = function colSpan() {
64692
64702
  return middleColumns.length - (startIndex + renderedCount) + 1;
64693
64703
  };
64704
+ colSpanWidth = middleColumns.slice(startIndex + renderedCount).reduce(function (sum, c) {
64705
+ return sum + (c.width || 0);
64706
+ }, 0);
64694
64707
  } else if (index < startIndex && index === leftFixedColumns.length && startIndex > 0) {
64695
64708
  colSpan = function colSpan() {
64696
64709
  return startIndex;
64697
64710
  };
64711
+ colSpanWidth = middleColumns.slice(0, startIndex).reduce(function (sum, c) {
64712
+ return sum + (c.width || 0);
64713
+ }, 0);
64698
64714
  }
64699
64715
  var hiddenTitle = context.groupLevel > 0 ? col.title : null;
64700
64716
  return objectSpread2_default()(objectSpread2_default()({}, col), {}, {
@@ -64702,7 +64718,10 @@ var useColumns = function useColumns(props) {
64702
64718
  render: function render() {
64703
64719
  return null;
64704
64720
  },
64705
- title: hiddenTitle
64721
+ title: hiddenTitle,
64722
+ style: {
64723
+ width: colSpanWidth
64724
+ }
64706
64725
  });
64707
64726
  }
64708
64727
  return col;
@@ -74722,7 +74741,7 @@ var upload_interface = __webpack_require__(8821);
74722
74741
 
74723
74742
 
74724
74743
  /* harmony default export */ var src_0 = ({
74725
- version: '3.9.3-beta.13'
74744
+ version: '3.9.3-beta.15'
74726
74745
  });
74727
74746
  }();
74728
74747
  /******/ return __webpack_exports__;