shineout 3.2.2-beta.1 → 3.2.3

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
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.2.2-beta.1'
479
+ version: '3.2.3'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11960,7 +11960,7 @@ var handleStyle = function handleStyle(style) {
11960
11960
  };
11961
11961
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11962
11962
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11963
- /* harmony default export */ var version = ('3.2.2-beta.1');
11963
+ /* harmony default export */ var version = ('3.2.3');
11964
11964
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11965
11965
 
11966
11966
 
@@ -16137,7 +16137,7 @@ var useCarouselStyle = styled(carousel_carousel, 'carousel');
16137
16137
  }, "&:not($".concat(name, "Disabled):not($").concat(name, "Error)"), {
16138
16138
  backgroundColor: token.hoverBackgroundColor
16139
16139
  }),
16140
- '[data-soui-role="input-group"] &': {
16140
+ '[data-soui-role="input-group"] &&&, [data-soui-role="input-group"] &&&:hover': {
16141
16141
  borderWidth: 0,
16142
16142
  borderRadius: 0,
16143
16143
  boxShadow: 'none',
@@ -17691,6 +17691,10 @@ var datePickerStyle = objectSpread2_default()(objectSpread2_default()({
17691
17691
  visibility: 'visible'
17692
17692
  }
17693
17693
  },
17694
+ datetimeHide: {
17695
+ opacity: '0',
17696
+ pointerEvents: 'none'
17697
+ },
17694
17698
  quickPicker: {
17695
17699
  padding: "".concat(src.datePickerQuickPanelPaddingY, " ").concat(src.datePickerQuickPanelPaddingX),
17696
17700
  display: 'flex',
@@ -19872,7 +19876,10 @@ var menuStyle = {
19872
19876
  display: 'inline-flex'
19873
19877
  },
19874
19878
  titleContent: {
19875
- whiteSpace: 'pre-wrap'
19879
+ whiteSpace: 'pre-wrap',
19880
+ display: 'flex',
19881
+ minWidth: 0,
19882
+ alignItems: 'center'
19876
19883
  // '$wrapperCollpase &': {
19877
19884
  // transition: `opacity ${animationDuration} ${transitionFunc}`,
19878
19885
  // },
@@ -27845,7 +27852,7 @@ var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top'
27845
27852
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
27846
27853
  var hideStyle = {
27847
27854
  pointerEvents: 'none',
27848
- position: 'absolute',
27855
+ position: 'fixed',
27849
27856
  zIndex: -1000,
27850
27857
  opacity: 0
27851
27858
  };
@@ -32465,7 +32472,6 @@ function removeProtocol(url) {
32465
32472
  short: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
32466
32473
  long: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
32467
32474
  },
32468
- pickerTitle: ['开始时间', '结束时间'],
32469
32475
  timeOfDayValues: ['上午', '下午'],
32470
32476
  ok: '确定',
32471
32477
  cancel: '取消',
@@ -32531,7 +32537,6 @@ function removeProtocol(url) {
32531
32537
  short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
32532
32538
  long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
32533
32539
  },
32534
- pickerTitle: ['Start Time', 'End Time'],
32535
32540
  timeOfDayValues: ['a.m.', 'p.m.'],
32536
32541
  ok: 'Ok',
32537
32542
  cancel: 'Cancel',
@@ -39748,6 +39753,19 @@ function formatted(date, fmt, options) {
39748
39753
  function getStartYear(date, options) {
39749
39754
  return Math.floor(getDateInfo(date, 'year', options) / 10) * 10;
39750
39755
  }
39756
+
39757
+ // 如果有 value 取 value 的 time 否则取 defaultTime
39758
+ var getDateWithTime = function getDateWithTime(date, value, defaultTime, min, max, options) {
39759
+ var timeDate = value || defaultTime && cloneTime(date, defaultTime, TIME_FORMAT, options);
39760
+ var newDate = util_toDate(date);
39761
+ if (timeDate) {
39762
+ newDate = setTime(newDate, timeDate, options);
39763
+ }
39764
+ // only can select day with the same day of min/max
39765
+ if (min && compareAsc(newDate, min) < 0) newDate = setTime(newDate, min, options);
39766
+ if (max && compareAsc(newDate, max) > 0) newDate = setTime(newDate, max, options);
39767
+ return newDate;
39768
+ };
39751
39769
  /* harmony default export */ var util = ({
39752
39770
  clearHMS: clearHMS,
39753
39771
  addDays: addDays,
@@ -39784,7 +39802,8 @@ function getStartYear(date, options) {
39784
39802
  compatibleFmt: compatibleFmt,
39785
39803
  transDateWithZone: transDateWithZone,
39786
39804
  getStartYear: getStartYear,
39787
- isValidString: isValidString
39805
+ isValidString: isValidString,
39806
+ getDateWithTime: getDateWithTime
39788
39807
  });
39789
39808
  ;// CONCATENATED MODULE: ../hooks/src/components/use-datepicker/use-datepicker-format.ts
39790
39809
 
@@ -39915,6 +39934,7 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
39915
39934
  });
39916
39935
  var setCurrentArrWithParams = usePersistFn(function (arg, type, quick) {
39917
39936
  setCurrentArr(arg);
39937
+ if (!type && !quick) return;
39918
39938
  setParams({
39919
39939
  type: type,
39920
39940
  quick: quick
@@ -40174,17 +40194,7 @@ var useDate = function useDate(props) {
40174
40194
  return util.getDateInfo(date, 'week', options);
40175
40195
  };
40176
40196
  var getDateWithTime = function getDateWithTime(date) {
40177
- var min = props.min,
40178
- max = props.max;
40179
- var timeDate = props.value || props.defaultTime && util.cloneTime(date, props.defaultTime, util.TIME_FORMAT, options);
40180
- var newDate = util.toDate(date);
40181
- if (timeDate) {
40182
- newDate = util.setTime(newDate, timeDate, options);
40183
- }
40184
- // only can select day with the same day of min/max
40185
- if (min && util.compareAsc(newDate, min) < 0) newDate = util.setTime(newDate, min, options);
40186
- if (max && util.compareAsc(newDate, max) > 0) newDate = util.setTime(newDate, max, options);
40187
- return newDate;
40197
+ return util.getDateWithTime(date, props.value, props.defaultTime, props.min, props.max, options);
40188
40198
  };
40189
40199
  var handleDayClick = function handleDayClick(date) {
40190
40200
  var _props$onChange;
@@ -40762,8 +40772,8 @@ var Day = function Day(props) {
40762
40772
  className: styles === null || styles === void 0 ? void 0 : styles.pickerFooter,
40763
40773
  dir: direction,
40764
40774
  children: [props.type === 'datetime' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
40765
- className: classnames_default()(styles === null || styles === void 0 ? void 0 : styles.pickerFooterLeft, styles === null || styles === void 0 ? void 0 : styles.datetime),
40766
- children: timeStr && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
40775
+ className: classnames_default()(styles === null || styles === void 0 ? void 0 : styles.pickerFooterLeft, styles === null || styles === void 0 ? void 0 : styles.datetime, !timeStr && (styles === null || styles === void 0 ? void 0 : styles.datetimeHide)),
40776
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
40767
40777
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
40768
40778
  children: icons_config.datepicker.Time
40769
40779
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(time, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
@@ -40771,7 +40781,7 @@ var Day = function Day(props) {
40771
40781
  showTitle: false,
40772
40782
  format: format
40773
40783
  })), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
40774
- children: func.getTimeStr()
40784
+ children: timeStr
40775
40785
  })]
40776
40786
  })
40777
40787
  }), showRight && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@@ -41644,7 +41654,7 @@ var useRangePick = function useRangePick(props) {
41644
41654
  newArr[1] = rangeMax;
41645
41655
  }
41646
41656
  } else if (date.getTime() > newArr[1].getTime()) {
41647
- var a = util.cloneTime(new Date(date), defaultTimeArr[1], 'HH:mm:ss', options);
41657
+ var a = util.cloneTime(new Date(date), arr[1] || defaultTimeArr[1], 'HH:mm:ss', options);
41648
41658
  newArr[1] = a.getTime() > date.getTime() ? a : new Date(date);
41649
41659
  }
41650
41660
  }
@@ -41712,6 +41722,14 @@ var useRangePick = function useRangePick(props) {
41712
41722
  var setTargetStart = usePersistFn(function (date) {
41713
41723
  setTargetArr([date, undefined]);
41714
41724
  });
41725
+ var getStartDobule = usePersistFn(function (date) {
41726
+ var end = util.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], endMin, endMax, options);
41727
+ return end;
41728
+ });
41729
+ var getEndDobule = usePersistFn(function (date) {
41730
+ var start = util.getDateWithTime(date, props.dateArr[1], defaultTimeArr[1], startMin, startMax, options);
41731
+ return start;
41732
+ });
41715
41733
  var setTargetEnd = usePersistFn(function (date) {
41716
41734
  setTargetArr([undefined, date]);
41717
41735
  });
@@ -41768,7 +41786,9 @@ var useRangePick = function useRangePick(props) {
41768
41786
  setTargetStart: setTargetStart,
41769
41787
  setTargetEnd: setTargetEnd,
41770
41788
  startDisabled: startDisabled,
41771
- endDisabled: endDisabled
41789
+ endDisabled: endDisabled,
41790
+ getStartDobule: getStartDobule,
41791
+ getEndDobule: getEndDobule
41772
41792
  });
