@pnt-team/pnt-component-frontend 0.0.39 → 0.0.41

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 (44) hide show
  1. package/README.md +70 -183
  2. package/lib/cjs/components/PntGeneralLayout/index.d.ts +82 -0
  3. package/lib/cjs/components/PntGeneralLayout/index.js +74 -0
  4. package/lib/cjs/components/PntGeneralLayout/index.scss +90 -0
  5. package/lib/cjs/components/PntImagePreview/index.js +37 -30
  6. package/lib/cjs/components/PntSecureBox/index.js +25 -32
  7. package/lib/cjs/global.css +2 -0
  8. package/lib/cjs/hooks/useHighSecurity.d.ts +2 -20
  9. package/lib/cjs/index.d.ts +1 -8
  10. package/lib/cjs/index.js +5 -17
  11. package/lib/esm/components/PntGeneralLayout/index.d.ts +82 -0
  12. package/lib/esm/components/PntGeneralLayout/index.js +54 -0
  13. package/lib/esm/components/PntGeneralLayout/index.scss +90 -0
  14. package/lib/esm/components/PntImagePreview/index.js +37 -30
  15. package/lib/esm/components/PntSecureBox/index.js +25 -22
  16. package/lib/esm/global.css +2 -0
  17. package/lib/esm/hooks/useHighSecurity.d.ts +2 -20
  18. package/lib/esm/index.d.ts +1 -8
  19. package/lib/esm/index.js +6 -14
  20. package/lib/umd/pnt-component-frontend.min.css +1 -1
  21. package/lib/umd/pnt-component-frontend.min.js +1 -1
  22. package/package.json +10 -9
  23. package/lib/cjs/components/PntCopyData/index.d.ts +0 -91
  24. package/lib/cjs/components/PntCopyData/index.js +0 -81
  25. package/lib/cjs/components/PntCopyData/index.scss +0 -5
  26. package/lib/cjs/hooks/useBtnPermission.d.ts +0 -67
  27. package/lib/cjs/hooks/useBtnPermission.js +0 -57
  28. package/lib/cjs/hooks/useOsPlatformList.d.ts +0 -66
  29. package/lib/cjs/hooks/useOsPlatformList.js +0 -88
  30. package/lib/cjs/hooks/usePagination.d.ts +0 -72
  31. package/lib/cjs/hooks/usePagination.js +0 -71
  32. package/lib/cjs/utils/request.d.ts +0 -8
  33. package/lib/cjs/utils/request.js +0 -82
  34. package/lib/esm/components/PntCopyData/index.d.ts +0 -91
  35. package/lib/esm/components/PntCopyData/index.js +0 -51
  36. package/lib/esm/components/PntCopyData/index.scss +0 -5
  37. package/lib/esm/hooks/useBtnPermission.d.ts +0 -67
  38. package/lib/esm/hooks/useBtnPermission.js +0 -31
  39. package/lib/esm/hooks/useOsPlatformList.d.ts +0 -66
  40. package/lib/esm/hooks/useOsPlatformList.js +0 -63
  41. package/lib/esm/hooks/usePagination.d.ts +0 -72
  42. package/lib/esm/hooks/usePagination.js +0 -47
  43. package/lib/esm/utils/request.d.ts +0 -8
  44. package/lib/esm/utils/request.js +0 -52
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
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
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/components/PntSecureBox/index.tsx
@@ -34,8 +24,8 @@ __export(PntSecureBox_exports, {
34
24
  module.exports = __toCommonJS(PntSecureBox_exports);
35
25
  var import_useHighSecurity = require("../../hooks/useHighSecurity");
36
26
  var import_utils = require("../../utils");
37
- var import_react = __toESM(require("react"));
38
27
  var import_index = require("./index.scss");
28
+ var import_jsx_runtime = require("react/jsx-runtime");
39
29
  var PntSecureBox = (prop) => {
40
30
  const {
41
31
  dataKey,
@@ -48,27 +38,30 @@ var PntSecureBox = (prop) => {
48
38
  fetcher
49
39
  } = prop;
50
40
  const { securityData, requestSecurityData } = (0, import_useHighSecurity.useHighSecurity)(fetcher);
51
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pnt-secure-box" }, /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderDom(
52
- (0, import_utils.isSecurityData)(dataValue) ? securityData[dataKey] || "******" : dataValue
53
- ), (0, import_utils.isSecurityData)(dataValue) && !securityData.hasOwnProperty(dataKey) && /* @__PURE__ */ import_react.default.createElement(
54
- "span",
55
- {
56
- className: "view-icon",
57
- onClick: () => {
58
- requestSecurityData({
59
- env,
60
- gameId,
61
- pageId,
62
- param: [
63
- {
64
- key: dataKey,
65
- value: dataValue
66
- }
67
- ]
68
- });
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pnt-secure-box", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
42
+ renderDom(
43
+ (0, import_utils.isSecurityData)(dataValue) ? securityData[dataKey] || "******" : dataValue
44
+ ),
45
+ (0, import_utils.isSecurityData)(dataValue) && !securityData.hasOwnProperty(dataKey) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ "span",
47
+ {
48
+ className: "view-icon",
49
+ onClick: () => {
50
+ requestSecurityData({
51
+ env,
52
+ gameId,
53
+ pageId,
54
+ param: [
55
+ {
56
+ key: dataKey,
57
+ value: dataValue
58
+ }
59
+ ]
60
+ });
61
+ },
62
+ children: viewText || "View"
69
63
  }
70
- },
71
- viewText || "View"
72
- )));
64
+ )
65
+ ] }) });
73
66
  };
