@lemon-fe/kits 1.0.0-200 → 1.0.0-202
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/components/DataGrid/components/CustomColumnPanel/FieldModal.js +6 -4
- package/es/components/DataGrid/components/CustomColumnPanel/Item.js +4 -2
- package/es/components/DataGrid/index.d.ts +1 -1
- package/es/components/DataGrid/index.js +29 -2
- package/es/components/DataGrid/index.less +3 -0
- package/es/components/Filter/index.js +2 -1
- package/es/components/SiderTree/index.less +0 -6
- package/es/styles/overrides.less +4 -0
- package/package.json +1 -1
|
@@ -46,7 +46,11 @@ export default function FieldModal(props) {
|
|
|
46
46
|
form = _Form$useForm2[0];
|
|
47
47
|
|
|
48
48
|
var ref = useRef(null);
|
|
49
|
-
var map =
|
|
49
|
+
var map = useMemo(function () {
|
|
50
|
+
return Object.fromEntries(nodes.map(function (item) {
|
|
51
|
+
return [item.title || '', item.id];
|
|
52
|
+
}));
|
|
53
|
+
}, []);
|
|
50
54
|
|
|
51
55
|
var handleAddExp = function handleAddExp(data) {
|
|
52
56
|
var _ref$current, _ref$current$resizabl;
|
|
@@ -62,7 +66,6 @@ export default function FieldModal(props) {
|
|
|
62
66
|
var _form$getFieldsValue = form.getFieldsValue(),
|
|
63
67
|
prev = _form$getFieldsValue.expression;
|
|
64
68
|
|
|
65
|
-
map.current = _objectSpread(_objectSpread({}, map.current), {}, _defineProperty({}, data.title || '', data.id));
|
|
66
69
|
form.setFieldsValue({
|
|
67
70
|
expression: prev.slice(0, pos) + "${".concat(data.title, "}") + prev.slice(pos)
|
|
68
71
|
});
|
|
@@ -113,7 +116,7 @@ export default function FieldModal(props) {
|
|
|
113
116
|
var parseExpression = function parseExpression(expression) {
|
|
114
117
|
return expression.replace(/\$\{([^{}]+)\}/g, function (match, p1) {
|
|
115
118
|
if (p1) {
|
|
116
|
-
var id = map
|
|
119
|
+
var id = map[p1];
|
|
117
120
|
|
|
118
121
|
if (id !== undefined) {
|
|
119
122
|
return "${".concat(id, "}");
|
|
@@ -137,7 +140,6 @@ export default function FieldModal(props) {
|
|
|
137
140
|
summary: false,
|
|
138
141
|
summaryType: 1
|
|
139
142
|
});
|
|
140
|
-
map.current = {};
|
|
141
143
|
}
|
|
142
144
|
} else {
|
|
143
145
|
setOpen(true);
|
|
@@ -74,12 +74,14 @@ var Item = /*#__PURE__*/memo(function (props) {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
var _useState = useState(
|
|
77
|
+
var _useState = useState(0),
|
|
78
78
|
_useState2 = _slicedToArray(_useState, 2),
|
|
79
79
|
visible = _useState2[0],
|
|
80
80
|
setVisible = _useState2[1];
|
|
81
81
|
|
|
82
82
|
useEffect(function () {
|
|
83
|
+
setVisible(getChecked.current());
|
|
84
|
+
|
|
83
85
|
var handler = function handler() {
|
|
84
86
|
setVisible(getChecked.current());
|
|
85
87
|
};
|
|
@@ -88,7 +90,7 @@ var Item = /*#__PURE__*/memo(function (props) {
|
|
|
88
90
|
return function () {
|
|
89
91
|
api.removeEventListener('columnVisible', handler);
|
|
90
92
|
};
|
|
91
|
-
}, []);
|
|
93
|
+
}, [node.column]);
|
|
92
94
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
93
95
|
style: {
|
|
94
96
|
paddingLeft: level * 20 + 8
|
|
@@ -52,7 +52,7 @@ export default class DataGrid<TData extends Record<string, any>> extends Compone
|
|
|
52
52
|
Text: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").TextEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
53
53
|
Date: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").DateEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
54
54
|
Number: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").NumberEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
55
|
-
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "
|
|
55
|
+
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "allowClear" | "options" | "virtual" | "showSearch" | "listHeight"> & {
|
|
56
56
|
fieldNames?: {
|
|
57
57
|
label: string;
|
|
58
58
|
value: string;
|
|
@@ -72,7 +72,7 @@ import Scheme from 'async-validator';
|
|
|
72
72
|
import BigNumber from 'bignumber.js';
|
|
73
73
|
import classNames from 'classnames';
|
|
74
74
|
import { get, set } from 'lodash';
|
|
75
|
-
import { create, parseDependencies,
|
|
75
|
+
import { create, parseDependencies, factory } from 'mathjs';
|
|
76
76
|
import memoizeOne from 'memoize-one';
|
|
77
77
|
import React, { Component, createRef } from 'react';
|
|
78
78
|
import shallowEqual from 'shallowequal';
|
|
@@ -100,9 +100,36 @@ import DetailCellRenderer from "./renderer/DetailCellRenderer";
|
|
|
100
100
|
import HeaderRenderer from "./renderer/HeaderRenderer";
|
|
101
101
|
import { prefix, getColField, isColumn, withSyncRender, Store, Selection, columnTypes } from "./utils";
|
|
102
102
|
|
|
103
|
+
var add = function add(a, b) {
|
|
104
|
+
return new BigNumber(a).plus(b);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var subtract = function subtract(a, b) {
|
|
108
|
+
return new BigNumber(a).minus(b);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var multiply = function multiply(a, b) {
|
|
112
|
+
return new BigNumber(a).times(b);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var divide = function divide(a, b) {
|
|
116
|
+
return new BigNumber(a).div(b);
|
|
117
|
+
};
|
|
118
|
+
|
|
103
119
|
var _create = create({
|
|
104
120
|
parseDependencies: parseDependencies,
|
|
105
|
-
|
|
121
|
+
createAdd: factory('add', [], function () {
|
|
122
|
+
return add;
|
|
123
|
+
}),
|
|
124
|
+
createSubtract: factory('subtract', [], function () {
|
|
125
|
+
return subtract;
|
|
126
|
+
}),
|
|
127
|
+
createMultiply: factory('multiply', [], function () {
|
|
128
|
+
return multiply;
|
|
129
|
+
}),
|
|
130
|
+
createDivide: factory('divide', [], function () {
|
|
131
|
+
return divide;
|
|
132
|
+
})
|
|
106
133
|
}),
|
|
107
134
|
parse = _create.parse;
|
|
108
135
|
|
|
@@ -533,6 +533,7 @@ function Filter(props) {
|
|
|
533
533
|
return handleFinish(val, 'submit');
|
|
534
534
|
},
|
|
535
535
|
form: form,
|
|
536
|
+
component: false,
|
|
536
537
|
onValuesChange: handleValuesChange
|
|
537
538
|
}, !simple && /*#__PURE__*/React.createElement(TabBar, {
|
|
538
539
|
tabs: tabs,
|
|
@@ -545,7 +546,7 @@ function Filter(props) {
|
|
|
545
546
|
direction: "row",
|
|
546
547
|
style: !width ? {
|
|
547
548
|
maxHeight: 72,
|
|
548
|
-
|
|
549
|
+
overflow: 'hidden'
|
|
549
550
|
} : undefined
|
|
550
551
|
}, data.map(function (item) {
|
|
551
552
|
if (!preserveFields && isFieldHidden(item)) {
|
|
@@ -52,13 +52,8 @@
|
|
|
52
52
|
.scrollBar();
|
|
53
53
|
|
|
54
54
|
.@{ant-prefix}-tree {
|
|
55
|
-
&-list-holder-inner {
|
|
56
|
-
align-items: stretch;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
&-node-content-wrapper {
|
|
60
56
|
min-width: 0;
|
|
61
|
-
overflow-x: hidden;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
&-title {
|
|
@@ -66,7 +61,6 @@
|
|
|
66
61
|
flex: 1;
|
|
67
62
|
align-items: center;
|
|
68
63
|
justify-content: space-between;
|
|
69
|
-
min-width: 56px;
|
|
70
64
|
border-radius: 4px;
|
|
71
65
|
cursor: pointer;
|
|
72
66
|
transition: background-color 0.2s;
|
package/es/styles/overrides.less
CHANGED
|
@@ -253,6 +253,10 @@ a[title='站长统计'] {
|
|
|
253
253
|
& &-treenode-leaf-last &-switcher-leaf-line::before {
|
|
254
254
|
height: (@tree-title-height / 2) !important;
|
|
255
255
|
}
|
|
256
|
+
|
|
257
|
+
& &-treenode-draggable &-draggable-icon {
|
|
258
|
+
width: @tree-node-indent-width;
|
|
259
|
+
}
|
|
256
260
|
}
|
|
257
261
|
|
|
258
262
|
/** button **/
|