@pubinfo/core 2.0.0-beta.26 → 2.0.0-beta.28

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 (63) hide show
  1. package/dist/{AppSetting-DodCOb_z.js → AppSetting-DMJZXmzA.js} +21 -20
  2. package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-CMOw56Mk.js → HCheckList.vue_vue_type_script_setup_true_lang-B3wESRn7.js} +2 -2
  3. package/dist/{PreferencesContent-Dic24ifo.js → PreferencesContent-BniiAnvk.js} +117 -113
  4. package/dist/{SettingBreadcrumb-DWpbGcSy.js → SettingBreadcrumb-C4f3EHvJ.js} +2 -2
  5. package/dist/{SettingCopyright-CIY0pFMT.js → SettingCopyright-BfIv7JmX.js} +1 -1
  6. package/dist/{SettingEnableTransition-f0xuLIrZ.js → SettingEnableTransition-ltxmSAel.js} +1 -1
  7. package/dist/{SettingHome-BFtJsJsN.js → SettingHome-D3YO-Jml.js} +1 -1
  8. package/dist/{SettingMenu-DuPD3iSG.js → SettingMenu-BFPc8wk1.js} +2 -2
  9. package/dist/{SettingMode-nZ65qSWK.js → SettingMode-FWqs1ki-.js} +1 -1
  10. package/dist/{SettingNavSearch-CrarPE7d.js → SettingNavSearch-CNH2GsIA.js} +1 -1
  11. package/dist/{SettingOther-BddvExCF.js → SettingOther-DeKEcGIY.js} +1 -1
  12. package/dist/{SettingPage-C6Na8HEN.js → SettingPage-CvRmxfR7.js} +1 -1
  13. package/dist/{SettingTabbar-nuwfRRaE.js → SettingTabbar-C7I7s-0s.js} +2 -2
  14. package/dist/SettingThemes-DzQ2YBRN.js +145 -0
  15. package/dist/{SettingToolbar-BdizZaGF.js → SettingToolbar-BPj0XLJ3.js} +1 -1
  16. package/dist/{SettingTopbar-D5BX5vS_.js → SettingTopbar-DVlc3dq-.js} +2 -2
  17. package/dist/{SettingWidthMode-CHrLW3gs.js → SettingWidthMode-BzNU65dj.js} +1 -1
  18. package/dist/{TopThinMode-CttqTmaT.js → TopThinMode-DSO5USf6.js} +1 -1
  19. package/dist/{_...all_--d4S-8dL.js → _...all_-6l5FWUkL.js} +1 -1
  20. package/dist/{colors-BOKDjZQI.js → colors-DiWJrScm.js} +1 -1
  21. package/dist/components/PubinfoIcon/register.d.ts +9 -0
  22. package/dist/{index-Cygbc-66.js → index-Be7jJtXg.js} +33 -31
  23. package/dist/{index-CC3GE307.js → index-BmMbAV1Y.js} +34 -30
  24. package/dist/{index-D0CMv5FJ.js → index-CXsL0aQN.js} +5618 -5248
  25. package/dist/{index-B0i20hau.js → index-CfasTv4x.js} +6 -6
  26. package/dist/{index-Bz9lh14R.js → index-Ckgil96Y.js} +30 -30
  27. package/dist/{index-DltN2SCZ.js → index-De_ME_Ws.js} +2 -2
  28. package/dist/{index-dPREgrj8.js → index-Md7zV10q.js} +12 -12
  29. package/dist/{index-DORROKh7.js → index-XnF26Tbt.js} +3 -3
  30. package/dist/{index-Cf8yM5Cv.js → index-bsi-FZDt.js} +11 -9
  31. package/dist/index.js +33 -32
  32. package/dist/{index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-Bmtn9Oo4.js → index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-B3Eieo0k.js} +315 -297
  33. package/dist/interface.d.ts +2 -0
  34. package/dist/layout/Layout.vue.d.ts +2 -2
  35. package/dist/{menu-Ddxel9ck.js → menu-CC5544p-.js} +3202 -3184
  36. package/dist/{pick-DEgsMKda.js → pick-CJo2YiT-.js} +1 -1
  37. package/dist/request.js +399 -390
  38. package/dist/route/routes.d.ts +6 -4
  39. package/dist/style.css +2 -2
  40. package/dist/utils/index.d.ts +6 -0
  41. package/package.json +26 -26
  42. package/src/api/modules/configData/xitongpeizhifuwu.ts +3 -3
  43. package/src/components/PubinfoApp/index.vue +1 -1
  44. package/src/components/PubinfoIcon/index.vue +3 -1
  45. package/src/components/PubinfoIcon/register.ts +19 -0
  46. package/src/components/PubinfoProvider/index.ts +1 -2
  47. package/src/create.ts +7 -0
  48. package/src/interface.ts +2 -0
  49. package/src/layout/Layout.vue +50 -59
  50. package/src/layout/components/Content/index.vue +34 -13
  51. package/src/layout/components/SettingBar/components/SettingThemes.vue +7 -5
  52. package/src/layout/components/Sidebar/MainSidebar.vue +4 -7
  53. package/src/layout/components/Tools/Preferences/PreferencesContent.vue +2 -1
  54. package/src/layout/components/Tools/index.vue +1 -8
  55. package/src/layout/provider.ts +7 -1
  56. package/src/pages/system/not-permission/index.vue +2 -2
  57. package/src/route/routes.ts +26 -8
  58. package/src/stores/modules/route.ts +10 -2
  59. package/src/utils/index.ts +14 -0
  60. package/types/vue-router.d.ts +3 -1
  61. package/dist/SettingThemes-DBq6j0zt.js +0 -144
  62. package/src/layout/components/Tools/I18nSelector.vue +0 -52
  63. package/src/pages/system/change-password/page.vue +0 -58