74
67
  var PntSecureBox_default = PntSecureBox;
@@ -0,0 +1,2 @@
1
+ /* TDesign 组件库全局样式(dumi 文档站自动加载) */
2
+ @import 'tdesign-react/dist/tdesign.min.css';
@@ -21,26 +21,8 @@ export type HighSecurityFetcher = (params: HighSecurityRequestParams) => Promise
21
21
  }>;
22
22
  }>;
23
23
  /**
24
- * 高敏数据解锁 Hook(L3 业务 Hook)
25
- *
26
- * 管理高敏数据的解锁状态。零业务侵入:请求函数通过 fetcher 注入,
27
- * 不再依赖内部 api/configs,避免将敏感配置打包进发布产物。
28
- *
29
- * @param fetcher 自定义高敏数据请求函数,需返回 { ret, data } 结构且 ret === 0 视为成功
30
- * @returns securityData 已解锁的高敏数据映射;requestSecurityData 请求解锁指定数据
31
- *
32
- * @example
33
- * ```tsx
34
- * import http from '@/utils/request';
35
- * import { useHighSecurity } from '@pnt-team/pnt-component-frontend';
36
- *
37
- * const Demo = () => {
38
- * const { securityData, requestSecurityData } = useHighSecurity((params) =>
39
- * http.post('/api/v3/business/game_info/high-security-decrypt', params).then(r => r.data)
40
- * );
41
- * // ...
42
- * };
43
- * ```
24
+ * 高敏数据解锁 Hook(PntSecureBox 内部依赖)
25
+ * @internal 不对外导出,归 PntSecureBox 组件内部使用
44
26
  */
