@go-wind/admin-react 0.0.0-stage → 0.1.0

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -2
  3. package/dist/access/access-control.d.ts +39 -0
  4. package/dist/access/field-permission.d.ts +11 -0
  5. package/dist/access/index.d.ts +4 -0
  6. package/dist/access/use-access.d.ts +50 -0
  7. package/dist/admin-react.css +2 -0
  8. package/dist/admin-react.js +5432 -0
  9. package/dist/admin-react.js.map +1 -0
  10. package/dist/auth-gateway.d.ts +54 -0
  11. package/dist/components/Loading/index.d.ts +22 -0
  12. package/dist/env.d.ts +5 -0
  13. package/dist/hooks/useProTableScrollY.d.ts +22 -0
  14. package/dist/hooks/useTime.d.ts +6 -0
  15. package/dist/hooks/useTitle.d.ts +1 -0
  16. package/dist/hooks/useTokenRefresh.d.ts +26 -0
  17. package/dist/i18n/components/LocaleSwitcher/index.d.ts +1 -0
  18. package/dist/i18n/components/index.d.ts +1 -0
  19. package/dist/i18n/config/i18n.d.ts +18 -0
  20. package/dist/i18n/hooks/index.d.ts +2 -0
  21. package/dist/i18n/hooks/useI18n.d.ts +96 -0
  22. package/dist/i18n/hooks/useLocaleSync.d.ts +4 -0
  23. package/dist/i18n/index.d.ts +3 -0
  24. package/dist/i18n/utils/detector.d.ts +26 -0
  25. package/dist/i18n/utils/formatter.d.ts +38 -0
  26. package/dist/i18n/utils/index.d.ts +3 -0
  27. package/dist/i18n/utils/sync.d.ts +27 -0
  28. package/dist/index.d.ts +34 -0
  29. package/dist/locales/en-US/index.d.ts +2 -0
  30. package/dist/locales/index.d.ts +10 -0
  31. package/dist/locales/zh-CN/index.d.ts +2 -0
  32. package/dist/nprogress-CwfUlis6.js +159 -0
  33. package/dist/nprogress-CwfUlis6.js.map +1 -0
  34. package/dist/preferences/components/PreferencesPanel/AppearancePanel.d.ts +3 -0
  35. package/dist/preferences/components/PreferencesPanel/GeneralPanel.d.ts +3 -0
  36. package/dist/preferences/components/PreferencesPanel/LayoutPanel.d.ts +3 -0
  37. package/dist/preferences/components/PreferencesPanel/ShortcutKeyPanel.d.ts +3 -0
  38. package/dist/preferences/components/PreferencesPanel/index.d.ts +8 -0
  39. package/dist/preferences/components/ThemeProvider/index.d.ts +9 -0
  40. package/dist/preferences/components/index.d.ts +2 -0
  41. package/dist/preferences/config/constants.d.ts +24 -0
  42. package/dist/preferences/config/darkTheme.d.ts +32 -0
  43. package/dist/preferences/config/default.d.ts +3 -0
  44. package/dist/preferences/config/index.d.ts +4 -0
  45. package/dist/preferences/config/lightTheme.d.ts +33 -0
  46. package/dist/preferences/hooks/index.d.ts +3 -0
  47. package/dist/preferences/hooks/useLocale.d.ts +23 -0
  48. package/dist/preferences/hooks/usePreferences.d.ts +31 -0
  49. package/dist/preferences/hooks/useThemeConfig.d.ts +2 -0
  50. package/dist/preferences/index.d.ts +5 -0
  51. package/dist/preferences/store/index.d.ts +24 -0
  52. package/dist/preferences/theme-transition.d.ts +17 -0
  53. package/dist/preferences/types/app.d.ts +238 -0
  54. package/dist/preferences/types/index.d.ts +4 -0
  55. package/dist/preferences/types/layout.d.ts +78 -0
  56. package/dist/preferences/types/preferences-root.d.ts +48 -0
  57. package/dist/preferences/types/theme.d.ts +29 -0
  58. package/dist/preferences/utils/diff.d.ts +7 -0
  59. package/dist/preferences/utils/merge.d.ts +9 -0
  60. package/dist/query-client.d.ts +9 -0
  61. package/dist/rolldown-runtime-BbCBk-LD.js +19 -0
  62. package/dist/router/factory.d.ts +7 -0
  63. package/dist/router/generators/generate-menus.d.ts +13 -0
  64. package/dist/router/generators/generate-routes-backend.d.ts +12 -0
  65. package/dist/router/generators/generate-routes-frontend.d.ts +17 -0
  66. package/dist/router/generators/index.d.ts +3 -0
  67. package/dist/router/index.d.ts +5 -0
  68. package/dist/router/routes-context.d.ts +8 -0
  69. package/dist/router/types/index.d.ts +207 -0
  70. package/dist/router/utils/index.d.ts +8 -0
  71. package/dist/router/utils/inject-redirect.d.ts +6 -0
  72. package/dist/router/utils/lazy.d.ts +11 -0
  73. package/dist/router/utils/loader.d.ts +14 -0
  74. package/dist/router/utils/menu.d.ts +5 -0
  75. package/dist/router/utils/merge-route-modules.d.ts +23 -0
  76. package/dist/router/utils/reset-routes.d.ts +18 -0
  77. package/dist/router/utils/sort-routes.d.ts +5 -0
  78. package/dist/router/utils/transform-meta-to-handle.d.ts +11 -0
  79. package/dist/storage/index.d.ts +2 -0
  80. package/dist/storage/storage.class.d.ts +125 -0
  81. package/dist/storage/storage.types.d.ts +199 -0
  82. package/dist/stores/auth.d.ts +56 -0
  83. package/dist/stores/index.d.ts +2 -0
  84. package/dist/stores/user.d.ts +32 -0
  85. package/dist/transport/rest/captcha-headers.d.ts +2 -0
  86. package/dist/transport/rest/index.d.ts +8 -0
  87. package/dist/transport/rest/modules/downloader.d.ts +9 -0
  88. package/dist/transport/rest/modules/interceptor.d.ts +9 -0
  89. package/dist/transport/rest/modules/uploader.d.ts +10 -0
  90. package/dist/transport/rest/pagination.d.ts +73 -0
  91. package/dist/transport/rest/preset-interceptors.d.ts +25 -0
  92. package/dist/transport/rest/request-api.d.ts +6 -0
  93. package/dist/transport/rest/request-client.d.ts +87 -0
  94. package/dist/transport/rest/types.d.ts +38 -0
  95. package/dist/transport/rest/utils.d.ts +16 -0
  96. package/dist/transport/sse/event.d.ts +44 -0
  97. package/dist/transport/sse/index.d.ts +5 -0
  98. package/dist/transport/sse/sse_client.d.ts +76 -0
  99. package/dist/transport/sse/types.d.ts +27 -0
  100. package/dist/types.d.ts +44 -0
  101. package/dist/utils/color.d.ts +27 -0
  102. package/dist/utils/date.d.ts +5 -0
  103. package/dist/utils/diff.d.ts +6 -0
  104. package/dist/utils/index.d.ts +9 -0
  105. package/dist/utils/inference.d.ts +111 -0
  106. package/dist/utils/merge.d.ts +17 -0
  107. package/dist/utils/nprogress.d.ts +11 -0
  108. package/dist/utils/tree.d.ts +27 -0
  109. package/dist/utils/url.d.ts +11 -0
  110. package/dist/utils/utils.d.ts +37 -0
  111. package/package.json +70 -3
