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.
Files changed (36) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/szld-components.es.js +17611 -15896
  3. package/dist/szld-components.umd.js +59 -56
  4. package/es/components/BackHeader/index.css +6 -0
  5. package/es/components/BackHeader/index.js +5 -3
  6. package/es/components/CreateForm/index.d.ts +2 -2
  7. package/es/components/CustomPagination/index.css +9 -0
  8. package/es/components/CustomPagination/index.d.ts +15 -0
  9. package/es/components/CustomPagination/index.js +69 -0
  10. package/es/components/CustomPagination/vite.svg +1 -0
  11. package/es/components/SearchTable/index.d.ts +3 -1
  12. package/es/components/SearchTable/index.js +3 -1
  13. package/es/components/VirtualTable/index.js +1 -1
  14. package/es/hooks/useChangePwd.js +9 -1
  15. package/es/index.js +192 -50
  16. package/es/main.d.ts +5 -3
  17. package/es/main.js +20 -16
  18. package/es/utils/hmacsm3.d.ts +7 -0
  19. package/es/utils/hmacsm3.js +20 -0
  20. package/lib/components/BackHeader/index.css +6 -0
  21. package/lib/components/BackHeader/index.js +4 -2
  22. package/lib/components/CreateForm/index.d.ts +2 -2
  23. package/lib/components/CustomPagination/index.css +9 -0
  24. package/lib/components/CustomPagination/index.d.ts +15 -0
  25. package/lib/components/CustomPagination/index.js +68 -0
  26. package/lib/components/CustomPagination/vite.svg +1 -0
  27. package/lib/components/SearchTable/index.d.ts +3 -1
  28. package/lib/components/SearchTable/index.js +2 -0
  29. package/lib/components/VirtualTable/index.js +1 -1
  30. package/lib/hooks/useChangePwd.js +9 -1
  31. package/lib/index.js +190 -48
  32. package/lib/main.d.ts +5 -3
  33. package/lib/main.js +8 -4
  34. package/lib/utils/hmacsm3.d.ts +7 -0
  35. package/lib/utils/hmacsm3.js +19 -0
  36. package/package.json +5 -3
