@lemon-fe/components 1.1.4 → 1.1.5-alpha.1
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.
|
@@ -13,12 +13,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { Checkbox, Form, Input, Modal, Select } from 'antd';
|
|
16
17
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
17
18
|
import FormLayout from "../../../form-layout";
|
|
18
19
|
import Icons from "../../../icons";
|
|
19
20
|
import TipMark from "../../../tip-mark";
|
|
20
21
|
import { isCustomField, prefix } from "../../utils";
|
|
21
|
-
import { Checkbox, Form, Input, Modal, Select } from 'antd';
|
|
22
22
|
export default function FieldModal(props) {
|
|
23
23
|
var openProp = props.open,
|
|
24
24
|
_onCancel = props.onCancel,
|
|
@@ -32,11 +32,6 @@ export default function FieldModal(props) {
|
|
|
32
32
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
33
33
|
form = _Form$useForm2[0];
|
|
34
34
|
var ref = useRef(null);
|
|
35
|
-
var map = useMemo(function () {
|
|
36
|
-
return Object.fromEntries(nodes.map(function (item) {
|
|
37
|
-
return [item.title || '', item.id];
|
|
38
|
-
}));
|
|
39
|
-
}, [nodes]);
|
|
40
35
|
var handleAddExp = function handleAddExp(data) {
|
|
41
36
|
var _ref$current;
|
|
42
37
|
var area = (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.resizableTextArea) === null || _ref$current === void 0 ? void 0 : _ref$current.textArea;
|
|
@@ -50,33 +45,40 @@ export default function FieldModal(props) {
|
|
|
50
45
|
expression: prev.slice(0, pos) + "${".concat(data.title, "}") + prev.slice(pos)
|
|
51
46
|
});
|
|
52
47
|
};
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
48
|
+
var _useMemo = useMemo(function () {
|
|
49
|
+
var items = [];
|
|
50
|
+
nodes.forEach(function (item) {
|
|
51
|
+
if (item.column) {
|
|
52
|
+
items.push(item);
|
|
53
|
+
} else {
|
|
54
|
+
item.leaf.forEach(function (leaf) {
|
|
55
|
+
items.push(_objectSpread(_objectSpread({}, leaf), {}, {
|
|
56
|
+
title: "".concat(item.title, "-").concat(leaf.title)
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var showLeaves = items.filter(function (item) {
|
|
62
|
+
if (!item.column) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
if (isCustomField(item.id)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
});
|
|
70
|
+
var nodeMap = Object.fromEntries(showLeaves.map(function (item) {
|
|
71
|
+
return [item.title || '', item.id];
|
|
72
|
+
}));
|
|
73
|
+
return [showLeaves, nodeMap];
|
|
74
|
+
}, [nodes]),
|
|
75
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
76
|
+
leaves = _useMemo2[0],
|
|
77
|
+
map = _useMemo2[1];
|
|
76
78
|
var formatExpression = function formatExpression(expression) {
|
|
77
79
|
return expression.replace(/\$\{([^{}]+)\}/g, function (match, p1) {
|
|
78
80
|
if (p1) {
|
|
79
|
-
var node =
|
|
81
|
+
var node = leaves.find(function (item) {
|
|
80
82
|
return item.id === p1;
|
|
81
83
|
});
|
|
82
84
|
if (node !== undefined) {
|
|
@@ -10,6 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { Button, Space, Tooltip, message } from 'antd';
|
|
12
12
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { createPortal } from 'react-dom';
|
|
13
14
|
import Icons from "../../../icons";
|
|
14
15
|
import { useGridStore } from "../../hooks";
|
|
15
16
|
import { prefix } from "../../utils";
|
|
@@ -18,6 +19,7 @@ import FieldModal from "./field-modal";
|
|
|
18
19
|
import ItemWrapper from "./item";
|
|
19
20
|
import { DndContext, DragOverlay, closestCenter } from '@dnd-kit/core';
|
|
20
21
|
import { useDebounce, useRequest } from '@lemon-fe/hooks';
|
|
22
|
+
import classNames from 'classnames';
|
|
21
23
|
export default function CustomColumnPanel(params) {
|
|
22
24
|
var columnApi = params.columnApi,
|
|
23
25
|
api = params.api,
|
|
@@ -291,11 +293,11 @@ export default function CustomColumnPanel(params) {
|
|
|
291
293
|
level: 0,
|
|
292
294
|
key: node.key
|
|
293
295
|
});
|
|
294
|
-
}))), /*#__PURE__*/React.createElement(DragOverlay, {
|
|
296
|
+
}))), /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(DragOverlay, {
|
|
295
297
|
dropAnimation: null
|
|
296
298
|
}, overlay ? /*#__PURE__*/React.createElement("div", {
|
|
297
|
-
className: prefix('column-panel-drag-overlay')
|
|
298
|
-
}, overlay) : null)), /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
className: classNames('ag-theme-lemon', prefix('column-panel-drag-overlay'))
|
|
300
|
+
}, overlay) : null), document.body)), /*#__PURE__*/React.createElement("div", {
|
|
299
301
|
className: prefix('column-panel-footer')
|
|
300
302
|
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
301
303
|
size: "small",
|
package/es/data-grid/index.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-alpha.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"registry": "https://registry.npmjs.org"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "e247a717369fe19915addf8721f387659a67ca00"
|
|
66
66
|
}
|