omni-layout 0.0.5-beta.1 → 0.0.5-beta.3

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 (60) 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 +38 -4
  12. package/dist/index.esm.css +38 -4
  13. package/dist/index.esm.js +2 -2
  14. package/dist/index.js +1946 -124
  15. package/dist/{RouteContext.d.ts → src/RouteContext.d.ts} +1 -1
  16. package/dist/src/compontent/PageHeader/index.d.ts +14 -0
  17. package/dist/{compontent → src/compontent}/PageHeaderWrapper/index.d.ts +2 -2
  18. package/dist/{compontent → src/compontent}/PageHeaderWtihTagWrapper/index.d.ts +2 -2
  19. package/dist/{compontent → src/compontent}/app/index.d.ts +1 -1
  20. package/dist/{compontent → src/compontent}/defaultSettings.d.ts +3 -2
  21. package/dist/{compontent → src/compontent}/footer/footer.d.ts +3 -3
  22. package/dist/{compontent → src/compontent}/header/all.d.ts +2 -2
  23. package/dist/src/compontent/header/favorate.d.ts +3 -0
  24. package/dist/{compontent → src/compontent}/header/help.d.ts +4 -4
  25. package/dist/{compontent → src/compontent}/header/index.d.ts +1 -1
  26. package/dist/{compontent → src/compontent}/search/index.d.ts +5 -3
  27. package/dist/{compontent → src/compontent}/sidemenu/BaseMenu.d.ts +4 -5
  28. package/dist/{compontent → src/compontent}/test/index.d.ts +2 -2
  29. package/dist/{compontent → src/compontent}/typings.d.ts +27 -6
  30. package/dist/{index.d.ts → src/index.d.ts} +1 -1
  31. package/dist/src/mock/appInfos.d.ts +16 -0
  32. package/dist/src/mock/data.d.ts +5 -0
  33. package/dist/{model → src/model}/base.d.ts +8 -3
  34. package/dist/{model → src/model}/menu.d.ts +6 -1
  35. package/dist/{util → src/util}/getBreadcrumbProps.d.ts +2 -2
  36. package/dist/src/util/icon.d.ts +2 -0
  37. package/dist/src/util/request.d.ts +11 -0
  38. package/package.json +13 -12
  39. package/dist/compontent/header/favorate.d.ts +0 -3
  40. package/dist/util/request.d.ts +0 -4
  41. /package/dist/{compontent → src/compontent}/GridContent/index.d.ts +0 -0
  42. /package/dist/{compontent → src/compontent}/NoticeIcon/NoticeList.d.ts +0 -0
  43. /package/dist/{compontent → src/compontent}/NoticeIcon/index.d.ts +0 -0
  44. /package/dist/{compontent → src/compontent}/footer/index.d.ts +0 -0
  45. /package/dist/{compontent → src/compontent}/noticebox/index.d.ts +0 -0
  46. /package/dist/{compontent → src/compontent}/sidemenu/SiderMenu.d.ts +0 -0
  47. /package/dist/{compontent → src/compontent}/sidemenu/SiderMenuUtils.d.ts +0 -0
  48. /package/dist/{compontent → src/compontent}/sidemenu/index.d.ts +0 -0
  49. /package/dist/{const.d.ts → src/const.d.ts} +0 -0
  50. /package/dist/{data → src/data}/allmenu.d.ts +0 -0
  51. /package/dist/{data → src/data}/data.d.ts +0 -0
  52. /package/dist/{getPageTitle.d.ts → src/getPageTitle.d.ts} +0 -0
  53. /package/dist/{store → src/store}/common.d.ts +0 -0
  54. /package/dist/{util → src/util}/check.d.ts +0 -0
  55. /package/dist/{util → src/util}/data.d.ts +0 -0
  56. /package/dist/{util → src/util}/getMenuData.d.ts +0 -0
  57. /package/dist/{util → src/util}/pathTools.d.ts +0 -0
  58. /package/dist/{util → src/util}/tree.d.ts +0 -0
  59. /package/dist/{util → src/util}/utils.d.ts +0 -0
  60. /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
@@ -1766,6 +1766,17 @@ html {
1766
1766
  padding-right: 15px;
1767
1767
  width: 35px;
1768
1768
  cursor: pointer;
1769
+ border: 0;
1770
+ background: transparent;
1771
+ outline: none;
1772
+ line-height: 49px;
1773
+ }
1774
+ .omni-layout-app .omni-notice-box .tool-head-close:focus,
1775
+ .omni-layout-app .omni-notice-box .tool-head-close:active {
1776
+ outline: none;
1777
+ }
1778
+ .omni-layout-app .omni-notice-box .tool-head-close .anticon {
1779
+ color: #666;
1769
1780
  }
1770
1781
  .omni-layout-app .omni-notice-box .tool-head-close,
1771
1782
  .omni-layout-app .omni-notice-box .tool-head-title,
@@ -1837,6 +1848,19 @@ html {
1837
1848
  color: #2684ff;
1838
1849
  padding-top: 0;
1839
1850
  }
