@pnt-team/pnt-component-frontend 0.0.34

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 (78) hide show
  1. package/README.md +34 -0
  2. package/lib/cjs/api/index.d.ts +17 -0
  3. package/lib/cjs/api/index.js +45 -0
  4. package/lib/cjs/assets/css/tdesign-theme.css +584 -0
  5. package/lib/cjs/assets/images/uploadImg.png +0 -0
  6. package/lib/cjs/assets/svg/inputSearch.svg +4 -0
  7. package/lib/cjs/assets/svg/inputTip.svg +5 -0
  8. package/lib/cjs/assets/svg/inputWarnTip.svg +5 -0
  9. package/lib/cjs/components/PntCopyData/index.d.ts +91 -0
  10. package/lib/cjs/components/PntCopyData/index.js +81 -0
  11. package/lib/cjs/components/PntCopyData/index.scss +5 -0
  12. package/lib/cjs/components/PntImagePreview/index.d.ts +75 -0
  13. package/lib/cjs/components/PntImagePreview/index.js +91 -0
  14. package/lib/cjs/components/PntImagePreview/index.scss +54 -0
  15. package/lib/cjs/components/PntSecureBox/index.d.ts +69 -0
  16. package/lib/cjs/components/PntSecureBox/index.js +65 -0
  17. package/lib/cjs/components/PntSecureBox/index.scss +19 -0
  18. package/lib/cjs/configs/host.d.ts +12 -0
  19. package/lib/cjs/configs/host.js +39 -0
  20. package/lib/cjs/configs/token.d.ts +2 -0
  21. package/lib/cjs/configs/token.js +25 -0
  22. package/lib/cjs/global.d.ts +30 -0
  23. package/lib/cjs/hooks/useBtnPermission.d.ts +67 -0
  24. package/lib/cjs/hooks/useBtnPermission.js +57 -0
  25. package/lib/cjs/hooks/useHighSecurity.d.ts +6 -0
  26. package/lib/cjs/hooks/useHighSecurity.js +51 -0
  27. package/lib/cjs/hooks/useOsPlatformList.d.ts +68 -0
  28. package/lib/cjs/hooks/useOsPlatformList.js +104 -0
  29. package/lib/cjs/hooks/usePagination.d.ts +72 -0
  30. package/lib/cjs/hooks/usePagination.js +71 -0
  31. package/lib/cjs/index.d.ts +10 -0
  32. package/lib/cjs/index.js +57 -0
  33. package/lib/cjs/utils/const.d.ts +13 -0
  34. package/lib/cjs/utils/const.js +51 -0
  35. package/lib/cjs/utils/index.d.ts +6 -0
  36. package/lib/cjs/utils/index.js +43 -0
  37. package/lib/cjs/utils/request.d.ts +8 -0
  38. package/lib/cjs/utils/request.js +82 -0
  39. package/lib/esm/api/index.d.ts +17 -0
  40. package/lib/esm/api/index.js +11 -0
  41. package/lib/esm/assets/css/tdesign-theme.css +584 -0
  42. package/lib/esm/assets/images/uploadImg.png +0 -0
  43. package/lib/esm/assets/svg/inputSearch.svg +4 -0
  44. package/lib/esm/assets/svg/inputTip.svg +5 -0
  45. package/lib/esm/assets/svg/inputWarnTip.svg +5 -0
  46. package/lib/esm/components/PntCopyData/index.d.ts +91 -0
  47. package/lib/esm/components/PntCopyData/index.js +51 -0
  48. package/lib/esm/components/PntCopyData/index.scss +5 -0
  49. package/lib/esm/components/PntImagePreview/index.d.ts +75 -0
  50. package/lib/esm/components/PntImagePreview/index.js +61 -0
  51. package/lib/esm/components/PntImagePreview/index.scss +54 -0
  52. package/lib/esm/components/PntSecureBox/index.d.ts +69 -0
  53. package/lib/esm/components/PntSecureBox/index.js +35 -0
  54. package/lib/esm/components/PntSecureBox/index.scss +19 -0
  55. package/lib/esm/configs/host.d.ts +12 -0
  56. package/lib/esm/configs/host.js +19 -0
  57. package/lib/esm/configs/token.d.ts +2 -0
  58. package/lib/esm/configs/token.js +5 -0
  59. package/lib/esm/global.d.ts +30 -0
  60. package/lib/esm/hooks/useBtnPermission.d.ts +67 -0
  61. package/lib/esm/hooks/useBtnPermission.js +31 -0
  62. package/lib/esm/hooks/useHighSecurity.d.ts +6 -0
  63. package/lib/esm/hooks/useHighSecurity.js +27 -0
  64. package/lib/esm/hooks/useOsPlatformList.d.ts +68 -0
  65. package/lib/esm/hooks/useOsPlatformList.js +68 -0
  66. package/lib/esm/hooks/usePagination.d.ts +72 -0
  67. package/lib/esm/hooks/usePagination.js +47 -0
  68. package/lib/esm/index.d.ts +10 -0
  69. package/lib/esm/index.js +17 -0
  70. package/lib/esm/utils/const.d.ts +13 -0
  71. package/lib/esm/utils/const.js +26 -0
  72. package/lib/esm/utils/index.d.ts +6 -0
  73. package/lib/esm/utils/index.js +19 -0
  74. package/lib/esm/utils/request.d.ts +8 -0
  75. package/lib/esm/utils/request.js +52 -0
  76. package/lib/umd/pnt-component-frontend.min.css +1 -0
  77. package/lib/umd/pnt-component-frontend.min.js +1 -0
  78. package/package.json +94 -0
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/utils/index.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ isSecurityData: () => isSecurityData
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var isSecurityData = (val) => {
26
+ const str = String(val);
27
+ if (!str.includes("_high_security_:"))
28
+ return false;
29
+ const rsp = str.split(":");
30
+ const calcStr = rsp.slice(0, -1).join(":");
31
+ const calcNum = parseInt(rsp[rsp.length - 1], 10);
32
+ if (isNaN(calcNum))
33
+ return false;
34
+ let num = 0;
35
+ for (const item of calcStr) {
36
+ num += item.charCodeAt(0);
37
+ }
38
+ return num === calcNum;
39
+ };
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ isSecurityData
43
+ });
@@ -0,0 +1,8 @@
1
+ export interface commonEesType<T> {
2
+ code: number;
3
+ msg: string;
4
+ data: T;
5
+ ret?: number;
6
+ }
7
+ declare const http: import("axios").AxiosInstance;
8
+ export default http;
@@ -0,0 +1,82 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/utils/request.ts
30
+ var request_exports = {};
31
+ __export(request_exports, {
32
+ default: () => request_default
33
+ });
34
+ module.exports = __toCommonJS(request_exports);
35
+ var import_axios = __toESM(require("axios"));
36
+ var import_host = __toESM(require("../configs/host"));
37
+ var import_token = __toESM(require("../configs/token"));
38
+ var import_const = require("./const");
39
+ var env = process.env.MODE || "development";
40
+ var API_HOST = import_host.default[env].API;
41
+ var http = import_axios.default.create({
42
+ baseURL: API_HOST,
43
+ timeout: 100 * 1e3,
44
+ withCredentials: true
45
+ });
46
+ http.interceptors.request.use(
47
+ (config) => {
48
+ var _a;
49
+ const conf = { ...config };
50
+ const matchPath = Object.values(import_const.SUB_APP_PATHNAME).filter(
51
+ (path) => window.location.pathname.includes(path)
52
+ )[0] || "";
53
+ if (process.env.NODE_ENV === "development") {
54
+ conf.baseURL = matchPath ? "/subapi" : conf.baseURL;
55
+ conf.headers["X-Service-Type"] = ((_a = conf.headers) == null ? void 0 : _a["x-service-type"]) || "11";
56
+ conf.headers["X-User-Id"] = "us-104fe9b46fdf4534be663ec9eaa9ea2e";
57
+ conf.headers["X-User-Name"] = "v_bwweiwang";
58
+ conf.headers.authorization = import_token.default;
59
+ } else {
60
+ conf.baseURL = "/";
61
+ }
62
+ if (!conf.url.includes("audience=")) {
63
+ conf.url = `${conf.url}?audience=${matchPath ? import_const.AUDIENCE_MAPPING[matchPath] : "/player-network"}`;
64
+ }
65
+ return conf;
66
+ },
67
+ (err) => Promise.reject(err)
68
+ );
69
+ http.interceptors.response.use(
70
+ (response) => {
71
+ if (response.status === 200) {
72
+ const { data } = response;
73
+ if (data.code === 0) {
74
+ return Promise.resolve(data);
75
+ }
76
+ return Promise.resolve(data);
77
+ }
78
+ return Promise.reject(response == null ? void 0 : response.data);
79
+ },
80
+ (e) => Promise.reject(e)
81
+ );
82
+ var request_default = http;
@@ -0,0 +1,17 @@
1
+ import { commonEesType } from "../utils/request";
2
+ /**
3
+ * 高敏信息解密
4
+ * @returns
5
+ */
6
+ interface SecurityItem {
7
+ key: string;
8
+ value: string;
9
+ }
10
+ /**
11
+ * 对数据进行高安全解密处理
12
+ *
13
+ * @param data 需要解密的数据
14
+ * @returns 解密后的数据
15
+ */
16
+ export declare function highSecurity(data: any): Promise<commonEesType<SecurityItem[]>>;
17
+ export {};
@@ -0,0 +1,11 @@
1
+ // src/api/index.ts
2
+ import axios from "../utils/request";
3
+ function highSecurity(data) {
4
+ return axios.post(
5
+ "/api/v3/business/game_info/high-security-decrypt?audience=/laas-pnt",
6
+ data
7
+ );
8
+ }
9
+ export {
10
+ highSecurity
11
+ };