@@ -1,4 +1,4 @@
1
- import { FormProps, FormItemProps, ColProps, RowProps, InputProps, SelectProps, InputNumberProps, RadioGroupProps, SwitchProps, TimePickerProps, ButtonProps, CascaderProps, RateProps } from "antd";
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" ? CascaderProps<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;
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,9 @@
1
+ .custom-pagination-module_customPagination_bb6f7 {
2
+ display: flex;
3
+ justify-content: flex-end;
4
+ align-items: center;
5
+ margin: 16px 0;
6
+ }
7
+ .custom-pagination-module_customPagination_bb6f7 .custom-pagination-module_jumpBtns_a6c0b {
8
+ margin-left: 8px;
9
+ }
@@ -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,68 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const antd = require("antd");
4
+ const react = require("react");
5
+ const customPagination = "custom-pagination-module_customPagination_bb6f7";
6
+ const jumpBtns = "custom-pagination-module_jumpBtns_a6c0b";
7
+ const styles = {
8
+ customPagination,
9
+ jumpBtns
10
+ };
11
+ function CustomPagination(props) {
12
+ const { totalText = "共", unitText = "条", jumpText = "跳至", pageText = "页", paginationProps } = props;
13
+ const [inputValue, setInputValue] = react.useState("");
14
+ const pageSize = (paginationProps == null ? void 0 : paginationProps.pageSize) || 10;
15
+ const handleChange = (e) => {
16
+ setInputValue(e.target.value);
17
+ };
18
+ const handleBlur = (e) => {
19
+ var _a;
20
+ setInputValue("");
21
+ if (Number.isNaN(Number(e.target.value))) {
22
+ return;
23
+ }
24
+ (_a = paginationProps == null ? void 0 : paginationProps.onChange) == null ? void 0 : _a.call(paginationProps, Number(e.target.value), pageSize);
25
+ };
26
+ const handleKeyDown = (e) => {
27
+ var _a;
28
+ if (e.key === "Enter") {
29
+ setInputValue("");
30
+ if (Number.isNaN(Number(inputValue))) {
31
+ return;
32
+ }
33
+ (_a = paginationProps == null ? void 0 : paginationProps.onChange) == null ? void 0 : _a.call(paginationProps, Number(inputValue), pageSize);
34
+ }
35
+ };
36
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.customPagination, children: [
37
+ /* @__PURE__ */ jsxRuntime.jsx(
38
+ antd.Pagination,
39
+ {
40
+ showTotal: (total) => `${totalText} ${total} ${unitText}`,
41
+ showSizeChanger: {
42
+ options: [
43
+ { label: `10 ${unitText}/${pageText}`, value: 10 },
44
+ { label: `20 ${unitText}/${pageText}`, value: 20 },
45
+ { label: `50 ${unitText}/${pageText}`, value: 50 },
46
+ { label: `100 ${unitText}/${pageText}`, value: 100 }
47
+ ]
48
+ },
49
+ ...paginationProps
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.jumpBtns, children: [
53
+ jumpText,
54
+ /* @__PURE__ */ jsxRuntime.jsx(
55
+ antd.Input,
56
+ {
57
+ style: { width: "50px", margin: "0 8px" },
58
+ value: inputValue,
59
+ onChange: handleChange,
60
+ onBlur: (e) => handleBlur(e),
61
+ onKeyDown: (e) => handleKeyDown(e)
62
+ }
63
+ ),
64
+ pageText
65
+ ] })
66
+ ] });
67
+ }
68
+ module.exports = CustomPagination;
@@ -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 | string;
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;
@@ -26,6 +26,7 @@ function SearchTable(props) {
26
26
  resizeable = false,
27
27
  tableId,
28
28
  storageKey = "szld_table_cell_width",
29
+ emptyText,
29
30
  ...rest
30
31
  } = tableProps;
31
32
  const [columns, setColumns] = react.useState(tableProps.columns || []);
@@ -121,6 +122,7 @@ function SearchTable(props) {
121
122
  components,
122
123
  columns,
123
124
  className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
125
+ locale: { emptyText: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { image: antd.Empty.PRESENTED_IMAGE_SIMPLE, description: emptyText }) },
124
126
  pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
125
127
  showPrevNextJumpers: true,
126
128
  showQuickJumper: true,
@@ -69,7 +69,7 @@ function VirtualTable(props) {
69
69
  columnCount: mergedColumns.length,
70
70
  columnWidth: (index) => {
71
71
  const { width } = mergedColumns[index];
72
- return totalHeight > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
72
+ return `${totalHeight}` > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
73
73
  },
74
74
  height: scroll.y,
75
75
  rowCount: rawData.length,
@@ -39,6 +39,13 @@ function useChangePwd(props) {
39
39
  }
40
40
  ];
41
41
  const handleChangePwd = ahooks.useLockFn(async (func, title) => {
42
+ const modalProps = props == null ? void 0 : props.modalProps;
43
+ let width = void 0;
44
+ if (modalProps == null ? void 0 : modalProps.width) {
45
+ if (typeof modalProps.width === "string" || typeof modalProps.width === "number") {
46
+ width = modalProps.width;
47
+ }
48
+ }
42
49
  await modal.confirm({
43
50
  title: title || "修改密码",
44
51
  icon: null,
@@ -57,7 +64,8 @@ function useChangePwd(props) {
57
64
  });
58
65
  });
59
66
  },
60
- ...props == null ? void 0 : props.modalProps
67
+ ...modalProps,
68
+ width
61
69
  });
62
70
  });
63
71
  return { handleChangePwd };
package/lib/index.js CHANGED
@@ -9,6 +9,7 @@ const main = require("./main");
9
9
  let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
