szld-libs 0.2.48 → 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/szld-components.es.js +17862 -16167
- package/dist/szld-components.umd.js +57 -57
- package/es/index.js +3 -1
- package/es/main.d.ts +4 -3
- package/es/main.js +16 -14
- package/es/utils/hmacsm3.d.ts +7 -0
- package/es/utils/hmacsm3.js +20 -0
- package/lib/index.js +2 -0
- package/lib/main.d.ts +4 -3
- package/lib/main.js +6 -4
- package/lib/utils/hmacsm3.d.ts +7 -0
- package/lib/utils/hmacsm3.js +19 -0
- package/package.json +4 -2
package/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import ReactDOM from "react-dom/client";
|
|
|
4
4
|
import { BrowserRouter } from "react-router-dom";
|
|
5
5
|
import { App, Form, Table, Flex, Button } from "antd";
|
|
6
6
|
import useConfig from "./hooks/useConfig";
|
|
7
|
-
import { useRowSelection, useChangePwd, BackHeader, SearchTable, CreateForm, CustomPagination } 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);
|
|
@@ -128,6 +128,8 @@ const Demo = () => {
|
|
|
128
128
|
const unitText = "条@";
|
|
129
129
|
const jumpText = "跳至@";
|
|
130
130
|
const pageText = "页@";
|
|
131
|
+
const sha = new HmacSM3("123");
|
|
132
|
+
sha.encrypt("abc");
|
|
131
133
|
return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
132
134
|
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
133
135
|
/* @__PURE__ */ jsxs(Flex, { gap: 20, align: "center", children: [
|
package/es/main.d.ts
CHANGED
|
@@ -14,11 +14,12 @@ import * as FormRules from './utils/formRules';
|
|
|
14
14
|
import compressionImage from './utils/image-compression';
|
|
15
15
|
import * as utils from './utils/index';
|
|
16
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';
|
|
17
20
|
import useCaptcha from './hooks/useCaptcha';
|
|
18
21
|
import useChangePwd from './hooks/useChangePwd';
|
|
19
22
|
import useConfig from './hooks/useConfig';
|
|
20
23
|
import useRemember from './hooks/useRemember';
|
|
21
24
|
import useRowSelection from './hooks/useRowSelection';
|
|
22
|
-
|
|
23
|
-
import HmacSHA512 from './utils/hmacSHA512';
|
|
24
|
-
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, download, EditTable, fileType, FormRules, HmacSHA512, LoopSlide, SearchTable, showWorkFlow, UploadFile, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode, WorkFlowNode, CustomPagination, };
|
|
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
|
@@ -14,15 +14,16 @@ import * as formRules from "./utils/formRules";
|
|
|
14
14
|
import { default as default12 } from "./utils/image-compression";
|
|
15
15
|
import * as index from "./utils/index";
|
|
16
16
|
import * as verifyCode from "./utils/verify-code";
|
|
17
|
-
import { default as default13 } from "./
|
|
18
|
-
import { default as default14 } from "./
|
|
19
|
-
import { default as default15 } from "./
|
|
20
|
-
import { default as default16 } from "./hooks/
|
|
21
|
-
import { default as default17 } from "./hooks/
|
|
22
|
-
import { default as default18 } from "./
|
|
23
|
-
import { default as default19 } from "./
|
|
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";
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
default13 as AES,
|
|
26
27
|
default7 as AuthButton,
|
|
27
28
|
default2 as BackHeader,
|
|
28
29
|
default8 as CoralButton,
|
|
@@ -30,7 +31,8 @@ export {
|
|
|
30
31
|
default11 as CustomPagination,
|
|
31
32
|
default6 as EditTable,
|
|
32
33
|
formRules as FormRules,
|
|
33
|
-
|
|
34
|
+
default14 as HmacSHA512,
|
|
35
|
+
default15 as HmacSM3,
|
|
34
36
|
default9 as LoopSlide,
|
|
35
37
|
default4 as SearchTable,
|
|
36
38
|
default5 as UploadFile,
|
|
@@ -39,11 +41,11 @@ export {
|
|
|
39
41
|
download,
|
|
40
42
|
filetype as fileType,
|
|
41
43
|
default10 as showWorkFlow,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
default16 as useCaptcha,
|
|
45
|
+
default17 as useChangePwd,
|
|
46
|
+
default18 as useConfig,
|
|
47
|
+
default19 as useRemember,
|
|
48
|
+
default20 as useRowSelection,
|
|
47
49
|
index as utils,
|
|
48
50
|
verifyCode as verfyCode
|
|
49
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
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -129,6 +129,8 @@ const Demo = () => {
|
|
|
129
129
|
const unitText = "条@";
|
|
130
130
|
const jumpText = "跳至@";
|
|
131
131
|
const pageText = "页@";
|
|
132
|
+
const sha = new main.HmacSM3("123");
|
|
133
|
+
sha.encrypt("abc");
|
|
132
134
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
133
135
|
/* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
|
|
134
136
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 20, align: "center", children: [
|
package/lib/main.d.ts
CHANGED
|
@@ -14,11 +14,12 @@ import * as FormRules from './utils/formRules';
|
|
|
14
14
|
import compressionImage from './utils/image-compression';
|
|
15
15
|
import * as utils from './utils/index';
|
|
16
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';
|
|
17
20
|
import useCaptcha from './hooks/useCaptcha';
|
|
18
21
|
import useChangePwd from './hooks/useChangePwd';
|
|
19
22
|
import useConfig from './hooks/useConfig';
|
|
20
23
|
import useRemember from './hooks/useRemember';
|
|
21
24
|
import useRowSelection from './hooks/useRowSelection';
|
|
22
|
-
|
|
23
|
-
import HmacSHA512 from './utils/hmacSHA512';
|
|
24
|
-
export { AES, AuthButton, BackHeader, compressionImage, CoralButton, CreateForm, download, EditTable, fileType, FormRules, HmacSHA512, LoopSlide, SearchTable, showWorkFlow, UploadFile, useCaptcha, useChangePwd, useConfig, useRemember, useRowSelection, utils, verfyCode, WorkFlowNode, CustomPagination, };
|
|
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
|
@@ -16,13 +16,14 @@ const formRules = require("./utils/formRules");
|
|
|
16
16
|
const imageCompression = require("./utils/image-compression");
|
|
17
17
|
const index = require("./utils/index");
|
|
18
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");
|
|
19
22
|
const useCaptcha = require("./hooks/useCaptcha");
|
|
20
23
|
const useChangePwd = require("./hooks/useChangePwd");
|
|
21
24
|
const useConfig = require("./hooks/useConfig");
|
|
22
25
|
const useRemember = require("./hooks/useRemember");
|
|
23
26
|
const useRowSelection = require("./hooks/useRowSelection");
|
|
24
|
-
const aes = require("./utils/aes");
|
|
25
|
-
const hmacSHA512 = require("./utils/hmacSHA512");
|
|
26
27
|
function _interopNamespaceDefault(e) {
|
|
27
28
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
28
29
|
if (e) {
|
|
@@ -64,10 +65,11 @@ exports.FormRules = formRules__namespace;
|
|
|
64
65
|
exports.compressionImage = imageCompression;
|
|
65
66
|
exports.utils = index__namespace;
|
|
66
67
|
exports.verfyCode = verifyCode__namespace;
|
|
68
|
+
exports.AES = aes;
|
|
69
|
+
exports.HmacSHA512 = hmacSHA512;
|
|
70
|
+
exports.HmacSM3 = hmacsm3;
|
|
67
71
|
exports.useCaptcha = useCaptcha;
|
|
68
72
|
exports.useChangePwd = useChangePwd;
|
|
69
73
|
exports.useConfig = useConfig;
|
|
70
74
|
exports.useRemember = useRemember;
|
|
71
75
|
exports.useRowSelection = useRowSelection;
|
|
72
|
-
exports.AES = aes;
|
|
73
|
-
exports.HmacSHA512 = hmacSHA512;
|
|
@@ -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.
|
|
4
|
+
"version": "0.2.49",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -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",
|