diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6a724f2..92601a1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,117 @@
# Changelog
+## [v2.0.0-beta.1](https://github.com/soybeanjs/soybean-admin/compare/v1.3.15...v2.0.0-beta.1) (2025-10-25)
+
+### 🚨 Breaking Changes
+
+- **hooks**: refactor useTable and enhance type definitions - by @soybeanjs [(8cc51)](https://github.com/soybeanjs/soybean-admin/commit/8cc5177)
+- **projects**: optimize layout mode, split horizontal mix component into two layouts, and rename the component. - by **Azir** [(b6ac3)](https://github.com/soybeanjs/soybean-admin/commit/b6ac310)
+- **request**: remove cancelRequest method and related logic from request instances - by @soybeanjs [(b4e12)](https://github.com/soybeanjs/soybean-admin/commit/b4e1253)
+
+### 🚀 Features
+
+- **components**:
+ - add the IconTooltip component. - by **Azir-11** [(a55b4)](https://github.com/soybeanjs/soybean-admin/commit/a55b4dc)
+ - replace NTooltip with IconTooltip and optimize the layout of related components. - by **Azir-11** [(40057)](https://github.com/soybeanjs/soybean-admin/commit/4005763)
+- **hooks**:
+ - add scrollX computation for total table width in useNaiveTable - by @Lruihao [(358e1)](https://github.com/soybeanjs/soybean-admin/commit/358e129)
+- **packages**:
+ - materials support slider-tab. closed #823 - by @CyberShen in https://github.com/soybeanjs/soybean-admin/issues/823 [(61fa4)](https://github.com/soybeanjs/soybean-admin/commit/61fa4b7)
+- **projects**:
+ - refactor theme drawer with tabbed layout for better UX. - by **Azir** [(8ba71)](https://github.com/soybeanjs/soybean-admin/commit/8ba71a0)
+ - Add current time display option for watermark - by @wenyuanw in https://github.com/soybeanjs/soybean-admin/issues/772 [(f238f)](https://github.com/soybeanjs/soybean-admin/commit/f238fcb)
+ - add 'vertical-hybrid-header-first' layout mode - by @wenyuanw [(b4e5c)](https://github.com/soybeanjs/soybean-admin/commit/b4e5c6d)
+ - add prompt information for scrolling mode and tab bar caching. - by **Azir-11** [(29a2a)](https://github.com/soybeanjs/soybean-admin/commit/29a2a5c)
+ - support theme preset function. - by **Azir-11** [(257f1)](https://github.com/soybeanjs/soybean-admin/commit/257f118)
+ - modify the default value of the reset cache policy to 'refresh'. - by **Azir-11** [(3c0a5)](https://github.com/soybeanjs/soybean-admin/commit/3c0a528)
+ - optimize tabs cache cleaning strategy. close #820. - by **Azir-11** in https://github.com/soybeanjs/soybean-admin/issues/820 [(ef7ac)](https://github.com/soybeanjs/soybean-admin/commit/ef7acc6)
+ - support closing tabs with middle mouse button click - by @wenyuanw [(a8d1e)](https://github.com/soybeanjs/soybean-admin/commit/a8d1e5d)
+ - support set global redius - by **CyberShen123** [(24c6d)](https://github.com/soybeanjs/soybean-admin/commit/24c6df5)
+ - support set global redius - by **CyberShen123** [(3549c)](https://github.com/soybeanjs/soybean-admin/commit/3549c4d)
+- **styles**:
+ - add text-autospace property to improve text layout - by @wenyuanw [(345aa)](https://github.com/soybeanjs/soybean-admin/commit/345aa29)
+
+### 🐞 Bug Fixes
+
+- **hooks**:
+ - correct chart rendering logic in useEcharts - by @soybeanjs [(8a7cd)](https://github.com/soybeanjs/soybean-admin/commit/8a7cd59)
+- **packages**:
+ - fix the parsing logic for stored data to ensure correct return of boolean values - by @Lruihao [(9ea56)](https://github.com/soybeanjs/soybean-admin/commit/9ea56c9)
+ - axios: fix json response. fixed #815 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/815 [(5be86)](https://github.com/soybeanjs/soybean-admin/commit/5be864a)
+- **projects**:
+ - Fix i18n-ally not working when setting moduleResolution to bundler. fixed #780 - by @xiaobao0505 in https://github.com/soybeanjs/soybean-admin/issues/780 [(41191)](https://github.com/soybeanjs/soybean-admin/commit/41191d5)
+- **styles**:
+ - show light color scrollbar while dark mode is on - by **whyang** [(dac50)](https://github.com/soybeanjs/soybean-admin/commit/dac5075)
+- **table**:
+ - add type annotations for records in useTable hook - by @soybeanjs [(32b8f)](https://github.com/soybeanjs/soybean-admin/commit/32b8f99)
+- **types**:
+ - fix proxy types - by @soybeanjs [(3d72f)](https://github.com/soybeanjs/soybean-admin/commit/3d72f95)
+ - fix ts type error - by @soybeanjs [(d5a3a)](https://github.com/soybeanjs/soybean-admin/commit/d5a3a25)
+
+### 🛠 Optimizations
+
+- **hooks**:
+ - optimize useEcharts - by @soybeanjs [(936b8)](https://github.com/soybeanjs/soybean-admin/commit/936b834)
+- **packages**:
+ - remove ofetch package - by @soybeanjs [(abaaa)](https://github.com/soybeanjs/soybean-admin/commit/abaaa4a)
+- **projects**:
+ - improve theme drawer responsive width for mobile devices - by @wenyuanw [(8439a)](https://github.com/soybeanjs/soybean-admin/commit/8439a60)
+ - improve robustness of second-level menu key logic - by @wenyuanw [(8b8a2)](https://github.com/soybeanjs/soybean-admin/commit/8b8a208)
+ - optimize theme drawer width - by @soybeanjs [(81468)](https://github.com/soybeanjs/soybean-admin/commit/8146858)
+ - optimize api type file - by @soybeanjs [(3a343)](https://github.com/soybeanjs/soybean-admin/commit/3a343ee)
+ - optimize radius settings - by @soybeanjs [(87a66)](https://github.com/soybeanjs/soybean-admin/commit/87a66a4)
+- **request**:
+ - enhance request options and response handling with generic types - by @soybeanjs [(50a5c)](https://github.com/soybeanjs/soybean-admin/commit/50a5cba)
+
+### 💅 Refactors
+
+- **hooks**:
+ - optimize useContext and update useMixMenuContext - by @soybeanjs [(c9651)](https://github.com/soybeanjs/soybean-admin/commit/c965140)
+ - streamline column visibility handling in useTable and table components - by @soybeanjs [(ee434)](https://github.com/soybeanjs/soybean-admin/commit/ee43414)
+ - remove useSignal hook and update exports - by @soybeanjs [(87adc)](https://github.com/soybeanjs/soybean-admin/commit/87adc35)
+- **menu**:
+ - optimize the margin on the menu - by **NicholasLD** [(d7311)](https://github.com/soybeanjs/soybean-admin/commit/d731111)
+- **projects**:
+ - remove unnecessary logic in onRouteSwitchWhenLoggedIn - by @wenyuanw [(d6c81)](https://github.com/soybeanjs/soybean-admin/commit/d6c8142)
+- **request**:
+ - unify response transformation methods and deprecate transformBackendResponse - by @soybeanjs [(f83ee)](https://github.com/soybeanjs/soybean-admin/commit/f83eefb)
+- **types**:
+ - move Auth and Route namespaces to separate files and clean up api.d.ts - by **Azir** [(d37ce)](https://github.com/soybeanjs/soybean-admin/commit/d37ce04)
+
+### 📖 Documentation
+
+- **projects**: add github trendshift info. - by **恕瑞玛的皇帝** [(2a0c9)](https://github.com/soybeanjs/soybean-admin/commit/2a0c9f1)
+
+### 🏡 Chore
+
+- **deps**:
+ - update NodeJS and pnpm version requirements in package.json and documentation - by **Junior25306** [(a5c4b)](https://github.com/soybeanjs/soybean-admin/commit/a5c4b4e)
+ - update deps - by @soybeanjs [(5cb1c)](https://github.com/soybeanjs/soybean-admin/commit/5cb1ceb)
+ - update deps - by @soybeanjs [(aeb63)](https://github.com/soybeanjs/soybean-admin/commit/aeb6369)
+ - update deps - by @soybeanjs [(e89b8)](https://github.com/soybeanjs/soybean-admin/commit/e89b86c)
+ - update deps - by @soybeanjs [(c962f)](https://github.com/soybeanjs/soybean-admin/commit/c962f7b)
+ - update deps - by @soybeanjs [(12135)](https://github.com/soybeanjs/soybean-admin/commit/1213531)
+ - update deps - by @soybeanjs [(b041f)](https://github.com/soybeanjs/soybean-admin/commit/b041fdd)
+ - update deps - by @soybeanjs [(d567c)](https://github.com/soybeanjs/soybean-admin/commit/d567c05)
+ - update deps - by @soybeanjs [(6cbf5)](https://github.com/soybeanjs/soybean-admin/commit/6cbf570)
+- **other**:
+ - update the ESLint validation configuration to support more file types. - by **Azir-11** [(be8f9)](https://github.com/soybeanjs/soybean-admin/commit/be8f915)
+- **packages**:
+ - update Vite version to 7 in package.json and documentation. - by **Azir** [(03dd6)](https://github.com/soybeanjs/soybean-admin/commit/03dd64c)
+ - add picomatch to fix scripts - by @soybeanjs [(805c3)](https://github.com/soybeanjs/soybean-admin/commit/805c338)
+- **vscode**:
+ - remove unused vue.server.hybridMode setting from .vscode/settings.json - by @soybeanjs [(13319)](https://github.com/soybeanjs/soybean-admin/commit/133196f)
+
+### 🎨 Styles
+
+- **projects**: format code. - by **Azir-11** [(100e0)](https://github.com/soybeanjs/soybean-admin/commit/100e0ea)
+
+### ❤️ Contributors
+
+[](https://github.com/soybeanjs) [](https://github.com/wenyuanw) [](https://github.com/CyberShen) [](https://github.com/Lruihao) [](https://github.com/xiaobao0505)
+[CyberShen123](mailto:s.lijun@qq.com), [whyang](mailto:whyang9701@gmail.com), [HongxuanG](mailto:1359774872@qq.com), [Azir-11](mailto:2075125282@qq.com), [NicholasLD](mailto:878639947@qq.com), [Junior25306](mailto:dayu429@qq.com)
+
## [v1.3.15](https://github.com/soybeanjs/soybean-admin/compare/v1.3.14...v1.3.15) (2025-06-24)
### 🚀 Features
diff --git a/package.json b/package.json
index 0b09c785..ccaf7ec2 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "soybean-admin",
"type": "module",
- "version": "1.3.15",
+ "version": "2.0.0-beta.1",
"description": "A fresh and elegant admin template, based on Vue3、Vite7、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite7、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
"author": {
"name": "Soybean",
@@ -54,7 +54,7 @@
"@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*",
"@sa/utils": "workspace:*",
- "@vueuse/core": "13.9.0",
+ "@vueuse/core": "14.0.0",
"clipboard": "2.0.11",
"dayjs": "1.11.18",
"defu": "6.1.4",
@@ -64,43 +64,43 @@
"nprogress": "0.2.0",
"pinia": "3.0.3",
"tailwind-merge": "3.3.1",
- "vue": "3.5.21",
+ "vue": "3.5.22",
"vue-draggable-plus": "0.6.0",
"vue-i18n": "11.1.12",
- "vue-router": "4.5.1"
+ "vue-router": "4.6.3"
},
"devDependencies": {
"@elegant-router/vue": "0.3.8",
- "@iconify/json": "2.2.385",
+ "@iconify/json": "2.2.400",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.7.1",
- "@types/node": "24.5.1",
+ "@types/node": "24.9.1",
"@types/nprogress": "0.2.3",
- "@unocss/eslint-config": "66.5.1",
- "@unocss/preset-icons": "66.5.1",
- "@unocss/preset-uno": "66.5.1",
- "@unocss/transformer-directives": "66.5.1",
- "@unocss/transformer-variant-group": "66.5.1",
- "@unocss/vite": "66.5.1",
+ "@unocss/eslint-config": "66.5.4",
+ "@unocss/preset-icons": "66.5.4",
+ "@unocss/preset-uno": "66.5.4",
+ "@unocss/transformer-directives": "66.5.4",
+ "@unocss/transformer-variant-group": "66.5.4",
+ "@unocss/vite": "66.5.4",
"@vitejs/plugin-vue": "6.0.1",
"@vitejs/plugin-vue-jsx": "5.1.1",
"consola": "3.4.2",
- "eslint": "9.35.0",
- "eslint-plugin-vue": "10.4.0",
+ "eslint": "9.38.0",
+ "eslint-plugin-vue": "10.5.1",
"kolorist": "1.8.0",
- "sass": "1.92.1",
+ "sass": "1.93.2",
"simple-git-hooks": "2.13.1",
- "tsx": "4.20.5",
- "typescript": "5.9.2",
- "unplugin-icons": "22.3.0",
- "unplugin-vue-components": "29.0.0",
- "vite": "7.1.5",
+ "tsx": "4.20.6",
+ "typescript": "5.9.3",
+ "unplugin-icons": "22.5.0",
+ "unplugin-vue-components": "30.0.0",
+ "vite": "7.1.12",
"vite-plugin-progress": "0.0.7",
"vite-plugin-svg-icons": "2.0.1",
- "vite-plugin-vue-devtools": "8.0.2",
+ "vite-plugin-vue-devtools": "8.0.3",
"vue-eslint-parser": "10.2.0",
- "vue-tsc": "3.0.7"
+ "vue-tsc": "3.1.2"
},
"simple-git-hooks": {
"commit-msg": "pnpm sa git-commit-verify",
diff --git a/packages/alova/package.json b/packages/alova/package.json
index 1e3bb5f8..996ccc4f 100644
--- a/packages/alova/package.json
+++ b/packages/alova/package.json
@@ -1,6 +1,6 @@
{
"name": "@sa/alova",
- "version": "1.3.15",
+ "version": "2.0.0-beta.1",
"exports": {
".": "./src/index.ts",
"./fetch": "./src/fetch.ts",
diff --git a/packages/axios/package.json b/packages/axios/package.json
index c173a016..dda52dfa 100644
--- a/packages/axios/package.json
+++ b/packages/axios/package.json
@@ -1,6 +1,6 @@
{
"name": "@sa/axios",
- "version": "1.3.15",
+ "version": "2.0.0-beta.1",
"exports": {
".": "./src/index.ts"
},
diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts
index cfbde18e..08af572d 100644
--- a/packages/axios/src/index.ts
+++ b/packages/axios/src/index.ts
@@ -14,11 +14,12 @@ import type {
ResponseType
} from './type';
-function createCommonRequest(
- axiosConfig?: CreateAxiosDefaults,
- options?: Partial>
-) {
- const opts = createDefaultOptions(options);
+function createCommonRequest<
+ ResponseData,
+ ApiData = ResponseData,
+ State extends Record = Record
+>(axiosConfig?: CreateAxiosDefaults, options?: Partial>) {
+ const opts = createDefaultOptions(options);
const axiosConf = createAxiosConfig(axiosConfig);
const instance = axios.create(axiosConf);
@@ -83,14 +84,6 @@ function createCommonRequest(
}
);
- function cancelRequest(requestId: string) {
- const abortController = abortControllerMap.get(requestId);
- if (abortController) {
- abortController.abort();
- abortControllerMap.delete(requestId);
- }
- }
-
function cancelAllRequest() {
abortControllerMap.forEach(abortController => {
abortController.abort();
@@ -101,7 +94,6 @@ function createCommonRequest(
return {
instance,
opts,
- cancelRequest,
cancelAllRequest
};
}
@@ -112,27 +104,27 @@ function createCommonRequest(
* @param axiosConfig axios config
* @param options request options
*/
-export function createRequest>(
+export function createRequest>(
axiosConfig?: CreateAxiosDefaults,
- options?: Partial>
+ options?: Partial>
) {
- const { instance, opts, cancelRequest, cancelAllRequest } = createCommonRequest(axiosConfig, options);
+ const { instance, opts, cancelAllRequest } = createCommonRequest(axiosConfig, options);
- const request: RequestInstance = async function request(
- config: CustomAxiosRequestConfig
- ) {
+ const request: RequestInstance = async function request<
+ T extends ApiData = ApiData,
+ R extends ResponseType = 'json'
+ >(config: CustomAxiosRequestConfig) {
const response: AxiosResponse = await instance(config);
const responseType = response.config?.responseType || 'json';
if (responseType === 'json') {
- return opts.transformBackendResponse(response);
+ return opts.transform(response);
}
return response.data as MappedType;
- } as RequestInstance;
+ } as RequestInstance;
- request.cancelRequest = cancelRequest;
request.cancelAllRequest = cancelAllRequest;
request.state = {} as State;
@@ -147,14 +139,14 @@ export function createRequest>(
+export function createFlatRequest>(
axiosConfig?: CreateAxiosDefaults,
- options?: Partial>
+ options?: Partial>
) {
- const { instance, opts, cancelRequest, cancelAllRequest } = createCommonRequest(axiosConfig, options);
+ const { instance, opts, cancelAllRequest } = createCommonRequest(axiosConfig, options);
- const flatRequest: FlatRequestInstance = async function flatRequest<
- T = any,
+ const flatRequest: FlatRequestInstance = async function flatRequest<
+ T extends ApiData = ApiData,
R extends ResponseType = 'json'
>(config: CustomAxiosRequestConfig) {
try {
@@ -163,20 +155,21 @@ export function createFlatRequest, error: null };
+ return { data: response.data as MappedType, error: null, response };
} catch (error) {
return { data: null, error, response: (error as AxiosError).response };
}
- } as FlatRequestInstance;
+ } as FlatRequestInstance;
- flatRequest.cancelRequest = cancelRequest;
flatRequest.cancelAllRequest = cancelAllRequest;
- flatRequest.state = {} as State;
+ flatRequest.state = {
+ ...opts.defaultState
+ } as State;
return flatRequest;
}
diff --git a/packages/axios/src/options.ts b/packages/axios/src/options.ts
index 8b2b116a..e7866397 100644
--- a/packages/axios/src/options.ts
+++ b/packages/axios/src/options.ts
@@ -4,15 +4,27 @@ import { stringify } from 'qs';
import { isHttpSuccess } from './shared';
import type { RequestOption } from './type';
-export function createDefaultOptions(options?: Partial>) {
- const opts: RequestOption = {
+export function createDefaultOptions<
+ ResponseData,
+ ApiData = ResponseData,
+ State extends Record = Record
+>(options?: Partial>) {
+ const opts: RequestOption = {
+ defaultState: {} as State,
+ transform: async response => response.data as unknown as ApiData,
+ transformBackendResponse: async response => response.data as unknown as ApiData,
onRequest: async config => config,
isBackendSuccess: _response => true,
onBackendFail: async () => {},
- transformBackendResponse: async response => response.data,
onError: async () => {}
};
+ if (options?.transform) {
+ opts.transform = options.transform;
+ } else {
+ opts.transform = options?.transformBackendResponse || opts.transform;
+ }
+
Object.assign(opts, options);
return opts;
diff --git a/packages/axios/src/type.ts b/packages/axios/src/type.ts
index 644847ff..846950c4 100644
--- a/packages/axios/src/type.ts
+++ b/packages/axios/src/type.ts
@@ -8,7 +8,30 @@ export type ContentType =
| 'application/x-www-form-urlencoded'
| 'application/octet-stream';
-export interface RequestOption {
+export type ResponseTransform = (input: Input) => Output | Promise