shineout 3.9.0-beta.27 → 3.9.0-beta.28

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.0-beta.27'
525
+ version: '3.9.0-beta.28'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
12400
12400
  };
12401
12401
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12403
- /* harmony default export */ var version = ('3.9.0-beta.27');
12403
+ /* harmony default export */ var version = ('3.9.0-beta.28');
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12405
12405
 
12406
12406
 
@@ -18822,13 +18822,13 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()(objectSpre
18822
18822
  color: src.datePickerCellOtherColor
18823
18823
  },
18824
18824
  '&:not($pickerCellDisabled):not($pickerCellActive):hover': {
18825
- '& span': {
18825
+ '& $pickerCellContent > span': {
18826
18826
  backgroundColor: src.datePickerCellHoverBackgroundColor,
18827
18827
  color: src.datePickerCellHoverColor
18828
18828
  }
18829
18829
  },
18830
18830
  '&$pickerCellInRange:not($pickerCellActive):not($pickerCellDisabled):hover': {
18831
- '& span': {
18831
+ '& $pickerCellContent > span': {
18832
18832
  backgroundColor: src.datePickerCellActiveHoverBackgroundColor
18833
18833
  }
18834
18834
  },
@@ -18842,7 +18842,7 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()(objectSpre
18842
18842
  position: 'relative',
18843
18843
  height: src.datePickerCellHeight,
18844
18844
  lineHeight: src.datePickerCellHeight,
18845
- '& span': {
18845
+ '& > span': {
18846
18846
  display: 'inline-block',
18847
18847
  minWidth: src.datePickerCellHotHeight,
18848
18848
  height: src.datePickerCellHotHeight,
@@ -41108,7 +41108,9 @@ var Scroll = function Scroll(props) {
41108
41108
  _props$scrollWidth = props.scrollWidth,
41109
41109
  scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
41110
41110
  _props$defaultHeight = props.defaultHeight,
41111
- defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
41111
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
41112
+ _props$keepScrollTop = props.keepScrollTop,
41113
+ keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
41112
41114
  var _useResize = useResize({
41113
41115
  targetRef: containerRef,
41114
41116
  timer: 100
@@ -41133,7 +41135,9 @@ var Scroll = function Scroll(props) {
41133
41135
 
41134
41136
  // 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
41135
41137
  var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
41136
- return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
41138
+ var maxHeight = Math.max(0, scrollHeight - height);
41139
+ if (keepScrollTop) return maxHeight;
41140
+ return height === 0 ? 0 : maxHeight;
41137
41141
  }, [scrollHeight, height]);
41138
41142
  var placeStyle = {
41139
41143
  paddingTop: paddingTop,
@@ -41422,6 +41426,7 @@ var VirtualList = function VirtualList(props) {
41422
41426
  wrapperRef: wrapperRef,
41423
41427
  onScroll: handleScroll,
41424
41428
  onMouseMove: handleMouseMove,
41429
+ keepScrollTop: keepScrollTop,
41425
41430
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Tag, {
41426
41431
  className: tagClassName,
41427
41432
  style: innerStyle,
@@ -47138,17 +47143,17 @@ var useDate = function useDate(props) {
47138
47143
  }),
47139
47144
  context = _useRef.current;
47140
47145
  var current = props.current === undefined || !props.current ? currentState : props.current;
47141
- var setCurrent = function setCurrent(date) {
47146
+ var setCurrent = function setCurrent(date, type) {
47142
47147
  var _props$onCurrentChang2;
47143
47148
  if (props.current !== undefined) {
47144
47149
  var _props$onCurrentChang;
47145
- (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date);
47150
+ (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date, type);
47146
47151
  } else {
47147
47152
  if (date) {
47148
47153
  setCurrentState(date);
47149
47154
  }
47150
47155
  }
47151
- (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date);
47156
+ (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date, type);
47152
47157
  };
47153
47158
  var isToday = function isToday(date) {
47154
47159
  var today = util.newDate(undefined, options);
@@ -47170,19 +47175,19 @@ var useDate = function useDate(props) {
47170
47175
  }, [options.weekStartsOn]);
47171
47176
  var handleNextYear = use_persist_fn(function () {
47172
47177
  var date = util.addYears(current, 1, options);
47173
- setCurrent(date);
47178
+ setCurrent(date, 'year');
47174
47179
  });
47175
47180
  var handlePrevYear = use_persist_fn(function () {
47176
47181
  var date = util.addYears(current, -1, options);
47177
- setCurrent(date);
47182
+ setCurrent(date, 'year');
47178
47183
  });
47179
47184
  var handleNextMonth = use_persist_fn(function () {
47180
47185
  var date = util.addMonths(current, 1, options);
47181
- setCurrent(date);
47186
+ setCurrent(date, 'month');
47182
47187
  });
47183
47188
  var handlePrevMonth = use_persist_fn(function () {
47184
47189
  var date = util.addMonths(current, -1, options);
47185
- setCurrent(date);
47190
+ setCurrent(date, 'month');
47186
47191
  });
47187
47192
  var isCurrentMonth = function isCurrentMonth(date) {
47188
47193
  return util.isSameMonth(date, current, options);
@@ -47789,8 +47794,8 @@ var Day = function Day(props) {
47789
47794
  props.onChange(date, noClose || props.type === 'datetime');
47790
47795
  props.setTarget(undefined);
47791
47796
  });
47792
- var setCurrent = usePersistFn(function (date) {
47793
- props.setCurrent(date, areaType);
47797
+ var setCurrent = usePersistFn(function (date, type) {
47798
+ props.setCurrent(date, type || areaType);
47794
47799
  });
47795
47800
  var _useDatePick = use_date({
47796
47801
  current: props.current,
@@ -47822,7 +47827,7 @@ var Day = function Day(props) {
47822
47827
  props.setCurrent(new Date(), areaType);
47823
47828
  props.onChange(new Date(), props.needConfirm || props.type === 'datetime');
47824
47829
  setTimeout(function () {
47825
- if (props.closeByConfirm && !props.range) props.closeByConfirm();
47830
+ if (props.needConfirm && props.closeByConfirm && !props.range) props.closeByConfirm();
47826
47831
  }, 0);
47827
47832
  };
47828
47833
  var renderDay = function renderDay(item, index) {
@@ -47852,7 +47857,16 @@ var Day = function Day(props) {
47852
47857
  onMouseLeave: isDisabled ? undefined : function () {
47853
47858
  props.setTarget(undefined);
47854
47859
  },
47855
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
47860
+ children: props.renderDate ? props.renderDate({
47861
+ date: item,
47862
+ isDisabled: isDisabled,
47863
+ isInRange: isInRange,
47864
+ isToday: isToday,
47865
+ isCurrentMonth: isCurrentMonth,
47866
+ isActive: isActive,
47867
+ position: props.position,
47868
+ className: styles === null || styles === void 0 ? void 0 : styles.pickerCellContent
47869
+ }) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
47856
47870
  className: styles === null || styles === void 0 ? void 0 : styles.pickerCellContent,
47857
47871
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
47858
47872
  children: func.getDayStr(item)
@@ -48053,15 +48067,15 @@ var useMonth = function useMonth(props) {
48053
48067
  context = _useRef.current;
48054
48068
  var current = props.current === undefined ? currentState : props.current;
48055
48069
  var startYear = util.getDateInfo(current, 'year', options);
48056
- var setCurrent = function setCurrent(date) {
48070
+ var setCurrent = function setCurrent(date, type) {
48057
48071
  var _props$onCurrentChang2;
48058
48072
  if (props.current !== undefined) {
48059
48073
  var _props$onCurrentChang;
48060
- (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date);
48074
+ (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date, type);
48061
48075
  } else {
48062
48076
  setCurrentState(date);
48063
48077
  }
48064
- (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date);
48078
+ (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date, type);
48065
48079
  };
48066
48080
  var isNow = function isNow(date) {
48067
48081
  var today = util.newDate(undefined, options);
@@ -48083,11 +48097,11 @@ var useMonth = function useMonth(props) {
48083
48097
  };
48084
48098
  var handleNext = use_persist_fn(function () {
48085
48099
  var date = util.addYears(current, 1, options);
48086
- setCurrent(date);
48100
+ setCurrent(date, 'year');
48087
48101
  });
48088
48102
  var handlePrev = use_persist_fn(function () {
48089
48103
  var date = util.addYears(current, -1, options);
48090
- setCurrent(date);
48104
+ setCurrent(date, 'year');
48091
48105
  });
48092
48106
  var isDisabled = function isDisabled(date) {
48093
48107
  var min = props.min,
@@ -48164,8 +48178,8 @@ var Month = function Month(props) {
48164
48178
  var changeMode = usePersistFn(function () {
48165
48179
  props.setMode('day');
48166
48180
  });
48167
- var setCurrent = usePersistFn(function (date) {
48168
- props.setCurrent(date, 'month');
48181
+ var setCurrent = usePersistFn(function (date, type) {
48182
+ props.setCurrent(date, type || 'month');
48169
48183
  });
48170
48184
  var _useMonthPick = use_month({
48171
48185
  current: props.current,
@@ -48286,15 +48300,15 @@ var useYear = function useYear(props) {
48286
48300
  context = _useRef.current;
48287
48301
  var current = props.current === undefined ? currentState : props.current;
48288
48302
  var startYear = util.getStartYear(current, options);
48289
- var setCurrent = function setCurrent(date) {
48303
+ var setCurrent = function setCurrent(date, type) {
48290
48304
  var _props$onCurrentChang2;
48291
48305
  if (props.current !== undefined) {
48292
48306
  var _props$onCurrentChang;
48293
- (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date);
48307
+ (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date, type);
48294
48308
  } else {
48295
48309
  setCurrentState(date);
48296
48310
  }
48297
- (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date);
48311
+ (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date, type);
48298
48312
  };
48299
48313
  var isNow = function isNow(date) {
48300
48314
  var today = util.newDate(undefined, options);
@@ -48316,11 +48330,11 @@ var useYear = function useYear(props) {
48316
48330
  };
48317
48331
  var handleNext = use_persist_fn(function () {
48318
48332
  var date = util.addYears(current, 10, options);
48319
- setCurrent(date);
48333
+ setCurrent(date, 'year');
48320
48334
  });
48321
48335
  var handlePrev = use_persist_fn(function () {
48322
48336
  var date = util.addYears(current, -10, options);
48323
- setCurrent(date);
48337
+ setCurrent(date, 'year');
48324
48338
  });
48325
48339
  var isDisabled = function isDisabled(date) {
48326
48340
  var min = props.min,
@@ -48399,8 +48413,8 @@ var Year = function Year(props) {
48399
48413
  var changeMode = usePersistFn(function () {
48400
48414
  props.setMode('month');
48401
48415
  });
48402
- var setCurrent = usePersistFn(function (date) {
48403
- props.setCurrent(date, 'year');
48416
+ var setCurrent = usePersistFn(function (date, type) {
48417
+ props.setCurrent(date, type || 'year');
48404
48418
  });
48405
48419
  var _useYearPick = use_year({
48406
48420
  current: props.current,
@@ -48524,15 +48538,15 @@ var useQuarter = function useQuarter(props) {
48524
48538
  context = _useRef.current;
48525
48539
  var current = props.current === undefined ? currentState : props.current;
48526
48540
  var startYear = util.getDateInfo(current, 'year', options);
48527
- var setCurrent = function setCurrent(date) {
48541
+ var setCurrent = function setCurrent(date, type) {
48528
48542
  var _props$onCurrentChang2;
48529
48543
  if (props.current !== undefined) {
48530
48544
  var _props$onCurrentChang;
48531
- (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date);
48545
+ (_props$onCurrentChang = props.onCurrentChange) === null || _props$onCurrentChang === void 0 || _props$onCurrentChang.call(props, date, type);
48532
48546
  } else {
48533
48547
  setCurrentState(date);
48534
48548
  }
48535
- (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date);
48549
+ (_props$onCurrentChang2 = props.onCurrentChange) === null || _props$onCurrentChang2 === void 0 || _props$onCurrentChang2.call(props, date, type);
48536
48550
  };
48537
48551
  var isNow = function isNow(date) {
48538
48552
  var today = util.newDate(undefined, options);
@@ -48553,11 +48567,11 @@ var useQuarter = function useQuarter(props) {
48553
48567
  };
48554
48568
  var handleNext = use_persist_fn(function () {
48555
48569
  var date = util.addYears(current, 1, options);
48556
- setCurrent(date);
48570
+ setCurrent(date, 'year');
48557
48571
  });
48558
48572
  var handlePrev = use_persist_fn(function () {
48559
48573
  var date = util.addYears(current, -1, options);
48560
- setCurrent(date);
48574
+ setCurrent(date, 'year');
48561
48575
  });
48562
48576
  var isDisabled = function isDisabled(date) {
48563
48577
  var min = props.min,
@@ -48629,8 +48643,8 @@ var Quarter = function Quarter(props) {
48629
48643
  var jssStyle = props.jssStyle;
48630
48644
  var config = useConfig();
48631
48645
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$datePicker = jssStyle.datePicker) === null || _jssStyle$datePicker === void 0 ? void 0 : _jssStyle$datePicker.call(jssStyle);
48632
- var setCurrent = usePersistFn(function (date) {
48633
- props.setCurrent(date, 'quarter');
48646
+ var setCurrent = usePersistFn(function (date, type) {
48647
+ props.setCurrent(date, type || 'quarter');
48634
48648
  });
48635
48649
  var _useQuarterPick = use_quarter({
48636
48650
  current: props.current,
@@ -48846,11 +48860,8 @@ var useRangePick = function useRangePick(props) {
48846
48860
  return newArr;
48847
48861
  });
48848
48862
  };
48849
- var setCurrent = usePersistFn(function (index, date) {
48850
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
48851
- args[_key - 2] = arguments[_key];
48852
- }
48853
- props.setCurrentArr.apply(props, [function (arr) {
48863
+ var setCurrent = usePersistFn(function (index, date, type) {
48864
+ props.setCurrentArr(function (arr) {
48854
48865
  var newArr = toConsumableArray_default()(arr);
48855
48866
  newArr[index] = date;
48856
48867
  var modeCache = context.modeCache;
@@ -48876,19 +48887,13 @@ var useRangePick = function useRangePick(props) {
48876
48887
  }
48877
48888
  }
48878
48889
  return newArr;
48879
- }].concat(args));
48890
+ }, type, undefined);
48880
48891
  });
48881
- var setCurrentStart = usePersistFn(function (date) {
48882
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
48883
- args[_key2 - 1] = arguments[_key2];
48884
- }
48885
- setCurrent.apply(void 0, [0, date].concat(args));
48892
+ var setCurrentStart = usePersistFn(function (date, type) {
48893
+ setCurrent(0, date, type);
48886
48894
  });
48887
- var setCurrentEnd = usePersistFn(function (date) {
48888
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
48889
- args[_key3 - 1] = arguments[_key3];
48890
- }
48891
- setCurrent.apply(void 0, [1, date].concat(args));
48895
+ var setCurrentEnd = usePersistFn(function (date, type) {
48896
+ setCurrent(1, date, type);
48892
48897
  });
48893
48898
  var setDateStart = usePersistFn(function (date, noClose) {
48894
48899
  setDate(0, date, noClose);
@@ -49139,6 +49144,7 @@ var Picker = function Picker(props) {
49139
49144
  }
49140
49145
  if (mode === 'day') {
49141
49146
  return /*#__PURE__*/(0,jsx_runtime.jsx)(day, objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, commonProps), timeProps), {}, {
49147
+ renderDate: props.renderDate,
49142
49148
  onDoubleClick: function onDoubleClick(item, type) {
49143
49149
  // 双击同时设置开始和结束日期
49144
49150
  if (props.range && props.type === 'datetime') {
@@ -49527,6 +49533,7 @@ var DatePicker = function DatePicker(props0) {
49527
49533
  registerModeDisabled: func.registerModeDisabled,
49528
49534
  isDisabledDate: func.isDisabledDate,
49529
49535
  needConfirm: props.needConfirm,
49536
+ renderDate: props.renderDate,
49530
49537
  children: props.children
49531
49538
  })
49532
49539
  })
@@ -59947,7 +59954,8 @@ var list_list_List = function List(props) {
59947
59954
  minWidth: 0,
59948
59955
  overflow: 'auto'
59949
59956
  },
59950
- dynamicVirtual: props.dynamicHeight
59957
+ dynamicVirtual: props.dynamicHeight,
59958
+ keepScrollTop: !!props.scrollLoading
59951
59959
  }), renderFooter()]
59952
59960
  });
59953
59961
  }
@@ -66068,7 +66076,7 @@ var thead_toNum = toNum;
66068
66076
  var fixedStyle = getFixedStyle(col.fixed, col.index, level);
66069
66077
  var cellClassName = classnames_default()(colTemp.className, colTemp.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), colTemp.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), colTemp.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), colTemp.align !== 'right' && colTemp.align !== 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignLeft), (col.lastFixed || col.firstFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), isLast && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), colTemp.sorter && props.cellSortable && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellSortable));
66070
66078
  var isExpand = colTemp.type === 'expand' || colTemp.type === 'row-expand';
66071
- if (colTemp.title || isExpand) {
66079
+ if (colTemp.title !== undefined || isExpand) {
66072
66080
  var sorter = renderSort(colTemp);
66073
66081
  var filter = renderFilter(colTemp, columnIndex);
66074
66082
  trs[level].push( /*#__PURE__*/(0,jsx_runtime.jsx)("th", {
@@ -74227,7 +74235,7 @@ var upload_interface = __webpack_require__(8821);
74227
74235
 
74228
74236
 
74229
74237
  /* harmony default export */ var src_0 = ({
74230
- version: '3.9.0-beta.27'
74238
+ version: '3.9.0-beta.28'
74231
74239
  });
74232
74240
  }();
74233
74241
  /******/ return __webpack_exports__;