@pubinfo/core 2.2.3 → 2.2.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.
@@ -5,6 +5,9 @@ declare function __VLS_template(): {
5
5
  header?(_: {}): any;
6
6
  sidebar?(_: {}): any;
7
7
  topbar?(_: {}): any;
8
+ breadcrumb?(_: {
9
+ items: import('.').BreadcrumbSlotItem[];
10
+ }): any;
8
11
  default?(_: {}): any;
9
12
  notAllowed?(_: {}): any;
10
13
  footer?(_: {}): any;
@@ -18,6 +21,7 @@ declare const __VLS_component: import('vue').DefineComponent<LayoutProps, {}, {}
18
21
  showSidebar: boolean;
19
22
  showTabbar: boolean;
20
23
  showToolbar: boolean;
24
+ showBreadcrumb: boolean;
21
25
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
22
26
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
27
  export default _default;
@@ -1,2 +1,20 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
1
+ import { BreadcrumbSlotProps } from '../interface';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Readonly<{
5
+ breadcrumb?: (props: BreadcrumbSlotProps) => any;
6
+ }> & {
7
+ breadcrumb?: (props: BreadcrumbSlotProps) => any;
8
+ };
9
+ refs: {};
10
+ rootEl: HTMLDivElement;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
15
  export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -1,2 +1,20 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ import { BreadcrumbSlotProps } from './interface';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Readonly<{
5
+ breadcrumb?: (props: BreadcrumbSlotProps) => any;
6
+ }> & {
7
+ breadcrumb?: (props: BreadcrumbSlotProps) => any;
8
+ };
9
+ refs: {};
10
+ rootEl: any;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
15
  export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,8 @@
1
+ export interface BreadcrumbSlotItem {
2
+ title: string;
3
+ path: string;
4
+ mainIndex?: number;
5
+ }
6
+ export interface BreadcrumbSlotProps {
7
+ items: BreadcrumbSlotItem[];
8
+ }
@@ -19,6 +19,7 @@ import 'floating-vue/dist/style.css';
19
19
  */
20
20
  export declare function LayoutComponent(): ModuleOptions;
21
21
  export type { DropdownMenu, DropdownMenuRender } from './components/Tools/interface';
22
+ export type { BreadcrumbSlotItem, BreadcrumbSlotProps } from './components/Topbar/interface';
22
23
  export declare const Tool: {
23
24
  Fullscreen: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
24
25
  PageReload: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -19,4 +19,9 @@ export interface LayoutProps {
19
19
  * @default true
20
20
  */
21
21
  showToolbar?: boolean;
22
+ /**
23
+ * 是否展示面包屑
24
+ * @default true
25
+ */
26
+ showBreadcrumb?: boolean;
22
27
  }
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface PubinfoOptions extends Options {
17
17
  export declare function createPubinfo(options: PubinfoOptions): () => Promise<import('./core').Context>;
18
18
  export { RESPONSE_CODE } from './built-in/authentication';
19
19
  export { Copyright, Layout, LayoutContent, LayoutHeader, LayoutProvider, LayoutSidebar, LayoutTopbar, Logo, NotAllowed, Tool, Tools, } from './built-in/layout-component';
20
- export type { DropdownMenu, DropdownMenuRender } from './built-in/layout-component';
20
+ export type { BreadcrumbSlotItem, BreadcrumbSlotProps, DropdownMenu, DropdownMenuRender } from './built-in/layout-component';
21
21
  export { updateWatermark } from './built-in/layout-component/composables/useWatermark';
22
22
  export { createRequest, defineIconModule, defineRouteModule, getAllIconModules, getAllRouteModules, readProjectModules, } from './core';
23
23
  export * from './core/interface';
package/dist/index.js CHANGED
@@ -691,7 +691,7 @@ function Kr(e) {
691
691
  tabs: !0,
692
692
  toolbar: !0,
693
693
  ...t.getRemoteAppRouteById(a)?.meta?.layout
694
- }, o = r.sidebarMenus, { menuMode: s, subMenuOnlyOneHide: c, enableSubMenuCollapseButton: l } = n.settings.menu, u = n.mode, d = n.settings.tabbar.enable, f = n.settings.favorites.enable, p = n.settings.breadcrumb.enable;
694
+ }, o = r.sidebarMenus, { menuMode: s, subMenuOnlyOneHide: c, enableSubMenuCollapseButton: l } = n.settings.menu, u = n.mode, d = n.settings.tabbar.enable, f = n.settings.favorites.enable, p = n.settings.breadcrumb.enable, m = u === "pc" && p && i?.showBreadcrumb;
695
695
  return {
696
696
  header: u === "pc" && ["head", "only-head"].includes(s) && e.header && i?.showHeader,
697
697
  mainSidebar: (u === "mobile" && s !== "single" || ["side", "only-side"].includes(s)) && e.sidebar && i?.showSidebar,
@@ -701,7 +701,8 @@ function Kr(e) {
701
701
  "single"
702
702
  ].includes(s) && o.length > 0 && !(c && o.length === 1 && (!o[0].children || o[0]?.children.every((e) => e.meta?.sidebar === !1)))) && e.sidebar && i?.showSidebar,
703
703
  tabbar: d && e.tabs && i?.showTabbar,
704
- toolbar: !(s === "head" && !l && !f && !p || s === "only-head" && !f && !p) && e.toolbar && i?.showToolbar
704
+ toolbar: !(s === "head" && !l && !f && !m || s === "only-head" && !f && !m) && e.toolbar && i?.showToolbar,
705
+ breadcrumb: m
705
706
  };
706
707
  }) };
