@lemon-fe/components 0.1.76 → 0.1.79

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,16 @@
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;
31
29
 
32
30
  &::before {
33
31
  position: absolute;
34
32
  top: 0;
35
- left: 0;
33
+ left: -16px;
36
34
  width: 16px;
37
35
  height: 100%;
38
- // background: linear-gradient(90deg, rgba(248, 248, 248, 0) 0%, @table-row-hover-bg 100%);
36
+ box-shadow: inset -16px 0 8px -8px @table-row-hover-bg;
39
37
  content: '';
40
38
  }
41
39
 
@@ -114,6 +112,14 @@
114
112
  }
115
113
  }
116
114
 
115
+ .ant-table-row-selected &-operator::before {
116
+ box-shadow: inset -16px 0 8px -8px var(--ant-primary-1);
117
+ }
118
+
119
+ .ant-table-row-selected:hover &-operator::before {
120
+ box-shadow: inset -16px 0 8px -8px var(--ant-primary-color-2);
121
+ }
122
+
117
123
  &-resizable-handle {
118
124
  position: absolute;
119
125
  top: 50%;
@@ -45,5 +45,7 @@ export default function EditableTableFormItem(props) {
45
45
  return;
46
46
  }
47
47
  }]
48
- }, /*#__PURE__*/React.createElement(Table, _objectSpread({}, tableProps)));
48
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread({
49
+ ref: ref
50
+ }, tableProps)));
49
51
  }
@@ -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,33 @@ 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 = result.length;
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;
400
+ size += itemWidth;
397
401
 
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;
402
+ if (size > width - btnsWidth) {
403
+ end = i;
404
+ btnsVisible = true;
405
+ break;
408
406
  }
409
- });
410
- rows.push(currRow);
411
- value += simple ? 208 : 248;
412
-
413
- if (currRow.length > 0 && value >= width + getColStyle(1).width) {
414
- rows.push([]);
415
407
  }
416
408
 
417
- var visible = rows.length > 1;
409
+ end = end || 1;
410
+ btnsVisible = btnsVisible && result.length > 1;
418
411
 
419
- if (!collapsed || !visible) {
420
- return [result, visible];
412
+ if (!collapsed) {
413
+ return [result, btnsVisible];
421
414
  }
422
415
 
423
- return [rows[0], visible];
416
+ return [result.slice(0, end), btnsVisible];
424
417
  }, [data, width, collapsed, simple, activeKeys]),
425
418
  _useMemo2 = _slicedToArray(_useMemo, 2),
426
419
  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")
@@ -28,8 +28,7 @@ export interface PopupProps<ValueType> extends ModalProps {
28
28
  */
29
29
  emptyValue?: ValueType;
30
30
  }
31
- interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, 'value' | 'onChange' | 'emptyValue'> {
32
- value: ValueType;
31
+ interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, 'onChange' | 'emptyValue'> {
33
32
  onChange?: (value: ValueType) => void;
34
33
  emptyValue: ValueType;
35
34
  }
package/es/Popup/index.js CHANGED
@@ -56,7 +56,7 @@ function Popup(props) {
56
56
 
57
57
  var prefixCls = "".concat(PREFIX_CLS, "-popup");
58
58
 
59
- var _useState = useState(valueProp),
59
+ var _useState = useState(valueProp || emptyValue),
60
60
  _useState2 = _slicedToArray(_useState, 2),
61
61
  value = _useState2[0],
62
62
  setValue = _useState2[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.76",
3
+ "version": "0.1.79",
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": "9a65df6bf44689cbfd8079b3d905e912a761280b"
44
+ "gitHead": "ce227b96ca0f19c73f82363e69b616f5ac48d81b"
45
45
  }