@lemon-fe/components 0.1.75 → 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.
- package/es/BaseTable/index.less +12 -5
- package/es/Filter/index.js +19 -28
- package/es/FormLayout/index.less +4 -0
- package/es/Layout/index.d.ts +2 -1
- package/es/Layout/index.js +13 -5
- package/es/Popup/index.d.ts +6 -2
- package/es/Popup/index.js +4 -3
- package/package.json +2 -2
package/es/BaseTable/index.less
CHANGED
|
@@ -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
|
-
|
|
30
|
-
|
|
28
|
+
background-color: inherit;
|
|
29
|
+
background-clip: content-box;
|
|
31
30
|
|
|
32
31
|
&::before {
|
|
33
32
|
position: absolute;
|
|
34
33
|
top: 0;
|
|
35
|
-
left:
|
|
34
|
+
left: -16px;
|
|
36
35
|
width: 16px;
|
|
37
36
|
height: 100%;
|
|
38
|
-
|
|
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%;
|
package/es/Filter/index.js
CHANGED
|
@@ -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(
|
|
335
|
+
handleFinish();
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
|
|
339
|
-
var handleFinish = function handleFinish(
|
|
339
|
+
var handleFinish = function handleFinish() {
|
|
340
340
|
if (onChange) {
|
|
341
|
-
onChange(
|
|
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
|
|
391
|
-
var
|
|
392
|
-
var
|
|
393
|
-
|
|
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 (
|
|
399
|
-
|
|
400
|
-
|
|
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
|
-
|
|
414
|
-
rows.push([]);
|
|
407
|
+
size += itemWidth;
|
|
415
408
|
}
|
|
416
409
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (!collapsed || !visible) {
|
|
420
|
-
return [result, visible];
|
|
410
|
+
if (!collapsed) {
|
|
411
|
+
return [result, btnsVisible];
|
|
421
412
|
}
|
|
422
413
|
|
|
423
|
-
return [
|
|
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],
|
package/es/FormLayout/index.less
CHANGED
package/es/Layout/index.d.ts
CHANGED
|
@@ -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: {
|
package/es/Layout/index.js
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
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/es/Popup/index.d.ts
CHANGED
|
@@ -23,10 +23,14 @@ export interface PopupProps<ValueType> extends ModalProps {
|
|
|
23
23
|
disabledTip?: string;
|
|
24
24
|
bordered?: boolean;
|
|
25
25
|
onClick?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* @description 清空后的值
|
|
28
|
+
*/
|
|
29
|
+
emptyValue?: ValueType;
|
|
26
30
|
}
|
|
27
|
-
interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, '
|
|
28
|
-
value: ValueType;
|
|
31
|
+
interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, 'onChange' | 'emptyValue'> {
|
|
29
32
|
onChange?: (value: ValueType) => void;
|
|
33
|
+
emptyValue: ValueType;
|
|
30
34
|
}
|
|
31
35
|
declare function Popup<ValueType>(props: ValuedPopupProps<ValueType>): JSX.Element;
|
|
32
36
|
declare function Popup<ValueType>(props: PopupProps<ValueType>): JSX.Element;
|
package/es/Popup/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["value", "onChange", "component", "children", "formatLabel", "disabled", "allowClear", "autoFocus", "showLabel", "beforeOk", "placeholder", "onClick", "disabledTip", "bordered"];
|
|
1
|
+
var _excluded = ["value", "onChange", "component", "children", "formatLabel", "disabled", "allowClear", "autoFocus", "showLabel", "beforeOk", "placeholder", "onClick", "disabledTip", "bordered", "emptyValue"];
|
|
2
2
|
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
@@ -51,11 +51,12 @@ function Popup(props) {
|
|
|
51
51
|
disabledTip = props.disabledTip,
|
|
52
52
|
_props$bordered = props.bordered,
|
|
53
53
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
54
|
+
emptyValue = props.emptyValue,
|
|
54
55
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
55
56
|
|
|
56
57
|
var prefixCls = "".concat(PREFIX_CLS, "-popup");
|
|
57
58
|
|
|
58
|
-
var _useState = useState(valueProp),
|
|
59
|
+
var _useState = useState(valueProp || emptyValue),
|
|
59
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
61
|
value = _useState2[0],
|
|
61
62
|
setValue = _useState2[1];
|
|
@@ -144,7 +145,7 @@ function Popup(props) {
|
|
|
144
145
|
e.stopPropagation();
|
|
145
146
|
|
|
146
147
|
if (onChange) {
|
|
147
|
-
onChange(
|
|
148
|
+
onChange(emptyValue);
|
|
148
149
|
}
|
|
149
150
|
};
|
|
150
151
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "0.1.
|
|
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": "
|
|
44
|
+
"gitHead": "c3ea23e58ff912db41794c92c844fcf9b2d7c18c"
|
|
45
45
|
}
|