45
27
  export declare const useHighSecurity: (fetcher: HighSecurityFetcher) => {
46
28
  securityData: Record<string, string>;
@@ -1,10 +1,3 @@
1
- export { default as PntCopyData } from './components/PntCopyData';
2
1
  export { default as PntImagePreview } from './components/PntImagePreview';
3
2
  export { default as PntSecureBox } from './components/PntSecureBox';
4
- export { default as useBtnPermission } from './hooks/useBtnPermission';
5
- export { useHighSecurity } from './hooks/useHighSecurity';
6
- export { default as useOsPlatformList } from './hooks/useOsPlatformList';
7
- export { default as usePagination } from './hooks/usePagination';
8
- export type { BtnPermissionMap, UseBtnPermissionOptions } from './hooks/useBtnPermission';
9
- export type { OsPlatformData, OsPlatformFetcher } from './hooks/useOsPlatformList';
10
- export type { PaginationData, PaginationRequestParams, OnPaginationRequest } from './hooks/usePagination';
3
+ export { default as PntGeneralLayout } from './components/PntGeneralLayout';
package/lib/cjs/index.js CHANGED
@@ -29,29 +29,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.ts
30
30
  var src_exports = {};
31
31
  __export(src_exports, {
32
- PntCopyData: () => import_PntCopyData.default,
32
+ PntGeneralLayout: () => import_PntGeneralLayout.default,
33
33
  PntImagePreview: () => import_PntImagePreview.default,
34
- PntSecureBox: () => import_PntSecureBox.default,
35
- useBtnPermission: () => import_useBtnPermission.default,
36
- useHighSecurity: () => import_useHighSecurity.useHighSecurity,
37
- useOsPlatformList: () => import_useOsPlatformList.default,
38
- usePagination: () => import_usePagination.default
34
+ PntSecureBox: () => import_PntSecureBox.default
39
35
  });
40
36
  module.exports = __toCommonJS(src_exports);
41
- var import_PntCopyData = __toESM(require("./components/PntCopyData"));
42
37
  var import_PntImagePreview = __toESM(require("./components/PntImagePreview"));
43
38
  var import_PntSecureBox = __toESM(require("./components/PntSecureBox"));
44
- var import_useBtnPermission = __toESM(require("./hooks/useBtnPermission"));
45
- var import_useHighSecurity = require("./hooks/useHighSecurity");
46
- var import_useOsPlatformList = __toESM(require("./hooks/useOsPlatformList"));
47
- var import_usePagination = __toESM(require("./hooks/usePagination"));
39
+ var import_PntGeneralLayout = __toESM(require("./components/PntGeneralLayout"));
48
40
  // Annotate the CommonJS export names for ESM import in node:
49
41
  0 && (module.exports = {
50
- PntCopyData,
42
+ PntGeneralLayout,
51
43
  PntImagePreview,
52
- PntSecureBox,
53
- useBtnPermission,
54
- useHighSecurity,
55
- useOsPlatformList,
56
- usePagination
44
+ PntSecureBox
57
45
  });
@@ -0,0 +1,82 @@
1
+ import React, { FunctionComponent, ReactNode, Ref } from 'react';
2
+ import './index.scss';
3
+ interface PntGeneralLayoutProps {
4
+ /**
5
+ * 自定义类名
6
+ */
7
+ className?: string;
8
+ /**
9
+ * 头部标题内容
10
+ * @description 传入后将渲染 Layout Header 区域
11
+ */
12
+ headerTitle?: ReactNode;
13
+ /**
14
+ * 是否显示返回按钮
15
+ * @default false
16
+ */
17
+ showBackButton?: boolean;
18
+ /**
19
+ * 返回按钮点击回调
20
+ */
21
+ onBackButtonClick?: (() => void) | undefined;
22
+ /**
23
+ * 子头部内容
24
+ * @description 位于 Header 下方,常用于放置面包屑、Tab 等
25
+ */
26
+ subHeaderContent?: ReactNode;
27
+ /**
28
+ * 头部右侧操作区
29
+ * @description 常用于放置按钮组
30
+ */
31
+ operation?: ReactNode;
32
+ /**
33
+ * 内容区 ref
34
+ */
35
+ bodyRef?: Ref<HTMLDivElement>;
36
+ /**
37
+ * 页面主体内容
38
+ */
39
+ children?: ReactNode;
40
+ /**
41
+ * 内容区自定义样式
42
+ */
43
+ bodyStyle?: React.CSSProperties;
44
+ /**
45
+ * 底部内容
46
+ * @description 传入后将渲染 Layout Footer 区域,常用于放置操作按钮
47
+ */
48
+ footer?: ReactNode;
49
+ }
50
+ /**
51
+ * 通用页面布局组件(L4 布局组件)
52
+ * @description 提供标准的「头部 + 子头部 + 内容区 + 底部」页面布局结构,
53
+ * 基于 TDesign Layout 封装,适用于后台管理系统的详情页、表单页等场景。
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * // 基础用法:仅内容区
58
+ * <PntGeneralLayout>
59
+ * <div>页面内容</div>
60
+ * </PntGeneralLayout>
61
+ *
62
+ * // 带标题和操作按钮
63
+ * <PntGeneralLayout
64
+ * headerTitle="页面标题"
65
+ * operation={<><Button>保存</Button><Button>取消</Button></>}
66
+ * >
67
+ * <Form />
68
+ * </PntGeneralLayout>
69
+ *
70
+ * // 带返回按钮和底部
71
+ * <PntGeneralLayout
72
+ * headerTitle="详情页"
73
+ * showBackButton
74
+ * onBackButtonClick={() => history.back()}
75
+ * footer={<><Button>提交</Button><Button>重置</Button></>}
76
+ * >
77
+ * <Detail />
78
+ * </PntGeneralLayout>
79
+ * ```
80
+ */
81
+ declare const PntGeneralLayout: FunctionComponent<PntGeneralLayoutProps>;
82
+ export default PntGeneralLayout;
@@ -0,0 +1,54 @@
1
+ // src/components/PntGeneralLayout/index.tsx
2
+ import { ArrowLeftIcon } from "tdesign-icons-react";
3
+ import { Layout } from "tdesign-react";
4
+ import "./index.scss";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var PntGeneralLayout = (prop) => {
7
+ const {
8
+ className,
9
+ headerTitle,
10
+ showBackButton = false,
11
+ onBackButtonClick,
12
+ subHeaderContent,
13
+ operation,
14
+ bodyRef,
15
+ children,
16
+ bodyStyle,
17
+ footer
18
+ } = prop;
19
+ const { Header, Footer } = Layout;
20
+ return /* @__PURE__ */ jsxs(Layout, { className: `pnt-general-layout${className ? " " + className : ""}`, children: [
21
+ headerTitle && /* @__PURE__ */ jsxs(Header, { children: [
22
+ /* @__PURE__ */ jsxs("span", { className: "header-title", children: [
23
+ showBackButton && /* @__PURE__ */ jsx(
24
+ ArrowLeftIcon,
25
+ {
26
+ className: "goback-icon",
27
+ size: "24px",
28
+ onClick: onBackButtonClick
29
+ }
30
+ ),
31
+ /* @__PURE__ */ jsx("span", { className: "title", children: headerTitle })
32
+ ] }),
33
+ operation && /* @__PURE__ */ jsx("span", { className: "header-operation", children: operation })
34
+ ] }),
35
+ subHeaderContent && /* @__PURE__ */ jsx("div", { className: "general-layout-sub-header", children: subHeaderContent }),
36
+ /* @__PURE__ */ jsx(
37
+ "div",
38
+ {
39
+ className: "general-layout-body",
40
+ ref: bodyRef,
41
+ style: {
42
+ height: `calc(100%${headerTitle && " - 72px"}${footer && " - 72px"})`,
43
+ ...bodyStyle
44
+ },
45
+ children
46
+ }
47
+ ),
48
+ footer && /* @__PURE__ */ jsx(Footer, { children: footer })
49
+ ] });
50
+ };
51
+ var PntGeneralLayout_default = PntGeneralLayout;
52
+ export {
53
+ PntGeneralLayout_default as default
54
+ };
@@ -0,0 +1,90 @@
1
+ .pnt-general-layout {
2
+ height: 100%;
3
+ background-color: rgba(0, 0, 0, 0);
4
+
5
+ .t-layout__header {
6
+ height: auto;
7
+ display: flex;
8
+ justify-content: space-between;
9
+ border-bottom: 1px solid #f0f3f6;
10
+
11
+ .header-title {
12
+ display: inline-block;
13
+ vertical-align: top;
14
+ padding: 24px;
15
+
16
+ .goback-icon {
17
+ margin-right: 12px;
18
+ vertical-align: top;
19
+ color: #3f8cff;
20
+ cursor: pointer;
21
+ }
22
+
23
+ .title {
24
+ display: inline-block;
25
+ vertical-align: top;
26
+ font-weight: 600;
27
+ font-size: 20px;
28
+ height: 24px;
29
+ line-height: 24px;
30
+ }
31
+ }
32
+
33
+ .header-operation {
34
+ height: 72px;
35
+ line-height: 72px;
36
+ padding-right: 24px;
37
+
38
+ .t-button + .t-button {
39
+ margin-left: 12px;
40
+ }
41
+ }
42
+ }
43
+
44
+ .general-layout-sub-header {
45
+ border-bottom: 1px solid #f0f3f6;
46
+ }
47
+
48
+ .general-layout-body {
49
+ height: 100%;
50
+ padding: 24px;
51
+ overflow-y: auto;
52
+ background: #fafafa;
53
+
54
+ > div.tea-card,
55
+ > div.t-card,
56
+ > div.t-loading__parent > div.t-card,
57
+ > div[class*='-wrapper'],
58
+ > div[class*='-block'] {
59
+ box-shadow: none;
60
+ margin-bottom: 24px;
61
+ border-radius: 4px;
62
+ }
63
+
64
+ > div:last-child,
65
+ > div:last-child.t-card,
66
+ > div:last-child.tea-card,
67
+ > div.t-loading__parent > div:last-child.t-card,
68
+ > div:last-child[class*='-wrapper'],
69
+ > div:last-child[class*='-block'] {
70
+ margin-bottom: 0;
71
+ }
72
+ }
73
+
74
+ .t-layout__footer {
75
+ padding: 18px 24px;
76
+ background: #fff;
77
+ border-top: 1px solid #f0f3f6;
78
+
79
+ .t-button {
80
+ font-size: 14px;
81
+ min-width: 92px;
82
+ height: 36px;
83
+ font-weight: 600;
84
+
85
+ & + .t-button {
86
+ margin-left: 12px;
87
+ }
88
+ }
89
+ }
90
+ }
@@ -1,9 +1,9 @@
1
1
  // src/components/PntImagePreview/index.tsx
2
2
  import uploadImg from "../../assets/images/uploadImg.png";
3
- import React from "react";
4
3
  import { BrowseIcon, DeleteIcon, LoadingIcon } from "tdesign-icons-react";
5
4
  import { Image, ImageViewer } from "tdesign-react";
6
5
  import "./index.scss";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  var PntImagePreview = ({
8
8
  iconUrl,
9
9
  loading,
@@ -12,15 +12,18 @@ var PntImagePreview = ({
12
12
  onRemove
13
13
  }) => {
14
14
  const src = (iconUrl == null ? void 0 : iconUrl.length) ? iconUrl : defaultImg || uploadImg;
15
- const LoadingContent = (isImageLoading) => /* @__PURE__ */ React.createElement(
15
+ const LoadingContent = (isImageLoading) => /* @__PURE__ */ jsx(
16
16
  "div",
17
17
  {
18
18
  className: isImageLoading ? "pnt-image-preview-progress" : "pnt-image-preview-upload-progress",
19
- style: params == null ? void 0 : params.style
20
- },
21
- /* @__PURE__ */ React.createElement("div", { className: "pnt-image-preview-loading" }, /* @__PURE__ */ React.createElement(LoadingIcon, { size: "18px", name: "loading" }), /* @__PURE__ */ React.createElement("p", null, "上传中"))
19
+ style: params == null ? void 0 : params.style,
20
+ children: /* @__PURE__ */ jsxs("div", { className: "pnt-image-preview-loading", children: [
21
+ /* @__PURE__ */ jsx(LoadingIcon, { size: "18px", name: "loading" }),
22
+ /* @__PURE__ */ jsx("p", { children: "上传中" })
23
+ ] })
24
+ }
22
25
  );
23
- return /* @__PURE__ */ React.createElement(
26
+ return /* @__PURE__ */ jsx(
24
27
  "div",
25
28
  {
26
29
  className: "pnt-image-preview-wrapper",
@@ -28,31 +31,35 @@ var PntImagePreview = ({
28
31
  if ((iconUrl == null ? void 0 : iconUrl.length) || loading) {
29
32
  e.stopPropagation();
30
33
  }
31
- }
32
- },
33
- loading ? LoadingContent(false) : /* @__PURE__ */ React.createElement(
34
- ImageViewer,
35
- {
36
- images: [src],
37
- closeOnOverlay: true,
38
- trigger: ({ open }) => {
39
- const mask = /* @__PURE__ */ React.createElement("div", { className: "pnt-image-preview-mask" }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(BrowseIcon, { onClick: open, size: "16px", name: "browse" })), /* @__PURE__ */ React.createElement("span", { className: "pnt-image-preview-divider" }), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(DeleteIcon, { onClick: onRemove, size: "16px", name: "delete" })));
40
- return /* @__PURE__ */ React.createElement(
41
- Image,
42
- {
43
- alt: "",
44
- src,
45
- loading: LoadingContent(true),
46
- overlayContent: iconUrl ? mask : /* @__PURE__ */ React.createElement(React.Fragment, null),
47
- overlayTrigger: "hover",
48
- fit: "contain",
49
- className: "pnt-image-preview",
50
- style: params == null ? void 0 : params.style
51
- }
52
- );
34
+ },
35
+ children: loading ? LoadingContent(false) : /* @__PURE__ */ jsx(
36
+ ImageViewer,
37
+ {
38
+ images: [src],
39
+ closeOnOverlay: true,
40
+ trigger: ({ open }) => {
41
+ const mask = /* @__PURE__ */ jsxs("div", { className: "pnt-image-preview-mask", children: [
42
+ /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(BrowseIcon, { onClick: open, size: "16px", name: "browse" }) }),
43
+ /* @__PURE__ */ jsx("span", { className: "pnt-image-preview-divider" }),
44
+ /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(DeleteIcon, { onClick: onRemove, size: "16px", name: "delete" }) })
45
+ ] });
46
+ return /* @__PURE__ */ jsx(
47
+ Image,
48
+ {
49
+ alt: "",
50
+ src,
51
+ loading: LoadingContent(true),
52
+ overlayContent: iconUrl ? mask : /* @__PURE__ */ jsx(Fragment, {}),
53
+ overlayTrigger: "hover",
54
+ fit: "contain",
55
+ className: "pnt-image-preview",
56
+ style: params == null ? void 0 : params.style
57
+ }
58
+ );
59
+ }
53
60
  }
54
- }
55
- )
61
+ )
62
+ }
56
63
  );
