shineout 3.4.4-beta.7 → 3.5.0-beta.2

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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.4-beta.7'
495
+ version: '3.5.0-beta.2'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11984,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
11984
11984
  };
11985
11985
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11986
11986
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11987
- /* harmony default export */ var version = ('3.4.4-beta.7');
11987
+ /* harmony default export */ var version = ('3.5.0-beta.2');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -30071,22 +30071,23 @@ var getPopoverPosition = function getPopoverPosition(target) {
30071
30071
  var popupRect = popup === null || popup === void 0 ? void 0 : popup.getBoundingClientRect();
30072
30072
  if (verticalPoint > windowHeight / 2) position = 'top';else position = 'bottom';
30073
30073
 
30074
+ // TODO: 暂时移除,另考虑方案
30074
30075
  // 如果渲染了弹出内容,则根据弹出内容宽度计算是否自动调整位置
30075
- if (popupRect) {
30076
- if ((popupRect === null || popupRect === void 0 ? void 0 : popupRect.width) / 2 > rect.left) {
30077
- position += '-left';
30078
- }
30079
- if ((popupRect === null || popupRect === void 0 ? void 0 : popupRect.width) / 2 > windowWidth - rect.right) {
30080
- position += '-right';
30081
- }
30082
- } else {
30083
- // 兜底计算
30084
- if (horizontalPoint > windowWidth * 0.6) {
30085
- position += '-right';
30086
- } else if (horizontalPoint < windowWidth * 0.4) {
30087
- position += '-left';
30088
- }
30076
+ // if (popupRect && popupRect?.width) {
30077
+ // if (popupRect?.width / 2 > rect.left) {
30078
+ // position += '-left';
30079
+ // }
30080
+ // if (popupRect?.width / 2 > windowWidth - rect.right) {
30081
+ // position += '-right';
30082
+ // }
30083
+ // } else {
30084
+ // 兜底计算
30085
+ if (horizontalPoint > windowWidth * 0.6) {
30086
+ position += '-right';
30087
+ } else if (horizontalPoint < windowWidth * 0.4) {
30088
+ position += '-left';
30089
30089
  }
30090
+ // }
30090
30091
  }
30091
30092
  return position;
30092
30093
  };
@@ -44321,7 +44322,7 @@ var Modal = function Modal(props) {
44321
44322
  }
44322
44323
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
44323
44324
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.header,
44324
- onMouseDown: props.moveable ? moveInfo.handleMouseDown : undefined,
44325
+ onMouseDown: props.moveable && !props.fullScreen ? moveInfo.handleMouseDown : undefined,
44325
44326
  children: [renderIcon(), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
44326
44327
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerTitle,
44327
44328
  children: props.title
@@ -44387,7 +44388,7 @@ var Modal = function Modal(props) {
44387
44388
  panelStyle.top = undefined;
44388
44389
  panelStyle.width = undefined;
44389
44390
  }
44390
- if (props.moveable) {
44391
+ if (props.moveable && !props.fullScreen) {
44391
44392
  panelStyle.transform = "translate(".concat(moveInfo.pos.x, "px, ").concat(moveInfo.pos.y, "px)");
44392
44393
  }
44393
44394
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormFooterProvider, {
@@ -57260,6 +57261,33 @@ var useTableVirtual = function useTableVirtual(props) {
57260
57261
  props.scrollRef.current.scrollTop = beforeHeight;
57261
57262
  }
57262
57263
  });
57264
+ var scrollColumnByLeft = usePersistFn(function (targetLeft) {
57265
+ if (targetLeft < 0) return;
57266
+ var scrollEl = props.scrollRef.current;
57267
+ if (!scrollEl) return;
57268
+ // scrollLeft max
57269
+ var max = scrollEl.scrollWidth - scrollEl.clientWidth;
57270
+ var left = Math.min(targetLeft, max);
57271
+ if (left === scrollEl.scrollLeft) return;
57272
+ setLeft(left);
57273
+ scrollEl.scrollLeft = left;
57274
+ });
57275
+ var scrollColumnIntoView = usePersistFn(function (colKey) {
57276
+ if (colKey === undefined) return;
57277
+ var col = props.columns.find(function (col) {
57278
+ return col.key === colKey;
57279
+ });
57280
+ if (!col || col.fixed) return;
57281
+ var left = 0;
57282
+ for (var i = 0, len = col.index; i < len; i++) {
57283
+ if (props.columns[i].fixed) {
57284
+ left = 0;
57285
+ } else {
57286
+ left += props.colgroup[i];
57287
+ }
57288
+ }
57289
+ scrollColumnByLeft(left);
57290
+ });
57263
57291
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
57264
57292
  var scrollRefHeight = props.scrollRef.current ? props.scrollRef.current.clientHeight : 0;
57265
57293
  var tableRefHeight = props.innerRef.current ? props.innerRef.current.clientHeight : 0;
@@ -57323,7 +57351,9 @@ var useTableVirtual = function useTableVirtual(props) {
57323
57351
  handleScroll: handleScroll,
57324
57352
  setRowHeight: setRowHeight,
57325
57353
  getTranslate: getTranslate,
57326
- scrollToIndex: scrollToIndex
57354
+ scrollToIndex: scrollToIndex,
57355
+ scrollColumnByLeft: scrollColumnByLeft,
57356
+ scrollColumnIntoView: scrollColumnIntoView
57327
57357
  };
57328
57358
  };
57329
57359
  /* harmony default export */ var use_table_virtual = (useTableVirtual);
@@ -58721,6 +58751,7 @@ var emptyRef = {
58721
58751
  disabled: !virtual,
58722
58752
  data: treeData,
58723
58753
  columns: columns,
58754
+ colgroup: colgroup,
58724
58755
  rowsInView: props.rowsInView || 20,
58725
58756
  rowHeight: props.rowHeight || 40,
58726
58757
  scrollRef: scrollRef,
@@ -59012,7 +59043,9 @@ var emptyRef = {
59012
59043
  };
59013
59044
  var tableFunc = useLatestObj({
59014
59045
  scrollToIndex: virtualInfo.scrollToIndex,
59015
- getRenderIndexByData: getRenderIndexByData
59046
+ getRenderIndexByData: getRenderIndexByData,
59047
+ scrollColumnIntoView: virtualInfo.scrollColumnIntoView,
59048
+ scrollColumnByLeft: virtualInfo.scrollColumnByLeft
59016
59049
  });
59017
59050
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
59018
59051
  if (props.tableRef) {
@@ -65234,7 +65267,7 @@ var upload_interface = __webpack_require__(8821);
65234
65267
 
65235
65268
 
65236
65269
  /* harmony default export */ var src_0 = ({
65237
- version: '3.4.4-beta.7'
65270
+ version: '3.5.0-beta.2'
65238
65271
  });
65239
65272
  }();
65240
65273
  /******/ return __webpack_exports__;