ebaoferc 0.1.10 → 0.2.0

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.
@@ -9,4 +9,5 @@ export default function FlexRowCol(props: PropsWithChildren<{
9
9
  lineCountChange?: (count: number) => void;
10
10
  collapsed?: boolean;
11
11
  collapsedLineCount?: number;
12
+ showAfterSize?: boolean;
12
13
  } & RowProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["colProps", "width", "maxColCount", "gutter", "collapsedLineCount", "collapsed", "lineCountChange", "children"];
2
+ var _excluded = ["colProps", "width", "maxColCount", "gutter", "collapsedLineCount", "collapsed", "lineCountChange", "children", "showAfterSize"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -30,12 +30,13 @@ export default function FlexRowCol(props) {
30
30
  collapsed = _props$collapsed === void 0 ? true : _props$collapsed,
31
31
  lineCountChange = props.lineCountChange,
32
32
  children = props.children,
33
+ _props$showAfterSize = props.showAfterSize,
34
+ showAfterSize = _props$showAfterSize === void 0 ? false : _props$showAfterSize,
33
35
  rest = _objectWithoutProperties(props, _excluded);
34
36
 
35
37
  // 使用 ref 和 useSize 钩子获取容器宽度
36
38
  var ref = useRef(null);
37
39
  var size = useSize(ref);
38
-
39
40
  // 使用 useMemo 计算布局,避免不必要的重复计算
40
41
  var _useMemo = useMemo(function () {
41
42
  var gapX = (gutter === null || gutter === void 0 ? void 0 : gutter[0]) || 0;
@@ -83,12 +84,11 @@ export default function FlexRowCol(props) {
83
84
  lineCountChange === null || lineCountChange === void 0 || lineCountChange(lineCount);
84
85
  }
85
86
  }, [lineCount, lineCountChange, size === null || size === void 0 ? void 0 : size.width]);
86
- // console.log(lineCount);
87
- // 渲染行列布局
87
+ var show = showAfterSize ? size === null || size === void 0 ? void 0 : size.width : size;
88
88
  return /*#__PURE__*/_jsx(Row, _objectSpread(_objectSpread({
89
89
  gutter: gutter
90
90
  }, rest), {}, {
91
91
  ref: ref,
92
- children: size !== null && size !== void 0 && size.width ? processedChildren : null
92
+ children: show ? processedChildren : null
93
93
  }));
94
94
  }
@@ -71,6 +71,7 @@ export default function StyledQueryFilter(props) {
71
71
  collapsedLineCount: collapsedLineCount,
72
72
  lineCountChange: handleLineCountChange,
73
73
  width: itemWith,
74
+ showAfterSize: true,
74
75
  children: children
75
76
  })
76
77
  })), /*#__PURE__*/_jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ebaoferc",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",