10
10
  const Demo = () => {
11
11
  useConfig(key);
12
+ const [form] = antd.Form.useForm();
12
13
  react.useEffect(() => {
13
14
  }, []);
14
15
  const columns = [
@@ -41,53 +42,190 @@ const Demo = () => {
41
42
  react.useEffect(() => {
42
43
  setSelectedKeys([1, 12, 21]);
43
44
  }, []);
44
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh" }, children: [
45
- /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "新增系统", isBack: true }),
46
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setList(columns), children: "test" }),
47
- /* @__PURE__ */ jsxRuntime.jsx(
48
- "div",
49
- {
50
- style: {
51
- height: "400px",
52
- border: "1px solid #333",
53
- margin: "20px"
45
+ const { handleChangePwd } = main.useChangePwd();
46
+ const typeList = [
47
+ {
48
+ flinfo: "数据",
49
+ children: [
50
+ {
51
+ flinfo: "数据1"
52
+ },
53
+ {
54
+ flinfo: "数据2"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ flinfo: "表",
60
+ children: [
61
+ {
62
+ flinfo: "表1"
63
+ },
64
+ {
65
+ flinfo: "表2"
66
+ }
67
+ ]
68
+ }
69
+ ];
70
+ const formItems = [
71
+ {
72
+ dataIndex: "asctypeid",
73
+ title: "编号",
74
+ valueType: "inputNumber",
75
+ valueProps: {
76
+ placeholder: "请输入编号",
77
+ controls: false,
78
+ min: 0
79
+ },
80
+ formItemProps: {
81
+ rules: [
82
+ {
83
+ required: true,
84
+ message: "请输入编号"
85
+ }
86
+ ]
87
+ },
88
+ colProps: { span: 11 }
89
+ },
90
+ {
91
+ dataIndex: "asctype",
92
+ title: "归类名",
93
+ valueProps: {
94
+ placeholder: "请输入归类名",
95
+ maxLength: 100,
96
+ allowClear: true
97
+ },
98
+ colProps: { span: 11, offset: 2 },
99
+ formItemProps: {
100
+ rules: [
101
+ {
102
+ required: true,
103
+ message: "请输入归类名"
104
+ },
105
+ { whitespace: true, message: "输入内容不能只有空格" }
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ dataIndex: "tabsortList",
111
+ title: "分类",
112
+ valueType: "cascader",
113
+ valueProps: {
114
+ placeholder: "请选择分类",
115
+ options: typeList,
116
+ changeOnSelect: true,
117
+ fieldNames: {
118
+ label: "flinfo",
119
+ value: "flinfo",
120
+ children: "children"
54
121
  }
122
+ },
123
+ colProps: {
124
+ span: 11
55
125
  }
56
- ),
57
- /* @__PURE__ */ jsxRuntime.jsx(
58
- main.SearchTable,
59
- {
60
- tableProps: {
61
- columns: [
62
- {
63
- dataIndex: "id",
64
- title: "ID"
65
- },
66
- {
67
- dataIndex: "a",
68
- title: "a",
69
- width: 200
70
- },
71
- {
72
- dataIndex: "a2",
73
- title: "a",
74
- width: 200
75
- },
76
- {
77
- dataIndex: "a3",
78
- title: "a",
79
- width: 200
80
- },
81
- {
82
- dataIndex: "a4",
83
- title: "a",
84
- width: 400
126
+ }
127
+ ];
128
+ const totalText = "共@";
129
+ const unitText = "条@";
130
+ const jumpText = "跳至@";
131
+ const pageText = "页@";
132
+ const sha = new main.HmacSM3("123");
133
+ sha.encrypt("abc");
134
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
135
+ /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
136
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 20, align: "center", children: [
137
+ "1. 测试修改密码hooks",
138
+ /* @__PURE__ */ jsxRuntime.jsx(
139
+ antd.Button,
140
+ {
141
+ onClick: () => handleChangePwd((params) => {
142
+ }),
143
+ children: "修改密码"
144
+ }
145
+ )
146
+ ] }),
147
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
148
+ "2. 测试循环滚动组件",
149
+ /* @__PURE__ */ jsxRuntime.jsx(
150
+ "div",
151
+ {
152
+ style: {
153
+ height: "400px",
154
+ border: "1px solid #333",
155
+ margin: "20px"
156
+ }
157
+ }
158
+ )
159
+ ] }),
160
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
161
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 20, align: "center", style: { marginBottom: 10 }, children: [
162
+ "3. 测试表格组件",
163
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setList(columns), children: "test" })
164
+ ] }),
165
+ /* @__PURE__ */ jsxRuntime.jsx(
166
+ main.SearchTable,
167
+ {
168
+ tableProps: {
169
+ columns: [
170
+ {
171
+ dataIndex: "id",
172
+ title: "ID"
173
+ },
174
+ {
175
+ dataIndex: "a",
176
+ title: "a",
177
+ width: 200
178
+ },
179
+ {
180
+ dataIndex: "a2",
181
+ title: "a",
182
+ width: 200
183
+ },
184
+ {
185
+ dataIndex: "a3",
186
+ title: "a",
187
+ width: 200
188
+ },
189
+ {
190
+ dataIndex: "a4",
191
+ title: "a",
192
+ width: 400
193
+ }
194
+ ],
195
+ dataSource: list,
196
+ resizeable: true,
197
+ rowKey: "id",
198
+ pagination: {
199
+ total: 25,
200
+ current,
201
+ pageSize: 10,
202
+ onChange(page, pageSize) {
203
+ const index = (page - 1) * 10;
204
+ const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
205
+ setList(arr);
206
+ setCurrent(page);
207
+ }
85
208
  }
86
- ],
87
- dataSource: list,
88
- resizeable: true,
89
- rowKey: "id",
90
- pagination: {
209
+ }
210
+ }
211
+ )
212
+ ] }),
213
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
214
+ "4. 测试创建表单组件",
215
+ /* @__PURE__ */ jsxRuntime.jsx(
216
+ main.CreateForm,
217
+ {
218
+ items: formItems,
219
+ formProps: { form, wrapperCol: { span: 24 }, style: { width: "60%", marginTop: 10 } }
220
+ }
221
+ )
222
+ ] }),
223
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
224
+ "5. 测试自定义分页组件",
225
+ /* @__PURE__ */ jsxRuntime.jsx(
226
+ main.CustomPagination,
227
+ {
228
+ paginationProps: {
91
229
  total: 25,
92
230
  current,
93
231
  pageSize: 10,
@@ -97,12 +235,16 @@ const Demo = () => {
97
235
  setList(arr);
98
236
  setCurrent(page);
99
237
  }
100
- }
238
+ },
239
+ totalText,
240
+ unitText,
241
+ jumpText,
242
+ pageText
101
243
  }