@@ -303,8 +303,16 @@ const useRouteStore = defineStore(
303
303
  delete arr[index].meta!.singleMenu;
304
304
  }
305
305
 
306
- if (!arr[index].component) {
307
- arr[index].component = Layout;
306
+ if (!item.component) {
307
+ item.component = Layout;
308
+ }
309
+
310
+ // 给一级路由设置 provider
311
+ if (route.meta?.provider) {
312
+ (item.meta as any) = {
313
+ ...(item.meta ?? {}),
314
+ provider: route.meta.provider,
315
+ };
308
316
  }
309
317
  });
310
318
  }
@@ -35,6 +35,20 @@ export function objectToPaths(obj: Record<string, any>, prefix = '') {
35
35
  }, [] as string[]);
36
36
  }
37
37
 
38
+ /**
39
+ * 基于 `import.meta.glob` 读取 `iconMap`
40
+ */
41
+ export function loadIconsFromGlob(modules: Record<string, { default: string }>): Record<string, string> {
42
+ return Object.fromEntries(
43
+ Object.entries(modules)
44
+ .map(([path, mod]) => {
45
+ const name = path.match(/([^/]+)(?=\.svg$)/)?.[1];
46
+ return name ? [name, mod.default] : null;
47
+ })
48
+ .filter(Boolean) as [string, string][],
49
+ );
50
+ }
51
+
38
52
  export * from './cleanup';
39
53
  export * from './crypto';
40
54
  export { default as eventBus } from './eventBus';
@@ -25,6 +25,7 @@ export interface RouterMetaRawBaseOptions {
25
25
  breadcrumbNeste: Route.breadcrumb[]
26
26
  isDev: boolean
27
27
  enabled: boolean
28
+ provider?: any
28
29
  }
29
30
 
30
31
  type RouterMetaRaw = RequireExactlyOne<Partial<RouterMetaRawBaseOptions>, 'title'>;