@@ -0,0 +1,76 @@
1
+ import type { SSEClientConfig, SSEConnectionStatus, SSEEventHandler, SSEEventName } from './types';
2
+ /**
3
+ * SSE客户端
4
+ */
5
+ export declare class SSEClient {
6
+ private abortController;
7
+ private config;
8
+ private eventSource;
9
+ private handlers;
10
+ private status;
11
+ private readonly transport;
12
+ constructor(config: SSEClientConfig);
13
+ /**
14
+ * 解析数据(自动处理 JSON 格式)
15
+ * @param rawData
16
+ * @private
17
+ */
18
+ private parseData;
19
+ /**
20
+ * 触发事件监听器
21
+ * @param eventName
22
+ * @param data
23
+ * @param event
24
+ * @private
25
+ */
26
+ private triggerHandler;
27
+ /**
28
+ * 通过 EventSource 建立 SSE 连接
29
+ * @param url 连接 URL
30
+ * @private
31
+ */
32
+ _connectByEventSource(url: string): void;
33
+ /**
34
+ * 通过 fetchEventSource 建立 SSE 连接(支持更灵活的配置和控制)
35
+ * @param url 连接 URL
36
+ * @private
37
+ */
38
+ _connectByFetchEventSource(url: string): Promise<void>;
39
+ /**
40
+ * 关闭 SSE 连接
41
+ */
42
+ close(): void;
43
+ /**
44
+ * 建立 SSE 连接
45
+ * @param url 可选连接 URL,默认为配置中的 URL
46
+ */
47
+ connect(url?: string): Error | null;
48
+ /**
49
+ * 获取当前连接状态
50
+ */
51
+ getStatus(): SSEConnectionStatus;
52
+ /**
53
+ * 移除事件监听器
54
+ * @param eventName
55
+ * @param handler
56
+ */
57
+ off<T = unknown>(eventName: SSEEventName, handler?: SSEEventHandler<T>): void;
58
+ /**
59
+ * 注册事件监听器(支持泛型指定数据类型)
60
+ * @param eventName
61
+ * @param handler
62
+ */
63
+ on<T = unknown>(eventName: SSEEventName, handler: SSEEventHandler<T>): void;
64
+ /**
65
+ * 关闭当前连接并使用新的 URL / headers 重新连接
66
+ * 适用于 token 刷新后需要携带新凭证的场景
67
+ * @param url 可选的新连接 URL,默认沿用配置中的 URL
68
+ */
69
+ reconnect(url?: string): void;
70
+ /**
71
+ * 动态设置/更新请求头(不会影响正在进行中的连接,下次 connect 时生效)
72
+ * 注意:EventSource 模式不支持自定义请求头,此方法仅对 fetch-event-source 模式生效
73
+ * @param headers 键值对,会浅合并到当前 headers 配置中
74
+ */
75
+ setHeaders(headers: Record<string, string>): void;
76
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * SSE 事件类型(区分默认事件和自定义事件)
3
+ */
4
+ export type SSEEventName = 'error' | 'message' | 'open' | string;
5
+ /**
6
+ * SSE 事件回调函数类型(T 为数据类型)
7
+ */
8
+ export type SSEEventHandler<T = unknown> = (data: T, event: MessageEvent) => void;
9
+ /**
10
+ * SSE 连接实现方式
11
+ */
12
+ export type SSETransport = 'event-source' | 'fetch-event-source';
13
+ /**
14
+ * SSE 客户端配置
15
+ */
16
+ export interface SSEClientConfig {
17
+ url: string;
18
+ withCredentials?: boolean;
19
+ reconnectDelay?: number;
20
+ autoParseJson?: boolean;
21
+ headers?: Record<string, string>;
22
+ transport?: SSETransport;
23
+ }
24
+ /**
25
+ * SSE 连接状态
26
+ */
27
+ export type SSEConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'error';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 包内基础类型(自 go-wind-admin 的 src/types/global.d.ts 迁入)。
3
+ *
4
+ * 宿主应用保留自己的全局 `UserInfo`/`BasicUserInfo` 声明即可——它们与本包的
5
+ * AdminUserInfo 结构兼容(宿主接口字段为必填,赋给本包可选字段类型天然可赋值),
6
+ * 无需 declaration merging。
7
+ */
8
+ /** 用户信息基础形状(与宿主 BasicUserInfo 对齐) */
9
+ export interface AdminUserBasic {
10
+ [key: string]: any;
11
+ /** 头像 */
12
+ avatar: string;
13
+ /** 用户id(后端 uint64,proto3 JSON 下为字符串) */
14
+ id: string;
15
+ /** 用户昵称 */
16
+ nickname: string;
17
+ /** 用户实名 */
18
+ realname: string;
19
+ /** 用户角色 */
20
+ roles?: string[];
21
+ /** 租户id(后端 uint64,proto3 JSON 下为字符串) */
22
+ tenantId: string;
23
+ /** 用户名 */
24
+ username: string;
25
+ }
26
+ /** 包内认证/用户 store 消费的用户信息形状 */
27
+ export interface AdminUserInfo extends AdminUserBasic {
28
+ /** 用户描述 */
29
+ description?: string;
30
+ /** 首页地址 */
31
+ homePath?: string;
32
+ /** accessToken */
33
+ token?: string;
34
+ }
35
+ /**
36
+ * React Router 路由 handle 元数据类型。
37
+ * 用于 useMatches() 获取路由附加信息(自宿主全局声明迁入)。
38
+ */
39
+ export interface RouteHandle {
40
+ title?: string;
41
+ icon?: string;
42
+ authority?: string[];
43
+ [key: string]: any;
44
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 生成基于字符串的固定随机色(HSL模式,保证饱和度和明度适中)
3
+ *
4
+ * 浅底色(l=85):只能配深色墨(最差色相对深色墨仍 ≥11:1),配白字不可读。
5
+ * @param str
6
+ */
7
+ export declare const getRandomColor: (str: string) => string;
8
+ /**
9
+ * 根据首字母生成固定随机色(头像实底色,前景固定近白)
10
+ *
11
+ * 明度取 28% 是量出来的:本函数的产物一律配 antd/EP 头像的白字,而 hsl 同饱和度下
12
+ * 45% 明度是"两种墨都不合格"的死区(360 个色相里最差 white 2.03 / dark 2.01);
13
+ * 28% + s60 保证任意色相下白字 ≥4.86:1(判据与换算见 docs/design-language.md §2.1)。
14
+ * @param char
15
+ */
16
+ export declare const getCharColor: (char: string) => string;
17
+ export declare function hexToRgb(hex: string): [number, number, number];
18
+ export declare function rgbToHex(r: number, g: number, b: number): string;
19
+ /** 解析 `#rgb`/`#rrggbb`/`hsl(h s% l%)`/`hsl(h, s%, l%)` 为 [r,g,b](0-255);无法识别返回 null */
20
+ export declare function parseColor(c: string): [number, number, number] | null;
21
+ /**
22
+ * 与 CSS `color-mix(in srgb, base pct%, other)` 同口径的 JS 版本。
23
+ * 存在的理由:antd 的 token 值(colorLink、Menu.itemSelectedColor 等)会被 antd 再做
24
+ * 一次色彩运算,不能填 `var(--gowind-*)`,所以「语义色作文字」的降档/升档要在 TS 里算一遍;
25
+ * 比例与 vue-element 端 `styles/vendors/_element-plus.scss` §3 完全一致,改动须同步两处。
26
+ */
27
+ export declare function mixColor(base: string, other: string, pct: number): string;
@@ -0,0 +1,5 @@
1
+ export declare function formatDate(dateString: string | undefined): string;
2
+ export declare const formatDateTime: (timestamp?: any) => string;
3
+ export declare const DATE_FORMAT = "YYYY-MM-DD";
4
+ export declare const TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
5
+ export declare const TIME_PICKER_FORMAT = "HH:mm:ss";
@@ -0,0 +1,6 @@
1
+ declare function arraysEqual<T>(a: T[], b: T[]): boolean;
2
+ type DiffResult<T> = Partial<{
3
+ [K in keyof T]: T[K] extends object ? DiffResult<T[K]> : T[K];
4
+ }>;
5
+ declare function diff<T extends Record<string, any>>(obj1: T, obj2: T): DiffResult<T>;
6
+ export { arraysEqual, diff };
@@ -0,0 +1,9 @@
1
+ export * from './merge';
2
+ export * from './inference';
3
+ export * from './utils';
4
+ export * from './nprogress';
5
+ export * from './date';
6
+ export * from './color';
7
+ export * from './url';
8
+ export * from './diff';
9
+ export * from './tree';
@@ -0,0 +1,111 @@
1
+ /**
2
+ * 检查传入的值是否为函数。
3
+ *
4
+ * @param {unknown} value 要检查的值。
5
+ * @returns {boolean} 如果值是函数,返回 true,否则返回 false。
6
+ */
7
+ declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown;
8
+ /**
9
+ * 检查传入的值是否为对象(不包括 null 和数组)。
10
+ *
11
+ * @param {unknown} value 要检查的值。
12
+ * @returns {boolean} 如果值是对象,返回 true,否则返回 false。
13
+ */
14
+ declare function isObject(value: unknown): value is Record<string, unknown>;
15
+ /**
16
+ * 检查传入的值是否为字符串。
17
+ *
18
+ * @param {unknown} value 要检查的值。
19
+ * @returns {boolean} 如果值是字符串,返回 true,否则返回 false。
20
+ */
21
+ declare function isString(value: unknown): value is string;
22
+ /**
23
+ * 检查传入的值是否为undefined。
24
+ *
25
+ * @param {unknown} value 要检查的值。
26
+ * @returns {boolean} 如果值是undefined,返回true,否则返回false。
27
+ */
28
+ declare function isUndefined(value?: unknown): value is undefined;
29
+ /**
30
+ * 检查传入的值是否为boolean
31
+ * @param value
32
+ * @returns 如果值是布尔值,返回true,否则返回false。
33
+ */
34
+ declare function isBoolean(value: unknown): value is boolean;
35
+ /**
36
+ * 检查传入的值是否为空。
37
+ *
38
+ * 以下情况将被认为是空:
39
+ * - 值为null。
40
+ * - 值为undefined。
41
+ * - 值为一个空字符串。
42
+ * - 值为一个长度为0的数组。
43
+ * - 值为一个没有元素的Map或Set。
44
+ * - 值为一个没有属性的对象。
45
+ *
46
+ * @param {T} value 要检查的值。
47
+ * @returns {boolean} 如果值为空,返回true,否则返回false。
48
+ */
49
+ declare function isEmpty<T = unknown>(value?: T): value is T;
50
+ /**
51
+ * 检查传入的字符串是否为有效的HTTP或HTTPS URL。
52
+ *
53
+ * @param {string} url 要检查的字符串。
54
+ * @return {boolean} 如果字符串是有效的HTTP或HTTPS URL,返回true,否则返回false。
55
+ */
56
+ declare function isHttpUrl(url?: string): boolean;
57
+ /**
58
+ * 检查传入的值是否为window对象。
59
+ *
60
+ * @param {unknown} value 要检查的值。
61
+ * @returns {boolean} 如果值是window对象,返回true,否则返回false。
62
+ */
63
+ declare function isWindow(value: unknown): value is Window;
64
+ /**
65
+ * 检查当前运行环境是否为Mac OS。
66
+ *
67
+ * 这个函数通过检查navigator.userAgent字符串来判断当前运行环境。
68
+ * 如果userAgent字符串中包含"macintosh"或"mac os x"(不区分大小写),则认为当前环境是Mac OS。
69
+ *
70
+ * @returns {boolean} 如果当前环境是Mac OS,返回true,否则返回false。
71
+ */
72
+ declare function isMacOs(): boolean;
73
+ /**
74
+ * 检查当前运行环境是否为Windows OS。
75
+ *
76
+ * 这个函数通过检查navigator.userAgent字符串来判断当前运行环境。
77
+ * 如果userAgent字符串中包含"windows"或"win32"(不区分大小写),则认为当前环境是Windows OS。
78
+ *
79
+ * @returns {boolean} 如果当前环境是Windows OS,返回true,否则返回false。
80
+ */
81
+ declare function isWindowsOs(): boolean;
82
+ /**
83
+ * 检查传入的值是否为数字
84
+ * @param value
85
+ */
86
+ declare function isNumber(value: unknown): value is number;
87
+ /**
88
+ * Returns the first value in the provided list that is neither `null` nor `undefined`.
89
+ *
90
+ * This function iterates over the input values and returns the first one that is
91
+ * not strictly equal to `null` or `undefined`. If all values are either `null` or
92
+ * `undefined`, it returns `undefined`.
93
+ *
94
+ * @template T - The type of the input values.
95
+ * @param {...(T | null | undefined)[]} values - A list of values to evaluate.
96
+ * @returns {T | undefined} - The first value that is not `null` or `undefined`, or `undefined` if none are found.
97
+ *
98
+ * @example
99
+ * // Returns 42 because it is the first non-null, non-undefined value.
100
+ * getFirstNonNullOrUndefined(undefined, null, 42, 'hello'); // 42
101
+ *
102
+ * @example
103
+ * // Returns 'hello' because it is the first non-null, non-undefined value.
104
+ * getFirstNonNullOrUndefined(null, undefined, 'hello', 123); // 'hello'
105
+ *
106
+ * @example
107
+ * // Returns undefined because all values are either null or undefined.
108
+ * getFirstNonNullOrUndefined(undefined, null); // undefined
109
+ */
110
+ declare function getFirstNonNullOrUndefined<T>(...values: (null | T | undefined)[]): T | undefined;
111
+ export { getFirstNonNullOrUndefined, isBoolean, isEmpty, isFunction, isHttpUrl, isMacOs, isNumber, isObject, isString, isUndefined, isWindow, isWindowsOs, };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 深度合并对象
3
+ * @param target - 目标对象
4
+ * @param source - 源对象
5
+ * @returns 合并后的新对象
6
+ */
7
+ export declare function merge<T extends Record<string, any>, U extends Record<string, any>>(target: T, source: U): T & U;
8
+ /**
9
+ * 创建自定义合并函数
10
+ * @param customizer - 自定义处理函数
11
+ * @returns 合并函数
12
+ */
13
+ export declare function createMerge(customizer?: (obj: Record<string, any>, key: string, value: any) => boolean | void): <T extends Record<string, any>, U extends Record<string, any>>(target: T, source: U) => T & U;
14
+ /**
15
+ * 带数组覆盖功能的合并函数
16
+ */
17
+ export declare const mergeWithArrayOverride: <T extends Record<string, any>, U extends Record<string, any>>(target: T, source: U) => T & U;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 开始显示进度条。
3
+ * 此函数首先加载NProgress库,然后调用NProgress的start方法开始显示进度条。
4
+ */
5
+ declare function startProgress(): Promise<void>;
6
+ /**
7
+ * 停止显示进度条,并隐藏进度条。
8
+ * 此函数首先加载NProgress库,然后调用NProgress的done方法停止并隐藏进度条。
9
+ */
10
+ declare function stopProgress(): Promise<void>;
11
+ export { startProgress, stopProgress };
@@ -0,0 +1,27 @@
1
+ interface TreeConfigOptions {
2
+ childProps: string;
3
+ }
4
+ /**
5
+ * @zh_CN 遍历树形结构,并返回所有节点中指定的值。
6
+ * @param tree 树形结构数组
7
+ * @param getValue 获取节点值的函数
8
+ * @param options 作为子节点数组的可选属性名称。
9
+ * @returns 所有节点中指定的值的数组
10
+ */
11
+ declare function traverseTreeValues<T, V>(tree: T[], getValue: (node: T) => V, options?: TreeConfigOptions): V[];
12
+ /**
13
+ * 根据条件过滤给定树结构的节点,并以原有顺序返回所有匹配节点的数组。
14
+ * @param tree 要过滤的树结构的根节点数组。
15
+ * @param filter 用于匹配每个节点的条件。
16
+ * @param options 作为子节点数组的可选属性名称。
17
+ * @returns 包含所有匹配节点的数组。
18
+ */
19
+ declare function filterTree<T extends Record<string, any>>(tree: T[], filter: (node: T) => boolean, options?: TreeConfigOptions): T[];
20
+ /**
21
+ * 根据条件重新映射给定树结构的节
22
+ * @param tree 要过滤的树结构的根节点数组。
23
+ * @param mapper 用于map每个节点的条件。
24
+ * @param options 作为子节点数组的可选属性名称。
25
+ */
26
+ declare function mapTree<T, V extends Record<string, any>>(tree: T[], mapper: (node: T) => V, options?: TreeConfigOptions): V[];
27
+ export { filterTree, mapTree, traverseTreeValues };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 获取url中的全部参数
3
+ * @param search - url参数
4
+ */
5
+ export declare function getUrlAllParam(search: string): Record<string, string>;
6
+ /**
7
+ * 获取url中参数某个值
8
+ * @param search - url参数
9
+ * @param key - 搜索值
10
+ */
11
+ export declare function getUrlParam(search: string, key: string): string;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Sums the passed percentage to the R, G or B of a HEX color
3
+ * @param {string} color The color to change
4
+ * @param {number} amount The amount to change the color by
5
+ * @returns {string} The processed part of the color
6
+ */
7
+ export declare function addLight(color: string, amount: number): string;
8
+ /**
9
+ * Lightens a 6 char HEX color according to the passed percentage
10
+ * @param {string} color The color to change
11
+ * @param {number} amount The amount to change the color by
12
+ * @returns {string} The processed color represented as HEX
13
+ */
14
+ export declare function lighten(color: string, amount: number): string;
15
+ /**
16
+ * 绑定实例方法
17
+ * @param instance 实例
18
+ */
19
+ export declare function bindMethods<T extends object>(instance: T): void;
20
+ /**
21
+ * 滚动到顶部
22
+ */
23
+ export declare function scrollToTop(): void;
24
+ /**
25
+ * 滚动到底部
26
+ */
27
+ export declare function scrollToBottom(): void;
28
+ /**
29
+ * 滚动到指定元素
30
+ * @param element 目标元素
31
+ */
32
+ export declare function scrollTo(element: HTMLElement): void;
33
+ /**
34
+ * 金额格式化3000->3,000
35
+ * @param amount - 金额
36
+ */
37
+ export declare function amountFormatter(amount: number): string;
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@go-wind/admin-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "React 19 admin shell mechanisms extracted from go-wind-admin: axios transport (token rotation/captcha headers), SSE client, auth store with injectable AuthGateway, route factory (frontend/backend access modes), access control, i18n engine, theme/preferences, query client, generic hooks & utils.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "react",
9
+ "admin",
10
+ "auth",
11
+ "router",
12
+ "i18n",
13
+ "theme",
14
+ "antd"
15
+ ],
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "module": "./dist/admin-react.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/admin-react.js"
25
+ },
26
+ "./style.css": "./dist/admin-react.css"
27
+ },
28
+ "peerDependencies": {
29
+ "@ant-design/icons": ">=5.6.0",
30
+ "@ant-design/pro-components": ">=2.8.0",
31
+ "@tanstack/react-query": ">=5.0.0",
32
+ "antd": ">=6.0.0",
33
+ "i18next": ">=25.0.0",
34
+ "react": ">=19.0.0",
35
+ "react-dom": ">=19.0.0",
36
+ "react-i18next": ">=17.0.0",
37
+ "react-router-dom": ">=6.26.0",
38
+ "zustand": ">=5.0.0"
39
+ },
40
+ "dependencies": {
41
+ "@microsoft/fetch-event-source": "^2.0.1",
42
+ "axios": "^1.16.1",
43
+ "dayjs": "^1.11.20",
44
+ "nprogress": "^0.2.0"
45
+ },
46
+ "devDependencies": {
47
+ "@ant-design/icons": "^5.6.1",
48
+ "@ant-design/pro-components": "^2.8.10",
49
+ "@tanstack/react-query": "^5.100.11",
50
+ "@types/nprogress": "^0.2.3",
51
+ "@types/react": "^19.2.15",
52
+ "@types/react-dom": "^19.2.3",
53
+ "@vitejs/plugin-react": "^5.1.2",
54
+ "antd": "^6.4.3",
55
+ "i18next": "^26.2.0",
56
+ "less": "^4.6.4",
57
+ "react": "^19.2.6",
58
+ "react-dom": "^19.2.6",
59
+ "react-i18next": "^17.0.8",
60
+ "react-router-dom": "^6.26.0",
61
+ "typescript": "^5.9.3",
62
+ "vite": "^8.0.0",
63
+ "zustand": "^5.0.13"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public",
67
+ "registry": "https://registry.npmjs.org/"
68
+ },
69
+ "scripts": {
70
+ "build": "vite build && tsc -p tsconfig.build.json && node ../../scripts/flatten-dts.mjs",
71
+ "typecheck": "tsc --noEmit"
72
+ }
6
73
  }