@lemon-fe/components 0.1.69 → 0.1.72
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/Filter/index.js +2 -2
- package/es/Popup/index.d.ts +6 -6
- package/es/Popup/index.js +6 -2
- package/es/SelectView/index.d.ts +1 -0
- package/es/SelectView/index.js +10 -6
- package/es/SiderTree/index.d.ts +1 -1
- package/package.json +3 -3
package/es/Filter/index.js
CHANGED
|
@@ -408,9 +408,9 @@ function Filter(props) {
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
rows.push(currRow);
|
|
411
|
-
value += simple ?
|
|
411
|
+
value += simple ? 208 : 248;
|
|
412
412
|
|
|
413
|
-
if (currRow.length > 0 && value
|
|
413
|
+
if (currRow.length > 0 && value >= width + getColStyle(1).width) {
|
|
414
414
|
rows.push([]);
|
|
415
415
|
}
|
|
416
416
|
|
package/es/Popup/index.d.ts
CHANGED
|
@@ -3,13 +3,18 @@ import type { ModalProps } from 'antd/lib/modal';
|
|
|
3
3
|
export interface PopupProps<ValueType> extends ModalProps {
|
|
4
4
|
value?: ValueType;
|
|
5
5
|
onChange?: (value?: ValueType) => void;
|
|
6
|
+
/**
|
|
7
|
+
* @description 渲染函数,这个函数不是作为组件渲染的,偷懒可以直接传入组件,如果需要考虑优化参考demo的传入方式
|
|
8
|
+
*/
|
|
6
9
|
component: (params: {
|
|
7
10
|
value?: ValueType;
|
|
8
11
|
onChange: (value: ValueType) => void;
|
|
9
12
|
}) => ReactElement | null;
|
|
10
13
|
formatLabel?: (value: ValueType) => string;
|
|
11
14
|
beforeOk?: (value: ValueType) => ValueType | PromiseLike<ValueType>;
|
|
12
|
-
children?:
|
|
15
|
+
children?: JSX.Element | ((props: {
|
|
16
|
+
value?: ValueType;
|
|
17
|
+
}) => JSX.Element);
|
|
13
18
|
allowClear?: boolean;
|
|
14
19
|
disabled?: boolean;
|
|
15
20
|
autoFocus?: boolean;
|
|
@@ -19,10 +24,5 @@ export interface PopupProps<ValueType> extends ModalProps {
|
|
|
19
24
|
bordered?: boolean;
|
|
20
25
|
onClick?: () => void;
|
|
21
26
|
}
|
|
22
|
-
interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, 'value' | 'onChange'> {
|
|
23
|
-
value: ValueType;
|
|
24
|
-
onChange?: (value: ValueType) => void;
|
|
25
|
-
}
|
|
26
|
-
declare function Popup<ValueType>(props: ValuedPopupProps<ValueType>): JSX.Element;
|
|
27
27
|
declare function Popup<ValueType>(props: PopupProps<ValueType>): JSX.Element;
|
|
28
28
|
export default Popup;
|
package/es/Popup/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
26
26
|
|
|
27
27
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
28
28
|
|
|
29
|
-
import React, { useState, cloneElement, useRef } from 'react';
|
|
29
|
+
import React, { useState, cloneElement, useRef, isValidElement } from 'react';
|
|
30
30
|
import { Modal, Input, message } from 'antd';
|
|
31
31
|
import { CloseCircleFilled } from '@ant-design/icons';
|
|
32
32
|
import { PREFIX_CLS } from '../constants';
|
|
@@ -151,7 +151,11 @@ function Popup(props) {
|
|
|
151
151
|
var label = valueProp ? formatLabel ? formatLabel(valueProp) : valueProp : undefined;
|
|
152
152
|
var trigger;
|
|
153
153
|
|
|
154
|
-
if (children) {
|
|
154
|
+
if (typeof children === 'function') {
|
|
155
|
+
trigger = children({
|
|
156
|
+
value: valueProp
|
|
157
|
+
});
|
|
158
|
+
} else if ( /*#__PURE__*/isValidElement(children)) {
|
|
155
159
|
trigger = showLabel ? /*#__PURE__*/cloneElement(children, undefined, label) : children;
|
|
156
160
|
} else {
|
|
157
161
|
trigger = /*#__PURE__*/React.createElement(Input, {
|
package/es/SelectView/index.d.ts
CHANGED
package/es/SelectView/index.js
CHANGED
|
@@ -24,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
24
|
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
26
|
|
|
27
|
-
import React, {
|
|
27
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
28
28
|
import { Tabs, Button } from 'antd';
|
|
29
29
|
import { get } from 'lodash';
|
|
30
30
|
import Filter from '../Filter';
|
|
@@ -111,11 +111,15 @@ export default function SelectView(props) {
|
|
|
111
111
|
onChange === null || onChange === void 0 ? void 0 : onChange(newRows);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
var handleChangeParams =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
var handleChangeParams = function handleChangeParams(mParams) {
|
|
115
|
+
var nextParams = _objectSpread(_objectSpread({}, params), mParams);
|
|
116
|
+
|
|
117
|
+
if (filter === null || filter === void 0 ? void 0 : filter.onChange) {
|
|
118
|
+
filter.onChange(nextParams);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
setParams(nextParams);
|
|
122
|
+
};
|
|
119
123
|
|
|
120
124
|
var handleValuesChange = function handleValuesChange(changedValues, allValues) {
|
|
121
125
|
var _filter$onValuesChang;
|
package/es/SiderTree/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface Props<KeyType> extends Omit<TreeProps, 'onSelect' | 'selectedKeys' | '
|
|
|
13
13
|
onSelect?: (node: TreeData<KeyType>, info: {
|
|
14
14
|
event: 'select';
|
|
15
15
|
selected: boolean;
|
|
16
|
-
node: EventDataNode
|
|
16
|
+
node: EventDataNode<DataNode>;
|
|
17
17
|
selectedNodes: DataNode[];
|
|
18
18
|
nativeEvent: MouseEvent;
|
|
19
19
|
}) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "鲁盛杰 <lusj@cnlemon.net>",
|
|
6
6
|
"homepage": "",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@types/color-string": "^1.5.2",
|
|
37
37
|
"@types/lodash": "^4.14.179",
|
|
38
38
|
"@types/react-resizable": "^1.7.4",
|
|
39
|
-
"antd": "^4.
|
|
39
|
+
"antd": "^4.21.6",
|
|
40
40
|
"rc-resize-observer": "^1.2.0",
|
|
41
41
|
"react": "^17.0.2",
|
|
42
42
|
"react-dom": "^17.0.2"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "21ba97408ddedae75c198d8fd0f3c1d5da248f9f"
|
|
45
45
|
}
|