707
708
  }
@@ -6845,11 +6846,11 @@ var xf = L({
6845
6846
  name: "Toolbar",
6846
6847
  __name: "index",
6847
6848
  setup(e) {
6848
- let t = Cn(), n = wn(), { settingsStore: r, menuStore: i, generateTitle: a } = D(), o = k(() => r.mode === "mobile" || [
6849
+ let t = Cn(), n = wn(), { settingsStore: r, menuStore: i, generateTitle: a } = D(), { show: o } = Kr(), s = k(() => r.mode === "mobile" || [
6849
6850
  "side",
6850
6851
  "head",
6851
6852
  "single"
6852
- ].includes(r.settings.menu.menuMode) && r.settings.menu.enableSubMenuCollapseButton && !(r.settings.menu.subMenuOnlyOneHide && i.sidebarMenus.length === 1 && (!i.sidebarMenus[0].children || i.sidebarMenus[0]?.children.every((e) => e.meta?.sidebar === !1)))), s = k(() => r.mode === "pc" && r.settings.breadcrumb.enable);
6853
+ ].includes(r.settings.menu.menuMode) && r.settings.menu.enableSubMenuCollapseButton && !(r.settings.menu.subMenuOnlyOneHide && i.sidebarMenus.length === 1 && (!i.sidebarMenus[0].children || i.sidebarMenus[0]?.children.every((e) => e.meta?.sidebar === !1))));
6853
6854
  function c() {
6854
6855
  return {
6855
6856
  path: "/",
@@ -6925,7 +6926,7 @@ var xf = L({
6925
6926
  return (e, t) => {
6926
6927
  let n = Sd, i = Zd;
6927
6928
  return z(), M("div", wf, [N("div", Tf, [
6928
- U(o) ? (z(), M("div", {
6929
+ U(s) ? (z(), M("div", {
6929
6930
  key: 0,
6930
6931
  class: R(["flex-center cursor-pointer px-2 py-1 transition-transform", { "-rotate-z-180": U(r).settings.menu.subMenuCollapse }]),
6931
6932
  onClick: t[0] ||= (e) => U(r).toggleSidebarCollapse()
@@ -6943,10 +6944,10 @@ var xf = L({
6943
6944
  default: G(() => [F(Cf)]),
6944
6945
  _: 1
6945
6946
  })) : j("", !0),
6946
- U(s) ? (z(), A(Oo, {
6947
+ U(o).breadcrumb ? V(e.$slots, "breadcrumb", {
6947
6948
  key: 2,
6948
- class: R(["breadcrumb", { [`breadcrumb-${U(r).settings.breadcrumb.style}`]: U(r).settings.breadcrumb.style !== "" }])
6949
- }, {
6949
+ items: U(l)
6950
+ }, () => [F(Oo, { class: R(["breadcrumb", { [`breadcrumb-${U(r).settings.breadcrumb.style}`]: U(r).settings.breadcrumb.style !== "" }]) }, {
6950
6951
  default: G(() => [F(zt, { name: "breadcrumb" }, {
6951
6952
  default: G(() => [(z(!0), M(O, null, cn(U(l), (e, t) => (z(), A(jo, { key: `${t}_${e.path}_${e.title}` }, {
6952
6953
  default: G(() => [F(i, {
@@ -6969,16 +6970,20 @@ var xf = L({
6969
6970
  _: 1
6970
6971
  })]),
6971
6972
  _: 1
6972
- }, 8, ["class"])) : j("", !0)
6973
+ }, 8, ["class"])], !0) : j("", !0)
6973
6974
  ]), F($o)]);
6974
6975
  };
6975
6976
  }
6976
- }), [["__scopeId", "data-v-a8b21919"]]), Of = /* @__PURE__ */ I({
6977
+ }), [["__scopeId", "data-v-3a201144"]]), Of = /* @__PURE__ */ I({
6977
6978
  name: "Topbar",
6978
6979
  __name: "index",
6979
6980
  setup(e) {
6980
- let { show: t } = Kr();
6981
- return (e, n) => (z(), M(O, null, [U(t).tabbar ? (z(), A(Yd, { key: 0 })) : j("", !0), U(t).toolbar ? (z(), A(Df, { key: 1 })) : j("", !0)], 64));
6981
+ let t = hn(), { show: n } = Kr();
6982
+ return (e, r) => (z(), M(O, null, [U(n).tabbar ? (z(), A(Yd, { key: 0 })) : j("", !0), U(n).toolbar ? (z(), A(Df, { key: 1 }, Vt({ _: 2 }, [t.breadcrumb ? {
6983
+ name: "breadcrumb",
6984
+ fn: G((t) => [V(e.$slots, "breadcrumb", Xt(Wt(t)))]),
6985
+ key: "0"
6986
+ } : void 0]), 1024)) : j("", !0)], 64));
6982
6987
  }
6983
6988
  });
6984
6989
  //#endregion
@@ -7113,14 +7118,18 @@ var If = { class: "wrapper" }, Lf = { class: "main" }, Rf = /* @__PURE__ */ ct(/
7113
7118
  showToolbar: {
7114
7119
  type: Boolean,
7115
7120
  default: !0
7121
+ },
7122
+ showBreadcrumb: {
7123
+ type: Boolean,
7124
+ default: !0
7116
7125
  }
7117
7126
  },
7118
7127
  setup(e) {
7119
7128
  let t = e;
7120
7129
  Gr(t);
7121
- let { show: n } = Kr(t), r = Cn(), { auth: i } = ce(), { settingsStore: a } = D(), { mainSidebarActualWidth: o, subSidebarActualWidth: s } = Af(t);
7130
+ let { show: n } = Kr(t), r = Cn(), { auth: i } = ce(), { settingsStore: a } = D(), { mainSidebarActualWidth: o, subSidebarActualWidth: s } = Af(t), c = hn();
7122
7131
  jf(), Pf();
7123
- let c = k(() => r.matched.every((e) => i(e.meta.auth ?? "")));
7132
+ let l = k(() => r.matched.every((e) => i(e.meta.auth ?? "")));
7124
7133
  W(() => a.settings.menu.subMenuCollapse, (e) => {
7125
7134
  a.mode === "mobile" && (e ? document.body.classList.remove("overflow-hidden") : document.body.classList.add("overflow-hidden"));
7126
7135
  }), W(() => r.path, () => {
@@ -7128,16 +7137,16 @@ var If = { class: "wrapper" }, Lf = { class: "main" }, Rf = /* @__PURE__ */ ct(/
7128
7137
  e.settings.menu.subMenuCollapse = !0;
7129
7138
  });
7130
7139
  });
7131
- let l = B(0), u = B(!1), d = Je("--g-tabbar-height", document.documentElement || document.body), f = Je("--g-toolbar-height", document.documentElement || document.body), p = k(() => (n.value.tabbar ? Number.parseInt(d.value) : 0) + (n.value.toolbar ? Number.parseInt(f.value) : 0));
7132
- function m() {
7133
- l.value = (document.documentElement || document.body).scrollTop;
7140
+ let u = B(0), d = B(!1), f = Je("--g-tabbar-height", document.documentElement || document.body), p = Je("--g-toolbar-height", document.documentElement || document.body), m = k(() => (n.value.tabbar ? Number.parseInt(f.value) : 0) + (n.value.toolbar ? Number.parseInt(p.value) : 0));
7141
+ function h() {
7142
+ u.value = (document.documentElement || document.body).scrollTop;
7134
7143
  }
7135
7144
  return en(() => {
7136
- window.addEventListener("scroll", m);
7145
+ window.addEventListener("scroll", h);
7137
7146
  }), tn(() => {
7138
- window.removeEventListener("scroll", m);
7139
- }), W(l, (e, t) => {
7140
- u.value = a.settings.topbar.mode === "sticky" && e > t && e > p.value;
7147
+ window.removeEventListener("scroll", h);
7148
+ }), W(u, (e, t) => {
7149
+ d.value = a.settings.topbar.mode === "sticky" && e > t && e > m.value;
7141
7150
  }), (e, t) => (z(), M("div", {
7142
7151
  class: "layout",
7143
7152
  style: Zt({
@@ -7163,16 +7172,20 @@ var If = { class: "wrapper" }, Lf = { class: "main" }, Rf = /* @__PURE__ */ ct(/
7163
7172
  "has-tabbar": U(n).tabbar,
7164
7173
  "has-toolbar": U(n).toolbar,
7165
7174
  [`topbar-${U(a).settings.topbar.mode}`]: !0,
7166
- shadow: !U(a).settings.topbar.switchTabbarAndToolbar && U(l),
7167
- hide: U(u),
7175
+ shadow: !U(a).settings.topbar.switchTabbarAndToolbar && U(u),
7176
+ hide: U(d),
7168
7177
  "switch-tabbar-toolbar": U(a).settings.topbar.switchTabbarAndToolbar
7169
7178
  }]),
7170
7179
  "data-fixed-calc-width": ""
7171
- }, [V(e.$slots, "topbar", {}, () => [F(Of)], !0)], 2),
7180
+ }, [V(e.$slots, "topbar", {}, () => [F(Of, null, Vt({ _: 2 }, [U(c).breadcrumb ? {
7181
+ name: "breadcrumb",
7182
+ fn: G((t) => [V(e.$slots, "breadcrumb", Xt(Wt(t)), void 0, !0)]),
7183
+ key: "0"
7184
+ } : void 0]), 1024)], !0)], 2),
7172
7185
  N("div", Lf, [yn(N("div", {
7173
7186
  class: "exit-main-page-maximize",
7174
7187
  onClick: t[1] ||= (e) => U(a).setMainPageMaximize()
7175
- }, [F(U(ur))], 512), [[_n, U(a).mainPageMaximizeStatus]]), U(c) ? V(e.$slots, "default", { key: 0 }, () => [F(Pr)], !0) : V(e.$slots, "notAllowed", { key: 1 }, () => [F(Ms)], !0)]),
7188
+ }, [F(U(ur))], 512), [[_n, U(a).mainPageMaximizeStatus]]), U(l) ? V(e.$slots, "default", { key: 0 }, () => [F(Pr)], !0) : V(e.$slots, "notAllowed", { key: 1 }, () => [F(Ms)], !0)]),
7176
7189
  V(e.$slots, "footer", {}, () => [F(Ur)], !0)
7177
7190
  ], 4)
7178
7191
  ])], 2),
@@ -7180,7 +7193,7 @@ var If = { class: "wrapper" }, Lf = { class: "main" }, Rf = /* @__PURE__ */ ct(/
7180
7193
  F(mr)
7181
7194
  ], 4));
7182
7195
  }
7183
- }), [["__scopeId", "data-v-486fb888"]]), zf = [
7196
+ }), [["__scopeId", "data-v-a05bef9f"]]), zf = [
7184
7197
  "top",
7185
7198
  "right",
7186
7199
  "bottom",