omni-layout 0.0.4-beta.3 → 0.0.5-beta.2

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 (58) hide show
  1. package/dist/demo/src/App.d.ts +14 -0
  2. package/dist/demo/src/index.d.ts +1 -0
  3. package/dist/demo/src/layouts/BasicLayout.d.ts +16 -0
  4. package/dist/demo/src/pages/ArticlesPage.d.ts +10 -0
  5. package/dist/demo/src/pages/CategoryPage.d.ts +9 -0
  6. package/dist/demo/src/pages/Dashboard.d.ts +10 -0
  7. package/dist/demo/src/pages/DetailPage.d.ts +10 -0
  8. package/dist/demo/src/pages/ListPage.d.ts +10 -0
  9. package/dist/demo/src/pages/SettingPage.d.ts +13 -0
  10. package/dist/demo/vite.config.d.ts +2 -0
  11. package/dist/index.css +16 -5
  12. package/dist/index.esm.css +16 -5
  13. package/dist/index.esm.js +2 -2
  14. package/dist/index.js +1923 -285
  15. package/dist/{RouteContext.d.ts → src/RouteContext.d.ts} +1 -1
  16. package/dist/{compontent → src/compontent}/app/index.d.ts +1 -1
  17. package/dist/{compontent → src/compontent}/defaultSettings.d.ts +1 -1
  18. package/dist/{compontent → src/compontent}/footer/footer.d.ts +3 -3
  19. package/dist/{compontent → src/compontent}/header/all.d.ts +2 -2
  20. package/dist/src/compontent/header/favorate.d.ts +3 -0
  21. package/dist/{compontent → src/compontent}/header/help.d.ts +4 -4
  22. package/dist/{compontent → src/compontent}/header/index.d.ts +1 -1
  23. package/dist/{compontent → src/compontent}/search/index.d.ts +1 -1
  24. package/dist/{compontent → src/compontent}/sidemenu/BaseMenu.d.ts +1 -1
  25. package/dist/{compontent → src/compontent}/test/index.d.ts +2 -2
  26. package/dist/{compontent → src/compontent}/typings.d.ts +27 -6
  27. package/dist/src/mock/appInfos.d.ts +16 -0
  28. package/dist/src/mock/data.d.ts +5 -0
  29. package/dist/{model → src/model}/base.d.ts +8 -3
  30. package/dist/{model → src/model}/menu.d.ts +6 -1
  31. package/dist/{util → src/util}/getBreadcrumbProps.d.ts +1 -1
  32. package/dist/src/util/request.d.ts +11 -0
  33. package/package.json +6 -4
  34. package/dist/compontent/header/favorate.d.ts +0 -3
  35. package/dist/util/request.d.ts +0 -4
  36. /package/dist/{compontent → src/compontent}/GridContent/index.d.ts +0 -0
  37. /package/dist/{compontent → src/compontent}/NoticeIcon/NoticeList.d.ts +0 -0
  38. /package/dist/{compontent → src/compontent}/NoticeIcon/index.d.ts +0 -0
  39. /package/dist/{compontent → src/compontent}/PageHeaderWrapper/index.d.ts +0 -0
  40. /package/dist/{compontent → src/compontent}/PageHeaderWtihTagWrapper/index.d.ts +0 -0
  41. /package/dist/{compontent → src/compontent}/footer/index.d.ts +0 -0
  42. /package/dist/{compontent → src/compontent}/noticebox/index.d.ts +0 -0
  43. /package/dist/{compontent → src/compontent}/sidemenu/SiderMenu.d.ts +0 -0
  44. /package/dist/{compontent → src/compontent}/sidemenu/SiderMenuUtils.d.ts +0 -0
  45. /package/dist/{compontent → src/compontent}/sidemenu/index.d.ts +0 -0
  46. /package/dist/{const.d.ts → src/const.d.ts} +0 -0
  47. /package/dist/{data → src/data}/allmenu.d.ts +0 -0
  48. /package/dist/{data → src/data}/data.d.ts +0 -0
  49. /package/dist/{getPageTitle.d.ts → src/getPageTitle.d.ts} +0 -0
  50. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  51. /package/dist/{store → src/store}/common.d.ts +0 -0
  52. /package/dist/{util → src/util}/check.d.ts +0 -0
  53. /package/dist/{util → src/util}/data.d.ts +0 -0
  54. /package/dist/{util → src/util}/getMenuData.d.ts +0 -0
  55. /package/dist/{util → src/util}/pathTools.d.ts +0 -0
  56. /package/dist/{util → src/util}/tree.d.ts +0 -0
  57. /package/dist/{util → src/util}/utils.d.ts +0 -0
  58. /package/dist/{util → src/util}/watermark.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ /**
3
+ * App — 路由注册
4
+ *
5
+ * 路由与 mock 菜单数据保持一致:
6
+ * /manage/world → Dashboard (首页欢迎)
7
+ * /app/collection → ListPage (列表页 + 面包屑:应用管理 > 收藏管理)
8
+ * /manage/pms → ListPage (列表页 + 面包屑:系统管理 > 权限列表)
9
+ * /manage/data → SettingPage (带 Tabs 的设置页)
10
+ * /content/articles → ArticlesPage (文章列表,2 级面包屑:内容管理 > 文章列表)
11
+ * /content/articles/detail → DetailPage (3 级面包屑:内容管理 > 文章列表 > 文章详情)
12
+ * /content/category → CategoryPage (分类管理)
13
+ */
14
+ export default function App(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import 'omni-layout/index.less';
3
+ import 'omni-layout/antd.css';
4
+ /**
5
+ * BasicLayout — OmniLayout 的演示包装层
6
+ *
7
+ * 核心要点:
8
+ * 1. useLocation() 获取真实 location,pathname 随路由切换自动更新
9
+ * 2. useHistory() 用于 menuItemRender / tabRender 触发真实路由跳转
10
+ * 3. mockMode=true 所有 API 调用均由 src/mock/data.ts 中的本地数据拦截
11
+ * 4. noticeSwitch=true 展示消息中心徽标
12
+ * 5. siderSearchSwitch=true 展示侧边栏关键字搜索
13
+ */
14
+ export default function BasicLayout({ children }: {
15
+ children: React.ReactNode;
16
+ }): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /**
3
+ * ArticlesPage — 文章列表页(内容管理 > 文章列表)
4
+ *
5
+ * 演示点:
6
+ * - 2 级面包屑:内容管理 > 文章列表
7
+ * - 点击「查看详情」跳转到 /content/articles/detail,触发 3 级面包屑
8
+ * - Tab 页签自动新增,并高亮当前活跃 Tab
9
+ */
10
+ export default function ArticlesPage(): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ /**
3
+ * CategoryPage — 分类管理页(内容管理 > 分类管理)
4
+ *
5
+ * 演示点:
6
+ * - 面包屑:内容管理 > 分类管理(2 级)
7
+ * - 与文章列表处于同一父菜单「内容管理」下,切换时侧边菜单高亮变化
8
+ */
9
+ export default function CategoryPage(): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /**
3
+ * Dashboard — 首页欢迎页
4
+ *
5
+ * 演示点:
6
+ * - 路由 /manage/world 对应 "系统管理 > 欢迎界面",面包屑自动生成
7
+ * - 点击导航卡片触发路由跳转,侧边菜单高亮联动
8
+ * - Tab 页签自动新增当前路由
9
+ */
10
+ export default function Dashboard(): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /**
3
+ * DetailPage — 文章详情页(内容管理 > 文章列表 > 文章详情)
4
+ *
5
+ * 演示点(核心):
6
+ * - 3 级面包屑:内容管理 > 文章列表 > 文章详情(由 OmniLayout 根据 routesMap 自动生成)
7
+ * - 路由 /content/articles/detail 与 mock 菜单树中的第三级节点对应
8
+ * - Tab 页签列表新增本条目,侧边菜单高亮到父菜单「文章列表」
9
+ */
10
+ export default function DetailPage(): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ /**
3
+ * ListPage — 通用列表页
4
+ *
5
+ * 演示点:
6
+ * - 面包屑根据当前路由自动生成(2 级:父菜单 > 当前页)
7
+ * - 页头标题由 RouteContext 注入,与菜单数据中的 name 字段同步
8
+ * - 可用于 /app/collection 或 /manage/pms 两个路由
9
+ */
10
+ export default function ListPage(): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ /**
3
+ * SettingPage — 设置页(系统管理 > 数据权限)
4
+ *
5
+ * 演示点:
6
+ * - PageHeaderWrapper 的 tabList + onTabChange 联动(通过 OmniLayout noPageHeader=false 默认行为)
7
+ * - Tab 切换时内容区域变化,页头 Tabs 与内容保持同步
8
+ * - 面包屑:系统管理 > 数据权限(2 级)
9
+ *
10
+ * 注意:OmniLayout 内置的 PageHeaderWtihTagWrapper 的 tabList 是用于「历史访问 Tab 页签」,
11
+ * 本页面使用独立的 antd Tabs 演示页头级 Tabs 交互。
12
+ */
13
+ export default function SettingPage(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/dist/index.css CHANGED
@@ -318,7 +318,8 @@ mark {
318
318
  content: '';
319
319
  }
320
320
  .anticon {
321
- display: inline-block;
321
+ display: inline-flex;
322
+ align-items: center;
322
323
  color: inherit;
323
324
  font-style: normal;
324
325
  line-height: 0;
@@ -2087,11 +2088,21 @@ html {
2087
2088
  /* stylelint-disable */
2088
2089
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2089
2090
  .ant-pro-page-header-wrap-children-content {
2090
- margin: 24px 24px 0;
2091
+ margin: 12px 24px 0;
2091
2092
  }
2092
2093
  .ant-pro-page-header-wrap-page-header-warp {
2093
2094
  background-color: #fff;
2094
2095
  }
2096
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header {
2097
+ padding: 16px 24px 0;
2098
+ }
2099
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-heading {
2100
+ margin-bottom: 0;
2101
+ }
2102
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-footer {
2103
+ padding: 0;
2104
+ margin-top: 4px;
2105
+ }
2095
2106
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-detail {
2096
2107
  display: flex;
2097
2108
  }
@@ -2100,7 +2111,7 @@ html {
2100
2111
  width: 100%;
2101
2112
  }
2102
2113
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title-content {
2103
- margin-bottom: 16px;
2114
+ margin-bottom: 12px;
2104
2115
  }
2105
2116
  @media screen and (max-width: 576px) {
2106
2117
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content {
@@ -2119,12 +2130,12 @@ html {
2119
2130
  width: 100%;
2120
2131
  }
2121
2132
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title {
2122
- margin-bottom: 16px;
2133
+ margin-bottom: 12px;
2123
2134
  }
2124
2135
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-logo,
2125
2136
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content,
2126
2137
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2127
- margin-bottom: 16px;
2138
+ margin-bottom: 12px;
2128
2139
  }
2129
2140
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2130
2141
  min-width: 242px;
@@ -318,7 +318,8 @@ mark {
318
318
  content: '';
319
319
  }
320
320
  .anticon {
321
- display: inline-block;
321
+ display: inline-flex;
322
+ align-items: center;
322
323
  color: inherit;
323
324
  font-style: normal;
324
325
  line-height: 0;
@@ -2087,11 +2088,21 @@ html {
2087
2088
  /* stylelint-disable */
2088
2089
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2089
2090
  .ant-pro-page-header-wrap-children-content {
2090
- margin: 24px 24px 0;
2091
+ margin: 12px 24px 0;
2091
2092
  }
2092
2093
  .ant-pro-page-header-wrap-page-header-warp {
2093
2094
  background-color: #fff;
2094
2095
  }
2096
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header {
2097
+ padding: 16px 24px 0;
2098
+ }
2099
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-heading {
2100
+ margin-bottom: 0;
2101
+ }
2102
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-footer {
2103
+ padding: 0;
2104
+ margin-top: 4px;
2105
+ }
2095
2106
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-detail {
2096
2107
  display: flex;
2097
2108
  }
@@ -2100,7 +2111,7 @@ html {
2100
2111
  width: 100%;
2101
2112
  }
2102
2113
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title-content {
2103
- margin-bottom: 16px;
2114
+ margin-bottom: 12px;
2104
2115
  }
2105
2116
  @media screen and (max-width: 576px) {
2106
2117
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content {
@@ -2119,12 +2130,12 @@ html {
2119
2130
  width: 100%;
2120
2131
  }
2121
2132
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title {
2122
- margin-bottom: 16px;
2133
+ margin-bottom: 12px;
2123
2134
  }
2124
2135
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-logo,
2125
2136
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content,
2126
2137
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2127
- margin-bottom: 16px;
2138
+ margin-bottom: 12px;
2128
2139
  }
2129
2140
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2130
2141
  min-width: 242px;