@nokecy/qc-ui 0.0.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.
- package/README.md +23 -0
- package/dist/cjs/ag-grid-plus/ag-gridPlus.d.ts +5 -0
- package/dist/cjs/ag-grid-plus/ag-gridPlus.js +191 -0
- package/dist/cjs/ag-grid-plus/global.scss +65 -0
- package/dist/cjs/ag-grid-plus/gridManager/index.d.ts +8 -0
- package/dist/cjs/ag-grid-plus/gridManager/index.js +51 -0
- package/dist/cjs/ag-grid-plus/index.d.ts +3 -0
- package/dist/cjs/ag-grid-plus/index.js +23 -0
- package/dist/cjs/ag-grid-plus/interface.d.ts +25 -0
- package/dist/cjs/ag-grid-plus/interface.js +17 -0
- package/dist/cjs/ag-grid-plus/queryForm/index.d.ts +10 -0
- package/dist/cjs/ag-grid-plus/queryForm/index.js +210 -0
- package/dist/cjs/ag-grid-plus/queryForm/index.less +48 -0
- package/dist/cjs/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
- package/dist/cjs/ag-grid-plus/queryForm/queryForm.js +110 -0
- package/dist/cjs/array-table/index.d.ts +10 -0
- package/dist/cjs/array-table/index.js +205 -0
- package/dist/cjs/dashboard/dashboard/components/index.d.ts +2 -0
- package/dist/cjs/dashboard/dashboard/components/index.js +15 -0
- package/dist/cjs/dashboard/dashboard/components/modal/index.d.ts +3 -0
- package/dist/cjs/dashboard/dashboard/components/modal/index.js +26 -0
- package/dist/cjs/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
- package/dist/cjs/dashboard/dashboard/components/toolbar/index.js +37 -0
- package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
- package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.js +3 -0
- package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.less +49 -0
- package/dist/cjs/dashboard/dashboard/index.d.ts +62 -0
- package/dist/cjs/dashboard/dashboard/index.js +603 -0
- package/dist/cjs/dashboard/dashboard/index.less +173 -0
- package/dist/cjs/dashboard/dashboard/service.d.ts +8 -0
- package/dist/cjs/dashboard/dashboard/service.js +114 -0
- package/dist/cjs/dashboard/dashboard/utils.d.ts +9 -0
- package/dist/cjs/dashboard/dashboard/utils.js +126 -0
- package/dist/cjs/dashboard/index.d.ts +3 -0
- package/dist/cjs/dashboard/index.js +30 -0
- package/dist/cjs/dashboard/utils.d.ts +24 -0
- package/dist/cjs/dashboard/utils.js +162 -0
- package/dist/cjs/dashboard/widget/index.d.ts +13 -0
- package/dist/cjs/dashboard/widget/index.js +79 -0
- package/dist/cjs/dashboard/widget/index.less +7 -0
- package/dist/cjs/dashboard/widget/selector/index.d.ts +4 -0
- package/dist/cjs/dashboard/widget/selector/index.js +271 -0
- package/dist/cjs/dashboard/widget/selector/index.less +434 -0
- package/dist/cjs/dashboard/widget/utils.d.ts +4 -0
- package/dist/cjs/dashboard/widget/utils.js +116 -0
- package/dist/cjs/elsaFlow/config-graph.d.ts +1 -0
- package/dist/cjs/elsaFlow/config-graph.js +57 -0
- package/dist/cjs/elsaFlow/index.d.ts +6 -0
- package/dist/cjs/elsaFlow/index.js +199 -0
- package/dist/cjs/elsaFlow/react-edge/edge1.d.ts +4 -0
- package/dist/cjs/elsaFlow/react-edge/edge1.js +31 -0
- package/dist/cjs/elsaFlow/react-edge/edge1.less +0 -0
- package/dist/cjs/elsaFlow/react-edge/edge2.d.ts +4 -0
- package/dist/cjs/elsaFlow/react-edge/edge2.js +31 -0
- package/dist/cjs/elsaFlow/react-edge/edge2.less +0 -0
- package/dist/cjs/elsaFlow/react-node/node1.d.ts +4 -0
- package/dist/cjs/elsaFlow/react-node/node1.js +28 -0
- package/dist/cjs/elsaFlow/react-node/node1.less +11 -0
- package/dist/cjs/elsaFlow/react-node/node2.d.ts +4 -0
- package/dist/cjs/elsaFlow/react-node/node2.js +28 -0
- package/dist/cjs/elsaFlow/react-node/node2.less +11 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +37 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.d.ts +5 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +169 -0
- package/dist/esm/ag-grid-plus/global.scss +65 -0
- package/dist/esm/ag-grid-plus/gridManager/index.d.ts +8 -0
- package/dist/esm/ag-grid-plus/gridManager/index.js +44 -0
- package/dist/esm/ag-grid-plus/index.d.ts +3 -0
- package/dist/esm/ag-grid-plus/index.js +3 -0
- package/dist/esm/ag-grid-plus/interface.d.ts +25 -0
- package/dist/esm/ag-grid-plus/interface.js +9 -0
- package/dist/esm/ag-grid-plus/queryForm/index.d.ts +10 -0
- package/dist/esm/ag-grid-plus/queryForm/index.js +189 -0
- package/dist/esm/ag-grid-plus/queryForm/index.less +48 -0
- package/dist/esm/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
- package/dist/esm/ag-grid-plus/queryForm/queryForm.js +92 -0
- package/dist/esm/array-table/index.d.ts +10 -0
- package/dist/esm/array-table/index.js +179 -0
- package/dist/esm/dashboard/dashboard/components/index.d.ts +2 -0
- package/dist/esm/dashboard/dashboard/components/index.js +2 -0
- package/dist/esm/dashboard/dashboard/components/modal/index.d.ts +3 -0
- package/dist/esm/dashboard/dashboard/components/modal/index.js +17 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/index.js +24 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/style/index.js +1 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/style/index.less +49 -0
- package/dist/esm/dashboard/dashboard/index.d.ts +62 -0
- package/dist/esm/dashboard/dashboard/index.js +571 -0
- package/dist/esm/dashboard/dashboard/index.less +173 -0
- package/dist/esm/dashboard/dashboard/service.d.ts +8 -0
- package/dist/esm/dashboard/dashboard/service.js +102 -0
- package/dist/esm/dashboard/dashboard/utils.d.ts +9 -0
- package/dist/esm/dashboard/dashboard/utils.js +106 -0
- package/dist/esm/dashboard/index.d.ts +3 -0
- package/dist/esm/dashboard/index.js +3 -0
- package/dist/esm/dashboard/utils.d.ts +24 -0
- package/dist/esm/dashboard/utils.js +142 -0
- package/dist/esm/dashboard/widget/index.d.ts +13 -0
- package/dist/esm/dashboard/widget/index.js +59 -0
- package/dist/esm/dashboard/widget/index.less +7 -0
- package/dist/esm/dashboard/widget/selector/index.d.ts +4 -0
- package/dist/esm/dashboard/widget/selector/index.js +249 -0
- package/dist/esm/dashboard/widget/selector/index.less +434 -0
- package/dist/esm/dashboard/widget/utils.d.ts +4 -0
- package/dist/esm/dashboard/widget/utils.js +88 -0
- package/dist/esm/elsaFlow/config-graph.d.ts +1 -0
- package/dist/esm/elsaFlow/config-graph.js +42 -0
- package/dist/esm/elsaFlow/index.d.ts +6 -0
- package/dist/esm/elsaFlow/index.js +189 -0
- package/dist/esm/elsaFlow/react-edge/edge1.d.ts +4 -0
- package/dist/esm/elsaFlow/react-edge/edge1.js +18 -0
- package/dist/esm/elsaFlow/react-edge/edge1.less +0 -0
- package/dist/esm/elsaFlow/react-edge/edge2.d.ts +4 -0
- package/dist/esm/elsaFlow/react-edge/edge2.js +18 -0
- package/dist/esm/elsaFlow/react-edge/edge2.less +0 -0
- package/dist/esm/elsaFlow/react-node/node1.d.ts +4 -0
- package/dist/esm/elsaFlow/react-node/node1.js +16 -0
- package/dist/esm/elsaFlow/react-node/node1.less +11 -0
- package/dist/esm/elsaFlow/react-node/node2.d.ts +4 -0
- package/dist/esm/elsaFlow/react-node/node2.js +16 -0
- package/dist/esm/elsaFlow/react-node/node2.less +11 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +5 -0
- package/dist/umd/qc-ui.min.css +1 -0
- package/dist/umd/qc-ui.min.js +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
import React, { Fragment, useRef } from 'react';
|
|
10
|
+
import { AgGridReact } from 'ag-grid-react';
|
|
11
|
+
import { useField, observer, useFieldSchema, RecursionField } from '@formily/react';
|
|
12
|
+
import { isArr } from '@formily/shared';
|
|
13
|
+
import { ArrayBase } from '@formily/antd';
|
|
14
|
+
import uniqueId from 'lodash/uniqueId';
|
|
15
|
+
import '@ag-grid-community/core/dist/styles/ag-grid.css';
|
|
16
|
+
import '@ag-grid-community/core/dist/styles/ag-theme-alpine.css';
|
|
17
|
+
|
|
18
|
+
var isColumnComponent = function isColumnComponent(schema) {
|
|
19
|
+
var _schema$xComponent;
|
|
20
|
+
|
|
21
|
+
return ((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.indexOf('Column')) > -1;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var isOperationsComponent = function isOperationsComponent(schema) {
|
|
25
|
+
var _schema$xComponent2;
|
|
26
|
+
|
|
27
|
+
return ((_schema$xComponent2 = schema['x-component']) === null || _schema$xComponent2 === void 0 ? void 0 : _schema$xComponent2.indexOf('Operations')) > -1;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var isAdditionComponent = function isAdditionComponent(schema) {
|
|
31
|
+
var _schema$xComponent3;
|
|
32
|
+
|
|
33
|
+
return ((_schema$xComponent3 = schema['x-component']) === null || _schema$xComponent3 === void 0 ? void 0 : _schema$xComponent3.indexOf('Addition')) > -1;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var useArrayTableSources = function useArrayTableSources() {
|
|
37
|
+
var arrayField = useField();
|
|
38
|
+
var schema = useFieldSchema();
|
|
39
|
+
|
|
40
|
+
var parseSources = function parseSources(schema) {
|
|
41
|
+
if (isColumnComponent(schema) || isOperationsComponent(schema) || isAdditionComponent(schema)) {
|
|
42
|
+
var _schema$xComponentP, _schema$xComponentP2, _field$component;
|
|
43
|
+
|
|
44
|
+
if (!((_schema$xComponentP = schema['x-component-props']) !== null && _schema$xComponentP !== void 0 && _schema$xComponentP['dataIndex']) && !schema['name']) return [];
|
|
45
|
+
var name = ((_schema$xComponentP2 = schema['x-component-props']) === null || _schema$xComponentP2 === void 0 ? void 0 : _schema$xComponentP2['dataIndex']) || schema['name'];
|
|
46
|
+
var field = arrayField.query(arrayField.address.concat(name)).take();
|
|
47
|
+
var columnProps = (field === null || field === void 0 ? void 0 : (_field$component = field.component) === null || _field$component === void 0 ? void 0 : _field$component[1]) || schema['x-component-props'] || {};
|
|
48
|
+
var display = (field === null || field === void 0 ? void 0 : field.display) || schema['x-display'];
|
|
49
|
+
return [{
|
|
50
|
+
name: name,
|
|
51
|
+
display: display,
|
|
52
|
+
field: field,
|
|
53
|
+
schema: schema,
|
|
54
|
+
columnProps: columnProps
|
|
55
|
+
}];
|
|
56
|
+
} else if (schema.properties) {
|
|
57
|
+
return schema.reduceProperties(function (buf, schema) {
|
|
58
|
+
return buf.concat(parseSources(schema));
|
|
59
|
+
}, []);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var parseArrayItems = function parseArrayItems(schema) {
|
|
64
|
+
if (!schema) return [];
|
|
65
|
+
var sources = [];
|
|
66
|
+
var items = isArr(schema) ? schema : [schema];
|
|
67
|
+
return items.reduce(function (columns, schema) {
|
|
68
|
+
var item = parseSources(schema);
|
|
69
|
+
|
|
70
|
+
if (item) {
|
|
71
|
+
return columns.concat(item);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return columns;
|
|
75
|
+
}, sources);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
if (!schema) throw new Error('can not found schema object');
|
|
79
|
+
return parseArrayItems(schema.items);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var useArrayTableColumns = function useArrayTableColumns(field, sources) {
|
|
83
|
+
return sources.reduce(function (buf, _ref, key) {
|
|
84
|
+
var name = _ref.name,
|
|
85
|
+
columnProps = _ref.columnProps,
|
|
86
|
+
schema = _ref.schema,
|
|
87
|
+
display = _ref.display;
|
|
88
|
+
if (display !== 'visible') return buf;
|
|
89
|
+
if (!isColumnComponent(schema)) return buf;
|
|
90
|
+
return buf.concat(_objectSpread(_objectSpread({}, columnProps), {}, {
|
|
91
|
+
field: name,
|
|
92
|
+
cellRenderer: function cellRenderer(_ref2) {
|
|
93
|
+
var _field$value;
|
|
94
|
+
|
|
95
|
+
var value = _ref2.value,
|
|
96
|
+
record = _ref2.data;
|
|
97
|
+
var index = field === null || field === void 0 ? void 0 : (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.indexOf(record);
|
|
98
|
+
var children = /*#__PURE__*/React.createElement(ArrayBase.Item, {
|
|
99
|
+
index: index,
|
|
100
|
+
record: function record() {
|
|
101
|
+
var _field$value2;
|
|
102
|
+
|
|
103
|
+
return field === null || field === void 0 ? void 0 : (_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2[index];
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/React.createElement(RecursionField, {
|
|
106
|
+
schema: schema,
|
|
107
|
+
name: index,
|
|
108
|
+
onlyRenderProperties: true
|
|
109
|
+
}));
|
|
110
|
+
return children;
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
}, []);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var useAddition = function useAddition() {
|
|
117
|
+
var schema = useFieldSchema();
|
|
118
|
+
return schema.reduceProperties(function (addition, schema, key) {
|
|
119
|
+
if (isAdditionComponent(schema)) {
|
|
120
|
+
return /*#__PURE__*/React.createElement(RecursionField, {
|
|
121
|
+
schema: schema,
|
|
122
|
+
name: key
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return addition;
|
|
127
|
+
}, null);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export var ArrayTable = observer(function (props) {
|
|
131
|
+
var ref = useRef();
|
|
132
|
+
var field = useField();
|
|
133
|
+
var dataSource = Array.isArray(field.value) ? field.value.slice() : [];
|
|
134
|
+
var sources = useArrayTableSources();
|
|
135
|
+
var columns = useArrayTableColumns(field, sources);
|
|
136
|
+
var addition = useAddition();
|
|
137
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
ref: ref,
|
|
139
|
+
style: {
|
|
140
|
+
height: 600
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/React.createElement(ArrayBase, null, /*#__PURE__*/React.createElement(AgGridReact, {
|
|
143
|
+
className: "ag-theme-alpine",
|
|
144
|
+
getRowId: function getRowId(_ref3) {
|
|
145
|
+
var data = _ref3.data;
|
|
146
|
+
return data._id;
|
|
147
|
+
},
|
|
148
|
+
pagination: false,
|
|
149
|
+
columnDefs: columns,
|
|
150
|
+
rowData: dataSource
|
|
151
|
+
}), sources.map(function (column, key) {
|
|
152
|
+
//专门用来承接对Column的状态管理
|
|
153
|
+
if (!isColumnComponent(column.schema)) return;
|
|
154
|
+
return /*#__PURE__*/React.createElement(RecursionField, {
|
|
155
|
+
name: column.name,
|
|
156
|
+
schema: column.schema,
|
|
157
|
+
onlyRenderSelf: true,
|
|
158
|
+
key: key
|
|
159
|
+
});
|
|
160
|
+
}), addition));
|
|
161
|
+
});
|
|
162
|
+
ArrayTable.displayName = 'ArrayTable';
|
|
163
|
+
|
|
164
|
+
ArrayTable.Column = function () {
|
|
165
|
+
return /*#__PURE__*/React.createElement(Fragment, null);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
ArrayBase.mixin(ArrayTable);
|
|
169
|
+
|
|
170
|
+
var Addition = function Addition(props) {
|
|
171
|
+
return /*#__PURE__*/React.createElement(ArrayBase.Addition, _extends({}, props, {
|
|
172
|
+
defaultValue: _objectSpread(_objectSpread({}, props.defaultValue), {}, {
|
|
173
|
+
_id: uniqueId()
|
|
174
|
+
})
|
|
175
|
+
}));
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
ArrayTable.Addition = Addition;
|
|
179
|
+
export default ArrayTable;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default (function () {
|
|
2
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
3
|
+
className: "modal-state",
|
|
4
|
+
id: "modal-2",
|
|
5
|
+
type: "checkbox"
|
|
6
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "modal"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
9
|
+
className: "modal__bg",
|
|
10
|
+
for: "modal-2"
|
|
11
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "modal__inner"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
14
|
+
className: "modal__close",
|
|
15
|
+
for: "modal-2"
|
|
16
|
+
}))));
|
|
17
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export interface ToolBarPropsIF {
|
|
4
|
+
extraLeft?: React.ReactNode;
|
|
5
|
+
extraRight?: React.ReactNode;
|
|
6
|
+
style?: React.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
className?: string;
|
|
8
|
+
fixed?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Toolbar: (props: ToolBarPropsIF) => JSX.Element;
|
|
11
|
+
export default Toolbar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import "./style";
|
|
4
|
+
var prefixCls = 'react-dashboard-toolbar';
|
|
5
|
+
|
|
6
|
+
var Toolbar = function Toolbar(props) {
|
|
7
|
+
var extraLeft = props.extraLeft,
|
|
8
|
+
extraRight = props.extraRight,
|
|
9
|
+
fixed = props.fixed,
|
|
10
|
+
className = props.className,
|
|
11
|
+
style = props.style;
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: classNames(prefixCls, fixed ? "".concat(prefixCls, "-fixed") : '', className),
|
|
14
|
+
style: style
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "".concat(prefixCls, "-left")
|
|
17
|
+
}, extraLeft), /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "".concat(prefixCls, "-space")
|
|
19
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "".concat(prefixCls, "-right")
|
|
21
|
+
}, extraRight));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Toolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.less";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.react-dashboard-toolbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
// width: 100%;
|
|
6
|
+
padding: 0 10px;
|
|
7
|
+
padding-bottom: 10px;
|
|
8
|
+
// background: var(--component-background);
|
|
9
|
+
|
|
10
|
+
&:after {
|
|
11
|
+
display: block;
|
|
12
|
+
clear: both;
|
|
13
|
+
content: '';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-left {
|
|
17
|
+
float: left;
|
|
18
|
+
|
|
19
|
+
button {
|
|
20
|
+
margin-right: 10px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&-right {
|
|
25
|
+
float: right;
|
|
26
|
+
|
|
27
|
+
button {
|
|
28
|
+
margin-left: 10px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-space {
|
|
33
|
+
flex: auto;
|
|
34
|
+
height: 1px;
|
|
35
|
+
margin: 0 !important;
|
|
36
|
+
padding: 0 !important;
|
|
37
|
+
border: 0 !important;
|
|
38
|
+
-webkit-box-flex: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-fixed {
|
|
42
|
+
position: fixed;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
z-index: 9;
|
|
46
|
+
border-top: 1px solid rgba(128, 128, 128, 0.1);
|
|
47
|
+
box-shadow: 0 -1px 2px rgba(128, 128, 128, 0.03);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Component, FunctionComponent, ReactElement } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export declare type LayoutItem = {
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
i: string;
|
|
10
|
+
minW: number;
|
|
11
|
+
maxW: number;
|
|
12
|
+
minH: number;
|
|
13
|
+
maxH: number;
|
|
14
|
+
};
|
|
15
|
+
export declare type LayoutsIF = LayoutItem[];
|
|
16
|
+
export interface WidgetIF {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
tags: string[];
|
|
20
|
+
component: Component | FunctionComponent;
|
|
21
|
+
configComponent: Component | FunctionComponent | null;
|
|
22
|
+
maxLength: number;
|
|
23
|
+
snapShot: ImageBitmapSource;
|
|
24
|
+
icon: ReactElement;
|
|
25
|
+
iconBackground: string;
|
|
26
|
+
size: {
|
|
27
|
+
defaultWidth: number;
|
|
28
|
+
defaultHeight: number;
|
|
29
|
+
maxWidth: number;
|
|
30
|
+
maxHeight: number;
|
|
31
|
+
minWidth: number;
|
|
32
|
+
minHeight: number;
|
|
33
|
+
};
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
export interface WidgetsIF {
|
|
37
|
+
[key: string]: WidgetIF;
|
|
38
|
+
}
|
|
39
|
+
export interface Dashboard {
|
|
40
|
+
widgets: WidgetsIF;
|
|
41
|
+
editMode?: boolean;
|
|
42
|
+
defaultLayout?: LayoutsIF;
|
|
43
|
+
widgetWrapClassName?: string;
|
|
44
|
+
widgetWrapStyle?: React.CSSProperties;
|
|
45
|
+
layout?: LayoutsIF;
|
|
46
|
+
minHeight?: number;
|
|
47
|
+
maxWidgetLength?: number;
|
|
48
|
+
toolbar?: boolean;
|
|
49
|
+
storageKey?: string;
|
|
50
|
+
onLayoutChange?: (layout: LayoutsIF) => void;
|
|
51
|
+
onReset?: (dirtyCurrentLayout: LayoutsIF, currentLayout: LayoutItem) => void;
|
|
52
|
+
onRemoveWidget?: (widget: WidgetIF, dirtyCurrentLayout: LayoutsIF, currentLayout: LayoutsIF) => void;
|
|
53
|
+
onAddWidget?: (widget: WidgetIF, dirtyCurrentLayout: LayoutsIF, currentLayout: LayoutsIF) => void;
|
|
54
|
+
onReload?: (currentLayout: LayoutsIF) => void;
|
|
55
|
+
onCancelEdit?: (dirtyCurrentLayout: LayoutsIF, currentLayout: LayoutItem) => void;
|
|
56
|
+
onEdit?: (currentLayout: LayoutsIF) => void;
|
|
57
|
+
onSave?: (currentLayout: LayoutsIF) => void;
|
|
58
|
+
onRevert?: (dirtyCurrentLayout: LayoutsIF, currentLayout: LayoutItem) => void;
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}
|
|
61
|
+
declare const Dashboard: React.ForwardRefExoticComponent<Pick<Dashboard, keyof Dashboard> & React.RefAttributes<unknown>>;
|
|
62
|
+
export default Dashboard;
|