57
64
  };
58
65
  var PntImagePreview_default = PntImagePreview;
@@ -3,8 +3,8 @@ import {
3
3
  useHighSecurity
4
4
  } from "../../hooks/useHighSecurity";
5
5
  import { isSecurityData } from "../../utils";
6
- import React from "react";
7
6
  import "./index.scss";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  var PntSecureBox = (prop) => {
9
9
  const {
10
10
  dataKey,
@@ -17,28 +17,31 @@ var PntSecureBox = (prop) => {
17
17
  fetcher
18
18
  } = prop;
19
19
  const { securityData, requestSecurityData } = useHighSecurity(fetcher);
20
- return /* @__PURE__ */ React.createElement("div", { className: "pnt-secure-box" }, /* @__PURE__ */ React.createElement(React.Fragment, null, renderDom(
21
- isSecurityData(dataValue) ? securityData[dataKey] || "******" : dataValue
22
- ), isSecurityData(dataValue) && !securityData.hasOwnProperty(dataKey) && /* @__PURE__ */ React.createElement(
23
- "span",
24
- {
25
- className: "view-icon",
26
- onClick: () => {
27
- requestSecurityData({
28
- env,
29
- gameId,
30
- pageId,
31
- param: [
32
- {
33
- key: dataKey,
34
- value: dataValue
35
- }
36
- ]
37
- });
20
+ return /* @__PURE__ */ jsx("div", { className: "pnt-secure-box", children: /* @__PURE__ */ jsxs(Fragment, { children: [
21
+ renderDom(
22
+ isSecurityData(dataValue) ? securityData[dataKey] || "******" : dataValue
23
+ ),
24
+ isSecurityData(dataValue) && !securityData.hasOwnProperty(dataKey) && /* @__PURE__ */ jsx(
25
+ "span",
26
+ {
27
+ className: "view-icon",
28
+ onClick: () => {
29
+ requestSecurityData({
30
+ env,
31
+ gameId,
32
+ pageId,
33
+ param: [
34
+ {
35
+ key: dataKey,
36
+ value: dataValue
37
+ }
38
+ ]
39
+ });
40
+ },
41
+ children: viewText || "View"
38
42
  }
39
- },
40
- viewText || "View"
41
- )));
43
+ )
44
+ ] }) });
42
45
  };
43
46
  var PntSecureBox_default = PntSecureBox;
44
47
  export {
@@ -0,0 +1,2 @@
1
+ /* TDesign 组件库全局样式(dumi 文档站自动加载) */
2
+ @import 'tdesign-react/dist/tdesign.min.css';
@@ -21,26 +21,8 @@ export type HighSecurityFetcher = (params: HighSecurityRequestParams) => Promise
21
21
  }>;
22
22
  }>;
23
23
  /**
24
- * 高敏数据解锁 Hook(L3 业务 Hook)
25
- *
26
- * 管理高敏数据的解锁状态。零业务侵入:请求函数通过 fetcher 注入,
27
- * 不再依赖内部 api/configs,避免将敏感配置打包进发布产物。
28
- *
29
- * @param fetcher 自定义高敏数据请求函数,需返回 { ret, data } 结构且 ret === 0 视为成功
30
- * @returns securityData 已解锁的高敏数据映射;requestSecurityData 请求解锁指定数据
31
- *
32
- * @example
33
- * ```tsx
34
- * import http from '@/utils/request';
35
- * import { useHighSecurity } from '@pnt-team/pnt-component-frontend';
36
- *
37
- * const Demo = () => {
38
- * const { securityData, requestSecurityData } = useHighSecurity((params) =>
39
- * http.post('/api/v3/business/game_info/high-security-decrypt', params).then(r => r.data)
40
- * );
41
- * // ...
42
- * };
43
- * ```
24
+ * 高敏数据解锁 Hook(PntSecureBox 内部依赖)
25
+ * @internal 不对外导出,归 PntSecureBox 组件内部使用
44
26
  */
45
27
  export declare const useHighSecurity: (fetcher: HighSecurityFetcher) => {
46
28
  securityData: Record<string, string>;
@@ -1,10 +1,3 @@
1
- export { default as PntCopyData } from './components/PntCopyData';
2
1
  export { default as PntImagePreview } from './components/PntImagePreview';
3
2
  export { default as PntSecureBox } from './components/PntSecureBox';
4
- export { default as useBtnPermission } from './hooks/useBtnPermission';
5
- export { useHighSecurity } from './hooks/useHighSecurity';
6
- export { default as useOsPlatformList } from './hooks/useOsPlatformList';
7
- export { default as usePagination } from './hooks/usePagination';
8
- export type { BtnPermissionMap, UseBtnPermissionOptions } from './hooks/useBtnPermission';
9
- export type { OsPlatformData, OsPlatformFetcher } from './hooks/useOsPlatformList';
10
- export type { PaginationData, PaginationRequestParams, OnPaginationRequest } from './hooks/usePagination';
3
+ export { default as PntGeneralLayout } from './components/PntGeneralLayout';
package/lib/esm/index.js CHANGED
@@ -1,17 +1,9 @@
1
1
  // src/index.ts
2
- import { default as default2 } from "./components/PntCopyData";
3
- import { default as default3 } from "./components/PntImagePreview";
4
- import { default as default4 } from "./components/PntSecureBox";
5
- import { default as default5 } from "./hooks/useBtnPermission";
6
- import { useHighSecurity } from "./hooks/useHighSecurity";
7
- import { default as default6 } from "./hooks/useOsPlatformList";
8
- import { default as default7 } from "./hooks/usePagination";
2
+ import { default as default2 } from "./components/PntImagePreview";
3
+ import { default as default3 } from "./components/PntSecureBox";
4
+ import { default as default4 } from "./components/PntGeneralLayout";
9
5
  export {
10
- default2 as PntCopyData,
11
- default3 as PntImagePreview,
12
- default4 as PntSecureBox,
13
- default5 as useBtnPermission,
14
- useHighSecurity,
15
- default6 as useOsPlatformList,
16
- default7 as usePagination
6
+ default4 as PntGeneralLayout,
7
+ default2 as PntImagePreview,
8
+ default3 as PntSecureBox
17
9
  };