@pnt-team/pnt-component-frontend 0.0.35 → 0.0.36

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 (77) hide show
  1. package/README.md +71 -64
  2. package/package.json +8 -2
  3. package/lib/cjs/api/index.d.ts +0 -17
  4. package/lib/cjs/api/index.js +0 -45
  5. package/lib/cjs/assets/css/tdesign-theme.css +0 -584
  6. package/lib/cjs/assets/images/uploadImg.png +0 -0
  7. package/lib/cjs/assets/svg/inputSearch.svg +0 -4
  8. package/lib/cjs/assets/svg/inputTip.svg +0 -5
  9. package/lib/cjs/assets/svg/inputWarnTip.svg +0 -5
  10. package/lib/cjs/components/PntCopyData/index.d.ts +0 -91
  11. package/lib/cjs/components/PntCopyData/index.js +0 -81
  12. package/lib/cjs/components/PntCopyData/index.scss +0 -5
  13. package/lib/cjs/components/PntImagePreview/index.d.ts +0 -75
  14. package/lib/cjs/components/PntImagePreview/index.js +0 -91
  15. package/lib/cjs/components/PntImagePreview/index.scss +0 -54
  16. package/lib/cjs/components/PntSecureBox/index.d.ts +0 -69
  17. package/lib/cjs/components/PntSecureBox/index.js +0 -65
  18. package/lib/cjs/components/PntSecureBox/index.scss +0 -19
  19. package/lib/cjs/configs/host.d.ts +0 -12
  20. package/lib/cjs/configs/host.js +0 -39
  21. package/lib/cjs/configs/token.d.ts +0 -2
  22. package/lib/cjs/configs/token.js +0 -25
  23. package/lib/cjs/global.d.ts +0 -30
  24. package/lib/cjs/hooks/useBtnPermission.d.ts +0 -67
  25. package/lib/cjs/hooks/useBtnPermission.js +0 -57
  26. package/lib/cjs/hooks/useHighSecurity.d.ts +0 -6
  27. package/lib/cjs/hooks/useHighSecurity.js +0 -51
  28. package/lib/cjs/hooks/useOsPlatformList.d.ts +0 -68
  29. package/lib/cjs/hooks/useOsPlatformList.js +0 -104
  30. package/lib/cjs/hooks/usePagination.d.ts +0 -72
  31. package/lib/cjs/hooks/usePagination.js +0 -71
  32. package/lib/cjs/index.d.ts +0 -10
  33. package/lib/cjs/utils/const.d.ts +0 -13
  34. package/lib/cjs/utils/const.js +0 -51
  35. package/lib/cjs/utils/index.d.ts +0 -6
  36. package/lib/cjs/utils/index.js +0 -43
  37. package/lib/cjs/utils/request.d.ts +0 -8
  38. package/lib/cjs/utils/request.js +0 -82
  39. package/lib/esm/api/index.d.ts +0 -17
  40. package/lib/esm/api/index.js +0 -11
  41. package/lib/esm/assets/css/tdesign-theme.css +0 -584
  42. package/lib/esm/assets/images/uploadImg.png +0 -0
  43. package/lib/esm/assets/svg/inputSearch.svg +0 -4
  44. package/lib/esm/assets/svg/inputTip.svg +0 -5
  45. package/lib/esm/assets/svg/inputWarnTip.svg +0 -5
  46. package/lib/esm/components/PntCopyData/index.d.ts +0 -91
  47. package/lib/esm/components/PntCopyData/index.js +0 -51
  48. package/lib/esm/components/PntCopyData/index.scss +0 -5
  49. package/lib/esm/components/PntImagePreview/index.d.ts +0 -75
  50. package/lib/esm/components/PntImagePreview/index.js +0 -61
  51. package/lib/esm/components/PntImagePreview/index.scss +0 -54
  52. package/lib/esm/components/PntSecureBox/index.d.ts +0 -69
  53. package/lib/esm/components/PntSecureBox/index.js +0 -35
  54. package/lib/esm/components/PntSecureBox/index.scss +0 -19
  55. package/lib/esm/configs/host.d.ts +0 -12
  56. package/lib/esm/configs/host.js +0 -19
  57. package/lib/esm/configs/token.d.ts +0 -2
  58. package/lib/esm/configs/token.js +0 -5
  59. package/lib/esm/global.d.ts +0 -30
  60. package/lib/esm/hooks/useBtnPermission.d.ts +0 -67
  61. package/lib/esm/hooks/useBtnPermission.js +0 -31
  62. package/lib/esm/hooks/useHighSecurity.d.ts +0 -6
  63. package/lib/esm/hooks/useHighSecurity.js +0 -27
  64. package/lib/esm/hooks/useOsPlatformList.d.ts +0 -68
  65. package/lib/esm/hooks/useOsPlatformList.js +0 -68
  66. package/lib/esm/hooks/usePagination.d.ts +0 -72
  67. package/lib/esm/hooks/usePagination.js +0 -47
  68. package/lib/esm/index.d.ts +0 -10
  69. package/lib/esm/index.js +0 -17
  70. package/lib/esm/utils/const.d.ts +0 -13
  71. package/lib/esm/utils/const.js +0 -26
  72. package/lib/esm/utils/index.d.ts +0 -6
  73. package/lib/esm/utils/index.js +0 -19
  74. package/lib/esm/utils/request.d.ts +0 -8
  75. package/lib/esm/utils/request.js +0 -52
  76. package/lib/umd/pnt-component-frontend.min.css +0 -1
  77. package/lib/umd/pnt-component-frontend.min.js +0 -1