@@ -37,7 +38,8 @@ export declare namespace Route {
37
38
  | 'icon'
38
39
  | 'activeIcon'
39
40
  | 'auth'
40
- | 'enabled';
41
+ | 'enabled'
42
+ | 'provider';
41
43
 
42
44
  type recordMainRawBasicMeta = Partial<Pick<RouterMetaRawBaseOptions, mainMeta>>;
43
45
 
@@ -1,144 +0,0 @@
1
- import { _ as T } from "./HDivider-DgXBhPr0.js";
2
- import { markRaw as b, createElementBlock as d, openBlock as o, createElementVNode as t, defineComponent as k, useModel as V, withDirectives as S, createStaticVNode as $, vModelCheckbox as w, toRef as D, computed as B, createBlock as N, withCtx as j, createVNode as u, unref as c, isRef as L, Fragment as g, renderList as f, normalizeClass as M, normalizeStyle as h, toDisplayString as z } from "vue";
3
- import "./menu-Ddxel9ck.js";
4
- import "pinia-plugin-persistedstate";
5
- import { d as F, u as R } from "./index-D0CMv5FJ.js";
6
- import { themes as v } from "@pubinfo/config/themes";
7
- import { _ as x } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- const A = {
9
- viewBox: "-5 -2 24 24",
10
- width: "1.2em",
11
- height: "1.2em"
12
- };
13
- function E(i, e) {
14
- return o(), d("svg", A, e[0] || (e[0] = [
15
- t("path", {
16
- fill: "currentColor",
17
- d: "M3 0h8a3 3 0 0 1 3 3v15a2 2 0 0 1-3.348 1.477L7.674 16.76a1 1 0 0 0-1.348 0l-2.978 2.717A2 2 0 0 1 0 18V3a3 3 0 0 1 3-3"
18
- }, null, -1)
19
- ]));
20
- }
21
- const H = b({ name: "jam-bookmark-f", render: E }), I = {
22
- viewBox: "0 0 16 16",
23
- width: "1.2em",
24
- height: "1.2em"
25
- };
26
- function U(i, e) {
27
- return o(), d("svg", I, e[0] || (e[0] = [
28
- t("path", {
29
- fill: "currentColor",
30
- "fill-rule": "evenodd",
31
- d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m3.78-9.72a.75.75 0 0 0-1.06-1.06L6.75 9.19L5.53 7.97a.75.75 0 0 0-1.06 1.06l1.75 1.75a.75.75 0 0 0 1.06 0z",
32
- "clip-rule": "evenodd"
33
- }, null, -1)
34
- ]));
35
- }
36
- const W = b({ name: "pajamas-check-circle-filled", render: U }), J = {
37
- flex: "",
38
- "justify-center": "",
39
- "pb-15px": ""
40
- }, O = { class: "toggleWrapper" }, P = /* @__PURE__ */ k({
41
- name: "DayNightToggle",
42
- __name: "DayNightToggle",
43
- props: {
44
- modelValue: {},
45
- modelModifiers: {}
46
- },
47
- emits: ["update:modelValue"],
48
- setup(i) {
49
- const e = V(i, "modelValue");
50
- return (_, s) => (o(), d("div", J, [
51
- t("div", O, [
52
- S(t("input", {
53
- id: "dn",
54
- "onUpdate:modelValue": s[0] || (s[0] = (p) => e.value = p),
55
- type: "checkbox",
56
- class: "dn"
57
- }, null, 512), [
58
- [w, e.value]
59
- ]),
60
- s[1] || (s[1] = $('<label for="dn" class="toggle" data-v-d927ea22><span class="toggle__handler" data-v-d927ea22><span class="crater crater--1" data-v-d927ea22></span><span class="crater crater--2" data-v-d927ea22></span><span class="crater crater--3" data-v-d927ea22></span></span><span class="star star--1" data-v-d927ea22></span><span class="star star--2" data-v-d927ea22></span><span class="star star--3" data-v-d927ea22></span><span class="star star--4" data-v-d927ea22></span><span class="star star--5" data-v-d927ea22></span><span class="star star--6" data-v-d927ea22></span></label>', 1))
61
- ])
62
- ]));
63
- }
64
- }), q = /* @__PURE__ */ x(P, [["__scopeId", "data-v-d927ea22"]]), G = { class: "themes" }, K = ["onClick"], Q = {
65
- class: "theme-type",
66
- flex: "",
67
- "items-center": ""
68
- }, X = { class: "theme-point" }, Y = { class: "explosion" }, Z = /* @__PURE__ */ k({
69
- name: "SettingThemes",
70
- __name: "SettingThemes",
71
- setup(i) {
72
- const { isDark: e } = F(), { settingsStore: _ } = R(), s = D(_.settings, "app"), p = [
73
- "--ui-primary",
74
- "--ui-text",
75
- "--g-bg",
76
- "--g-header-bg",
77
- "--g-main-sidebar-bg",
78
- "--g-sub-sidebar-bg"
79
- ], y = B(
80
- () => Object.keys(v).map((n) => {
81
- const l = v[n], m = p.map((r) => l[r].startsWith("#") ? l[r] : `rgb(${l[r]})`), a = v[n].label;
82
- return {
83
- label: n,
84
- value: l,
85
- colors: m,
86
- name: a
87
- };
88
- }).filter(
89
- (n) => n.value["color-scheme"] === s.value.colorScheme
90
- )
91
- );
92
- function C(n) {
93
- const l = n.label;
94
- e.value ? s.value.darkTheme = l : s.value.lightTheme = l;
95
- }
96
- return (n, l) => {
97
- const m = T;
98
- return o(), N(m, { title: "颜色主题风格" }, {
99
- default: j(() => [
100
- t("div", null, [
101
- u(q, {
102
- modelValue: c(e),
103
- "onUpdate:modelValue": l[0] || (l[0] = (a) => L(e) ? e.value = a : null)
104
- }, null, 8, ["modelValue"])
105
- ]),
106
- t("div", G, [
107
- (o(!0), d(g, null, f(c(y), (a) => (o(), d("div", {
108
- key: a.label,
109
- class: M(["theme", { active: c(e) ? c(s).darkTheme === a.label : c(s).lightTheme === a.label }]),
110
- onClick: (r) => C(a)
111
- }, [
112
- t("div", Q, [
113
- t("span", {
114
- style: h({ color: a.colors.at(0) }),
115
- "mr-5px": ""
116
- }, [
117
- u(c(H))
118
- ], 4),
119
- t("span", {
120
- style: h({ color: a.colors.at(0) }),
121
- "text-sm": ""
122
- }, z(a.name || a.label), 5)
123
- ]),
124
- t("div", X, [
125
- (o(!0), d(g, null, f(a.colors, (r) => (o(), d("div", {
126
- key: r,
127
- class: "point",
128
- style: h({ backgroundColor: r })
129
- }, null, 4))), 128))
130
- ]),
131
- t("div", Y, [
132
- u(c(W))
133
- ])
134
- ], 10, K))), 128))
135
- ])
136
- ]),
137
- _: 1
138
- });
139
- };
140
- }
141
- }), ce = /* @__PURE__ */ x(Z, [["__scopeId", "data-v-066297c5"]]);
142
- export {
143
- ce as default
144
- };
@@ -1,52 +0,0 @@
1
- <script setup lang="ts">
2
- import { getUILocales } from '@/locales';
3
- import { useI18n } from 'vue-i18n';
4
- import { useContext } from '../../composables/useContext';
5
-
6
- // TODO 完成功能
7
-
8
- defineOptions({
9
- name: 'I18nSelector',
10
- });
11
-
12
- const { locale } = useI18n();
13
- const route = useRoute();
14
-
15
- const { settingsStore, generateI18nTitle } = useContext();
16
-
17
- const UILocales = computed(() => getUILocales());
18
-
19
- const langItems = computed(() => {
20
- return Object.keys(UILocales.value).map((item: string) => {
21
- const icons: Record<string, string> = {
22
- 'en': 'i-circle-flags-en',
23
- 'zh-cn': 'i-circle-flags-cn',
24
- 'zh-tw': 'i-circle-flags-cn',
25
- };
26
- return {
27
- icon: icons[item],
28
- label: UILocales.value[item].labelName,
29
- disabled: settingsStore.settings.app.defaultLang === item,
30
- handle: () => setLanguage(item),
31
- };
32
- });
33
- });
34
-
35
- function setLanguage(name: string) {
36
- locale.value = name;
37
- settingsStore.setDefaultLang(name);
38
-
39
- if (route.meta.breadcrumbNeste?.at(-1)?.i18n || route.meta.breadcrumbNeste?.at(-1)?.title) {
40
- settingsStore.setTitle(generateI18nTitle(route.meta.breadcrumbNeste?.at(-1)?.i18n, route.meta.breadcrumbNeste?.at(-1)?.title));
41
- }
42
- else {
43
- settingsStore.setTitle(generateI18nTitle(route.meta.i18n, route.meta.title));
44
- }
45
- }
46
- </script>
47
-
48
- <template>
49
- <HDropdownMenu v-if="settingsStore.settings.toolbar.enableI18n" :items="[langItems]">
50
- <slot />
51
- </HDropdownMenu>
52
- </template>
@@ -1,58 +0,0 @@
1
- <script setup lang="ts">
2
- import { PassStrengthValidator } from '@/components';
3
- import ChangePasswordForm from './components/ChangePasswordForm/index.vue';
4
-
5
- defineOptions({
6
- name: 'ChangePasswordPageView',
7
- });
8
-
9
- const ChangePassWordForm = ref<InstanceType<typeof ChangePasswordForm>>();
10
-
11
- const newPassWord = computed({
12
- get() {
13
- return ChangePassWordForm.value?.formState.newPassword;
14
- },
15
- set() {},
16
- });
17
-
18
- const route = useRoute();
19
- const token = route.params.changePassWordToken;
20
- const isValidate = ref(false);
21
- </script>
22
-
23
- <template>
24
- <div
25
- flex="~"
26
- w-full
27
- h-full
28
- >
29
- <main
30
- flex="~ auto center"
31
- w-full
32
- h-full
33
- pt-10px
34
- >
35
- <div
36
- w-full
37
- h-full
38
- flex="~"
39
- justify-between
40
- bg="#fff"
41
- px-32px
42
- py-20px
43
- >
44
- <div w-420px ml-60px mt-70px>
45
- <div flex="~ col center" mb-40px>
46
- <span text="18px" font="bold">
47
- 更改密码
48
- </span>
49
- </div>
50
- <ChangePasswordForm ref="ChangePassWordForm" v-model:validate="isValidate" :token="token" />
51
- </div>
52
- <div w-644px py-15px bg="red">
53
- <PassStrengthValidator v-model="newPassWord" v-model:validate="isValidate" />
54
- </div>
55
- </div>
56
- </main>
57
- </div>
58
- </template>