41773
41793
  var minDate = min ? util.toDate(min, options) : undefined;
41774
41794
  var maxDate = max ? util.toDate(max, options) : undefined;
@@ -41912,12 +41932,18 @@ var Picker = function Picker(props) {
41912
41932
  onDoubleClick: function onDoubleClick(item, type) {
41913
41933
  // 双击同时设置开始和结束日期
41914
41934
  if (props.range && props.type === 'datetime') {
41915
- if (position === 'start' && !isDisabledDate(item, 'end')) {
41916
- func.setCurrentEnd(item, type);
41917
- func.setDateEnd(item, true);
41918
- } else if (!isDisabledDate(item, 'start')) {
41919
- func.setCurrentStart(item, type);
41920
- func.setDateStart(item, true);
41935
+ if (position === 'start') {
41936
+ var end = func.getStartDobule(item);
41937
+ if (!isDisabledDate(end, 'end')) {
41938
+ func.setCurrentEnd(end, type);
41939
+ func.setDateEnd(end, true);
41940
+ }
41941
+ } else if (position === 'end') {
41942
+ var start = func.getEndDobule(item);
41943
+ if (!isDisabledDate(start, 'start')) {
41944
+ func.setCurrentStart(start, type);
41945
+ func.setDateStart(start, true);
41946
+ }
41921
41947
  }
41922
41948
  }
41923
41949
  }
@@ -42763,15 +42789,17 @@ var Modal = function Modal(props) {
42763
42789
  defaultHeight: height,
42764
42790
  panelRef: panelRef
42765
42791
  });
42792
+ var rerender = useRender();
42766
42793
  var handleMaskVisible = function handleMaskVisible() {
42767
42794
  // 多个moal 只有第一个显示的时候才显示遮罩
42768
42795
  // context.isMask 用来判断是否是第一个显示的modal
42769
42796
  if (visible && !hasMask) {
42770
42797
  context.isMask = true;
42771
42798
  hasMask = true;
42799
+ rerender();
42772
42800
  }
42773
42801
  };
42774
- handleMaskVisible();
42802
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(handleMaskVisible, [visible]);
42775
42803
  var updateOrigin = function updateOrigin() {
42776
42804
  // 更新transform-origin
42777
42805
  if (props.position || props.moveable || !props.zoom) return;
@@ -47213,7 +47241,7 @@ var useNumberFormat = function useNumberFormat(props) {
47213
47241
  ;// CONCATENATED MODULE: ../base/src/input/input-number.tsx
47214
47242
 
47215
47243
 
47216
- var input_number_excluded = ["jssStyle", "hideArrow"],
47244
+ var input_number_excluded = ["jssStyle", "hideArrow", "numType", "integerLimit", "digits", "min", "max", "step", "allowNull"],
47217
47245
  input_number_excluded2 = ["onMinus", "onPlus"];
47218
47246
 
47219
47247
 
@@ -47228,18 +47256,25 @@ var InputNumber = function InputNumber(props) {
47228
47256
  var commonProps = use_input_common(props);
47229
47257
  var jssStyle = commonProps.jssStyle,
47230
47258
  hideArrow = commonProps.hideArrow,
47259
+ numType = commonProps.numType,
47260
+ integerLimit = commonProps.integerLimit,
47261
+ digits = commonProps.digits,
47262
+ min = commonProps.min,
47263
+ max = commonProps.max,
47264
+ step = commonProps.step,
47265
+ allowNull = commonProps.allowNull,
47231
47266
  restProps = objectWithoutProperties_default()(commonProps, input_number_excluded);
47232
47267
  var inputStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$input = jssStyle.input) === null || _jssStyle$input === void 0 ? void 0 : _jssStyle$input.call(jssStyle);
47233
47268
  var numberFormatParams = {
47234
47269
  onBlur: restProps.onBlur,
47235
47270
  onFocus: restProps.onFocus,
47236
- digits: restProps.digits,
47237
- integerLimit: restProps.integerLimit,
47238
- numType: restProps.numType,
47239
- min: restProps.min,
47240
- max: restProps.max,
47241
- step: restProps.step,
47242
- allowNull: restProps.allowNull
47271
+ digits: digits,
47272
+ integerLimit: integerLimit,
47273
+ numType: numType,
47274
+ min: min,
47275
+ max: max,
47276
+ step: step,
47277
+ allowNull: allowNull
47243
47278
  };
47244
47279
  var _useInputNumber = use_input_number(objectSpread2_default()({
47245
47280
  value: commonProps.value,
@@ -47249,7 +47284,9 @@ var InputNumber = function InputNumber(props) {
47249
47284
  onMinus = _useInputNumber.onMinus,
47250
47285
  onPlus = _useInputNumber.onPlus,
47251
47286
  numberFormatProps = objectWithoutProperties_default()(_useInputNumber, input_number_excluded2);
47252
- var forwardProps = removeProps(commonProps, objectSpread2_default()({}, numberFormatParams));
47287
+ var forwardProps = removeProps(commonProps, objectSpread2_default()(objectSpread2_default()({}, numberFormatParams), {}, {
47288
+ hideArrow: hideArrow
47289
+ }));
47253
47290
  var addEnd = hideArrow ? null : /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
47254
47291
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
47255
47292
  className: inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.numberStep,
@@ -47390,17 +47427,20 @@ var Scroll = function Scroll(props) {
47390
47427
  isMouseDown: false
47391
47428
  }),
47392
47429
  context = _useRef.current;
47430
+ var _props$scrollHeight = props.scrollHeight,
47431
+ scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
47432
+ _props$scrollWidth = props.scrollWidth,
47433
+ scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
47434
+ _props$defaultHeight = props.defaultHeight,
47435
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
47393
47436
  var _useResize = useResize({
47394
47437
  targetRef: containerRef
47395
47438
  }),
47396
47439
  width = _useResize.width,
47397
- height = _useResize.height;
47440
+ h = _useResize.height;
47441
+ var height = h || defaultHeight;
47398
47442
  var config = useConfig();
47399
47443
  var isRtl = config.direction === 'rtl';
47400
- var _props$scrollHeight = props.scrollHeight,
47401
- scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
47402
- _props$scrollWidth = props.scrollWidth,
47403
- scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth;
47404
47444
  var scrollerStyle = props.scrollerStyle || {
47405
47445
  height: '100%',
47406
47446
  width: '100%',
@@ -48958,7 +48998,7 @@ var Tree = function Tree(props) {
48958
48998
  handleUpdateExpanded(expanded);
48959
48999
  }, [expanded]);
48960
49000
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48961
- if (!active) return;
49001
+ // if (!active) return;
48962
49002
  handleUpdateActive(active);
48963
49003
  }, [active]);
48964
49004
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
@@ -50568,6 +50608,7 @@ var PaginationSimple = function PaginationSimple(props) {
50568
50608
 
50569
50609
 
50570
50610
 
50611
+
50571
50612
  var usePagination = function usePagination(props) {
50572
50613
  var totalProp = props.total,
50573
50614
  pageSizeProp = props.pageSize,
@@ -50588,14 +50629,15 @@ var usePagination = function usePagination(props) {
50588
50629
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50589
50630
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
50590
50631
  }, [pageSizeProp]);
50591
- var handleChange = function handleChange(current, size) {
50592
- setCurrent(current);
50632
+ var handleChange = usePersistFn(function (c, size) {
50633
+ if (c === current && size === undefined) return;
50634
+ setCurrent(c);
50593
50635
  setPageSize(size || pageSizeProp);
50594
50636
  if (onChange) {
50595
- var sizeChange = pageSize !== size;
50596
- onChange(current, size || pageSize, sizeChange);
50637
+ var sizeChange = size !== undefined && pageSize !== size;
50638
+ onChange(c, size || pageSize, sizeChange);
50597
50639
  }
50598
- };
50640
+ });
50599
50641
  var getRootProps = function getRootProps() {
50600
50642
  var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
50601
50643
  var externalEventHandlers = extractEventHandlers(externalProps);
@@ -56111,8 +56153,8 @@ var Tr = function Tr(props) {
56111
56153
  };
56112
56154
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56113
56155
  if (props.setRowHeight && trRef.current) {
56114
- var expandHeight = expandRef.current ? expandRef.current.offsetHeight : 0;
56115
- props.setRowHeight(props.rowIndex, trRef.current.offsetHeight + expandHeight);
56156
+ var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
56157
+ props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
56116
56158
  }
56117
56159
  }, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
56118
56160
  var renderTreeExpand = function renderTreeExpand(content) {
@@ -56545,6 +56587,10 @@ var emptyRef = {
56545
56587
  var tfootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
56546
56588
  var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
56547
56589
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
56590
+ var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
56591
+ emptyHeight: 0
56592
+ }),
56593
+ context = _useRef.current;
56548
56594
  var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
56549
56595
 
56550
56596
  // 虚拟列表高度另外计算
@@ -56714,6 +56760,9 @@ var emptyRef = {
56714
56760
  if ((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) return null;
56715
56761
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
56716
56762
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper,
56763
+ ref: function ref(el) {
56764
+ context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
56765
+ },
56717
56766
  children: props.empty || /*#__PURE__*/(0,jsx_runtime.jsx)(src_empty_empty, {
56718
56767
  jssStyle: props.jssStyle
56719
56768
  })
@@ -56830,6 +56879,7 @@ var emptyRef = {
56830
56879
  scrollWidth: width || 1,
56831
56880
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
56832
56881
  onScroll: handleVirtualScroll,
56882
+ defaultHeight: context.emptyHeight,
56833
56883
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
56834
56884
  style: {
56835
56885
  width: width,
@@ -59391,7 +59441,7 @@ var TreeSelect = function TreeSelect(props0) {
59391
59441
  keygen: keygen,
59392
59442
  unmatch: unmatch,
59393
59443
  value: value,
59394
- highlight: true,
59444
+ highlight: !multiple,
59395
59445
  loader: loader,
59396
59446
  onExpand: onExpandTree,
59397
59447
  expanded: controlExpanded,
@@ -63027,7 +63077,7 @@ var upload_interface = __webpack_require__(4412);
63027
63077
 
63028
63078
 
63029
63079
  /* harmony default export */ var src_0 = ({
63030
- version: '3.2.2-beta.1'
63080
+ version: '3.2.3'
63031
63081
  });
63032
63082
  }();
63033
63083
  /******/ return __webpack_exports__;