szld-libs 0.0.15 → 0.0.17
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/style.css +1 -1
- package/dist/{index.js → szld-components.es.js} +1860 -1856
- package/dist/{index.umd.cjs → szld-components.umd.js} +27 -27
- package/es/components/AuthButton/index.d.ts +7 -0
- package/es/components/AuthButton/index.js +12 -0
- package/es/components/AuthButton/vite.svg +1 -0
- package/es/components/BackHeader/index.css +14 -0
- package/{@types → es}/components/BackHeader/index.d.ts +0 -0
- package/es/components/BackHeader/index.js +55 -0
- package/es/components/BackHeader/vite.svg +1 -0
- package/es/components/CreateForm/index.css +39 -0
- package/{@types → es}/components/CreateForm/index.d.ts +0 -0
- package/es/components/CreateForm/index.js +227 -0
- package/es/components/CreateForm/vite.svg +1 -0
- package/es/components/Echarts/index.css +5 -0
- package/{@types → es}/components/Echarts/index.d.ts +0 -0
- package/es/components/Echarts/index.js +65 -0
- package/es/components/Echarts/vite.svg +1 -0
- package/es/components/EditTable/index.css +9 -0
- package/{@types → es}/components/EditTable/index.d.ts +0 -0
- package/es/components/EditTable/index.js +99 -0
- package/es/components/EditTable/vite.svg +1 -0
- package/es/components/Loading/index.css +22 -0
- package/{@types → es}/components/Loading/index.d.ts +0 -0
- package/es/components/Loading/index.js +44 -0
- package/es/components/Loading/vite.svg +1 -0
- package/es/components/SearchTable/index.css +3 -0
- package/{@types → es}/components/SearchTable/index.d.ts +0 -0
- package/es/components/SearchTable/index.js +34 -0
- package/es/components/SearchTable/vite.svg +1 -0
- package/{@types → es}/components/Upload/index.d.ts +0 -0
- package/es/components/Upload/index.js +125 -0
- package/es/components/Upload/vite.svg +1 -0
- package/es/components/VirtualTable/index.css +18 -0
- package/{@types → es}/components/VirtualTable/index.d.ts +0 -0
- package/es/components/VirtualTable/index.js +172 -0
- package/es/components/VirtualTable/vite.svg +1 -0
- package/es/components/WorkFlowNode/index.css +110 -0
- package/{@types → es}/components/WorkFlowNode/index.d.ts +0 -0
- package/es/components/WorkFlowNode/index.js +125 -0
- package/es/components/WorkFlowNode/vite.svg +1 -0
- package/{@types → es}/components/common/403.d.ts +0 -0
- package/es/components/common/403.js +18 -0
- package/{@types → es}/components/common/404.d.ts +0 -0
- package/es/components/common/404.js +18 -0
- package/es/components/common/vite.svg +1 -0
- package/{@types → es}/index.d.ts +0 -0
- package/es/index.js +144 -0
- package/{@types → es}/main.d.ts +2 -1
- package/es/main.js +28 -0
- package/{@types → es}/utils/download.d.ts +0 -0
- package/es/utils/download.js +59 -0
- package/{@types → es}/utils/filetype.d.ts +0 -0
- package/es/utils/filetype.js +41 -0
- package/{@types → es}/utils/index.d.ts +0 -0
- package/es/utils/index.js +114 -0
- package/{@types → es}/utils/verify-code.d.ts +0 -0
- package/es/utils/verify-code.js +115 -0
- package/es/utils/vite.svg +1 -0
- package/es/vite.svg +1 -0
- package/lib/components/AuthButton/index.d.ts +7 -0
- package/lib/components/AuthButton/index.js +11 -0
- package/lib/components/AuthButton/vite.svg +1 -0
- package/lib/components/BackHeader/index.css +14 -0
- package/lib/components/BackHeader/index.d.ts +11 -0
- package/lib/components/BackHeader/index.js +54 -0
- package/lib/components/BackHeader/vite.svg +1 -0
- package/lib/components/CreateForm/index.css +39 -0
- package/lib/components/CreateForm/index.d.ts +48 -0
- package/lib/components/CreateForm/index.js +227 -0
- package/lib/components/CreateForm/vite.svg +1 -0
- package/lib/components/Echarts/index.css +5 -0
- package/lib/components/Echarts/index.d.ts +14 -0
- package/lib/components/Echarts/index.js +81 -0
- package/lib/components/Echarts/vite.svg +1 -0
- package/lib/components/EditTable/index.css +9 -0
- package/lib/components/EditTable/index.d.ts +17 -0
- package/lib/components/EditTable/index.js +98 -0
- package/lib/components/EditTable/vite.svg +1 -0
- package/lib/components/Loading/index.css +22 -0
- package/lib/components/Loading/index.d.ts +4 -0
- package/lib/components/Loading/index.js +43 -0
- package/lib/components/Loading/vite.svg +1 -0
- package/lib/components/SearchTable/index.css +3 -0
- package/lib/components/SearchTable/index.d.ts +16 -0
- package/lib/components/SearchTable/index.js +33 -0
- package/lib/components/SearchTable/vite.svg +1 -0
- package/lib/components/Upload/index.d.ts +9 -0
- package/lib/components/Upload/index.js +124 -0
- package/lib/components/Upload/vite.svg +1 -0
- package/lib/components/VirtualTable/index.css +18 -0
- package/lib/components/VirtualTable/index.d.ts +4 -0
- package/lib/components/VirtualTable/index.js +171 -0
- package/lib/components/VirtualTable/vite.svg +1 -0
- package/lib/components/WorkFlowNode/index.css +110 -0
- package/lib/components/WorkFlowNode/index.d.ts +9 -0
- package/lib/components/WorkFlowNode/index.js +124 -0
- package/lib/components/WorkFlowNode/vite.svg +1 -0
- package/lib/components/common/403.d.ts +3 -0
- package/lib/components/common/403.js +17 -0
- package/lib/components/common/404.d.ts +3 -0
- package/lib/components/common/404.js +17 -0
- package/lib/components/common/vite.svg +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +145 -0
- package/lib/main.d.ts +14 -0
- package/lib/main.js +48 -0
- package/lib/utils/download.d.ts +3 -0
- package/lib/utils/download.js +59 -0
- package/lib/utils/filetype.d.ts +35 -0
- package/lib/utils/filetype.js +41 -0
- package/lib/utils/index.d.ts +12 -0
- package/lib/utils/index.js +114 -0
- package/lib/utils/verify-code.d.ts +27 -0
- package/lib/utils/verify-code.js +115 -0
- package/lib/utils/vite.svg +1 -0
- package/lib/vite.svg +1 -0
- package/package.json +10 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
const AuthButton = (props) => {
|
|
4
|
+
const { auth = true, ...rest } = props;
|
|
5
|
+
if (!auth) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return /* @__PURE__ */ jsx(Button, { ...rest });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
AuthButton as default
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Space, Typography } from "antd";
|
|
3
|
+
import { ArrowLeftOutlined } from "@ant-design/icons";
|
|
4
|
+
import { useNavigate } from "react-router-dom";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
const main = "szld-main";
|
|
7
|
+
const title = "szld-title";
|
|
8
|
+
const sub = "szld-sub";
|
|
9
|
+
const styles = {
|
|
10
|
+
main,
|
|
11
|
+
title,
|
|
12
|
+
sub
|
|
13
|
+
};
|
|
14
|
+
const { Title, Text } = Typography;
|
|
15
|
+
const BackHeader = (props) => {
|
|
16
|
+
const {
|
|
17
|
+
isBack = true,
|
|
18
|
+
title: title2,
|
|
19
|
+
extra,
|
|
20
|
+
subTitle = null,
|
|
21
|
+
className,
|
|
22
|
+
titleStyle
|
|
23
|
+
} = props;
|
|
24
|
+
const navigate = useNavigate();
|
|
25
|
+
const renderSubtitle = () => {
|
|
26
|
+
if (typeof subTitle === "string") {
|
|
27
|
+
return /* @__PURE__ */ jsx(Text, { className: styles.sub, children: subTitle });
|
|
28
|
+
}
|
|
29
|
+
return subTitle;
|
|
30
|
+
};
|
|
31
|
+
const goBack = () => {
|
|
32
|
+
navigate(-1);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: classNames(styles.main, {
|
|
38
|
+
className
|
|
39
|
+
}),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(Space, { children: [
|
|
42
|
+
isBack && /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { fontSize: 24 }, onClick: goBack }),
|
|
43
|
+
/* @__PURE__ */ jsxs(Title, { level: 2, className: styles.title, style: titleStyle, children: [
|
|
44
|
+
title2,
|
|
45
|
+
renderSubtitle()
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
extra
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
BackHeader as default
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.szld-fieldModal {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
width: 100%;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
padding: 4px 11px;
|
|
7
|
+
color: rgba(0, 0, 0, 0.88);
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
line-height: 1.57142857;
|
|
10
|
+
background-color: #ffffff;
|
|
11
|
+
background-image: none;
|
|
12
|
+
border-width: 1px;
|
|
13
|
+
border-style: solid;
|
|
14
|
+
border-color: #d9d9d9;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
transition: all 0.2s;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
.szld-fieldModal:hover {
|
|
20
|
+
border-color: #4096ff;
|
|
21
|
+
}
|
|
22
|
+
.szld-fieldModal .szld-content {
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
.szld-fieldModal .szld-suffix {
|
|
26
|
+
flex: none;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
color: rgba(0, 0, 0, 0.45);
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: color 0.3s;
|
|
31
|
+
margin: 0;
|
|
32
|
+
vertical-align: -1px;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
.szld-fieldModal .szld-placeholder {
|
|
37
|
+
color: #d4d4d4;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, createElement } from "react";
|
|
3
|
+
import { Form, Row, Col, Input, Space, Button, Cascader, TimePicker, DatePicker, Switch, Radio, InputNumber, Select, Checkbox } from "antd";
|
|
4
|
+
import { CloseCircleFilled } from "@ant-design/icons";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import UploadFile from "../Upload";
|
|
7
|
+
const fieldModal = "szld-fieldModal";
|
|
8
|
+
const content = "szld-content";
|
|
9
|
+
const suffix = "szld-suffix";
|
|
10
|
+
const placeholder = "szld-placeholder";
|
|
11
|
+
const styles = {
|
|
12
|
+
fieldModal,
|
|
13
|
+
content,
|
|
14
|
+
suffix,
|
|
15
|
+
placeholder
|
|
16
|
+
};
|
|
17
|
+
const formLayout = {
|
|
18
|
+
labelCol: {
|
|
19
|
+
span: 4
|
|
20
|
+
},
|
|
21
|
+
wrapperCol: {
|
|
22
|
+
span: 20
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const getValuePropName = (valueType) => {
|
|
26
|
+
switch (valueType) {
|
|
27
|
+
case "upload":
|
|
28
|
+
return "fileList";
|
|
29
|
+
case "switch":
|
|
30
|
+
return "checked";
|
|
31
|
+
default:
|
|
32
|
+
return "value";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const CreateForm = (props) => {
|
|
36
|
+
const {
|
|
37
|
+
items,
|
|
38
|
+
rowProps,
|
|
39
|
+
formProps,
|
|
40
|
+
readonly = false,
|
|
41
|
+
hiddenTitle = false
|
|
42
|
+
} = props;
|
|
43
|
+
const onBtnClick = (e, item) => {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if (item.btnType === "submit") {
|
|
46
|
+
(_a = formProps == null ? void 0 : formProps.form) == null ? void 0 : _a.validateFields().then((values) => {
|
|
47
|
+
item.onClick && item.onClick(values);
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (item.btnType === "reset") {
|
|
52
|
+
(_b = formProps == null ? void 0 : formProps.form) == null ? void 0 : _b.resetFields();
|
|
53
|
+
item.onClick && item.onClick(e);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (item.btnType === "cancel") {
|
|
57
|
+
item.onClick && item.onClick(e);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const normFile = (e) => {
|
|
61
|
+
if (Array.isArray(e)) {
|
|
62
|
+
return e;
|
|
63
|
+
}
|
|
64
|
+
return e && e.fileList;
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
Form,
|
|
68
|
+
{
|
|
69
|
+
layout: "horizontal",
|
|
70
|
+
form: formProps == null ? void 0 : formProps.form,
|
|
71
|
+
...formLayout,
|
|
72
|
+
...formProps || {},
|
|
73
|
+
children: /* @__PURE__ */ jsx(Row, { gutter: 16, ...rowProps, children: items.filter((v) => !v.hidden).map((item) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return /* @__PURE__ */ jsx(Col, { ...item.colProps || { span: 24 }, children: /* @__PURE__ */ jsx(
|
|
76
|
+
Form.Item,
|
|
77
|
+
{
|
|
78
|
+
...item.valueType === "upload" ? {
|
|
79
|
+
getValueFromEvent: normFile
|
|
80
|
+
} : {},
|
|
81
|
+
label: !hiddenTitle ? item.title : "",
|
|
82
|
+
name: item.valueType === "btns" ? void 0 : item.dataIndex,
|
|
83
|
+
...item.formItemProps,
|
|
84
|
+
children: item.readonly ? /* @__PURE__ */ jsx("div", { children: item.value || ((_a = formProps == null ? void 0 : formProps.initialValues) == null ? void 0 : _a[item.dataIndex]) }) : item.readonly === void 0 && readonly ? /* @__PURE__ */ jsx("div", { children: item.value || ((_b = formProps == null ? void 0 : formProps.initialValues) == null ? void 0 : _b[item.dataIndex]) }) : /* @__PURE__ */ jsx(
|
|
85
|
+
FormFields,
|
|
86
|
+
{
|
|
87
|
+
onChange: (e) => {
|
|
88
|
+
var _a2;
|
|
89
|
+
return (_a2 = item == null ? void 0 : item.onChange) == null ? void 0 : _a2.call(item, e);
|
|
90
|
+
},
|
|
91
|
+
valueType: item.valueType,
|
|
92
|
+
onBtnClick,
|
|
93
|
+
valueProps: item.valueProps
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
) }, item.dataIndex);
|
|
98
|
+
}) })
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
const FormFields = (props) => {
|
|
103
|
+
const { valueType, valueProps, value, onChange, onBtnClick, inputRef } = props;
|
|
104
|
+
const children = useMemo(() => {
|
|
105
|
+
let result = /* @__PURE__ */ jsx(Input, { placeholder: "请输入", ...valueProps, allowClear: true });
|
|
106
|
+
switch (valueType) {
|
|
107
|
+
case "password":
|
|
108
|
+
result = /* @__PURE__ */ jsx(Input.Password, { ...valueProps });
|
|
109
|
+
break;
|
|
110
|
+
case "modal":
|
|
111
|
+
result = /* @__PURE__ */ jsx(FieldModal, { ...valueProps });
|
|
112
|
+
break;
|
|
113
|
+
case "checkbox":
|
|
114
|
+
result = /* @__PURE__ */ jsx(Checkbox.Group, { ...valueProps });
|
|
115
|
+
break;
|
|
116
|
+
case "select":
|
|
117
|
+
result = /* @__PURE__ */ jsx(
|
|
118
|
+
Select,
|
|
119
|
+
{
|
|
120
|
+
placeholder: "请选择",
|
|
121
|
+
...valueProps,
|
|
122
|
+
allowClear: true
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
break;
|
|
126
|
+
case "inputNumber":
|
|
127
|
+
result = /* @__PURE__ */ jsx(
|
|
128
|
+
InputNumber,
|
|
129
|
+
{
|
|
130
|
+
style: { width: "100%" },
|
|
131
|
+
placeholder: "请输入",
|
|
132
|
+
...valueProps
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
break;
|
|
136
|
+
case "textarea":
|
|
137
|
+
result = /* @__PURE__ */ jsx(
|
|
138
|
+
Input.TextArea,
|
|
139
|
+
{
|
|
140
|
+
placeholder: "请输入",
|
|
141
|
+
...valueProps,
|
|
142
|
+
allowClear: true
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
break;
|
|
146
|
+
case "radio":
|
|
147
|
+
result = /* @__PURE__ */ jsx(Radio.Group, { ...valueProps });
|
|
148
|
+
break;
|
|
149
|
+
case "switch":
|
|
150
|
+
result = /* @__PURE__ */ jsx(Switch, { ...valueProps });
|
|
151
|
+
break;
|
|
152
|
+
case "datePicker":
|
|
153
|
+
result = /* @__PURE__ */ jsx(
|
|
154
|
+
DatePicker,
|
|
155
|
+
{
|
|
156
|
+
style: { width: "100%" },
|
|
157
|
+
...valueProps,
|
|
158
|
+
allowClear: true
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
break;
|
|
162
|
+
case "rangePicker":
|
|
163
|
+
result = /* @__PURE__ */ jsx(
|
|
164
|
+
DatePicker.RangePicker,
|
|
165
|
+
{
|
|
166
|
+
style: { width: "100%" },
|
|
167
|
+
...valueProps,
|
|
168
|
+
allowClear: true
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
break;
|
|
172
|
+
case "timePicker":
|
|
173
|
+
result = /* @__PURE__ */ jsx(
|
|
174
|
+
TimePicker,
|
|
175
|
+
{
|
|
176
|
+
style: { width: "100%" },
|
|
177
|
+
...valueProps,
|
|
178
|
+
allowClear: true
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
break;
|
|
182
|
+
case "cascader":
|
|
183
|
+
result = /* @__PURE__ */ jsx(
|
|
184
|
+
Cascader,
|
|
185
|
+
{
|
|
186
|
+
...valueProps,
|
|
187
|
+
allowClear: true
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
break;
|
|
191
|
+
case "upload":
|
|
192
|
+
result = /* @__PURE__ */ jsx(UploadFile, { ...valueProps });
|
|
193
|
+
break;
|
|
194
|
+
case "btns":
|
|
195
|
+
result = /* @__PURE__ */ jsx(Space, { children: valueProps == null ? void 0 : valueProps.map((item) => /* @__PURE__ */ createElement(
|
|
196
|
+
Button,
|
|
197
|
+
{
|
|
198
|
+
type: item.btnType === "submit" ? "primary" : "default",
|
|
199
|
+
..._.omit(item, ["btnType"]),
|
|
200
|
+
key: item.btnType,
|
|
201
|
+
onClick: (e) => {
|
|
202
|
+
onBtnClick == null ? void 0 : onBtnClick(e, item);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
item.title
|
|
206
|
+
)) });
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
return result;
|
|
210
|
+
}, [valueType, valueProps, onChange, value]);
|
|
211
|
+
return React.cloneElement(children, {
|
|
212
|
+
[getValuePropName(valueType || "input")]: value,
|
|
213
|
+
onChange,
|
|
214
|
+
ref: inputRef
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
const FieldModal = (props) => {
|
|
218
|
+
const { placeholder: placeholder2, labelKey, onToggle, value, onClear } = props;
|
|
219
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.fieldModal, children: [
|
|
220
|
+
/* @__PURE__ */ jsx("div", { className: styles.content, onClick: () => onToggle(true), children: !value ? /* @__PURE__ */ jsx("span", { className: styles.placeholder, children: placeholder2 }) : /* @__PURE__ */ jsx("span", { children: value[labelKey] }) }),
|
|
221
|
+
/* @__PURE__ */ jsx("span", { className: styles.suffix, onClick: onClear, children: value && /* @__PURE__ */ jsx(CloseCircleFilled, {}) })
|
|
222
|
+
] });
|
|
223
|
+
};
|
|
224
|
+
export {
|
|
225
|
+
FormFields,
|
|
226
|
+
CreateForm as default
|
|
227
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as echarts from "echarts/core";
|
|
3
|
+
import { BarChart } from "echarts/charts";
|
|
4
|
+
import { TitleComponent, TooltipComponent, GridComponent, DatasetComponent, TransformComponent } from "echarts/components";
|
|
5
|
+
import { LabelLayout, UniversalTransition } from "echarts/features";
|
|
6
|
+
import { CanvasRenderer } from "echarts/renderers";
|
|
7
|
+
import { useRef, useEffect } from "react";
|
|
8
|
+
import { useDebounceFn } from "ahooks";
|
|
9
|
+
const main = "szld-main";
|
|
10
|
+
const classes = {
|
|
11
|
+
main
|
|
12
|
+
};
|
|
13
|
+
echarts.use([
|
|
14
|
+
TitleComponent,
|
|
15
|
+
TooltipComponent,
|
|
16
|
+
GridComponent,
|
|
17
|
+
DatasetComponent,
|
|
18
|
+
TransformComponent,
|
|
19
|
+
BarChart,
|
|
20
|
+
LabelLayout,
|
|
21
|
+
UniversalTransition,
|
|
22
|
+
CanvasRenderer
|
|
23
|
+
]);
|
|
24
|
+
const Echarts = (props) => {
|
|
25
|
+
const ref = useRef(null);
|
|
26
|
+
const eRef = useRef(null);
|
|
27
|
+
const resizeRef = useRef(null);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (ref.current && eRef.current) {
|
|
30
|
+
resizeRef.current = new ResizeObserver((entries) => {
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
if (entry.target === ref.current) {
|
|
33
|
+
run();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
resizeRef.current.observe(ref.current);
|
|
38
|
+
}
|
|
39
|
+
return () => {
|
|
40
|
+
var _a;
|
|
41
|
+
ref.current && ((_a = resizeRef.current) == null ? void 0 : _a.unobserve(ref.current));
|
|
42
|
+
resizeRef.current = null;
|
|
43
|
+
};
|
|
44
|
+
}, [ref.current, eRef.current]);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (ref.current && !eRef.current) {
|
|
47
|
+
eRef.current = echarts.init(ref.current);
|
|
48
|
+
}
|
|
49
|
+
}, [ref.current]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (eRef.current && ref.current) {
|
|
52
|
+
eRef.current.setOption(props.option);
|
|
53
|
+
}
|
|
54
|
+
}, [eRef.current]);
|
|
55
|
+
const onResize = () => {
|
|
56
|
+
if (eRef.current) {
|
|
57
|
+
eRef.current.resize();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const { run } = useDebounceFn(onResize, { wait: 300 });
|
|
61
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes.main });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
Echarts as default
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Table, Form } from "antd";
|
|
3
|
+
import React, { useRef, useContext } from "react";
|
|
4
|
+
import { FormFields } from "../CreateForm";
|
|
5
|
+
const editableCellValueWrap = "szld-editableCellValueWrap";
|
|
6
|
+
const classes = {
|
|
7
|
+
editableCellValueWrap
|
|
8
|
+
};
|
|
9
|
+
const EditableContext = React.createContext(null);
|
|
10
|
+
const EditableRow = ({ index, ...props }) => {
|
|
11
|
+
const [form] = Form.useForm();
|
|
12
|
+
return /* @__PURE__ */ jsx(Form, { form, component: false, children: /* @__PURE__ */ jsx(EditableContext.Provider, { value: form, children: /* @__PURE__ */ jsx("tr", { ...props }) }) });
|
|
13
|
+
};
|
|
14
|
+
function EditableCell(props) {
|
|
15
|
+
const {
|
|
16
|
+
title,
|
|
17
|
+
editable,
|
|
18
|
+
children,
|
|
19
|
+
dataIndex,
|
|
20
|
+
record,
|
|
21
|
+
rules,
|
|
22
|
+
onChange,
|
|
23
|
+
type = "input",
|
|
24
|
+
valueProps,
|
|
25
|
+
...restProps
|
|
26
|
+
} = props;
|
|
27
|
+
const inputRef = useRef(null);
|
|
28
|
+
const form = useContext(EditableContext);
|
|
29
|
+
const save = async () => {
|
|
30
|
+
try {
|
|
31
|
+
const values = await form.validateFields();
|
|
32
|
+
onChange({ ...record, ...values });
|
|
33
|
+
} catch (errInfo) {
|
|
34
|
+
console.log("Save failed:", errInfo);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const renderItem = () => {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
FormFields,
|
|
40
|
+
{
|
|
41
|
+
valueType: type,
|
|
42
|
+
valueProps: {
|
|
43
|
+
...valueProps,
|
|
44
|
+
onBlur: save,
|
|
45
|
+
onPressEnter: save
|
|
46
|
+
},
|
|
47
|
+
inputRef
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
let childNode = children;
|
|
52
|
+
if (editable) {
|
|
53
|
+
childNode = /* @__PURE__ */ jsx(
|
|
54
|
+
Form.Item,
|
|
55
|
+
{
|
|
56
|
+
style: { margin: 0 },
|
|
57
|
+
initialValue: record[dataIndex],
|
|
58
|
+
name: dataIndex,
|
|
59
|
+
rules,
|
|
60
|
+
children: renderItem()
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsx("td", { children: childNode });
|
|
65
|
+
}
|
|
66
|
+
function EditTable(props) {
|
|
67
|
+
const { columns, onChange, ...rest } = props;
|
|
68
|
+
const components = {
|
|
69
|
+
body: {
|
|
70
|
+
row: EditableRow,
|
|
71
|
+
cell: EditableCell
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const mergeColumns = columns == null ? void 0 : columns.map((col) => {
|
|
75
|
+
if (!col.editable) {
|
|
76
|
+
return col;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
...col,
|
|
80
|
+
onCell: (record) => ({
|
|
81
|
+
...col,
|
|
82
|
+
record,
|
|
83
|
+
onChange
|
|
84
|
+
})
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
88
|
+
Table,
|
|
89
|
+
{
|
|
90
|
+
...rest,
|
|
91
|
+
components,
|
|
92
|
+
rowClassName: () => classes.editableRow,
|
|
93
|
+
columns: mergeColumns
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
EditTable as default
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.szld-loadingWrapper .szld-loadingRoot {
|
|
2
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
3
|
+
position: fixed;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
z-index: 1000;
|
|
7
|
+
inset: 0;
|
|
8
|
+
}
|
|
9
|
+
.szld-loadingWrapper .szld-loadingBody {
|
|
10
|
+
position: fixed;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
inset: 0;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
z-index: 1000;
|
|
17
|
+
}
|
|
18
|
+
.szld-loadingWrapper .szld-loadingBody .szld-content {
|
|
19
|
+
width: 100px;
|
|
20
|
+
height: 100px;
|
|
21
|
+
border-radius: 20px;
|
|
22
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingOutlined } from "@ant-design/icons";
|
|
3
|
+
import { Spin } from "antd";
|
|
4
|
+
import ReactDOM from "react-dom/client";
|
|
5
|
+
const loadingWrapper = "szld-loadingWrapper";
|
|
6
|
+
const loadingRoot = "szld-loadingRoot";
|
|
7
|
+
const loadingBody = "szld-loadingBody";
|
|
8
|
+
const content = "szld-content";
|
|
9
|
+
const classes = {
|
|
10
|
+
loadingWrapper,
|
|
11
|
+
loadingRoot,
|
|
12
|
+
loadingBody,
|
|
13
|
+
content
|
|
14
|
+
};
|
|
15
|
+
const antIcon = /* @__PURE__ */ jsx(LoadingOutlined, { style: { fontSize: 40 }, spin: true });
|
|
16
|
+
const Loading = () => {
|
|
17
|
+
const div = document.createElement("div");
|
|
18
|
+
const style = document.createElement("style");
|
|
19
|
+
const loading = ReactDOM.createRoot(div);
|
|
20
|
+
const Container = () => /* @__PURE__ */ jsxs("div", { className: classes.loadingWrapper, children: [
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: classes.loadingRoot }),
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: classes.loadingBody, children: /* @__PURE__ */ jsx("div", { className: classes.content, children: /* @__PURE__ */ jsx(Spin, { indicator: antIcon }) }) })
|
|
23
|
+
] });
|
|
24
|
+
const hiddenScroll = () => {
|
|
25
|
+
const styleContent = `body { overflow-y: hidden; }`;
|
|
26
|
+
style.textContent = styleContent;
|
|
27
|
+
document.head.appendChild(style);
|
|
28
|
+
};
|
|
29
|
+
const render = () => {
|
|
30
|
+
document.body.appendChild(div);
|
|
31
|
+
hiddenScroll();
|
|
32
|
+
loading.render(/* @__PURE__ */ jsx(Container, {}));
|
|
33
|
+
};
|
|
34
|
+
const close = () => {
|
|
35
|
+
loading.unmount();
|
|
36
|
+
document.body.removeChild(div);
|
|
37
|
+
document.head.removeChild(style);
|
|
38
|
+
};
|
|
39
|
+
render();
|
|
40
|
+
return { close };
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
Loading as default
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|