1851
+ .omni-layout-app .omni-notice-box .message-dd-hover button {
1852
+ color: #2684ff;
1853
+ padding-top: 0;
1854
+ border: 0;
1855
+ background: transparent;
1856
+ cursor: pointer;
1857
+ line-height: 21px;
1858
+ font-size: 12px;
1859
+ }
1860
+ .omni-layout-app .omni-notice-box .message-dd-hover button:focus,
1861
+ .omni-layout-app .omni-notice-box .message-dd-hover button:active {
1862
+ outline: none;
1863
+ }
1840
1864
  .omni-layout-app .omni-notice-box .nav-message-text {
1841
1865
  float: left;
1842
1866
  width: 120px;
@@ -2088,11 +2112,21 @@ html {
2088
2112
  /* stylelint-disable */
2089
2113
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2090
2114
  .ant-pro-page-header-wrap-children-content {
2091
- margin: 24px 24px 0;
2115
+ margin: 12px 24px 0;
2092
2116
  }
2093
2117
  .ant-pro-page-header-wrap-page-header-warp {
2094
2118
  background-color: #fff;
2095
2119
  }
2120
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header {
2121
+ padding: 16px 24px 0;
2122
+ }
2123
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-heading {
2124
+ margin-bottom: 0;
2125
+ }
2126
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-footer {
2127
+ padding: 0;
2128
+ margin-top: 4px;
2129
+ }
2096
2130
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-detail {
2097
2131
  display: flex;
2098
2132
  }
@@ -2101,7 +2135,7 @@ html {
2101
2135
  width: 100%;
2102
2136
  }
2103
2137
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title-content {
2104
- margin-bottom: 16px;
2138
+ margin-bottom: 12px;
2105
2139
  }
2106
2140
  @media screen and (max-width: 576px) {
2107
2141
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content {
@@ -2120,12 +2154,12 @@ html {
2120
2154
  width: 100%;
2121
2155
  }
2122
2156
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title {
2123
- margin-bottom: 16px;
2157
+ margin-bottom: 12px;
2124
2158
  }
2125
2159
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-logo,
2126
2160
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content,
2127
2161
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2128
- margin-bottom: 16px;
2162
+ margin-bottom: 12px;
2129
2163
  }
2130
2164
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2131
2165
  min-width: 242px;
@@ -1766,6 +1766,17 @@ html {
1766
1766
  padding-right: 15px;
1767
1767
  width: 35px;
1768
1768
  cursor: pointer;
1769
+ border: 0;
1770
+ background: transparent;
1771
+ outline: none;
1772
+ line-height: 49px;
1773
+ }
1774
+ .omni-layout-app .omni-notice-box .tool-head-close:focus,
1775
+ .omni-layout-app .omni-notice-box .tool-head-close:active {
1776
+ outline: none;
1777
+ }
1778
+ .omni-layout-app .omni-notice-box .tool-head-close .anticon {
1779
+ color: #666;
1769
1780
  }
1770
1781
  .omni-layout-app .omni-notice-box .tool-head-close,
1771
1782
  .omni-layout-app .omni-notice-box .tool-head-title,
@@ -1837,6 +1848,19 @@ html {
1837
1848
  color: #2684ff;
1838
1849
  padding-top: 0;
1839
1850
  }
1851
+ .omni-layout-app .omni-notice-box .message-dd-hover button {
1852
+ color: #2684ff;
1853
+ padding-top: 0;
1854
+ border: 0;
1855
+ background: transparent;
1856
+ cursor: pointer;
1857
+ line-height: 21px;
1858
+ font-size: 12px;
1859
+ }
1860
+ .omni-layout-app .omni-notice-box .message-dd-hover button:focus,
1861
+ .omni-layout-app .omni-notice-box .message-dd-hover button:active {
1862
+ outline: none;
1863
+ }
1840
1864
  .omni-layout-app .omni-notice-box .nav-message-text {
1841
1865
  float: left;
1842
1866
  width: 120px;
@@ -2088,11 +2112,21 @@ html {
2088
2112
  /* stylelint-disable */
2089
2113
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
2090
2114
  .ant-pro-page-header-wrap-children-content {
2091
- margin: 24px 24px 0;
2115
+ margin: 12px 24px 0;
2092
2116
  }
2093
2117
  .ant-pro-page-header-wrap-page-header-warp {
2094
2118
  background-color: #fff;
2095
2119
  }
2120
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header {
2121
+ padding: 16px 24px 0;
2122
+ }
2123
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-heading {
2124
+ margin-bottom: 0;
2125
+ }
2126
+ .ant-pro-page-header-wrap-page-header-warp .ant-page-header-footer {
2127
+ padding: 0;
2128
+ margin-top: 4px;
2129
+ }
2096
2130
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-detail {
2097
2131
  display: flex;
2098
2132
  }
@@ -2101,7 +2135,7 @@ html {
2101
2135
  width: 100%;
2102
2136
  }
2103
2137
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title-content {
2104
- margin-bottom: 16px;
2138
+ margin-bottom: 12px;
2105
2139
  }
2106
2140
  @media screen and (max-width: 576px) {
2107
2141
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content {
@@ -2120,12 +2154,12 @@ html {
2120
2154
  width: 100%;
2121
2155
  }
2122
2156
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-title {
2123
- margin-bottom: 16px;
2157
+ margin-bottom: 12px;
2124
2158
  }
2125
2159
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-logo,
2126
2160
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-content,
2127
2161
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2128
- margin-bottom: 16px;
2162
+ margin-bottom: 12px;
2129
2163
  }
2130
2164
  .ant-pro-page-header-wrap-main .ant-pro-page-header-wrap-extraContent {
2131
2165
  min-width: 242px;