102
- }
103
- )
244
+ )
245
+ ] })
104
246
  ] });
105
247
  };
106
248
  ReactDOM.createRoot(document.getElementById("root")).render(
107
- /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.BrowserRouter, { children: /* @__PURE__ */ jsxRuntime.jsx(Demo, {}) })
249
+ /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.BrowserRouter, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.App, { children: /* @__PURE__ */ jsxRuntime.jsx(Demo, {}) }) })
108
250
  );
package/lib/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
- import AES from './utils/aes';
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/lib/main.js CHANGED
@@ -9,19 +9,21 @@ const AuthButton = require("./components/AuthButton");
9
9
  const CoralButton = require("./components/CoralButton");
10
10
  const LoopSlide = require("./components/LoopSlide");
11
11
  const WorkFlowNode = require("./components/WorkFlowNode");
12
+ const CustomPagination = require("./components/CustomPagination");
12
13
  const download = require("./utils/download");
13
14
  const filetype = require("./utils/filetype");
14
15
  const formRules = require("./utils/formRules");
15
16
  const imageCompression = require("./utils/image-compression");
16
17
  const index = require("./utils/index");
17
18
  const verifyCode = require("./utils/verify-code");
19
+ const aes = require("./utils/aes");
20
+ const hmacSHA512 = require("./utils/hmacSHA512");
21
+ const hmacsm3 = require("./utils/hmacsm3");
18
22
  const useCaptcha = require("./hooks/useCaptcha");
