@sunggang/ui-lib 0.1.63 → 0.1.64
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/index.esm.js
CHANGED
|
@@ -19,6 +19,7 @@ import format$1 from 'date-fns/format/index.js';
|
|
|
19
19
|
import '@tanstack/react-table';
|
|
20
20
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
21
21
|
import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
22
|
+
import crypto$1 from 'crypto';
|
|
22
23
|
|
|
23
24
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
24
25
|
function getDefaultExportFromCjs(x) {
|
|
@@ -2205,8 +2206,8 @@ var isArguments$1 = isArguments;
|
|
|
2205
2206
|
/** Detect free variable `exports`. */ var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
2206
2207
|
/** Detect free variable `module`. */ var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
2207
2208
|
/** Detect the popular CommonJS extension `module.exports`. */ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
2208
|
-
/** Built-in value references. */ var Buffer$
|
|
2209
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer$
|
|
2209
|
+
/** Built-in value references. */ var Buffer$2 = moduleExports$2 ? root$1.Buffer : undefined;
|
|
2210
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : undefined;
|
|
2210
2211
|
/**
|
|
2211
2212
|
* Checks if `value` is a buffer.
|
|
2212
2213
|
*
|
|
@@ -2988,7 +2989,7 @@ Stack.prototype.set = stackSet;
|
|
|
2988
2989
|
/** Detect free variable `exports`. */ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
2989
2990
|
/** Detect free variable `module`. */ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
2990
2991
|
/** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2991
|
-
/** Built-in value references. */ var Buffer = moduleExports ? root$1.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
2992
|
+
/** Built-in value references. */ var Buffer$1 = moduleExports ? root$1.Buffer : undefined, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : undefined;
|
|
2992
2993
|
/**
|
|
2993
2994
|
* Creates a clone of `buffer`.
|
|
2994
2995
|
*
|
|
@@ -71854,4 +71855,27 @@ var verifyTaxId = function(idStr) {
|
|
|
71854
71855
|
return isLegal;
|
|
71855
71856
|
};
|
|
71856
71857
|
|
|
71857
|
-
|
|
71858
|
+
var decryptByEcPay = function(data, hashKey, hashIV) {
|
|
71859
|
+
var decipher = crypto$1.createDecipheriv("aes-128-cbc", Buffer.from(hashKey), Buffer.from(hashIV));
|
|
71860
|
+
decipher.setAutoPadding(true); // 使用 PKCS7 填充模式
|
|
71861
|
+
var decrypted = decipher.update(data, "base64", "utf8");
|
|
71862
|
+
decrypted += decipher.final("utf8");
|
|
71863
|
+
// 步驟 3: 解析解密後的資料
|
|
71864
|
+
var decodedData = decodeURIComponent(decrypted);
|
|
71865
|
+
var decoded = JSON.parse(decodedData);
|
|
71866
|
+
return decoded;
|
|
71867
|
+
};
|
|
71868
|
+
var encryptByEcPay = function(data, hashKey, hashIV) {
|
|
71869
|
+
// 步驟 1: 轉換資料為 JSON 字串
|
|
71870
|
+
var jsonData = JSON.stringify(data);
|
|
71871
|
+
// 步驟 2: URLEncode 編碼
|
|
71872
|
+
var urlEncodedData = window.encodeURIComponent(jsonData);
|
|
71873
|
+
// 步驟 3: AES 加密
|
|
71874
|
+
var cipher = crypto$1.createCipheriv("aes-128-cbc", Buffer.from(hashKey), Buffer.from(hashIV));
|
|
71875
|
+
cipher.setAutoPadding(true); // 使用 PKCS7 填充模式
|
|
71876
|
+
var encrypted = cipher.update(urlEncodedData, "utf8", "base64");
|
|
71877
|
+
encrypted += cipher.final("base64");
|
|
71878
|
+
return encrypted;
|
|
71879
|
+
};
|
|
71880
|
+
|
|
71881
|
+
export { CkEditor, CustomUpload, DateRangePicker, DropImage, ReactDateRange, Regex, Spin, Switch, UiLibrary, decryptByEcPay, encryptByEcPay, verifyId, verifyTaxId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sunggang/ui-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@iconify/react": "^4.1.1",
|
|
6
6
|
"@mdx-js/react": "^3.0.1",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"@radix-ui/react-popover": "^1.0.7",
|
|
11
11
|
"@radix-ui/react-slot": "^1.0.2",
|
|
12
12
|
"@radix-ui/react-switch": "^1.0.3",
|
|
13
|
-
"@storybook/addon-docs": "^8.1.10",
|
|
14
13
|
"@tanstack/react-table": "^8.16.0",
|
|
15
14
|
"class-variance-authority": "^0.7.0",
|
|
16
15
|
"clsx": "^2.1.0",
|