szld-libs 0.2.47 → 0.2.49
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/szld-components.es.js +17611 -15896
- package/dist/szld-components.umd.js +59 -56
- package/es/components/BackHeader/index.css +6 -0
- package/es/components/BackHeader/index.js +5 -3
- package/es/components/CreateForm/index.d.ts +2 -2
- package/es/components/CustomPagination/index.css +9 -0
- package/es/components/CustomPagination/index.d.ts +15 -0
- package/es/components/CustomPagination/index.js +69 -0
- package/es/components/CustomPagination/vite.svg +1 -0
- package/es/components/SearchTable/index.d.ts +3 -1
- package/es/components/SearchTable/index.js +3 -1
- package/es/components/VirtualTable/index.js +1 -1
- package/es/hooks/useChangePwd.js +9 -1
- package/es/index.js +192 -50
- package/es/main.d.ts +5 -3
- package/es/main.js +20 -16
- package/es/utils/hmacsm3.d.ts +7 -0
- package/es/utils/hmacsm3.js +20 -0
- package/lib/components/BackHeader/index.css +6 -0
- package/lib/components/BackHeader/index.js +4 -2
- package/lib/components/CreateForm/index.d.ts +2 -2
- package/lib/components/CustomPagination/index.css +9 -0
- package/lib/components/CustomPagination/index.d.ts +15 -0
- package/lib/components/CustomPagination/index.js +68 -0
- package/lib/components/CustomPagination/vite.svg +1 -0
- package/lib/components/SearchTable/index.d.ts +3 -1
- package/lib/components/SearchTable/index.js +2 -0
- package/lib/components/VirtualTable/index.js +1 -1
- package/lib/hooks/useChangePwd.js +9 -1
- package/lib/index.js +190 -48
- package/lib/main.d.ts +5 -3
- package/lib/main.js +8 -4
- package/lib/utils/hmacsm3.d.ts +7 -0
- package/lib/utils/hmacsm3.js +19 -0
- package/package.json +5 -3
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Space,
|
|
2
|
+
import { Space, Typography } from "antd";
|
|
3
3
|
import { ArrowLeftOutlined } from "@ant-design/icons";
|
|
4
4
|
import { useNavigate } from "react-router-dom";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
const main = "backheader-module_main_cac53";
|
|
7
7
|
const title = "backheader-module_title_33439";
|
|
8
8
|
const sub = "backheader-module_sub_1d015";
|
|
9
|
+
const btn = "backheader-module_btn_ee841";
|
|
9
10
|
const styles = {
|
|
10
11
|
main,
|
|
11
12
|
title,
|
|
12
|
-
sub
|
|
13
|
+
sub,
|
|
14
|
+
btn
|
|
13
15
|
};
|
|
14
16
|
const { Title, Text } = Typography;
|
|
15
17
|
const BackHeader = (props) => {
|
|
@@ -26,7 +28,7 @@ const BackHeader = (props) => {
|
|
|
26
28
|
};
|
|
27
29
|
return /* @__PURE__ */ jsxs("div", { className: classNames(styles.main, className), style, children: [
|
|
28
30
|
/* @__PURE__ */ jsxs(Space, { children: [
|
|
29
|
-
isBack && /* @__PURE__ */ jsx(
|
|
31
|
+
isBack && /* @__PURE__ */ jsx("div", { onClick: goBack, className: styles.btn, children: icon || /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { fontSize: 24 } }) }),
|
|
30
32
|
/* @__PURE__ */ jsxs(Title, { level, className: styles.title, style: titleStyle, children: [
|
|
31
33
|
title2,
|
|
32
34
|
renderSubtitle()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormProps, FormItemProps, ColProps, RowProps, InputProps, SelectProps, InputNumberProps, RadioGroupProps, SwitchProps, TimePickerProps, ButtonProps,
|
|
1
|
+
import { FormProps, FormItemProps, ColProps, RowProps, InputProps, SelectProps, InputNumberProps, RadioGroupProps, SwitchProps, TimePickerProps, ButtonProps, CascaderAutoProps, RateProps } from "antd";
|
|
2
2
|
import { DefaultOptionType } from "antd/es/cascader";
|
|
3
3
|
import { CheckboxGroupProps } from "antd/es/checkbox";
|
|
4
4
|
import { DatePickerProps, RangePickerProps } from "antd/es/date-picker";
|
|
@@ -23,7 +23,7 @@ interface ValueModalProps {
|
|
|
23
23
|
interface customValueProps {
|
|
24
24
|
children: ReactElement;
|
|
25
25
|
}
|
|
26
|
-
export type ValueProps<T> = T extends "checkbox" ? CheckboxGroupProps : T extends "select" ? SelectProps : T extends "inputNumber" ? InputNumberProps : T extends "textarea" ? TextAreaProps : T extends "radio" ? RadioGroupProps : T extends "switch" ? SwitchProps : T extends "rangePicker" ? RangePickerProps : T extends "datePicker" ? DatePickerProps : T extends "timePicker" ? TimePickerProps : T extends "input" ? InputProps : T extends "cascader" ?
|
|
26
|
+
export type ValueProps<T> = T extends "checkbox" ? CheckboxGroupProps : T extends "select" ? SelectProps : T extends "inputNumber" ? InputNumberProps : T extends "textarea" ? TextAreaProps : T extends "radio" ? RadioGroupProps : T extends "switch" ? SwitchProps : T extends "rangePicker" ? RangePickerProps : T extends "datePicker" ? DatePickerProps : T extends "timePicker" ? TimePickerProps : T extends "input" ? InputProps : T extends "cascader" ? CascaderAutoProps<DefaultOptionType> : T extends "upload" ? UploadFileProps : T extends "modal" ? ValueModalProps : T extends "btns" ? ValueBtnProps[] : T extends "password" ? PasswordProps : T extends "rate" ? RateProps : T extends "custom" ? customValueProps : InputProps;
|
|
27
27
|
export interface CreateFormItemProps<T> {
|
|
28
28
|
formItemProps?: FormItemProps;
|
|
29
29
|
valueType?: T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaginationProps } from 'antd';
|
|
2
|
+
export interface CustomPaginationProps {
|
|
3
|
+
/** 总数文本 */
|
|
4
|
+
totalText?: string;
|
|
5
|
+
/** 单位文本 */
|
|
6
|
+
unitText?: string;
|
|
7
|
+
/** 跳转文本 */
|
|
8
|
+
jumpText?: string;
|
|
9
|
+
/** 页文本 */
|
|
10
|
+
pageText?: string;
|
|
11
|
+
/** pagination属性配置 */
|
|
12
|
+
paginationProps?: PaginationProps;
|
|
13
|
+
}
|
|
14
|
+
declare function CustomPagination(props: CustomPaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default CustomPagination;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pagination, Input } from "antd";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const customPagination = "custom-pagination-module_customPagination_bb6f7";
|
|
5
|
+
const jumpBtns = "custom-pagination-module_jumpBtns_a6c0b";
|
|
6
|
+
const styles = {
|
|
7
|
+
customPagination,
|
|
8
|
+
jumpBtns
|
|
9
|
+
};
|
|
10
|
+
function CustomPagination(props) {
|
|
11
|
+
const { totalText = "共", unitText = "条", jumpText = "跳至", pageText = "页", paginationProps } = props;
|
|
12
|
+
const [inputValue, setInputValue] = useState("");
|
|
13
|
+
const pageSize = (paginationProps == null ? void 0 : paginationProps.pageSize) || 10;
|
|
14
|
+
const handleChange = (e) => {
|
|
15
|
+
setInputValue(e.target.value);
|
|
16
|
+
};
|
|
17
|
+
const handleBlur = (e) => {
|
|
18
|
+
var _a;
|
|
19
|
+
setInputValue("");
|
|
20
|
+
if (Number.isNaN(Number(e.target.value))) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
(_a = paginationProps == null ? void 0 : paginationProps.onChange) == null ? void 0 : _a.call(paginationProps, Number(e.target.value), pageSize);
|
|
24
|
+
};
|
|
25
|
+
const handleKeyDown = (e) => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (e.key === "Enter") {
|
|
28
|
+
setInputValue("");
|
|
29
|
+
if (Number.isNaN(Number(inputValue))) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
(_a = paginationProps == null ? void 0 : paginationProps.onChange) == null ? void 0 : _a.call(paginationProps, Number(inputValue), pageSize);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.customPagination, children: [
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
Pagination,
|
|
38
|
+
{
|
|
39
|
+
showTotal: (total) => `${totalText} ${total} ${unitText}`,
|
|
40
|
+
showSizeChanger: {
|
|
41
|
+
options: [
|
|
42
|
+
{ label: `10 ${unitText}/${pageText}`, value: 10 },
|
|
43
|
+
{ label: `20 ${unitText}/${pageText}`, value: 20 },
|
|
44
|
+
{ label: `50 ${unitText}/${pageText}`, value: 50 },
|
|
45
|
+
{ label: `100 ${unitText}/${pageText}`, value: 100 }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
...paginationProps
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: styles.jumpBtns, children: [
|
|
52
|
+
jumpText,
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
Input,
|
|
55
|
+
{
|
|
56
|
+
style: { width: "50px", margin: "0 8px" },
|
|
57
|
+
value: inputValue,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
onBlur: (e) => handleBlur(e),
|
|
60
|
+
onKeyDown: (e) => handleKeyDown(e)
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
pageText
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
CustomPagination as default
|
|
69
|
+
};
|
|
@@ -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>
|
|
@@ -7,7 +7,7 @@ export interface TableColumnProps<T> extends ColumnType<T> {
|
|
|
7
7
|
/** 宽度 */
|
|
8
8
|
width?: number | string;
|
|
9
9
|
/** 最小宽度 */
|
|
10
|
-
minWidth?: number
|
|
10
|
+
minWidth?: number;
|
|
11
11
|
}
|
|
12
12
|
export interface MTableProps<T> extends Omit<TableProps<T>, 'columns'> {
|
|
13
13
|
columns?: TableColumnProps<T>[];
|
|
@@ -19,6 +19,8 @@ export interface MTableProps<T> extends Omit<TableProps<T>, 'columns'> {
|
|
|
19
19
|
tableId?: string;
|
|
20
20
|
/** 存储key,默认szld_table_cell_width */
|
|
21
21
|
storageKey?: string;
|
|
22
|
+
/** 表格无数据文案 */
|
|
23
|
+
emptyText?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface SearchTableProps<RecordType> {
|
|
24
26
|
searchProps?: CreateFormProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Table } from "antd";
|
|
2
|
+
import { Table, Empty } from "antd";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { useState, useEffect, useMemo } from "react";
|
|
5
5
|
import { Resizable } from "react-resizable";
|
|
@@ -25,6 +25,7 @@ function SearchTable(props) {
|
|
|
25
25
|
resizeable = false,
|
|
26
26
|
tableId,
|
|
27
27
|
storageKey = "szld_table_cell_width",
|
|
28
|
+
emptyText,
|
|
28
29
|
...rest
|
|
29
30
|
} = tableProps;
|
|
30
31
|
const [columns, setColumns] = useState(tableProps.columns || []);
|
|
@@ -120,6 +121,7 @@ function SearchTable(props) {
|
|
|
120
121
|
components,
|
|
121
122
|
columns,
|
|
122
123
|
className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
|
|
124
|
+
locale: { emptyText: /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description: emptyText }) },
|
|
123
125
|
pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
|
|
124
126
|
showPrevNextJumpers: true,
|
|
125
127
|
showQuickJumper: true,
|
|
@@ -68,7 +68,7 @@ function VirtualTable(props) {
|
|
|
68
68
|
columnCount: mergedColumns.length,
|
|
69
69
|
columnWidth: (index) => {
|
|
70
70
|
const { width } = mergedColumns[index];
|
|
71
|
-
return totalHeight > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
|
|
71
|
+
return `${totalHeight}` > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
|
|
72
72
|
},
|
|
73
73
|
height: scroll.y,
|
|
74
74
|
rowCount: rawData.length,
|
package/es/hooks/useChangePwd.js
CHANGED
|
@@ -38,6 +38,13 @@ function useChangePwd(props) {
|
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
40
|
const handleChangePwd = useLockFn(async (func, title) => {
|
|
41
|
+
const modalProps = props == null ? void 0 : props.modalProps;
|
|
42
|
+
let width = void 0;
|
|
43
|
+
if (modalProps == null ? void 0 : modalProps.width) {
|
|
44
|
+
if (typeof modalProps.width === "string" || typeof modalProps.width === "number") {
|
|
45
|
+
width = modalProps.width;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
41
48
|
await modal.confirm({
|
|
42
49
|
title: title || "修改密码",
|
|
43
50
|
icon: null,
|
|
@@ -56,7 +63,8 @@ function useChangePwd(props) {
|
|
|
56
63
|
});
|
|
57
64
|
});
|
|
58
65
|
},
|
|
59
|
-
...
|
|
66
|
+
...modalProps,
|
|
67
|
+
width
|
|
60
68
|
});
|
|
61
69
|
});
|
|
62
70
|
return { handleChangePwd };
|
package/es/index.js
CHANGED
|
@@ -2,12 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import ReactDOM from "react-dom/client";
|
|
4
4
|
import { BrowserRouter } from "react-router-dom";
|
|
5
|
-
import { Table, Button } from "antd";
|
|
5
|
+
import { App, Form, Table, Flex, Button } from "antd";
|
|
6
6
|
import useConfig from "./hooks/useConfig";
|
|
7
|
-
import { useRowSelection, BackHeader, SearchTable } from "./main";
|
|
7
|
+
import { useRowSelection, useChangePwd, HmacSM3, BackHeader, SearchTable, CreateForm, CustomPagination } from "./main";
|
|
8
8
|
let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
|
|
9
9
|
const Demo = () => {
|
|
10
10
|
useConfig(key);
|
|
11
|
+
const [form] = Form.useForm();
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
}, []);
|
|
13
14
|
const columns = [
|
|
@@ -40,53 +41,190 @@ const Demo = () => {
|
|
|
40
41
|
useEffect(() => {
|
|
41
42
|
setSelectedKeys([1, 12, 21]);
|
|
42
43
|
}, []);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
const { handleChangePwd } = useChangePwd();
|
|
45
|
+
const typeList = [
|
|
46
|
+
{
|
|
47
|
+
flinfo: "数据",
|
|
48
|
+
children: [
|
|
49
|
+
{
|
|
50
|
+
flinfo: "数据1"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
flinfo: "数据2"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
flinfo: "表",
|
|
59
|
+
children: [
|
|
60
|
+
{
|
|
61
|
+
flinfo: "表1"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
flinfo: "表2"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
const formItems = [
|
|
70
|
+
{
|
|
71
|
+
dataIndex: "asctypeid",
|
|
72
|
+
title: "编号",
|
|
73
|
+
valueType: "inputNumber",
|
|
74
|
+
valueProps: {
|
|
75
|
+
placeholder: "请输入编号",
|
|
76
|
+
controls: false,
|
|
77
|
+
min: 0
|
|
78
|
+
},
|
|
79
|
+
formItemProps: {
|
|
80
|
+
rules: [
|
|
81
|
+
{
|
|
82
|
+
required: true,
|
|
83
|
+
message: "请输入编号"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
colProps: { span: 11 }
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
dataIndex: "asctype",
|
|
91
|
+
title: "归类名",
|
|
92
|
+
valueProps: {
|
|
93
|
+
placeholder: "请输入归类名",
|
|
94
|
+
maxLength: 100,
|
|
95
|
+
allowClear: true
|
|
96
|
+
},
|
|
97
|
+
colProps: { span: 11, offset: 2 },
|
|
98
|
+
formItemProps: {
|
|
99
|
+
rules: [
|
|
100
|
+
{
|
|
101
|
+
required: true,
|
|
102
|
+
message: "请输入归类名"
|
|
103
|
+
},
|
|
104
|
+
{ whitespace: true, message: "输入内容不能只有空格" }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
dataIndex: "tabsortList",
|
|
110
|
+
title: "分类",
|
|
111
|
+
valueType: "cascader",
|
|
112
|
+
valueProps: {
|
|
113
|
+
placeholder: "请选择分类",
|
|
114
|
+
options: typeList,
|
|
115
|
+
changeOnSelect: true,
|
|
116
|
+
fieldNames: {
|
|
117
|
+
label: "flinfo",
|
|
118
|
+
value: "flinfo",
|
|
119
|
+
children: "children"
|
|
53
120
|
}
|
|
121
|
+
},
|
|
122
|
+
colProps: {
|
|
123
|
+
span: 11
|
|
54
124
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
const totalText = "共@";
|
|
128
|
+
const unitText = "条@";
|
|
129
|
+
const jumpText = "跳至@";
|
|
130
|
+
const pageText = "页@";
|
|
131
|
+
const sha = new HmacSM3("123");
|
|
132
|
+
sha.encrypt("abc");
|
|
133
|
+
return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
134
|
+
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
135
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 20, align: "center", children: [
|
|
136
|
+
"1. 测试修改密码hooks",
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
Button,
|
|
139
|
+
{
|
|
140
|
+
onClick: () => handleChangePwd((params) => {
|
|
141
|
+
}),
|
|
142
|
+
children: "修改密码"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
147
|
+
"2. 测试循环滚动组件",
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
style: {
|
|
152
|
+
height: "400px",
|
|
153
|
+
border: "1px solid #333",
|
|
154
|
+
margin: "20px"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
160
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 20, align: "center", style: { marginBottom: 10 }, children: [
|
|
161
|
+
"3. 测试表格组件",
|
|
162
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setList(columns), children: "test" })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
SearchTable,
|
|
166
|
+
{
|
|
167
|
+
tableProps: {
|
|
168
|
+
columns: [
|
|
169
|
+
{
|
|
170
|
+
dataIndex: "id",
|
|
171
|
+
title: "ID"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
dataIndex: "a",
|
|
175
|
+
title: "a",
|
|
176
|
+
width: 200
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
dataIndex: "a2",
|
|
180
|
+
title: "a",
|
|
181
|
+
width: 200
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
dataIndex: "a3",
|
|
185
|
+
title: "a",
|
|
186
|
+
width: 200
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
dataIndex: "a4",
|
|
190
|
+
title: "a",
|
|
191
|
+
width: 400
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
dataSource: list,
|
|
195
|
+
resizeable: true,
|
|
196
|
+
rowKey: "id",
|
|
197
|
+
pagination: {
|
|
198
|
+
total: 25,
|
|
199
|
+
current,
|
|
200
|
+
pageSize: 10,
|
|
201
|
+
onChange(page, pageSize) {
|
|
202
|
+
const index = (page - 1) * 10;
|
|
203
|
+
const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
|
|
204
|
+
setList(arr);
|
|
205
|
+
setCurrent(page);
|
|
206
|
+
}
|
|
84
207
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
] }),
|
|
212
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
213
|
+
"4. 测试创建表单组件",
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
CreateForm,
|
|
216
|
+
{
|
|
217
|
+
items: formItems,
|
|
218
|
+
formProps: { form, wrapperCol: { span: 24 }, style: { width: "60%", marginTop: 10 } }
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
223
|
+
"5. 测试自定义分页组件",
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
CustomPagination,
|
|
226
|
+
{
|
|
227
|
+
paginationProps: {
|
|
90
228
|
total: 25,
|
|
91
229
|
current,
|
|
92
230
|
pageSize: 10,
|
|
@@ -96,12 +234,16 @@ const Demo = () => {
|
|
|
96
234
|
setList(arr);
|
|
97
235
|
setCurrent(page);
|
|
98
236
|
}
|
|
99
|
-
}
|
|
237
|
+
},
|
|
238
|
+
totalText,
|
|
239
|
+
unitText,
|
|
240
|
+
jumpText,
|
|
241
|
+
pageText
|
|
100
242
|
}
|
|
101
|
-
|
|
102
|
-
)
|
|
243
|
+
)
|
|
244
|
+
] })
|
|
103
245
|
] });
|
|
104
246
|
};
|
|
105
247
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
|
106
|
-
/* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(Demo, {}) })
|
|
248
|
+
/* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(App, { children: /* @__PURE__ */ jsx(Demo, {}) }) })
|
|
107
249
|
);
|
package/es/main.d.ts
CHANGED
|
@@ -7,17 +7,19 @@ import AuthButton from './components/AuthButton';
|
|
|
7
7
|
import CoralButton from './components/CoralButton';
|
|
8
8
|
import LoopSlide from './components/LoopSlide';
|
|
9
9
|
import showWorkFlow, { WorkFlowNode } from './components/WorkFlowNode';
|
|
10
|
+
import CustomPagination from './components/CustomPagination';
|
|
10
11
|
import * as download from './utils/download';
|
|
11
12
|
import * as fileType from './utils/filetype';
|
|
12
13
|
import * as FormRules from './utils/formRules';
|
|
13
14
|
import compressionImage from './utils/image-compression';
|
|
14
15
|
import * as utils from './utils/index';
|
|
15
16
|
import * as verfyCode from './utils/verify-code';
|
|
17
|
+
import AES from './utils/aes';
|
|
18
|
+
import HmacSHA512 from './utils/hmacSHA512';
|
|
19
|
+
import HmacSM3 from './utils/hmacsm3';
|
|
16
20
|
import useCaptcha from './hooks/useCaptcha';
|
|
17
21
|
import useChangePwd from './hooks/useChangePwd';
|
|
18
22
|
import useConfig from './hooks/useConfig';
|
|
19
23
|
import useRemember from './hooks/useRemember';
|
|
20
24
|
import useRowSelection from './hooks/useRowSelection';
|
|
21
|
-
|
|
22
|
-
import HmacSHA512 from './utils/hmacSHA512';
|
|
23
|
-
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, download, EditTable, fileType, FormRules, HmacSHA512, LoopSlide, SearchTable, showWorkFlow, UploadFile, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode, WorkFlowNode, };
|
|
25
|
+
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, download, EditTable, fileType, FormRules, HmacSHA512, HmacSM3, LoopSlide, SearchTable, showWorkFlow, UploadFile, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode, WorkFlowNode, CustomPagination, };
|
package/es/main.js
CHANGED
|
@@ -7,41 +7,45 @@ import { default as default7 } from "./components/AuthButton";
|
|
|
7
7
|
import { default as default8 } from "./components/CoralButton";
|
|
8
8
|
import { default as default9 } from "./components/LoopSlide";
|
|
9
9
|
import { WorkFlowNode, default as default10 } from "./components/WorkFlowNode";
|
|
10
|
+
import { default as default11 } from "./components/CustomPagination";
|
|
10
11
|
import * as download from "./utils/download";
|
|
11
12
|
import * as filetype from "./utils/filetype";
|
|
12
13
|
import * as formRules from "./utils/formRules";
|
|
13
|
-
import { default as
|
|
14
|
+
import { default as default12 } from "./utils/image-compression";
|
|
14
15
|
import * as index from "./utils/index";
|
|
15
16
|
import * as verifyCode from "./utils/verify-code";
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
17
|
+
import { default as default13 } from "./utils/aes";
|
|
18
|
+
import { default as default14 } from "./utils/hmacSHA512";
|
|
19
|
+
import { default as default15 } from "./utils/hmacsm3";
|
|
20
|
+
import { default as default16 } from "./hooks/useCaptcha";
|
|
21
|
+
import { default as default17 } from "./hooks/useChangePwd";
|
|
22
|
+
import { default as default18 } from "./hooks/useConfig";
|
|
23
|
+
import { default as default19 } from "./hooks/useRemember";
|
|
24
|
+
import { default as default20 } from "./hooks/useRowSelection";
|
|
23
25
|
export {
|
|
24
|
-
|
|
26
|
+
default13 as AES,
|
|
25
27
|
default7 as AuthButton,
|
|
26
28
|
default2 as BackHeader,
|
|
27
29
|
default8 as CoralButton,
|
|
28
30
|
default3 as CreateForm,
|
|
31
|
+
default11 as CustomPagination,
|
|
29
32
|
default6 as EditTable,
|
|
30
33
|
formRules as FormRules,
|
|
31
|
-
|
|
34
|
+
default14 as HmacSHA512,
|
|
35
|
+
default15 as HmacSM3,
|
|
32
36
|
default9 as LoopSlide,
|
|
33
37
|
default4 as SearchTable,
|
|
34
38
|
default5 as UploadFile,
|
|
35
39
|
WorkFlowNode,
|
|
36
|
-
|
|
40
|
+
default12 as compressionImage,
|
|
37
41
|
download,
|
|
38
42
|
filetype as fileType,
|
|
39
43
|
default10 as showWorkFlow,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
default16 as useCaptcha,
|
|
45
|
+
default17 as useChangePwd,
|
|
46
|
+
default18 as useConfig,
|
|
47
|
+
default19 as useRemember,
|
|
48
|
+
default20 as useRowSelection,
|
|
45
49
|
index as utils,
|
|
46
50
|
verifyCode as verfyCode
|
|
47
51
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { sm3 } from "sm-crypto";
|
|
8
|
+
class HmacSM3 {
|
|
9
|
+
constructor(secretKey) {
|
|
10
|
+
__publicField(this, "secretKey");
|
|
11
|
+
this.secretKey = secretKey;
|
|
12
|
+
}
|
|
13
|
+
encrypt(message) {
|
|
14
|
+
const params = this.secretKey ? { key: this.secretKey } : void 0;
|
|
15
|
+
return sm3(message, params);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
HmacSM3 as default
|
|
20
|
+
};
|
|
@@ -7,10 +7,12 @@ const classNames = require("classnames");
|
|
|
7
7
|
const main = "backheader-module_main_cac53";
|
|
8
8
|
const title = "backheader-module_title_33439";
|
|
9
9
|
const sub = "backheader-module_sub_1d015";
|
|
10
|
+
const btn = "backheader-module_btn_ee841";
|
|
10
11
|
const styles = {
|
|
11
12
|
main,
|
|
12
13
|
title,
|
|
13
|
-
sub
|
|
14
|
+
sub,
|
|
15
|
+
btn
|
|
14
16
|
};
|
|
15
17
|
const { Title, Text } = antd.Typography;
|
|
16
18
|
const BackHeader = (props) => {
|
|
@@ -27,7 +29,7 @@ const BackHeader = (props) => {
|
|
|
27
29
|
};
|
|
28
30
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames(styles.main, className), style, children: [
|
|
29
31
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
30
|
-
isBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
isBack && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: goBack, className: styles.btn, children: icon || /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, { style: { fontSize: 24 } }) }),
|
|
31
33
|
/* @__PURE__ */ jsxRuntime.jsxs(Title, { level, className: styles.title, style: titleStyle, children: [
|
|
32
34
|
title2,
|
|
33
35
|
renderSubtitle()
|