19
23
  const useChangePwd = require("./hooks/useChangePwd");
20
24
  const useConfig = require("./hooks/useConfig");
21
25
  const useRemember = require("./hooks/useRemember");
22
26
  const useRowSelection = require("./hooks/useRowSelection");
23
- const aes = require("./utils/aes");
24
- const hmacSHA512 = require("./utils/hmacSHA512");
25
27
  function _interopNamespaceDefault(e) {
26
28
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
27
29
  if (e) {
@@ -56,16 +58,18 @@ Object.defineProperty(exports, "WorkFlowNode", {
56
58
  get: () => WorkFlowNode.WorkFlowNode
57
59
  });
58
60
  exports.showWorkFlow = WorkFlowNode;
61
+ exports.CustomPagination = CustomPagination;
59
62
  exports.download = download__namespace;
60
63
  exports.fileType = filetype__namespace;
61
64
  exports.FormRules = formRules__namespace;
62
65
  exports.compressionImage = imageCompression;
63
66
  exports.utils = index__namespace;
64
67
  exports.verfyCode = verifyCode__namespace;
68
+ exports.AES = aes;
69
+ exports.HmacSHA512 = hmacSHA512;
70
+ exports.HmacSM3 = hmacsm3;
65
71
  exports.useCaptcha = useCaptcha;
66
72
  exports.useChangePwd = useChangePwd;
67
73
  exports.useConfig = useConfig;
68
74
  exports.useRemember = useRemember;
69
75
  exports.useRowSelection = useRowSelection;
70
- exports.AES = aes;
71
- exports.HmacSHA512 = hmacSHA512;
@@ -0,0 +1,7 @@
1
+ declare class HmacSM3 {
2
+ /** 密钥 */
3
+ secretKey?: string;
4
+ constructor(secretKey?: string);
5
+ encrypt(message: string): string;
6
+ }
7
+ export default HmacSM3;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => {
5
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ return value;
7
+ };
8
+ const smCrypto = require("sm-crypto");
9
+ class HmacSM3 {
10
+ constructor(secretKey) {
11
+ __publicField(this, "secretKey");
12
+ this.secretKey = secretKey;
13
+ }
14
+ encrypt(message) {
15
+ const params = this.secretKey ? { key: this.secretKey } : void 0;
16
+ return smCrypto.sm3(message, params);
17
+ }
18
+ }
19
+ module.exports = HmacSM3;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.47",
4
+ "version": "0.2.49",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "ahooks": "^3.7.4",
13
- "antd": "^5.15.1",
13
+ "antd": "^5.27.4",
14
14
  "crypto-js": "^4.2.0",
15
15
  "lodash": "^4.17.21",
16
16
  "pako": "^2.1.0",
@@ -18,7 +18,8 @@
18
18
  "react-dom": "^18.2.0",
19
19
  "react-resizable": "^3.0.5",
20
20
  "react-router-dom": "^6.6.1",
21
- "react-window": "^1.8.9"
21
+ "react-window": "^1.8.9",
22
+ "sm-crypto": "^0.3.13"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/crypto-js": "^4.2.1",
@@ -28,6 +29,7 @@
28
29
  "@types/react-dom": "^18.2.18",
29
30
  "@types/react-resizable": "^3.0.8",
30
31
  "@types/react-window": "^1.8.5",
32
+ "@types/sm-crypto": "^0.3.4",
31
33
  "@vitejs/plugin-react": "^3.0.0",
32
34
  "less": "^4.1.3",
33
35
  "rimraf": "^4.1.2",