package/README.md CHANGED
@@ -12,11 +12,11 @@ yarn add @pnt-team/pnt-component-frontend
12
12
 
13
13
  ### 依赖要求(peerDependencies)
14
14
 
15
- | 依赖 | 版本要求 | 说明 |
16
- |------|---------|------|
17
- | `react` | `>=16.9.0` | React 核心框架 |
18
- | `react-dom` | `>=16.9.0` | React DOM 渲染 |
19
- | `tdesign-react` | `>=1.5.0` | UI 组件库(本组件库基于 TDesign 封装) |
15
+ | 依赖 | 版本要求 | 说明 |
16
+ | --------------- | ---------- | -------------------------------------- |
17
+ | `react` | `>=16.9.0` | React 核心框架 |
18
+ | `react-dom` | `>=16.9.0` | React DOM 渲染 |
19
+ | `tdesign-react` | `>=1.5.0` | UI 组件库(本组件库基于 TDesign 封装) |
20
20
 
21
21
  > ⚠️ 请确保项目中已安装以上依赖,否则组件可能无法正常运行。
22
22
 
@@ -46,13 +46,13 @@ import {
46
46
 
47
47
  **Props:**
48
48
 
49
- | 属性 | 类型 | 必填 | 说明 |
50
- |------|------|------|------|
51
- | `data` | `string \| (() => Promise<string>)` | ✅ | 需要复制的数据,支持字符串或异步函数 |
52
- | `tips` | `(isCopy: boolean, isFail: boolean) => ReactNode` | ✅ | 提示内容渲染函数 |
53
- | `contentFn` | `(props: { onClick, onMouseLeave }) => ReactNode` | ✅ | 触发元素渲染函数 |
54
- | `placement` | `PopupPlacement` | ❌ | Popup 弹出位置,默认由 TDesign 决定 |
55
- | `className` | `string` | ❌ | 自定义类名 |
49
+ | 属性 | 类型 | 必填 | 说明 |
50
+ | ----------- | ------------------------------------------------- | ---- | ------------------------------------ |
51
+ | `data` | `string \| (() => Promise<string>)` | ✅ | 需要复制的数据,支持字符串或异步函数 |
52
+ | `tips` | `(isCopy: boolean, isFail: boolean) => ReactNode` | ✅ | 提示内容渲染函数 |
53
+ | `contentFn` | `(props: { onClick, onMouseLeave }) => ReactNode` | ✅ | 触发元素渲染函数 |
54
+ | `placement` | `PopupPlacement` | ❌ | Popup 弹出位置,默认由 TDesign 决定 |
55
+ | `className` | `string` | ❌ | 自定义类名 |
56
56
 
57
57
  **示例:**
58
58
 
@@ -84,13 +84,13 @@ import {
84
84
 
85
85
  **Props:**
86
86
 
87
- | 属性 | 类型 | 必填 | 说明 |
88
- |------|------|------|------|
89
- | `iconUrl` | `string \| undefined` | ✅ | 图片 URL 地址 |
90
- | `loading` | `boolean` | ✅ | 上传加载状态 |
91
- | `defaultImg` | `string` | ❌ | 默认图片(不传则使用内置默认图) |
92
- | `params` | `{ style?: CSSProperties; [key: string]: any }` | ❌ | 自定义扩展参数 |
93
- | `onRemove` | `(e: any) => void` | ❌ | 删除回调函数 |
87
+ | 属性 | 类型 | 必填 | 说明 |
88
+ | ------------ | ----------------------------------------------- | ---- | -------------------------------- |
89
+ | `iconUrl` | `string \| undefined` | ✅ | 图片 URL 地址 |
90
+ | `loading` | `boolean` | ✅ | 上传加载状态 |
91
+ | `defaultImg` | `string` | ❌ | 默认图片(不传则使用内置默认图) |
92
+ | `params` | `{ style?: CSSProperties; [key: string]: any }` | ❌ | 自定义扩展参数 |
93
+ | `onRemove` | `(e: any) => void` | ❌ | 删除回调函数 |
94
94
 
95
95
  **示例:**
96
96
 
@@ -114,15 +114,15 @@ import {
114
114
 
115
115
  **Props:**
116
116
 
117
- | 属性 | 类型 | 必填 | 说明 |
118
- |------|------|------|------|
119
- | `dataKey` | `string` | ✅ | 高敏信息的唯一标识 key |
120
- | `dataValue` | `string` | ✅ | 初始显示值(通常为脱敏后的数据) |
121
- | `env` | `string \| number` | ✅ | 环境标识(如 dev / test / production) |
122
- | `gameId` | `string \| number` | ✅ | 游戏 ID |
123
- | `renderDom` | `(content: string) => React.ReactNode` | ✅ | 自定义渲染函数 |
124
- | `viewText` | `string` | ❌ | 查看按钮文案,默认 `'View'` |
125
- | `pageId` | `string` | ❌ | 页面 ID(用于操作日志和权限验证) |
117
+ | 属性 | 类型 | 必填 | 说明 |
118
+ | ----------- | -------------------------------------- | ---- | -------------------------------------- |
119
+ | `dataKey` | `string` | ✅ | 高敏信息的唯一标识 key |
120
+ | `dataValue` | `string` | ✅ | 初始显示值(通常为脱敏后的数据) |
121
+ | `env` | `string \| number` | ✅ | 环境标识(如 dev / test / production) |
122
+ | `gameId` | `string \| number` | ✅ | 游戏 ID |
123
+ | `renderDom` | `(content: string) => React.ReactNode` | ✅ | 自定义渲染函数 |
124
+ | `viewText` | `string` | ❌ | 查看按钮文案,默认 `'View'` |
125
+ | `pageId` | `string` | ❌ | 页面 ID(用于操作日志和权限验证) |
126
126
 
127
127
  **示例:**
128
128
 
@@ -147,17 +147,17 @@ import {
147
147
 
148
148
  **参数:**
149
149
 
150
- | 参数 | 类型 | 说明 |
151
- |------|------|------|
150
+ | 参数 | 类型 | 说明 |
151
+ | --------------------- | -------------------------------------------- | -------------------------------------- |
152
152
  | `onPaginationRequest` | `(params: { pageNumber, pageSize }) => void` | 分页变化时的回调,外部在此发起列表请求 |
153
153
 
154
154
  **返回值:**
155
155
 
156
- | 返回值 | 类型 | 说明 |
157
- |--------|------|------|
158
- | `paginationData` | `{ currentPage, totalCount, totalPage, pageSize }` | 当前分页数据 |
159
- | `setPaginationData` | `(data: PaginationData) => void` | 回写分页数据(通常由外部请求完成后调用) |
160
- | `paginationProps` | `PaginationProps \| undefined` | 可直接展开到 `<Pagination {...paginationProps} />` |
156
+ | 返回值 | 类型 | 说明 |
157
+ | ------------------- | -------------------------------------------------- | -------------------------------------------------- |
158
+ | `paginationData` | `{ currentPage, totalCount, totalPage, pageSize }` | 当前分页数据 |
159
+ | `setPaginationData` | `(data: PaginationData) => void` | 回写分页数据(通常由外部请求完成后调用) |
160
+ | `paginationProps` | `PaginationProps \| undefined` | 可直接展开到 `<Pagination {...paginationProps} />` |
161
161
 
162
162
  **示例:**
163
163
 
@@ -195,18 +195,18 @@ const Demo = () => {
195
195
 
196
196
  **参数:**
197
197
 
198
- | 参数 | 类型 | 说明 |
199
- |------|------|------|
200
- | `permissions` | `BtnPermissionMap` | 按钮权限映射 `{ [type]: { [key]: 1 \| -1 \| -2 } }` |
201
- | `demoGame` | `{ id: number \| string; name: string }` | 演示游戏信息 |
202
- | `serviceInfo` | `{ serviceType?, serviceName? }` | 当前服务信息 |
198
+ | 参数 | 类型 | 说明 |
199
+ | ------------- | ---------------------------------------- | --------------------------------------------------- |
200
+ | `permissions` | `BtnPermissionMap` | 按钮权限映射 `{ [type]: { [key]: 1 \| -1 \| -2 } }` |
201
+ | `demoGame` | `{ id: number \| string; name: string }` | 演示游戏信息 |
202
+ | `serviceInfo` | `{ serviceType?, serviceName? }` | 当前服务信息 |
203
203
 
204
204
  **返回值:**
205
205
 
206
- | 返回值 | 类型 | 说明 |
207
- |--------|------|------|
208
- | `btnPermission` | `BtnPermissionMap` | 权限映射原文 |
209
- | `isDemoGame` | `boolean` | 是否为演示游戏 |
206
+ | 返回值 | 类型 | 说明 |
207
+ | ------------------ | --------------------------------------------- | -------------------------------------------- |
208
+ | `btnPermission` | `BtnPermissionMap` | 权限映射原文 |
209
+ | `isDemoGame` | `boolean` | 是否为演示游戏 |
210
210
  | `getBtnPermission` | `(type, key, defaultValue?) => 1 \| -1 \| -2` | 获取按钮权限(1 有权限 / -1 隐藏 / -2 禁用) |
211
211
 
212
212
  **示例:**
@@ -216,12 +216,19 @@ const Demo = ({ btnPermission, userInfo }) => {
216
216
  const { isDemoGame, getBtnPermission } = useBtnPermission({
217
217
  permissions: btnPermission,
218
218
  demoGame: userInfo?.demoGame,
219
- serviceInfo: { serviceType: userInfo?.serviceType, serviceName: userInfo?.serviceName },
219
+ serviceInfo: {
220
+ serviceType: userInfo?.serviceType,
221
+ serviceName: userInfo?.serviceName,
222
+ },
220
223
  });
221
224
 
222
225
  const createPerm = getBtnPermission('global', 'create');
223
226
  if (createPerm === -1) return null; // 隐藏
224
- return <Button disabled={createPerm === -2}>新建{isDemoGame ? '(演示)' : ''}</Button>;
227
+ return (
228
+ <Button disabled={createPerm === -2}>
229
+ 新建{isDemoGame ? '(演示)' : ''}
230
+ </Button>
231
+ );
225
232
  };
226
233
  ```
227
234
 
@@ -233,11 +240,11 @@ const Demo = ({ btnPermission, userInfo }) => {
233
240
 
234
241
  **返回值:**
235
242
 
236
- | 返回值 | 类型 | 说明 |
237
- |--------|------|------|
238
- | `securityData` | `object` | 已解锁的高敏数据映射 `{ [key]: value }` |
239
- | `setSecurityData` | `(data: object) => void` | 手动设置已解锁数据 |
240
- | `requestSecurityData` | `({ gameId, param, env }) => void` | 请求解锁指定高敏数据 |
243
+ | 返回值 | 类型 | 说明 |
244
+ | --------------------- | ---------------------------------- | --------------------------------------- |
245
+ | `securityData` | `object` | 已解锁的高敏数据映射 `{ [key]: value }` |
246
+ | `setSecurityData` | `(data: object) => void` | 手动设置已解锁数据 |
247
+ | `requestSecurityData` | `({ gameId, param, env }) => void` | 请求解锁指定高敏数据 |
241
248
 
242
249
  ---
243
250
 
@@ -247,14 +254,14 @@ const Demo = ({ btnPermission, userInfo }) => {
247
254
 
248
255
  **参数:**
249
256
 
250
- | 参数 | 类型 | 说明 |
251
- |------|------|------|
257
+ | 参数 | 类型 | 说明 |
258
+ | --------- | ------------------------------------ | -------------------------------------------- |
252
259
  | `fetcher` | `() => Promise<{ code, msg, data }>` | 自定义请求函数(不传则使用内置默认 fetcher) |
253
260
 
254
261
  **返回值:**
255
262
 
256
- | 返回值 | 类型 | 说明 |
257
- |--------|------|------|
263
+ | 返回值 | 类型 | 说明 |
264
+ | ---------------- | ------------------------------------------------------------------- | ----------- |
258
265
  | `osPlatformList` | `{ os_list: OsItem[]; platform_list: PlatformItem[] } \| undefined` | OS/平台数据 |
259
266
 
260
267
  **示例:**
@@ -272,7 +279,7 @@ const { osPlatformList } = useOsPlatformList(() => http.get('/my/os/platform'));
272
279
  label: p.platform_name_zh,
273
280
  value: p.id,
274
281
  }))}
275
- />
282
+ />;
276
283
  ```
277
284
 
278
285
  > 💡 如需强制刷新缓存,可调用 `clearOsPlatformListCache()` 清除全部缓存,或传入指定 fetcher 清除对应缓存。
@@ -301,14 +308,14 @@ yarn test
301
308
 
302
309
  ## 技术栈
303
310
 
304
- | 工具 | 用途 |
305
- |------|------|
306
- | [father4](https://github.com/umijs/father) | 组件库构建(ESM / CJS / UMD) |
307
- | [dumi2](https://d.umijs.org/) | 文档生成与开发调试 |
308
- | [TDesign React](https://tdesign.tencent.com/react) | UI 组件库(peerDependency) |
309
- | TypeScript | 类型安全 |
310
- | Sass | 样式方案 |
311
- | Jest | 单元测试 |
311
+ | 工具 | 用途 |
312
+ | -------------------------------------------------- | ----------------------------- |
313
+ | [father4](https://github.com/umijs/father) | 组件库构建(ESM / CJS / UMD) |
314
+ | [dumi2](https://d.umijs.org/) | 文档生成与开发调试 |
315
+ | [TDesign React](https://tdesign.tencent.com/react) | UI 组件库(peerDependency) |
316
+ | TypeScript | 类型安全 |
317
+ | Sass | 样式方案 |
318
+ | Jest | 单元测试 |
312
319
 
313
320
  ## 相关资源
314
321
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnt-team/pnt-component-frontend",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "main": "lib/cjs/index.js",
@@ -9,7 +9,13 @@
9
9
  "types": "lib/esm/index.d.ts",
10
10
  "style": "lib/esm/index.css",
11
11
  "files": [
12
- "lib"
12
+ "lib/components",
13
+ "lib/hooks",
14
+ "lib/utils",
15
+ "lib/assets",
16
+ "lib/index.js",
17
+ "lib/index.d.ts",
18
+ "lib/global.d.ts"
13
19
  ],
14
20
  "scripts": {
15
21
  "build": "father build",
@@ -1,17 +0,0 @@
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 {};
@@ -1,45 +0,0 @@
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/api/index.ts
30
- var api_exports = {};
31
- __export(api_exports, {
32
- highSecurity: () => highSecurity
33
- });
34
- module.exports = __toCommonJS(api_exports);
35
- var import_request = __toESM(require("../utils/request"));
36
- function highSecurity(data) {
37
- return import_request.default.post(
38
- "/api/v3/business/game_info/high-security-decrypt?audience=/laas-pnt",
39
- data
40
- );
41
- }
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
44
- highSecurity
45
- });