@sheinx/base 3.10.2-beta.4 → 3.10.2-beta.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAoB,MAAM,cAAc,CAAC;AAgB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CA22BxE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAoB,MAAM,cAAc,CAAC;AAgB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CA42BxE"}
@@ -157,6 +157,7 @@ function Table(props) {
157
157
  theadRef: theadRef,
158
158
  tbodyRef: tbodyRef,
159
159
  scrollRef: scrollRef,
160
+ tableElRef: tableRef,
160
161
  columns: columns,
161
162
  data: props.data,
162
163
  dataChangeResize: !!props.dataChangeResize,
@@ -170,13 +171,15 @@ function Table(props) {
170
171
  colgroup = _useTableLayout.colgroup,
171
172
  isScrollY = _useTableLayout.isScrollY,
172
173
  isScrollX = _useTableLayout.isScrollX,
173
- floatLeft = _useTableLayout.floatLeft,
174
- floatRight = _useTableLayout.floatRight,
175
174
  width = _useTableLayout.width,
176
175
  shouldLastColAuto = _useTableLayout.shouldLastColAuto,
177
176
  scrollBarWidth = _useTableLayout.scrollBarWidth,
178
177
  scrollWidth = _useTableLayout.scrollWidth,
179
- resizeFlag = _useTableLayout.resizeFlag;
178
+ resizeFlag = _useTableLayout.resizeFlag,
179
+ registerFloatClass = _useTableLayout.registerFloatClass;
180
+
181
+ // 注册 floatLeft/floatRight 的 CSS class 名,供 checkFloat 直接操作 DOM
182
+ registerFloatClass(tableClasses.floatLeft, tableClasses.floatRight);
180
183
  var _useTableFilter = (0, _hooks.useTableFilter)({
181
184
  keygen: props.keygen,
182
185
  data: props.data,
@@ -327,7 +330,7 @@ function Table(props) {
327
330
  var handleBodyScroll = (0, _hooks.usePersistFn)(function (e) {
328
331
  var target = e.currentTarget;
329
332
  if (!target) return;
330
- layoutFunc.checkFloat();
333
+ layoutFunc.scheduleCheckFloat();
331
334
  if (isVirtualColumnEnabled) columnInfo.handleScroll({
332
335
  scrollLeft: target.scrollLeft
333
336
  });
@@ -354,7 +357,7 @@ function Table(props) {
354
357
  var handleVirtualScroll = (0, _hooks.usePersistFn)(function (info) {
355
358
  virtualInfo.handleScroll(info);
356
359
  if (isVirtualColumnEnabled) columnInfo.handleScroll(info);
357
- layoutFunc.checkFloat();
360
+ layoutFunc.scheduleCheckFloat();
358
361
  if (headMirrorScrollRef.current) {
359
362
  headMirrorScrollRef.current.scrollLeft = info.scrollLeft;
360
363
  }
@@ -836,7 +839,7 @@ function Table(props) {
836
839
  });
837
840
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
838
841
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
839
- className: (0, _classnames.default)(tableWrapperClass, _defineProperty(_defineProperty(_defineProperty({}, tableClasses.sticky, props.sticky), tableClasses.floatLeft, floatLeft), tableClasses.floatRight, floatRight)),
842
+ className: (0, _classnames.default)(tableWrapperClass, _defineProperty({}, tableClasses.sticky, props.sticky)),
840
843
  style: tableWrapperStyle
841
844
  }, selection.getTableProps()), {}, {
842
845
  ref: tableRef,
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAoB,MAAM,cAAc,CAAC;AAgB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CA22BxE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAoB,MAAM,cAAc,CAAC;AAgB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CA42BxE"}
@@ -150,6 +150,7 @@ export default function Table(props) {
150
150
  theadRef: theadRef,
151
151
  tbodyRef: tbodyRef,
152
152
  scrollRef: scrollRef,
153
+ tableElRef: tableRef,
153
154
  columns: columns,
154
155
  data: props.data,
155
156
  dataChangeResize: !!props.dataChangeResize,
@@ -163,13 +164,15 @@ export default function Table(props) {
163
164
  colgroup = _useTableLayout.colgroup,
164
165
  isScrollY = _useTableLayout.isScrollY,
165
166
  isScrollX = _useTableLayout.isScrollX,
166
- floatLeft = _useTableLayout.floatLeft,
167
- floatRight = _useTableLayout.floatRight,
168
167
  width = _useTableLayout.width,
169
168
  shouldLastColAuto = _useTableLayout.shouldLastColAuto,
170
169
  scrollBarWidth = _useTableLayout.scrollBarWidth,
171
170
  scrollWidth = _useTableLayout.scrollWidth,
172
- resizeFlag = _useTableLayout.resizeFlag;
171
+ resizeFlag = _useTableLayout.resizeFlag,
172
+ registerFloatClass = _useTableLayout.registerFloatClass;
173
+
174
+ // 注册 floatLeft/floatRight 的 CSS class 名,供 checkFloat 直接操作 DOM
175
+ registerFloatClass(tableClasses.floatLeft, tableClasses.floatRight);
173
176
  var _useTableFilter = useTableFilter({
174
177
  keygen: props.keygen,
175
178
  data: props.data,
@@ -320,7 +323,7 @@ export default function Table(props) {
320
323
  var handleBodyScroll = usePersistFn(function (e) {
321
324
  var target = e.currentTarget;
322
325
  if (!target) return;
323
- layoutFunc.checkFloat();
326
+ layoutFunc.scheduleCheckFloat();
324
327
  if (isVirtualColumnEnabled) columnInfo.handleScroll({
325
328
  scrollLeft: target.scrollLeft
326
329
  });
@@ -347,7 +350,7 @@ export default function Table(props) {
347
350
  var handleVirtualScroll = usePersistFn(function (info) {
348
351
  virtualInfo.handleScroll(info);
349
352
  if (isVirtualColumnEnabled) columnInfo.handleScroll(info);
350
- layoutFunc.checkFloat();
353
+ layoutFunc.scheduleCheckFloat();
351
354
  if (headMirrorScrollRef.current) {
352
355
  headMirrorScrollRef.current.scrollLeft = info.scrollLeft;
353
356
  }
@@ -829,7 +832,7 @@ export default function Table(props) {
829
832
  });
830
833
  return /*#__PURE__*/_jsxs(_Fragment, {
831
834
  children: [/*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
832
- className: classNames(tableWrapperClass, _defineProperty(_defineProperty(_defineProperty({}, tableClasses.sticky, props.sticky), tableClasses.floatLeft, floatLeft), tableClasses.floatRight, floatRight)),
835
+ className: classNames(tableWrapperClass, _defineProperty({}, tableClasses.sticky, props.sticky)),
833
836
  style: tableWrapperStyle
834
837
  }, selection.getTableProps()), {}, {
835
838
  ref: tableRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.10.2-beta.4",
3
+ "version": "3.10.2-beta.6",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.10.2-beta.4",
13
+ "@sheinx/hooks": "3.10.2-beta.6",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.3.3"