@lemon-fe/components 0.1.77 → 0.1.78

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.
@@ -24,18 +24,17 @@
24
24
  align-items: center;
25
25
  justify-content: flex-end;
26
26
  height: 100%;
27
- padding-left: 16px;
28
27
  white-space: nowrap;
29
- // background-color: @table-row-hover-bg;
30
- // background-clip: content-box;
28
+ background-color: inherit;
29
+ background-clip: content-box;
31
30
 
32
31
  &::before {
33
32
  position: absolute;
34
33
  top: 0;
35
- left: 0;
34
+ left: -16px;
36
35
  width: 16px;
37
36
  height: 100%;
38
- // background: linear-gradient(90deg, rgba(248, 248, 248, 0) 0%, @table-row-hover-bg 100%);
37
+ box-shadow: inset -16px 0 8px -8px @table-row-hover-bg;
39
38
  content: '';
40
39
  }
41
40
 
@@ -114,6 +113,14 @@
114
113
  }
115
114
  }
116
115
 
116
+ .ant-table-row-selected &-operator::before {
117
+ box-shadow: inset -16px 0 8px -8px var(--ant-primary-1);
118
+ }
119
+
120
+ .ant-table-row-selected:hover &-operator::before {
121
+ box-shadow: inset -16px 0 8px -8px var(--ant-primary-color-2);
122
+ }
123
+
117
124
  &-resizable-handle {
118
125
  position: absolute;
119
126
  top: 50%;
@@ -282,7 +282,7 @@ function Filter(props) {
282
282
  form.resetFields();
283
283
 
284
284
  if (onChange) {
285
- onChange(form.getFieldsValue());
285
+ onChange(form.getFieldsValue(true));
286
286
  }
287
287
  };
288
288
 
@@ -332,13 +332,13 @@ function Filter(props) {
332
332
  if (index !== active) {
333
333
  setActive(index);
334
334
  form.setFieldsValue(tabs[index].value);
335
- handleFinish(form.getFieldsValue());
335
+ handleFinish();
336
336
  }
337
337
  };
338
338
 
339
- var handleFinish = function handleFinish(value) {
339
+ var handleFinish = function handleFinish() {
340
340
  if (onChange) {
341
- onChange(value);
341
+ onChange(form.getFieldsValue(true));
342
342
  }
343
343
  };
344
344
 
@@ -387,40 +387,31 @@ function Filter(props) {
387
387
  return [result, false];
388
388
  }
389
389
 
390
- var rows = [];
391
- var currRow = [];
392
- var value = 0;
393
- result.forEach(function (item) {
390
+ var btnsWidth = simple ? 208 : 248;
391
+ var btnsVisible = false;
392
+ var size = 0;
393
+ var end = 0;
394
+
395
+ for (var i = 0; i < result.length; i++) {
394
396
  var _compMap$get;
395
397
 
398
+ var item = result[i];
396
399
  var itemWidth = getColStyle(item.colSpan || (item.type ? (_compMap$get = compMap.get(item.type)) === null || _compMap$get === void 0 ? void 0 : _compMap$get.colSpan : 1)).width;
397
400
 
398
- if (value + itemWidth > width) {
399
- if (currRow.length > 0) {
400
- rows.push(currRow);
401
- }
402
-
403
- currRow = [item];
404
- value = itemWidth;
405
- } else {
406
- currRow.push(item);
407
- value += itemWidth;
401
+ if (size + itemWidth > width - btnsWidth) {
402
+ end = i;
403
+ btnsVisible = true;
404
+ break;
408
405
  }
409
- });
410
- rows.push(currRow);
411
- value += simple ? 208 : 248;
412
406
 
413
- if (currRow.length > 0 && value >= width + getColStyle(1).width) {
414
- rows.push([]);
407
+ size += itemWidth;
415
408
  }
416
409
 
417
- var visible = rows.length > 1;
418
-
419
- if (!collapsed || !visible) {
420
- return [result, visible];
410
+ if (!collapsed) {
411
+ return [result, btnsVisible];
421
412
  }
422
413
 
423
- return [rows[0], visible];
414
+ return [result.slice(0, end || 1), btnsVisible];
424
415
  }, [data, width, collapsed, simple, activeKeys]),
425
416
  _useMemo2 = _slicedToArray(_useMemo, 2),
426
417
  cols = _useMemo2[0],
@@ -50,6 +50,10 @@
50
50
  position: absolute;
51
51
  left: -11px;
52
52
  }
53
+
54
+ &-with-help &-explain {
55
+ margin-bottom: -@spaceY;
56
+ }
53
57
  }
54
58
 
55
59
  &-row {
@@ -19,6 +19,7 @@ interface Props {
19
19
  header?: ReactNode;
20
20
  footer?: ReactNode;
21
21
  body?: ReactNode;
22
+ onCollapse?: (collapsed: boolean) => void;
22
23
  }
23
24
  declare function Layout(props: Props): JSX.Element;
24
25
  declare namespace Layout {
@@ -27,7 +28,7 @@ declare namespace Layout {
27
28
  children?: React.ReactNode;
28
29
  left?: React.ReactNode;
29
30
  tab?: string | undefined;
30
- }) => JSX.Element;
31
+ } & Pick<Props, "onCollapse">) => JSX.Element;
31
32
  }
