@oj-module/runtime 0.1.5
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.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/api/notifications/index.d.ts +2 -0
- package/dist/api/system/menu/index.d.ts +6 -0
- package/dist/api/system/menu/types.d.ts +19 -0
- package/dist/api/system/role/api/client.d.ts +19 -0
- package/dist/api/system/role/api/client.schemas.d.ts +94 -0
- package/dist/api/system/role/index.d.ts +9 -0
- package/dist/api/system/role/types.d.ts +9 -0
- package/dist/api/user/index.d.ts +12 -0
- package/dist/api/user/types.d.ts +26 -0
- package/dist/components/access-control/index.d.ts +15 -0
- package/dist/components/basic-button/index.d.ts +7 -0
- package/dist/components/basic-content/index.d.ts +7 -0
- package/dist/components/basic-form/form-items/form-avatar-item.d.ts +6 -0
- package/dist/components/basic-form/form-items/form-tree-item.d.ts +13 -0
- package/dist/components/basic-form/form-items/index.d.ts +2 -0
- package/dist/components/basic-form/index.d.ts +1 -0
- package/dist/components/basic-table/constants.d.ts +1 -0
- package/dist/components/basic-table/index.d.ts +12 -0
- package/dist/components/basic-table/styles.d.ts +6 -0
- package/dist/components/exception-page/index.d.ts +3 -0
- package/dist/components/fullscreen-button/index.d.ts +17 -0
- package/dist/components/global-spin/index.d.ts +6 -0
- package/dist/components/iframe/index.d.ts +1 -0
- package/dist/components/jss-theme-provider/index.d.ts +26 -0
- package/dist/components/not-found/index.d.ts +6 -0
- package/dist/components/page-error/index.d.ts +2 -0
- package/dist/components/scrollbar/index.d.ts +7 -0
- package/dist/components/unknown-component/index.d.ts +6 -0
- package/dist/constants/options.d.ts +9 -0
- package/dist/contract/define-api.d.ts +43 -0
- package/dist/contract/define-api.js +44 -0
- package/dist/contract/errors.d.ts +16 -0
- package/dist/contract/errors.js +20 -0
- package/dist/contract/index.d.ts +15 -0
- package/dist/contract/index.js +13 -0
- package/dist/contract/scoped-request-like.d.ts +25 -0
- package/dist/contract/scoped-request-like.js +6 -0
- package/dist/hooks/use-access/constants.d.ts +24 -0
- package/dist/hooks/use-access/index.d.ts +9 -0
- package/dist/hooks/use-css-var/index.d.ts +17 -0
- package/dist/hooks/use-current-route/index.d.ts +6 -0
- package/dist/hooks/use-device-type/index.d.ts +9 -0
- package/dist/hooks/use-language/index.d.ts +5 -0
- package/dist/hooks/use-layout-menu/index.d.ts +6 -0
- package/dist/hooks/use-layout-style/index.d.ts +19 -0
- package/dist/hooks/use-preferences/index.d.ts +61 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/local-icons.d.ts +17 -0
- package/dist/icons/menu-icons.d.ts +4 -0
- package/dist/icons/ri.d.ts +14 -0
- package/dist/icons/types.d.ts +9 -0
- package/dist/index.d.ts +44 -0
- package/dist/layout/constants.d.ts +50 -0
- package/dist/layout/container-layout/index.d.ts +11 -0
- package/dist/layout/fullscreen-layout/index.d.ts +9 -0
- package/dist/layout/hooks/index.d.ts +1 -0
- package/dist/layout/hooks/use-layout.d.ts +20 -0
- package/dist/layout/keep-alive-layer/index.d.ts +15 -0
- package/dist/layout/layout-content/index.d.ts +3 -0
- package/dist/layout/layout-effects/index.d.ts +9 -0
- package/dist/layout/layout-footer/index.d.ts +5 -0
- package/dist/layout/layout-header/components/fullscreen-button.d.ts +2 -0
- package/dist/layout/layout-header/components/language-button.d.ts +2 -0
- package/dist/layout/layout-header/components/theme-button.d.ts +9 -0
- package/dist/layout/layout-header/components/user-menu.d.ts +2 -0
- package/dist/layout/layout-header/index.d.ts +5 -0
- package/dist/layout/layout-menu/index.d.ts +17 -0
- package/dist/layout/layout-menu/style.d.ts +6 -0
- package/dist/layout/layout-menu/types.d.ts +26 -0
- package/dist/layout/layout-menu/use-menu.d.ts +7 -0
- package/dist/layout/layout-menu/utils.d.ts +49 -0
- package/dist/layout/layout-mixed-sidebar/first-column-menu.d.ts +9 -0
- package/dist/layout/layout-mixed-sidebar/index.d.ts +14 -0
- package/dist/layout/layout-mobile-menu/index.d.ts +1 -0
- package/dist/layout/layout-root/index.d.ts +5 -0
- package/dist/layout/layout-sidebar/index.d.ts +5 -0
- package/dist/layout/layout-tabbar/components/draggable-tab-bar.d.ts +16 -0
- package/dist/layout/layout-tabbar/components/tab-maximize.d.ts +10 -0
- package/dist/layout/layout-tabbar/components/tab-options.d.ts +17 -0
- package/dist/layout/layout-tabbar/hooks/use-dropdown-menu.d.ts +26 -0
- package/dist/layout/layout-tabbar/index.d.ts +5 -0
- package/dist/layout/layout-tabbar/style.d.ts +6 -0
- package/dist/layout/parent-layout/index.d.ts +1 -0
- package/dist/layout/widgets/breadcrumb-views/index.d.ts +1 -0
- package/dist/layout/widgets/global-search/components/search-footer.d.ts +5 -0
- package/dist/layout/widgets/global-search/components/search-panel.d.ts +11 -0
- package/dist/layout/widgets/global-search/index.d.ts +1 -0
- package/dist/layout/widgets/logo/index.d.ts +9 -0
- package/dist/layout/widgets/notification/index.d.ts +19 -0
- package/dist/layout/widgets/notification/notification-container.d.ts +2 -0
- package/dist/layout/widgets/notification/types.d.ts +7 -0
- package/dist/layout/widgets/preferences/blocks/animation/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/footer/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/general/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/general/utils.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/index.d.ts +7 -0
- package/dist/layout/widgets/preferences/blocks/layout/constants.d.ts +4 -0
- package/dist/layout/widgets/preferences/blocks/layout/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/sidebar/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/tabbar/index.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/theme/builtin.d.ts +1 -0
- package/dist/layout/widgets/preferences/blocks/theme/index.d.ts +2 -0
- package/dist/layout/widgets/preferences/blocks/theme/theme.d.ts +1 -0
- package/dist/layout/widgets/preferences/index.d.ts +2 -0
- package/dist/layout/widgets/preferences/number-input-spinner.d.ts +10 -0
- package/dist/layout/widgets/preferences/select-item.d.ts +9 -0
- package/dist/layout/widgets/preferences/switch-item.d.ts +8 -0
- package/dist/layout/widgets/preferences/text-input.d.ts +8 -0
- package/dist/layout/widgets/sider-trigger/index.d.ts +5 -0
- package/dist/locales/helper.d.ts +15 -0
- package/dist/locales/index.d.ts +18 -0
- package/dist/locales/t.d.ts +10 -0
- package/dist/module-loader/define-module.d.ts +11 -0
- package/dist/module-loader/index.d.ts +20 -0
- package/dist/module-loader/keep-alive.d.ts +18 -0
- package/dist/module-loader/semver.d.ts +8 -0
- package/dist/module-loader/slots.d.ts +9 -0
- package/dist/module-loader/types.d.ts +91 -0
- package/dist/pages/login/index.d.ts +1 -0
- package/dist/plugins/hide-loading.d.ts +1 -0
- package/dist/plugins/loading.d.ts +7 -0
- package/dist/router/constants.d.ts +1 -0
- package/dist/router/extra-info/index.d.ts +1 -0
- package/dist/router/extra-info/route-path.d.ts +22 -0
- package/dist/router/guard/auth-guard.d.ts +21 -0
- package/dist/router/guard/index.d.ts +1 -0
- package/dist/router/guard/utils.d.ts +2 -0
- package/dist/router/index.d.ts +12 -0
- package/dist/router/routes/config.d.ts +7 -0
- package/dist/router/routes/core/auth.d.ts +13 -0
- package/dist/router/routes/core/exception.d.ts +12 -0
- package/dist/router/routes/core/fallback.d.ts +3 -0
- package/dist/router/routes/core/index.d.ts +2 -0
- package/dist/router/routes/index.d.ts +118 -0
- package/dist/router/types.d.ts +90 -0
- package/dist/router/utils/add-route-id-by-path.d.ts +81 -0
- package/dist/router/utils/ascending.d.ts +99 -0
- package/dist/router/utils/flatten-routes.d.ts +5 -0
- package/dist/router/utils/generate-menu-items-from-routes.d.ts +10 -0
- package/dist/router/utils/generate-routes-from-backend.d.ts +79 -0
- package/dist/router/utils/generate-routes-from-frontend.d.ts +5 -0
- package/dist/router/utils/merge-route-modules.d.ts +2 -0
- package/dist/router/utils/remove-trailing-slash.d.ts +10 -0
- package/dist/router/utils/resolve-layout.d.ts +17 -0
- package/dist/router/utils/resolve-login-route.d.ts +31 -0
- package/dist/runtime.js +27121 -0
- package/dist/store/access.d.ts +14 -0
- package/dist/store/api-provider.d.ts +47 -0
- package/dist/store/auth-provider.d.ts +19 -0
- package/dist/store/auth.d.ts +20 -0
- package/dist/store/global.d.ts +12 -0
- package/dist/store/preferences/index.d.ts +80 -0
- package/dist/store/preferences/types.d.ts +254 -0
- package/dist/store/tabs.d.ts +343 -0
- package/dist/store/user.d.ts +7 -0
- package/dist/types/app-info.d.ts +18 -0
- package/dist/utils/cn/index.d.ts +2 -0
- package/dist/utils/dom/index.d.ts +14 -0
- package/dist/utils/get-all-expanded-keys/index.d.ts +1 -0
- package/dist/utils/get-app-info/index.d.ts +13 -0
- package/dist/utils/get-app-namespace/index.d.ts +1 -0
- package/dist/utils/get-redirect-path.d.ts +8 -0
- package/dist/utils/iframe-guard.d.ts +18 -0
- package/dist/utils/is/index.d.ts +56 -0
- package/dist/utils/is-dark-theme/index.d.ts +7 -0
- package/dist/utils/is-light-theme/index.d.ts +7 -0
- package/dist/utils/is-windows-os/index.d.ts +6 -0
- package/dist/utils/progress/index.d.ts +3 -0
- package/dist/utils/remember-route/index.d.ts +1 -0
- package/dist/utils/request/constants.d.ts +5 -0
- package/dist/utils/request/envelope.d.ts +5 -0
- package/dist/utils/request/error-response.d.ts +12 -0
- package/dist/utils/request/global-progress.d.ts +21 -0
- package/dist/utils/request/go-login.d.ts +6 -0
- package/dist/utils/request/header-safe.d.ts +1 -0
- package/dist/utils/request/index.d.ts +1 -0
- package/dist/utils/request/refresh.d.ts +11 -0
- package/dist/utils/request/scoped.d.ts +17 -0
- package/dist/utils/request/whitelist.d.ts +1 -0
- package/dist/utils/static-antd/index.d.ts +12 -0
- package/dist/utils/toggle-html-class/index.d.ts +9 -0
- package/dist/utils/tree/index.d.ts +35 -0
- package/package.json +71 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 构造树型结构数据
|
|
3
|
+
* @param data 数据源
|
|
4
|
+
* @param id id字段 默认id
|
|
5
|
+
* @param parentId 父节点字段,默认parentId
|
|
6
|
+
* @param children 子节点字段,默认children
|
|
7
|
+
* @returns 追加字段后的树
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleTree(data: any[], id?: string, parentId?: string, children?: string): any;
|
|
10
|
+
export interface TreeConfigOptions {
|
|
11
|
+
childProps: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @zh_CN 遍历树形结构,并返回所有节点中指定的值。
|
|
15
|
+
* @param tree 树形结构数组
|
|
16
|
+
* @param getValue 获取节点值的函数
|
|
17
|
+
* @param options 作为子节点数组的可选属性名称。
|
|
18
|
+
* @returns 所有节点中指定的值的数组
|
|
19
|
+
*/
|
|
20
|
+
export declare function traverseTreeValues<T, V>(tree: T[], getValue: (node: T) => V, options?: TreeConfigOptions): V[];
|
|
21
|
+
/**
|
|
22
|
+
* 根据条件过滤给定树结构的节点,并以原有顺序返回所有匹配节点的数组。
|
|
23
|
+
* @param tree 要过滤的树结构的根节点数组。
|
|
24
|
+
* @param filter 用于匹配每个节点的条件。
|
|
25
|
+
* @param options 作为子节点数组的可选属性名称。
|
|
26
|
+
* @returns 包含所有匹配节点的数组。
|
|
27
|
+
*/
|
|
28
|
+
export declare function filterTree<T extends Record<string, any>>(tree: T[], filter: (node: T) => boolean, options?: TreeConfigOptions): T[];
|
|
29
|
+
/**
|
|
30
|
+
* 根据条件重新映射给定树结构的节点
|
|
31
|
+
* @param tree 要过滤的树结构的根节点数组。
|
|
32
|
+
* @param mapper 用于map每个节点的条件。
|
|
33
|
+
* @param options 作为子节点数组的可选属性名称。
|
|
34
|
+
*/
|
|
35
|
+
export declare function mapTree<T, V extends Record<string, any>>(tree: T[], mapper: (node: T) => V, options?: TreeConfigOptions): V[];
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oj-module/runtime",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.5",
|
|
5
|
+
"description": "React Antd Admin 框架运行时,供模块工程消费",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"imports": {
|
|
8
|
+
"#src/*": "./src/*",
|
|
9
|
+
"#modules/*": "../../modules/*",
|
|
10
|
+
"#manifest.json": "../../manifest.json"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/runtime.js"
|
|
16
|
+
},
|
|
17
|
+
"./contract": {
|
|
18
|
+
"types": "./dist/contract/index.d.ts",
|
|
19
|
+
"default": "./dist/contract/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./contract/errors": {
|
|
22
|
+
"types": "./dist/contract/errors.d.ts",
|
|
23
|
+
"default": "./dist/contract/errors.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@ant-design/icons": "^6.2.3",
|
|
31
|
+
"@ant-design/pro-components": "^3.1.12-0",
|
|
32
|
+
"@dnd-kit/core": "^6.3.1",
|
|
33
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
34
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
35
|
+
"ahooks": "^3.9.7",
|
|
36
|
+
"antd": "^6.4.2",
|
|
37
|
+
"antd-img-crop": "^4.30.0",
|
|
38
|
+
"clsx": "^2.1.1",
|
|
39
|
+
"i18next": "^26.2.0",
|
|
40
|
+
"keepalive-for-react": "^5.0.11",
|
|
41
|
+
"ky": "^2.0.2",
|
|
42
|
+
"motion": "^12.38.0",
|
|
43
|
+
"nprogress": "^0.2.0",
|
|
44
|
+
"pinyin-pro": "^3.28.1",
|
|
45
|
+
"react": "^19.2.6",
|
|
46
|
+
"react-dom": "^19.2.6",
|
|
47
|
+
"react-error-boundary": "^6.1.1",
|
|
48
|
+
"react-i18next": "^17.0.8",
|
|
49
|
+
"react-jss": "^10.10.0",
|
|
50
|
+
"react-router": "^7.15.1",
|
|
51
|
+
"simplebar-react": "^3.3.2",
|
|
52
|
+
"spin-delay": "^2.0.1",
|
|
53
|
+
"tailwind-merge": "^3.6.0",
|
|
54
|
+
"zustand": "^5.0.13"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"registry": "https://registry.npmjs.org/",
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"zod": "^4.5.4"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@iconify-json/ri": "^1.2.10",
|
|
65
|
+
"@iconify/tools": "^5.0.11",
|
|
66
|
+
"unplugin-icons": "^23.0.1"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "vite build && tsc -p tsconfig.contract.json && tsc -p tsconfig.dts.json && node scripts/rewrite-dts-specifiers.mjs && node scripts/inline-css.mjs"
|
|
70
|
+
}
|
|
71
|
+
}
|