@nokecy/qc-ui 0.0.2 → 0.0.3
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/dist/cjs/ag-grid-plus/ag-gridPlus.d.ts +1 -0
- package/dist/cjs/ag-grid-plus/ag-gridPlus.js +140 -38
- package/dist/cjs/ag-grid-plus/global.scss +18 -34
- package/dist/cjs/ag-grid-plus/queryForm/index.js +1 -3
- package/dist/cjs/ag-grid-plus/queryForm/queryForm.js +4 -2
- package/dist/cjs/ag-grid-plus/settingItem/index.d.ts +3 -0
- package/dist/cjs/ag-grid-plus/settingItem/index.js +27 -0
- package/dist/cjs/ag-grid-plus/toolBar/index.d.ts +20 -0
- package/dist/cjs/ag-grid-plus/toolBar/index.js +196 -0
- package/dist/cjs/ag-grid-plus/toolBar/style.d.ts +5 -0
- package/dist/cjs/ag-grid-plus/toolBar/style.js +142 -0
- package/dist/cjs/ag-grid-plus/utils.d.ts +8 -0
- package/dist/cjs/ag-grid-plus/utils.js +113 -0
- package/dist/cjs/array-table/index.d.ts +0 -2
- package/dist/cjs/array-table/index.js +0 -4
- package/dist/cjs/{elsaFlow/react-edge/edge1.less → elsa/components/finishNode.d.ts} +0 -0
- package/dist/cjs/elsa/components/finishNode.js +1 -0
- package/dist/cjs/{elsaFlow/react-edge/edge2.less → elsa/components/forkNode.d.ts} +0 -0
- package/dist/cjs/elsa/components/forkNode.js +1 -0
- package/dist/{esm/elsaFlow/react-edge/edge1.less → cjs/elsa/components/ifNode.d.ts} +0 -0
- package/dist/cjs/elsa/components/ifNode.js +1 -0
- package/dist/{esm/elsaFlow/react-edge/edge2.less → cjs/elsa/components/joinNode.d.ts} +0 -0
- package/dist/cjs/elsa/components/joinNode.js +1 -0
- package/dist/cjs/elsa/components/setNameNode.d.ts +0 -0
- package/dist/cjs/elsa/components/setNameNode.js +1 -0
- package/dist/cjs/elsa/components/startNode.d.ts +3 -0
- package/dist/cjs/elsa/components/startNode.js +24 -0
- package/dist/cjs/elsa/components/switchNode.d.ts +0 -0
- package/dist/cjs/elsa/components/switchNode.js +1 -0
- package/dist/cjs/elsa/components/timerNode.d.ts +0 -0
- package/dist/cjs/elsa/components/timerNode.js +1 -0
- package/dist/cjs/elsa/components/userTaskNode/index.d.ts +7 -0
- package/dist/cjs/elsa/components/userTaskNode/index.js +50 -0
- package/dist/cjs/elsa/components/userTaskNode/index.less +0 -0
- package/dist/cjs/elsa/components/userTaskNode/register.d.ts +1 -0
- package/dist/cjs/elsa/components/userTaskNode/register.js +54 -0
- package/dist/cjs/elsa/elsa.design.d.ts +4 -0
- package/dist/cjs/elsa/elsa.design.js +123 -0
- package/dist/cjs/elsa/index.d.ts +4 -0
- package/dist/cjs/elsa/index.js +40 -0
- package/dist/cjs/elsa/index.less +21 -0
- package/dist/cjs/extensible-grid/index.d.ts +4 -0
- package/dist/cjs/extensible-grid/index.js +39 -0
- package/dist/cjs/extensible-grid/interface.d.ts +10 -0
- package/dist/cjs/extensible-grid/interface.js +5 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/xflow/components/Wrapper.d.ts +3 -0
- package/dist/cjs/xflow/components/Wrapper.js +26 -0
- package/dist/cjs/xflow/components/XFlow.d.ts +3 -0
- package/dist/cjs/xflow/components/XFlow.js +47 -0
- package/dist/cjs/xflow/components/XFlowGraph.d.ts +4 -0
- package/dist/cjs/xflow/components/XFlowGraph.js +73 -0
- package/dist/cjs/xflow/components/graph-toolbar/index.d.ts +19 -0
- package/dist/cjs/xflow/components/graph-toolbar/index.js +60 -0
- package/dist/cjs/xflow/components/graph-toolbar/index.less +11 -0
- package/dist/cjs/xflow/components/index.d.ts +3 -0
- package/dist/cjs/xflow/components/index.js +31 -0
- package/dist/cjs/xflow/components/keyboard/index.d.ts +3 -0
- package/dist/cjs/xflow/components/keyboard/index.js +40 -0
- package/dist/cjs/xflow/components/minimap/index.d.ts +3 -0
- package/dist/cjs/xflow/components/minimap/index.js +53 -0
- package/dist/cjs/xflow/components/scroller/index.d.ts +4 -0
- package/dist/cjs/xflow/components/scroller/index.js +49 -0
- package/dist/cjs/xflow/components/selection/index.d.ts +3 -0
- package/dist/cjs/xflow/components/selection/index.js +40 -0
- package/dist/cjs/xflow/components/snapline/index.d.ts +3 -0
- package/dist/cjs/xflow/components/snapline/index.js +40 -0
- package/dist/cjs/xflow/components/transform/index.d.ts +3 -0
- package/dist/cjs/xflow/components/transform/index.js +38 -0
- package/dist/cjs/xflow/context/GraphContext.d.ts +10 -0
- package/dist/cjs/xflow/context/GraphContext.js +21 -0
- package/dist/cjs/xflow/hooks/clipboard/index.d.ts +2 -0
- package/dist/cjs/xflow/hooks/clipboard/index.js +34 -0
- package/dist/cjs/xflow/hooks/dnd/index.d.ts +2 -0
- package/dist/cjs/xflow/hooks/dnd/index.js +29 -0
- package/dist/cjs/xflow/hooks/format/index.d.ts +5 -0
- package/dist/cjs/xflow/hooks/format/index.js +60 -0
- package/dist/cjs/xflow/hooks/graph/index.d.ts +1 -0
- package/dist/cjs/xflow/hooks/graph/index.js +19 -0
- package/dist/cjs/xflow/hooks/history/index.d.ts +4 -0
- package/dist/cjs/xflow/hooks/history/index.js +63 -0
- package/dist/cjs/xflow/hooks/keyboard/index.d.ts +13 -0
- package/dist/cjs/xflow/hooks/keyboard/index.js +55 -0
- package/dist/cjs/xflow/hooks/selection/index.d.ts +3 -0
- package/dist/cjs/xflow/hooks/selection/index.js +41 -0
- package/dist/cjs/xflow/hooks/snapline/index.d.ts +2 -0
- package/dist/cjs/xflow/hooks/snapline/index.js +21 -0
- package/dist/cjs/xflow/hooks/transform/index.d.ts +2 -0
- package/dist/cjs/xflow/hooks/transform/index.js +21 -0
- package/dist/cjs/xflow/index.d.ts +3 -0
- package/dist/cjs/xflow/index.js +44 -0
- package/dist/cjs/xflow/styles/index.less +0 -0
- package/dist/cjs/xflow/types/index.d.ts +19 -0
- package/dist/cjs/xflow/types/index.js +5 -0
- package/dist/cjs/xflow/util/algorithm.d.ts +1 -0
- package/dist/cjs/xflow/util/algorithm.js +10 -0
- package/dist/cjs/xflow/util/index.d.ts +2 -0
- package/dist/cjs/xflow/util/index.js +16 -0
- package/dist/cjs/xflow/util/main.d.ts +2 -0
- package/dist/cjs/xflow/util/main.js +31 -0
- package/dist/cjs/xflow/util/model.d.ts +2 -0
- package/dist/cjs/xflow/util/model.js +29 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.d.ts +1 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +136 -39
- package/dist/esm/ag-grid-plus/global.scss +18 -34
- package/dist/esm/ag-grid-plus/queryForm/index.js +1 -3
- package/dist/esm/ag-grid-plus/queryForm/queryForm.js +4 -2
- package/dist/esm/ag-grid-plus/settingItem/index.d.ts +3 -0
- package/dist/esm/ag-grid-plus/settingItem/index.js +17 -0
- package/dist/esm/ag-grid-plus/toolBar/index.d.ts +20 -0
- package/dist/esm/ag-grid-plus/toolBar/index.js +176 -0
- package/dist/esm/ag-grid-plus/toolBar/style.d.ts +5 -0
- package/dist/esm/ag-grid-plus/toolBar/style.js +135 -0
- package/dist/esm/ag-grid-plus/utils.d.ts +8 -0
- package/dist/esm/ag-grid-plus/utils.js +94 -0
- package/dist/esm/array-table/index.d.ts +0 -2
- package/dist/esm/array-table/index.js +0 -2
- package/dist/esm/elsa/components/finishNode.d.ts +0 -0
- package/dist/esm/elsa/components/finishNode.js +0 -0
- package/dist/esm/elsa/components/forkNode.d.ts +0 -0
- package/dist/esm/elsa/components/forkNode.js +0 -0
- package/dist/esm/elsa/components/ifNode.d.ts +0 -0
- package/dist/esm/elsa/components/ifNode.js +0 -0
- package/dist/esm/elsa/components/joinNode.d.ts +0 -0
- package/dist/esm/elsa/components/joinNode.js +0 -0
- package/dist/esm/elsa/components/setNameNode.d.ts +0 -0
- package/dist/esm/elsa/components/setNameNode.js +0 -0
- package/dist/esm/elsa/components/startNode.d.ts +3 -0
- package/dist/esm/elsa/components/startNode.js +14 -0
- package/dist/esm/elsa/components/switchNode.d.ts +0 -0
- package/dist/esm/elsa/components/switchNode.js +0 -0
- package/dist/esm/elsa/components/timerNode.d.ts +0 -0
- package/dist/esm/elsa/components/timerNode.js +0 -0
- package/dist/esm/elsa/components/userTaskNode/index.d.ts +7 -0
- package/dist/esm/elsa/components/userTaskNode/index.js +33 -0
- package/dist/esm/elsa/components/userTaskNode/index.less +0 -0
- package/dist/esm/elsa/components/userTaskNode/register.d.ts +1 -0
- package/dist/esm/elsa/components/userTaskNode/register.js +48 -0
- package/dist/esm/elsa/elsa.design.d.ts +4 -0
- package/dist/esm/elsa/elsa.design.js +105 -0
- package/dist/esm/elsa/index.d.ts +4 -0
- package/dist/esm/elsa/index.js +25 -0
- package/dist/esm/elsa/index.less +21 -0
- package/dist/esm/extensible-grid/index.d.ts +4 -0
- package/dist/esm/extensible-grid/index.js +28 -0
- package/dist/esm/extensible-grid/interface.d.ts +10 -0
- package/dist/esm/extensible-grid/interface.js +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/xflow/components/Wrapper.d.ts +3 -0
- package/dist/esm/xflow/components/Wrapper.js +15 -0
- package/dist/esm/xflow/components/XFlow.d.ts +3 -0
- package/dist/esm/xflow/components/XFlow.js +32 -0
- package/dist/esm/xflow/components/XFlowGraph.d.ts +4 -0
- package/dist/esm/xflow/components/XFlowGraph.js +54 -0
- package/dist/esm/xflow/components/graph-toolbar/index.d.ts +19 -0
- package/dist/esm/xflow/components/graph-toolbar/index.js +44 -0
- package/dist/esm/xflow/components/graph-toolbar/index.less +11 -0
- package/dist/esm/xflow/components/index.d.ts +3 -0
- package/dist/esm/xflow/components/index.js +3 -0
- package/dist/esm/xflow/components/keyboard/index.d.ts +3 -0
- package/dist/esm/xflow/components/keyboard/index.js +22 -0
- package/dist/esm/xflow/components/minimap/index.d.ts +3 -0
- package/dist/esm/xflow/components/minimap/index.js +35 -0
- package/dist/esm/xflow/components/scroller/index.d.ts +4 -0
- package/dist/esm/xflow/components/scroller/index.js +28 -0
- package/dist/esm/xflow/components/selection/index.d.ts +3 -0
- package/dist/esm/xflow/components/selection/index.js +22 -0
- package/dist/esm/xflow/components/snapline/index.d.ts +3 -0
- package/dist/esm/xflow/components/snapline/index.js +22 -0
- package/dist/esm/xflow/components/transform/index.d.ts +3 -0
- package/dist/esm/xflow/components/transform/index.js +20 -0
- package/dist/esm/xflow/context/GraphContext.d.ts +10 -0
- package/dist/esm/xflow/context/GraphContext.js +9 -0
- package/dist/esm/xflow/hooks/clipboard/index.d.ts +2 -0
- package/dist/esm/xflow/hooks/clipboard/index.js +22 -0
- package/dist/esm/xflow/hooks/dnd/index.d.ts +2 -0
- package/dist/esm/xflow/hooks/dnd/index.js +17 -0
- package/dist/esm/xflow/hooks/format/index.d.ts +5 -0
- package/dist/esm/xflow/hooks/format/index.js +48 -0
- package/dist/esm/xflow/hooks/graph/index.d.ts +1 -0
- package/dist/esm/xflow/hooks/graph/index.js +8 -0
- package/dist/esm/xflow/hooks/history/index.d.ts +4 -0
- package/dist/esm/xflow/hooks/history/index.js +45 -0
- package/dist/esm/xflow/hooks/keyboard/index.d.ts +13 -0
- package/dist/esm/xflow/hooks/keyboard/index.js +40 -0
- package/dist/esm/xflow/hooks/selection/index.d.ts +3 -0
- package/dist/esm/xflow/hooks/selection/index.js +25 -0
- package/dist/esm/xflow/hooks/snapline/index.d.ts +2 -0
- package/dist/esm/xflow/hooks/snapline/index.js +9 -0
- package/dist/esm/xflow/hooks/transform/index.d.ts +2 -0
- package/dist/esm/xflow/hooks/transform/index.js +9 -0
- package/dist/esm/xflow/index.d.ts +3 -0
- package/dist/esm/xflow/index.js +3 -0
- package/dist/esm/xflow/styles/index.less +0 -0
- package/dist/esm/xflow/types/index.d.ts +19 -0
- package/dist/esm/xflow/types/index.js +1 -0
- package/dist/esm/xflow/util/algorithm.d.ts +1 -0
- package/dist/esm/xflow/util/algorithm.js +1 -0
- package/dist/esm/xflow/util/index.d.ts +2 -0
- package/dist/esm/xflow/util/index.js +2 -0
- package/dist/esm/xflow/util/main.d.ts +2 -0
- package/dist/esm/xflow/util/main.js +2 -0
- package/dist/esm/xflow/util/model.d.ts +2 -0
- package/dist/esm/xflow/util/model.js +19 -0
- package/dist/umd/qc-ui.min.css +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +18 -6
- package/dist/cjs/elsaFlow/config-graph.d.ts +0 -1
- package/dist/cjs/elsaFlow/config-graph.js +0 -57
- package/dist/cjs/elsaFlow/index.d.ts +0 -6
- package/dist/cjs/elsaFlow/index.js +0 -199
- package/dist/cjs/elsaFlow/react-edge/edge1.d.ts +0 -4
- package/dist/cjs/elsaFlow/react-edge/edge1.js +0 -31
- package/dist/cjs/elsaFlow/react-edge/edge2.d.ts +0 -4
- package/dist/cjs/elsaFlow/react-edge/edge2.js +0 -31
- package/dist/cjs/elsaFlow/react-node/node1.d.ts +0 -4
- package/dist/cjs/elsaFlow/react-node/node1.js +0 -28
- package/dist/cjs/elsaFlow/react-node/node1.less +0 -11
- package/dist/cjs/elsaFlow/react-node/node2.d.ts +0 -4
- package/dist/cjs/elsaFlow/react-node/node2.js +0 -28
- package/dist/cjs/elsaFlow/react-node/node2.less +0 -11
- package/dist/esm/elsaFlow/config-graph.d.ts +0 -1
- package/dist/esm/elsaFlow/config-graph.js +0 -42
- package/dist/esm/elsaFlow/index.d.ts +0 -6
- package/dist/esm/elsaFlow/index.js +0 -189
- package/dist/esm/elsaFlow/react-edge/edge1.d.ts +0 -4
- package/dist/esm/elsaFlow/react-edge/edge1.js +0 -18
- package/dist/esm/elsaFlow/react-edge/edge2.d.ts +0 -4
- package/dist/esm/elsaFlow/react-edge/edge2.js +0 -18
- package/dist/esm/elsaFlow/react-node/node1.d.ts +0 -4
- package/dist/esm/elsaFlow/react-node/node1.js +0 -16
- package/dist/esm/elsaFlow/react-node/node1.less +0 -11
- package/dist/esm/elsaFlow/react-node/node2.d.ts +0 -4
- package/dist/esm/elsaFlow/react-node/node2.js +0 -16
- package/dist/esm/elsaFlow/react-node/node2.less +0 -11
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _algorithm = require("./algorithm");
|
|
8
|
+
|
|
9
|
+
Object.keys(_algorithm).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _algorithm[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _algorithm[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _model = require("./model");
|
|
21
|
+
|
|
22
|
+
Object.keys(_model).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _model[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _model[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.preprocess = void 0;
|
|
7
|
+
|
|
8
|
+
var _x = require("@antv/x6");
|
|
9
|
+
|
|
10
|
+
var preprocess = function preprocess(model) {
|
|
11
|
+
var nodeOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
var edgeOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13
|
+
model.forEach(function (item) {
|
|
14
|
+
var shape = item.shape;
|
|
15
|
+
|
|
16
|
+
if (shape) {
|
|
17
|
+
if (_x.Node.registry.exist(shape)) {
|
|
18
|
+
_x.ObjectExt.merge(item, nodeOptions);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (_x.Edge.registry.exist(shape)) {
|
|
22
|
+
_x.ObjectExt.merge(item, edgeOptions);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return model;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.preprocess = preprocess;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["style", "params", "request", "dataSource", "headerTitle", "toolBarRender", "search", "onGridReady"];
|
|
1
|
+
var _excluded = ["style", "params", "request", "dataSource", "headerTitle", "toolBarRender", "search", "onGridReady", "children"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -25,12 +25,21 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
25
25
|
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; }
|
|
26
26
|
|
|
27
27
|
import { AgGridReact } from 'ag-grid-react';
|
|
28
|
-
import { Spin, Pagination } from 'antd';
|
|
29
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
28
|
+
import { Spin, Pagination, Card } from 'antd';
|
|
29
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
30
30
|
import GridManage from "./gridManager";
|
|
31
|
+
import "ag-grid-enterprise";
|
|
31
32
|
import "./global.scss";
|
|
32
|
-
import {
|
|
33
|
+
import { AgGridColumn } from "./interface";
|
|
33
34
|
import FormRender from "./queryForm";
|
|
35
|
+
import ToolBar from "./toolBar";
|
|
36
|
+
import SettingItem from "./settingItem";
|
|
37
|
+
import { RedoOutlined, SettingOutlined } from '@ant-design/icons';
|
|
38
|
+
import { convertFilterModel, dateTimeValueFormatter, dateValueFormatter, flatten, toTree } from "./utils";
|
|
39
|
+
|
|
40
|
+
var getSort = function getSort(columnState) {
|
|
41
|
+
return columnState ? "".concat(columnState.colId, " ").concat(columnState.sort) : "";
|
|
42
|
+
};
|
|
34
43
|
|
|
35
44
|
function AgGridPlus(props) {
|
|
36
45
|
var style = props.style,
|
|
@@ -41,6 +50,7 @@ function AgGridPlus(props) {
|
|
|
41
50
|
toolBarRender = props.toolBarRender,
|
|
42
51
|
search = props.search,
|
|
43
52
|
onReady = props.onGridReady,
|
|
53
|
+
children = props.children,
|
|
44
54
|
rest = _objectWithoutProperties(props, _excluded);
|
|
45
55
|
|
|
46
56
|
var apiRef = useRef();
|
|
@@ -52,35 +62,51 @@ function AgGridPlus(props) {
|
|
|
52
62
|
ready = _useState2[0],
|
|
53
63
|
setReady = _useState2[1];
|
|
54
64
|
|
|
55
|
-
var _useState3 = useState(),
|
|
65
|
+
var _useState3 = useState(false),
|
|
56
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
loading = _useState4[0],
|
|
68
|
+
setLoading = _useState4[1];
|
|
59
69
|
|
|
60
|
-
var _useState5 = useState(
|
|
70
|
+
var _useState5 = useState(),
|
|
61
71
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
columnDefs = _useState6[0],
|
|
73
|
+
setColumnDefs = _useState6[1];
|
|
64
74
|
|
|
65
75
|
var _useState7 = useState([]),
|
|
66
76
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
rowData = _useState8[0],
|
|
78
|
+
setRowData = _useState8[1];
|
|
79
|
+
|
|
80
|
+
var _useState9 = useState({}),
|
|
81
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
82
|
+
queryFilter = _useState10[0],
|
|
83
|
+
setQueryFilter = _useState10[1];
|
|
69
84
|
|
|
70
|
-
var
|
|
85
|
+
var _useState11 = useState(),
|
|
86
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
87
|
+
sortColumn = _useState12[0],
|
|
88
|
+
setSortColumn = _useState12[1];
|
|
89
|
+
|
|
90
|
+
var _useState13 = useState({
|
|
71
91
|
pageSize: 200,
|
|
72
92
|
current: 1,
|
|
73
93
|
total: dataSource ? dataSource.length : 0
|
|
74
94
|
}),
|
|
75
|
-
|
|
76
|
-
pagination =
|
|
77
|
-
setPagination =
|
|
95
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
96
|
+
pagination = _useState14[0],
|
|
97
|
+
setPagination = _useState14[1]; //默认列属性
|
|
78
98
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
|
|
100
|
+
var defaultColDef = {
|
|
101
|
+
resizable: true,
|
|
102
|
+
sortable: true,
|
|
103
|
+
flex: 1
|
|
104
|
+
};
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
if (ready && request) {
|
|
107
|
+
onRequest(queryFilter);
|
|
82
108
|
}
|
|
83
|
-
}, [JSON.stringify(gridParams),
|
|
109
|
+
}, [ready, JSON.stringify(gridParams), JSON.stringify(sortColumn), pagination.pageSize, pagination.current]);
|
|
84
110
|
var onGridReady = useCallback(function (params) {
|
|
85
111
|
apiRef.current = params.api;
|
|
86
112
|
columnsRef.current = params.columnApi;
|
|
@@ -91,54 +117,127 @@ function AgGridPlus(props) {
|
|
|
91
117
|
|
|
92
118
|
dataSource && setRowData(dataSource);
|
|
93
119
|
setColumnDefs(columnsRef.current.getColumns());
|
|
120
|
+
sortChanged(params.columnApi);
|
|
94
121
|
setReady(true);
|
|
95
122
|
}, [dataSource]);
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
|
|
124
|
+
var onRequest = function onRequest(queryFilter) {
|
|
125
|
+
setLoading(true);
|
|
126
|
+
var filter = convertFilterModel(queryFilter);
|
|
98
127
|
|
|
99
128
|
var params = _objectSpread(_objectSpread({
|
|
100
|
-
filter:
|
|
129
|
+
filter: filter
|
|
101
130
|
}, gridParams), {}, {
|
|
131
|
+
current: pagination.current,
|
|
102
132
|
skipCount: pagination.current == 1 ? 0 : pagination.current * pagination.pageSize,
|
|
103
133
|
maxResultCount: pagination.pageSize,
|
|
104
|
-
sorter:
|
|
134
|
+
sorter: getSort(sortColumn)
|
|
105
135
|
});
|
|
106
136
|
|
|
107
|
-
request && request(params, undefined,
|
|
137
|
+
request && request(params, undefined, queryFilter).then(function (response) {
|
|
108
138
|
var rowData = response.data;
|
|
109
139
|
var rowCount = response.total;
|
|
110
140
|
setRowData(rowData);
|
|
111
141
|
setPagination(_objectSpread(_objectSpread({}, pagination), {}, {
|
|
112
142
|
total: rowCount
|
|
113
143
|
}));
|
|
144
|
+
setLoading(false);
|
|
114
145
|
});
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var actionDom = useMemo(function () {
|
|
149
|
+
return toolBarRender && toolBarRender();
|
|
115
150
|
}, []);
|
|
151
|
+
|
|
152
|
+
var sortChanged = function sortChanged(columnApi) {
|
|
153
|
+
var sortedColumn = columnApi.getColumnState().find(function (col) {
|
|
154
|
+
return Boolean(col.sort);
|
|
155
|
+
});
|
|
156
|
+
setSortColumn(sortedColumn);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var onRest = function onRest() {
|
|
160
|
+
request && onRequest(queryFilter);
|
|
161
|
+
};
|
|
162
|
+
|
|
116
163
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
117
|
-
spinning:
|
|
164
|
+
spinning: loading
|
|
118
165
|
}, search == false ? null : /*#__PURE__*/React.createElement(FormRender, {
|
|
119
166
|
columns: columnDefs,
|
|
120
167
|
gridApi: apiRef.current,
|
|
121
168
|
onQuery: function onQuery(formValues) {
|
|
122
|
-
setQueryFilter(formValues);
|
|
169
|
+
setQueryFilter(_objectSpread({}, formValues));
|
|
170
|
+
onRequest && onRequest(formValues);
|
|
123
171
|
}
|
|
124
|
-
}), /*#__PURE__*/React.createElement(
|
|
172
|
+
}), /*#__PURE__*/React.createElement(Card, {
|
|
173
|
+
bordered: false,
|
|
174
|
+
headStyle: {
|
|
175
|
+
border: 0
|
|
176
|
+
},
|
|
177
|
+
bodyStyle: {
|
|
178
|
+
margin: 0,
|
|
179
|
+
padding: 12,
|
|
180
|
+
paddingTop: 0
|
|
181
|
+
}
|
|
182
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
125
183
|
style: _objectSpread({
|
|
126
184
|
display: "flex",
|
|
127
185
|
flexDirection: "column",
|
|
128
186
|
height: "100%"
|
|
129
187
|
}, style)
|
|
130
|
-
}, /*#__PURE__*/React.createElement(
|
|
188
|
+
}, /*#__PURE__*/React.createElement(ToolBar, {
|
|
189
|
+
title: headerTitle,
|
|
190
|
+
actions: actionDom,
|
|
191
|
+
settings: [/*#__PURE__*/React.createElement(SettingItem, {
|
|
192
|
+
onClick: onRest,
|
|
193
|
+
icon: /*#__PURE__*/React.createElement(RedoOutlined, null)
|
|
194
|
+
}), /*#__PURE__*/React.createElement(SettingItem, {
|
|
195
|
+
onClick: onRest,
|
|
196
|
+
icon: /*#__PURE__*/React.createElement(SettingOutlined, null)
|
|
197
|
+
})]
|
|
198
|
+
}), /*#__PURE__*/React.createElement(AgGridReact, _extends({
|
|
131
199
|
className: "ag-theme-alpine"
|
|
132
200
|
}, rest, {
|
|
133
201
|
//指定客户端模式
|
|
134
202
|
rowModelType: "clientSide",
|
|
135
|
-
rowData: rowData,
|
|
136
|
-
onGridReady: onGridReady
|
|
203
|
+
rowData: props.treeData ? flatten(toTree(rowData)) : rowData,
|
|
204
|
+
onGridReady: onGridReady,
|
|
205
|
+
defaultColDef: defaultColDef,
|
|
206
|
+
onSortChanged: function onSortChanged(event) {
|
|
207
|
+
sortChanged(event.columnApi);
|
|
208
|
+
},
|
|
209
|
+
columnTypes: {
|
|
210
|
+
numberColumn: {
|
|
211
|
+
width: 130,
|
|
212
|
+
filter: 'agNumberColumnFilter'
|
|
213
|
+
},
|
|
214
|
+
dateColumn: {
|
|
215
|
+
filter: 'agDateColumnFilter',
|
|
216
|
+
valueFormatter: dateValueFormatter
|
|
217
|
+
},
|
|
218
|
+
dateTimeColumn: {
|
|
219
|
+
filter: 'agDateColumnFilter',
|
|
220
|
+
valueFormatter: dateTimeValueFormatter
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
animateRows: true //停用默认分页组件
|
|
137
224
|
,
|
|
138
225
|
suppressPaginationPanel: true
|
|
226
|
+
}), props.rowSelection ? /*#__PURE__*/React.createElement(AgGridColumn, {
|
|
227
|
+
field: "",
|
|
228
|
+
width: 30,
|
|
229
|
+
flex: 0,
|
|
230
|
+
headerCheckboxSelection: true,
|
|
231
|
+
checkboxSelection: true,
|
|
232
|
+
showDisabledCheckboxes: true,
|
|
233
|
+
filter: false
|
|
234
|
+
}) : null, React.Children.map(children, function (child, index) {
|
|
235
|
+
return child;
|
|
139
236
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
140
237
|
style: {
|
|
141
|
-
marginTop:
|
|
238
|
+
marginTop: 12,
|
|
239
|
+
display: "flex",
|
|
240
|
+
justifyContent: "flex-end"
|
|
142
241
|
}
|
|
143
242
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
144
243
|
pageSize: pagination.pageSize,
|
|
@@ -156,14 +255,12 @@ function AgGridPlus(props) {
|
|
|
156
255
|
current: current
|
|
157
256
|
}));
|
|
158
257
|
},
|
|
159
|
-
size: "small",
|
|
160
|
-
|
|
161
|
-
return "".concat(range[0], "-").concat(range[1], " of ").concat(total, " items");
|
|
162
|
-
},
|
|
258
|
+
size: "small" // showTotal={(total, range) => `${range[0]}-${range[1]} of ${total} items`}
|
|
259
|
+
,
|
|
163
260
|
pageSizeOptions: [10, 100, 200, 500, 1000],
|
|
164
|
-
hideOnSinglePage:
|
|
165
|
-
showQuickJumper:
|
|
166
|
-
})));
|
|
261
|
+
hideOnSinglePage: false,
|
|
262
|
+
showQuickJumper: false
|
|
263
|
+
}))));
|
|
167
264
|
}
|
|
168
265
|
|
|
169
266
|
export default AgGridPlus;
|
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
// New API
|
|
2
|
+
@use "~ag-grid-community/styles" as ag;
|
|
3
|
+
@include ag.grid-styles(( // theme: alpine,
|
|
4
|
+
// alpine-active-color: red,
|
|
5
|
+
odd-row-background-color:#fafafa,
|
|
6
|
+
secondary-border-color:#f0f0f0,
|
|
7
|
+
border-color:#f0f0f5,
|
|
8
|
+
foreground-color: rgba(0, 0, 0, 0.88),
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
10
|
+
--ag-font-size: 11px,
|
|
11
|
+
--ag-font-family: ('microsoft yahei', 'Helvetica', 'Arial'),
|
|
5
12
|
|
|
13
|
+
--ag-borders: solid 0px,
|
|
14
|
+
--ag-borders-row: dashed 1px,
|
|
15
|
+
--ag-row-border-color: rgb(150, 150, 200),
|
|
16
|
+
--ag-grid-size: 4px,
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Default border for cells. This can be used to specify the border-style and border-color properties e.g. `dashed red` but the border-width is fixed at 1px.
|
|
10
|
-
grid-size: 4px,
|
|
11
|
-
odd-row-background-color:#fff,
|
|
12
|
-
secondary-border-color:#f0f0f0,
|
|
13
|
-
cell-horizontal-padding: ag-derived(grid-size, $times: 2),
|
|
14
|
-
border-color:#f0f0f5,
|
|
15
|
-
cell-horizontal-border: 1px solid ag-derived(secondary-border-color),
|
|
16
|
-
foreground-color: rgba(0, 0, 0, 0.88),
|
|
17
|
-
font-family: ('microsoft yahei', 'Helvetica', 'Arial'),
|
|
18
|
-
font-size: 12px));
|
|
18
|
+
--ag-header-background-color: #fafafa,
|
|
19
|
+
));
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ag-header-cell {
|
|
25
|
-
// or write CSS selectors to make customisations beyond what the parameters support
|
|
26
|
-
border-right: 1px solid ag-param(secondary-border-color);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ag-header-group-cell-with-group {
|
|
30
|
-
// or write CSS selectors to make customisations beyond what the parameters support
|
|
31
|
-
border-right: 1px solid ag-param(secondary-border-color);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.ag-header-center .ag-header-group-cell-label,
|
|
35
|
-
.ag-header-center .ag-header-cell-label {
|
|
36
|
-
text-align: center;
|
|
37
|
-
display: grid;
|
|
38
|
-
}
|
|
21
|
+
.ag-theme-alpine .ag-header-group-cell {
|
|
22
|
+
font-weight: 600;
|
|
39
23
|
}
|
|
@@ -57,9 +57,7 @@ var FormRender = function FormRender(props) {
|
|
|
57
57
|
}, []);
|
|
58
58
|
|
|
59
59
|
var onSubmit = function onSubmit() {
|
|
60
|
-
form.
|
|
61
|
-
onQuery(formValues);
|
|
62
|
-
});
|
|
60
|
+
onQuery && onQuery(form.values);
|
|
63
61
|
};
|
|
64
62
|
|
|
65
63
|
var onReset = /*#__PURE__*/function () {
|
|
@@ -7,7 +7,7 @@ import { observer } from '@formily/react';
|
|
|
7
7
|
var useCollapseGrid = function useCollapseGrid(maxRows) {
|
|
8
8
|
var grid = useMemo(function () {
|
|
9
9
|
return FormGrid.createFormGrid({
|
|
10
|
-
maxColumns:
|
|
10
|
+
maxColumns: 4,
|
|
11
11
|
maxWidth: 240,
|
|
12
12
|
maxRows: maxRows,
|
|
13
13
|
shouldVisible: function shouldVisible(node, grid) {
|
|
@@ -80,7 +80,9 @@ var QueryForm = observer(function (props) {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
return /*#__PURE__*/React.createElement(FormGrid, {
|
|
83
|
-
grid: grid
|
|
83
|
+
grid: grid,
|
|
84
|
+
colWrap: true,
|
|
85
|
+
strictAutoFit: true
|
|
84
86
|
}, props.children, /*#__PURE__*/React.createElement(FormGrid.GridColumn, {
|
|
85
87
|
gridSpan: -1,
|
|
86
88
|
style: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
var SettingItem = function SettingItem(props) {
|
|
4
|
+
var onClick = props.onClick,
|
|
5
|
+
icon = props.icon;
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
style: {
|
|
8
|
+
margin: "0 4px",
|
|
9
|
+
color: "#000",
|
|
10
|
+
fontSize: 16,
|
|
11
|
+
cursor: "pointer"
|
|
12
|
+
},
|
|
13
|
+
onClick: onClick
|
|
14
|
+
}, icon);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default SettingItem;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LabelTooltipType } from 'antd/es/form/FormItemLabel';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type SettingPropType = React.ReactNode;
|
|
4
|
+
export declare type ListToolBarProps = {
|
|
5
|
+
prefixCls?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
/** 副标题 */
|
|
11
|
+
subTitle?: React.ReactNode;
|
|
12
|
+
/** 标题提示 */
|
|
13
|
+
tooltip?: string | LabelTooltipType;
|
|
14
|
+
/** 工具栏右侧操作区 */
|
|
15
|
+
actions?: React.ReactNode[];
|
|
16
|
+
/** 工作栏右侧设置区 */
|
|
17
|
+
settings?: SettingPropType[];
|
|
18
|
+
};
|
|
19
|
+
declare const ListToolBar: React.FC<ListToolBarProps>;
|
|
20
|
+
export default ListToolBar;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import { LabelIconTip } from '@ant-design/pro-utils';
|
|
8
|
+
import { ConfigProvider, Tooltip } from 'antd';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import React, { useContext, useMemo } from 'react';
|
|
11
|
+
import { useStyle } from "./style";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 获取配置区域 DOM Item
|
|
15
|
+
*
|
|
16
|
+
* @param setting 配置项
|
|
17
|
+
*/
|
|
18
|
+
function getSettingItem(setting) {
|
|
19
|
+
if ( /*#__PURE__*/React.isValidElement(setting)) {
|
|
20
|
+
return setting;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (setting) {
|
|
24
|
+
var settingConfig = setting;
|
|
25
|
+
var icon = settingConfig.icon,
|
|
26
|
+
tooltip = settingConfig.tooltip,
|
|
27
|
+
_onClick = settingConfig.onClick,
|
|
28
|
+
key = settingConfig.key;
|
|
29
|
+
|
|
30
|
+
if (icon && tooltip) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
32
|
+
title: tooltip
|
|
33
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
key: key,
|
|
35
|
+
onClick: function onClick() {
|
|
36
|
+
if (_onClick) {
|
|
37
|
+
_onClick(key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, icon));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return icon;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var ListToolBar = function ListToolBar(_ref) {
|
|
50
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
51
|
+
title = _ref.title,
|
|
52
|
+
subTitle = _ref.subTitle,
|
|
53
|
+
tooltip = _ref.tooltip,
|
|
54
|
+
className = _ref.className,
|
|
55
|
+
style = _ref.style,
|
|
56
|
+
_ref$actions = _ref.actions,
|
|
57
|
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
58
|
+
_ref$settings = _ref.settings,
|
|
59
|
+
settings = _ref$settings === void 0 ? [] : _ref$settings;
|
|
60
|
+
|
|
61
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
62
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
63
|
+
|
|
64
|
+
var prefixCls = getPrefixCls('pro-table-list-toolbar', customizePrefixCls);
|
|
65
|
+
|
|
66
|
+
var _useStyle = useStyle(prefixCls),
|
|
67
|
+
hashId = _useStyle.hashId;
|
|
68
|
+
/** 有没有 title,需要结合多个场景判断 */
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
var hasTitle = useMemo(function () {
|
|
72
|
+
return title || subTitle || tooltip;
|
|
73
|
+
}, [subTitle, title, tooltip]);
|
|
74
|
+
/** 没有 key 的时候帮忙加一下 key 不加的话很烦人 */
|
|
75
|
+
|
|
76
|
+
var actionDom = useMemo(function () {
|
|
77
|
+
if (!Array.isArray(actions)) {
|
|
78
|
+
return actions;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (actions.length < 1) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
style: {
|
|
87
|
+
display: 'flex',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
gap: 8
|
|
90
|
+
}
|
|
91
|
+
}, actions.map(function (action, index) {
|
|
92
|
+
if (! /*#__PURE__*/React.isValidElement(action)) {
|
|
93
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
94
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
95
|
+
key: index
|
|
96
|
+
}, action);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return /*#__PURE__*/React.cloneElement(action, _objectSpread({
|
|
100
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
101
|
+
key: index
|
|
102
|
+
}, action === null || action === void 0 ? void 0 : action.props));
|
|
103
|
+
}));
|
|
104
|
+
}, [actions]);
|
|
105
|
+
var hasRight = useMemo(function () {
|
|
106
|
+
return hasTitle || actionDom || (settings === null || settings === void 0 ? void 0 : settings.length);
|
|
107
|
+
}, [actionDom, hasTitle, settings === null || settings === void 0 ? void 0 : settings.length]);
|
|
108
|
+
var hasLeft = useMemo(function () {
|
|
109
|
+
return tooltip || title || subTitle;
|
|
110
|
+
}, [hasTitle, subTitle, title, tooltip]);
|
|
111
|
+
var leftTitleDom = useMemo(function () {
|
|
112
|
+
// 保留dom是为了占位,不然 right 就变到左边了
|
|
113
|
+
if (!hasLeft && hasRight) {
|
|
114
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "".concat(prefixCls, "-left ").concat(hashId)
|
|
116
|
+
});
|
|
117
|
+
} // 减少 space 的dom,渲染的时候能节省点性能
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
if (hasTitle) {
|
|
121
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: "".concat(prefixCls, "-left ").concat(hashId)
|
|
123
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: "".concat(prefixCls, "-title ").concat(hashId)
|
|
125
|
+
}, /*#__PURE__*/React.createElement(LabelIconTip, {
|
|
126
|
+
tooltip: tooltip,
|
|
127
|
+
label: title,
|
|
128
|
+
subTitle: subTitle
|
|
129
|
+
})));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: "".concat(prefixCls, "-left ").concat(hashId)
|
|
134
|
+
}, hasTitle && /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: "".concat(prefixCls, "-title ").concat(hashId)
|
|
136
|
+
}, /*#__PURE__*/React.createElement(LabelIconTip, {
|
|
137
|
+
tooltip: tooltip,
|
|
138
|
+
label: title,
|
|
139
|
+
subTitle: subTitle
|
|
140
|
+
})));
|
|
141
|
+
}, [hasLeft, hasRight, hasTitle, hashId, prefixCls, subTitle, title, tooltip]);
|
|
142
|
+
var rightTitleDom = useMemo(function () {
|
|
143
|
+
if (!hasRight) return null;
|
|
144
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
className: "".concat(prefixCls, "-right ").concat(hashId),
|
|
146
|
+
style: {
|
|
147
|
+
alignItems: 'center'
|
|
148
|
+
}
|
|
149
|
+
}, actionDom, settings !== null && settings !== void 0 && settings.length ? /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: "".concat(prefixCls, "-setting-items ").concat(hashId)
|
|
151
|
+
}, settings.map(function (setting, index) {
|
|
152
|
+
var settingItem = getSettingItem(setting);
|
|
153
|
+
return (
|
|
154
|
+
/*#__PURE__*/
|
|
155
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
156
|
+
React.createElement("div", {
|
|
157
|
+
key: index,
|
|
158
|
+
className: "".concat(prefixCls, "-setting-item ").concat(hashId)
|
|
159
|
+
}, settingItem)
|
|
160
|
+
);
|
|
161
|
+
})) : null);
|
|
162
|
+
}, [hasRight, prefixCls, hashId, hasTitle, actionDom, settings]);
|
|
163
|
+
var titleNode = useMemo(function () {
|
|
164
|
+
if (!hasRight && !hasLeft) return null;
|
|
165
|
+
var containerClassName = classNames("".concat(prefixCls, "-container"), hashId, {});
|
|
166
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: containerClassName
|
|
168
|
+
}, leftTitleDom, rightTitleDom);
|
|
169
|
+
}, [hasLeft, hasRight, hashId, leftTitleDom, prefixCls, rightTitleDom]);
|
|
170
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
171
|
+
style: style,
|
|
172
|
+
className: classNames(prefixCls, hashId, className)
|
|
173
|
+
}, titleNode);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export default ListToolBar;
|