32
33
  export default Layout;
33
34
  declare function LayoutTabs(props: {
@@ -31,7 +31,8 @@ import { mapChildren } from '../utils';
31
31
  var prefixCls = "".concat(PREFIX_CLS, "-layout");
32
32
 
33
33
  function Sider(props) {
34
- var children = props.children;
34
+ var children = props.children,
35
+ onCollapse = props.onCollapse;
35
36
 
36
37
  var _useState = useState(false),
37
38
  _useState2 = _slicedToArray(_useState, 2),
@@ -47,7 +48,9 @@ function Sider(props) {
47
48
  }, children)), /*#__PURE__*/React.createElement("div", {
48
49
  className: "".concat(prefixCls, "-left-collapse"),
49
50
  onClick: function onClick() {
50
- return setCollapsed(!collapsed);
51
+ var result = !collapsed;
52
+ onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(result);
53
+ setCollapsed(result);
51
54
  }
52
55
  }, /*#__PURE__*/React.createElement("svg", {
53
56
  width: "12",
@@ -95,10 +98,13 @@ function Sider(props) {
95
98
 
96
99
  function Content(props) {
97
100
  var left = props.left,
98
- children = props.children;
101
+ children = props.children,
102
+ onCollapse = props.onCollapse;
99
103
  return /*#__PURE__*/React.createElement("div", {
100
104
  className: "".concat(prefixCls, "-content")
101
- }, left ? /*#__PURE__*/React.createElement(Sider, null, left) : null, /*#__PURE__*/React.createElement("div", {
105
+ }, left ? /*#__PURE__*/React.createElement(Sider, {
106
+ onCollapse: onCollapse
107
+ }, left) : null, /*#__PURE__*/React.createElement("div", {
102
108
  className: "".concat(prefixCls, "-main")
103
109
  }, children));
104
110
  }
@@ -114,7 +120,8 @@ export default function Layout(props) {
114
120
  header = props.header,
115
121
  left = props.left,
116
122
  footer = props.footer,
117
- body = props.body;
123
+ body = props.body,
124
+ onCollapse = props.onCollapse;
118
125
  return /*#__PURE__*/React.createElement("div", {
119
126
  className: classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-full"), full)),
120
127
  style: style
@@ -123,6 +130,7 @@ export default function Layout(props) {
123
130
  }, header) : null, /*#__PURE__*/React.createElement("div", {
124
131
  className: "".concat(prefixCls, "-body")
125
132
  }, body || /*#__PURE__*/React.createElement(Content, {
133
+ onCollapse: onCollapse,
126
134
  left: left
127
135
  }, children)), footer ? /*#__PURE__*/React.createElement("div", {
128
136
  className: "".concat(prefixCls, "-footer")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.77",
3
+ "version": "0.1.78",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -41,5 +41,5 @@
41
41
  "react": "^17.0.2",
42
42
  "react-dom": "^17.0.2"
43
43
  },
44
- "gitHead": "05d50e243e97f75d4f70667c57d66137a0311457"
44
+ "gitHead": "c3ea23e58ff912db41794c92c844fcf9b2d7c18c"
45
45
  }